From d1d29be14d5dec0ace55b9ceb2402ee5e8660927 Mon Sep 17 00:00:00 2001 From: caiichenr <34886864+caiichenr@users.noreply.github.com> Date: Wed, 26 Feb 2020 20:52:05 +0800 Subject: [PATCH 001/207] translating --- ...3 Building a non-breaking breakpoint for Python debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md b/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md index 1c33c05a68..0cafd51c17 100644 --- a/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md +++ b/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (caiichenr) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 182af28cda1901d7142fc41cb189a20e9f8541e4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 21:45:55 +0800 Subject: [PATCH 002/207] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @mengxinayan 请参阅我的校对,这个系列后面希望可以保持一致。 --- ...tructure a multi-file C program- Part 1.md | 130 +++++++++--------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md b/translated/tech/20190729 How to structure a multi-file C program- Part 1.md index 92166f2895..ec4c0dd961 100644 --- a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md +++ b/translated/tech/20190729 How to structure a multi-file C program- Part 1.md @@ -1,43 +1,44 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to structure a multi-file C program: Part 1) [#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-1) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions) -如何组织构建多文件 C 语言程序:第一部分 +如何组织构建多文件 C 语言程序(一) ====== -准备好你喜欢的饮料,编辑器和编译器,放一些音乐,然后开始构建一个由多个文件组成的 C 语言程序。 -![Programming keyboard.][1] +> 准备好你喜欢的饮料、编辑器和编译器,放一些音乐,然后开始构建一个由多个文件组成的 C 语言程序。 -大家常说计算机编程的艺术是管理复杂性和命名某些事物中的一部分。此外,我认为“有时需要添加绘图”是很正确的。 +![](https://img.linux.net.cn/data/attachment/album/202002/26/214517o5p7q45l2a8jkx4k.jpg) -在这篇文章里,我会在编写一个小型 C 程序时命名一些东西同时管理一些复杂性。程序的结构基于我所在 “[如何写一个好的 C 语言 main 函数][2]” 文中讨论的。但是,这次做一些不同的事。准备好你喜欢的饮料,编辑器和编译器,放一些音乐,让我们一起编写一个有趣的 C 语言程序。 +大家常说计算机编程的艺术部分是处理复杂性,部分是命名某些事物。此外,我认为“有时需要添加绘图”是在很大程度上是正确的。 -### 好的 Unix 程序中的哲学 +在这篇文章里,我会编写一个小型 C 程序,命名一些东西,同时处理一些复杂性。该程序的结构大致基于我在 《[如何写一个好的 C 语言 main 函数][2]》 文中讨论的。但是,这次做一些不同的事。准备好你喜欢的饮料、编辑器和编译器,放一些音乐,让我们一起编写一个有趣的 C 语言程序。 -首先你要知道这个 C 程序是一个 [Unix][3] 命令行工具。这意味着它运行在那些提供(或者可被移植) Unix C 运行环境的操作系统中。当 Unix 在贝尔实验室被发明后,它从一开始便充满了 [设计哲学][4]。用我的话来说:程序只做一件事,并做好它,然后对文件进行一些操作。虽然只做一件事并做好它是有意义的,但是“对文件进行一些操作”在这儿有一点儿不合适。 +### 优秀 Unix 程序哲学 -“文件” 在 Unix 中的抽象非常强大。一个 Unix 文件是以 end-of-file (EOF) 标志为结尾的字节流。文件中其他结构均由应用添加而非操作系统。操作系统提供了系统调用,使得程序能够对文件执行标准操作:打开,读取,写入,寻找和关闭(还有其他,但那是庞大的额外内容)。对于文件的标准化访问使得不同人用不同语言编写的程序能共用相同的抽象同时一起工作。 +首先,你要知道这个 C 程序是一个 [Unix][3] 命令行工具。这意味着它运行在(或者可被移植到)那些提供 Unix C 运行环境的操作系统中。当贝尔实验室发明 Unix 后,它从一开始便充满了[设计哲学][4]。用我自己的话来说就是:程序只做一件事,并做好它,并且对文件进行一些操作。虽然“只做一件事,并做好它”是有意义的,但是“对文件进行一些操作”的部分似乎有点儿不合适。 -具有共享文件接口可以构建 _可组合的_ 的程序。一个程序的输出可以作为另一个程序的输入。Unix 系操作系统默认为每个运行中程序提供了三个文件:标准输入(`stdin`),标准输出(`stdout`),和标准错误(`stderr`)。其中两个文件是只写的:`stdout` 和 `stderr`。而 `stdin` 是只读的。当我们在常见的 Shell 比如 Bash 中使用文件重定向时,可以看到其效果。 +事实证明,Unix 中抽象的 “文件” 非常强大。一个 Unix 文件是以文件结束符(EOF)标志为结尾的字节流。仅此而已。文件中任何其它结构均由应用程序所施加而非操作系统。操作系统提供了系统调用,使得程序能够对文件执行一套标准的操作:打开、读取、写入、寻址和关闭(还有其他,但说起来那就复杂了)。对于文件的标准化访问使得不同的程序共用相同的抽象,而且可以一同工作,即使它们是不同的人用不同语言编写的程序。 + +具有共享的文件接口使得构建*可组合的*的程序成为可能。一个程序的输出可以作为另一个程序的输入。Unix 家族的操作系统默认在执行程序时提供了三个文件:标准输入(`stdin`)、标准输出(`stdout`)和标准错误(`stderr`)。其中两个文件是只写的:`stdout` 和 `stderr`。而 `stdin` 是只读的。当我们在常见的 Shell 比如 Bash 中使用文件重定向时,可以看到其效果。 ``` -`$ ls | grep foo | sed -e 's/bar/baz/g' > ack` +$ ls | grep foo | sed -e 's/bar/baz/g' > ack ``` -这条指令可以被简要地描述为:`ls` 的结果被写入标准输出,它重定向到 `grep` 的标准输入,`grep` 的标准输出重定向到 `sed`的标准输入,`sed` 的标准输出重定向到当前目录下文件名为 `ack` 的文件中。 +这条指令可以被简要地描述为:`ls` 的结果被写入标准输出,它重定向到 `grep` 的标准输入,`grep` 的标准输出重定向到 `sed` 的标准输入,`sed` 的标准输出重定向到当前目录下文件名为 `ack` 的文件中。 -我们希望我们的程序在系统中灵活而又出色,因此让我们编写一个可以读写文件的程序。 +我们希望我们的程序在这个灵活又出色的生态系统中运作良好,因此让我们编写一个可以读写文件的程序。 -### MeowMeow: 流编码器/解码器概念 +### 喵呜喵呜:流编码器/解码器概念 -当我还是一个孩子在 ltmumblesgts 里学习计算机科学时,有许多编码方案。他们中的有些用于压缩文件,有些用于打包文件,另一些毫无用处因此显得十分愚蠢。列举一个最后一种情况例子:[MooMoo 编码方式][5]。 +当我还是一个露着豁牙的孩子懵懵懂懂地学习计算机科学时,学过很多编码方案。它们中的有些用于压缩文件,有些用于打包文件,另一些毫无用处因此显得十分愚蠢。列举最后这种情况的一个例子:[哞哞编码方案][5]。 -为了给我们程序一个目的,我将在 [2000s][6] 更新该概念并且完成一个名为 “MeowMeow” 的编码方式(因为在互联网上大家都喜欢猫)。这里的基本的想法获取文件并且使用文本 “meow” 对每半个字节进行编码。小写字母代表 0,大写字母代表 1。因为它会将 4 比特替换为 32 比特,因此会扩大文件的大小。这毫无实际意义。但想象一下人们看到经过这样编码后的结果。 +为了让我们的程序有个用途,我为它更新了一个 [21 世纪][6] 的概念,并且实现了一个名为“喵呜喵呜” 的编码方案的概念(毕竟网上大家都喜欢猫)。这里的基本的思路是获取文件并且使用文本 “meow” 对每个半字节(半个字节)进行编码。小写字母代表 0,大写字母代表 1。因为它会将 4 个比特替换为 32 个比特,因此会扩大文件的大小。没错,这毫无意义。但是想象一下人们看到经过这样编码后的惊讶表情。 ``` $ cat /home/your_sibling/.super_secret_journal_of_my_innermost_thoughts @@ -46,47 +47,46 @@ MeOWmeOWmeowMEoW... 这非常棒。 -### 最后完成 +### 最终的实现 完整的源代码可以在 [GitHub][7] 上面找到,但是我会写下我在编写程序时的思考。目的是说明如何组织构建多文件 C 语言程序。 -当我已经确定要编写一个 MeowMeow 编码和解码的程序时,我在 Shell 中执行了以下的命令 : +既然已经确定了要编写一个编码和解码“喵呜喵呜”格式的文件的程序时,我在 Shell 中执行了以下的命令 : ``` $ mkdir meowmeow $ cd meowmeow $ git init -$ touch Makefile     # recipes for compiling the program -$ touch main.c       # handles command-line options -$ touch main.h       # "global" constants and definitions -$ touch mmencode.c   # implements encoding a MeowMeow file -$ touch mmencode.h   # describes the encoding API -$ touch mmdecode.c   # implements decoding a MeowMeow file -$ touch mmdecode.h   # describes the decoding API -$ touch table.h      # defines encoding lookup table values -$ touch .gitignore   # names in this file are ignored by git +$ touch Makefile     # 编译程序的方法 +$ touch main.c       # 处理命令行选项 +$ touch main.h       # “全局”常量和定义 +$ touch mmencode.c   # 实现对喵呜喵呜文件的编码 +$ touch mmencode.h   # 描述编码 API +$ touch mmdecode.c   # 实现对喵呜喵呜文件的解码 +$ touch mmdecode.h   # 描述解码 API +$ touch table.h      # 定义编码查找表 +$ touch .gitignore   # 这个文件中的文件名会被 git 忽略 $ git add . $ git commit -m "initial commit of empty files" ``` -简单的说,我创建了一个空文件并且使用 git 提交。 -In short, I created a directory full of empty files and committed them to git. +简单的说,我创建了一个目录,里面全是空文件,并且提交到 git。 -即使文件中没有内容,你依旧可以从它的文件名推断功能。为了避免万一你无法理解,我在每条 `touch` 命令后面进行了简单描述。 +即使这些文件中没有内容,你依旧可以从它的文件名推断每个文件的用途。为了避免万一你无法理解,我在每条 `touch` 命令后面进行了简单描述。 -通常,一个程序从一个简单 `main.c` 文件开始,只需要两三个函数便可以解决问题。然后程序员便可以向自己的朋友或者老板展示该程序,同时突然显示了文件提示框支持所有新的“功能”和“需求”。“程序俱乐部”的第一条规则便是不谈论“程序俱乐部”。第二条规则是最小化单个文件的功能。 +通常,程序从一个简单 `main.c` 文件开始,只有两三个解决问题的函数。然后程序员轻率地向自己的朋友或者老板展示了该程序,然后为了支持所有新的“功能”和“需求”,文件中的函数数量就迅速爆开了。“程序俱乐部”的第一条规则便是不要谈论“程序俱乐部”,第二条规则是尽量减少单个文件中的函数。 -坦率地说,C 编译器并不关心程序中的所有函数是否都在一个文件中。但是我们并不是为计算机或编译器写程序,我们是为其他人(有时也包括我们)而去写程序的。我知道这有些奇怪,但这就是事实。程序是计算机解决问题所采用的一系列算法,保证人们可以理解它们是非常重要的,即使问题的参数发生了意料之外的变化。当在人们修改程序时,发现一个文件中有 2049 函数时会诅咒你的。 +老实说,C 编译器并不关心程序中的所有函数是否都在一个文件中。但是我们并不是为计算机或编译器写程序,我们是为其他人(有时也包括我们)去写程序的。我知道这可能有些奇怪,但这就是事实。程序体现了计算机解决问题所采用的一组算法,当问题的参数发生了意料之外的变化时,保证人们可以理解它们是非常重要的。当在人们修改程序时,发现一个文件中有 2049 函数时他们会诅咒你的。 -因此,好的程序员会将函数分隔开,将相似的函数分组到不同的文件中。这里我用了三个文件 `main.c`,`mmencode.c` 和 `mmdecode.c`。对于这样的小程序,也许看起来有些过头了。但是小程序很难保证一直小下去,因此计划拓展是一个好主意。 +因此,优秀的程序员会将函数分隔开,将相似的函数分组到不同的文件中。这里我用了三个文件 `main.c`、`mmencode.c` 和 `mmdecode.c`。对于这样小的程序,也许看起来有些过头了。但是小的程序很难保证一直小下去,因此哥忒拓展做好计划是一个“好主意”。 -但是那些 `.h` 文件呢?我会在后面解释一般的术语,简单地说,它们被称为头文件,同时它们可以包含 C 语言类型 和 C 预处理指令。头文件中不应该包含任何函数。你可以认为头文件和对应 `.c` 文件提供了用户编程接口(API)的定义,以便其他 `.c` 文件使用。 +但是那些 `.h` 文件呢?我会在后面解释一般的术语,简单地说,它们被称为头文件,同时它们可以包含 C 语言类型定义和 C 预处理指令。头文件中不应该包含任何函数。你可以认为头文件是提供了应用程序接口(API)的定义的一种 `.c` 文件,可以供其它 `.c` 文件使用。 ### 但是 Makefile 是什么呢? -我知道所有的酷小孩都使用 “Ultra CodeShredder 3000” 集成开发环境来编写下一个轰动一时的应用,同时构建你的项目包括在 Ctrl-Meta-Shift-Alt-Super-B 上进行混搭。但是回到今天,使用 Makefile 文件可以帮助做很多有用的工作在构建 C 程序时。Makefile 是一个包含如何处理文件的方式的文本文件,程序员可以使用其自动地从源代码构建二进制程序(包括其他东西!) +我知道下一个轰动一时的应用都是你们这些好孩子们用 “终极代码粉碎者 3000” 集成开发环境来编写的,而构建项目是用 Ctrl-Meta-Shift-Alt-Super-B 等一系列复杂的按键混搭出来的。但是如今(也就是今天),使用 `Makefile` 文件可以在构建 C 程序时帮助做很多有用的工作。`Makefile` 是一个包含如何处理文件的方式的文本文件,程序员可以使用其自动地从源代码构建二进制程序(以及其它东西!) -以下面这个小程序为例: +以下面这个小东西为例: ``` 00 # Makefile @@ -95,15 +95,15 @@ In short, I created a directory full of empty files and committed them to git. 03    cc -o my_sweet_program main.c ``` -‘#’ 符号后面的文本是注释,例如 00 行 +`#` 符号后面的文本是注释,例如 00 行。 -01 行是一个变量赋值,将 `TARGET` 变量赋值为字符串 `my_sweet_program`。按照惯例我的习惯是,所有 Makefile 变量均使用大写字母并用下划线分隔单词。 +01 行是一个变量赋值,将 `TARGET` 变量赋值为字符串 `my_sweet_program`。按照惯例,也是我的习惯,所有 `Makefile` 变量均使用大写字母并用下划线分隔单词。 -02 行包含要创建的文件名和其依赖的文件。在本例中,构建目标是 `my_sweet_program`,其依赖是 `main.c`。 +02 行包含该步骤recipe要创建的文件名和其依赖的文件。在本例中,构建目标target是 `my_sweet_program`,其依赖是 `main.c`。 -03 行是最后一行使用了一个制表符号(tab)而不是四个空格。这是将执行创建目标的命令。在本例中,我们使用 C 编译器前端 `cc` 以编译链接到 `my_sweet_program`。 +最后的 03 行使用了一个制表符号(`tab`)而不是四个空格。这是将要执行创建目标的命令。在本例中,我们使用 C 编译器C compiler前端 `cc` 以编译链接为 `my_sweet_program`。 -使用 Makefile 是非常简单的。 +使用 `Makefile` 是非常简单的。 ``` $ make @@ -112,59 +112,59 @@ $ ls Makefile  main.c  my_sweet_program ``` -将构建我们 MeowMeow 编码和解码器的 [Makefile][8] 比上面的例子要复杂,但其基本结构是相同的。我将在另一篇文章中将其分解为 Barney 风格。 +构建我们喵呜喵呜编码器/解码器的 [Makefile][8] 比上面的例子要复杂,但其基本结构是相同的。我将在另一篇文章中将其分解为 Barney 风格。 ### 形式伴随着功能 -我的想法是程序从一个文件中读取,转换它,并将转换后的结果存储到另一个文件中。以下是我想象使用程序命令行交互时的情况: +我的想法是程序从一个文件中读取、转换它,并将转换后的结果存储到另一个文件中。以下是我想象使用程序命令行交互时的情况: ``` -        $ meow < clear.txt > clear.meow -        $ unmeow < clear.meow > meow.tx -        $ diff clear.txt meow.tx -        $ +$ meow < clear.txt > clear.meow +$ unmeow < clear.meow > meow.tx +$ diff clear.txt meow.tx +$ ``` -我们需要编写命令行解析和处理输入/输出流的代码。我们需要一个函数对流进行编码并将结果写到另一个流中。最后,我们需要一个函数对流进行解码并将结果写到另一个流中。等一下,我们在讨论如何写一个程序,但是在上面的例子中,我调用了两个指令:`meow` 和 `unmeow`?我知道你可能会认为这会导致越变越复杂。 +我们需要编写代码以进行命令行解析和处理输入/输出流。我们需要一个函数对流进行编码并将结果写到另一个流中。最后,我们需要一个函数对流进行解码并将结果写到另一个流中。等一下,我们在讨论如何写一个程序,但是在上面的例子中,我调用了两个指令:`meow` 和 `unmeow`?我知道你可能会认为这会导致越变越复杂。 ### 次要内容:argv[0] 和 ln 指令 回想一下,C 语言 main 函数的结构如下: ``` -`int main(int argc, char *argv[])` +int main(int argc, char *argv[]) ``` -其中 `argc` 是命令行参数数量,`argv` 是字符指针列表(字符串)。`argv[0]` 是正在运行中的文件的路径。在 Unix 系统中许多互补功能的程序(比如:压缩和解压缩)看起来像两个命令,但事实上,它们在文件系统中是拥有两个名称的一个程序。使用 `ln` 命令通过创建文件系统链接来实现两个名称的功能。 +其中 `argc` 是命令行参数的数量,`argv` 是字符指针(字符串)的列表。`argv[0]` 是包含正在执行的程序的文件路径。在 Unix 系统中许多互补功能的程序(比如:压缩和解压缩)看起来像两个命令,但事实上,它们是在文件系统中拥有两个名称的一个程序。这个技巧是通过使用 `ln` 命令创建文件系统链接来实现两个名称的。 -一个在我笔记本中 `/usr/bin` 的例子如下: +在我笔记本电脑中 `/usr/bin` 的一个例子如下: ``` -   $ ls -li /usr/bin/git* +$ ls -li /usr/bin/git* 3376 -rwxr-xr-x. 113 root root     1.5M Aug 30  2018 /usr/bin/git 3376 -rwxr-xr-x. 113 root root     1.5M Aug 30  2018 /usr/bin/git-receive-pack ... ``` -这里 `git` 和 `git-receive-pack` 是同一个文件但是拥有不同的名字。我们说它们是相同的文件因为它们具有相同的 inode 值(第一列)。inode 是一个 Unix 文件系统的特点,其超越了本文的内容。 +这里 `git` 和 `git-receive-pack` 是同一个文件但是拥有不同的名字。我们说它们是相同的文件因为它们具有相同的 inode 值(第一列)。inode 是 Unix 文件系统的一个特点,对它的介绍超越了本文的内容范畴。 -优秀或懒惰的程序可以通过 Unix 文件系统此特点已达到写更少的代码但是交付双倍的程序。首先,我们编写一个基于其 `argv[0]` 的值而作出相应改变的程序,然后我们确保为该行为的名称创建链接。 +优秀或懒惰的程序可以通过 Unix 文件系统的这个特点达到写更少的代码但是交付双倍的程序。首先,我们编写一个基于其 `argv[0]` 的值而作出相应改变的程序,然后我们确保为导致该行为的名称创建链接。 -在我们的 Makefile 中,`unmeow` 链接通过以下的方式来创建: +在我们的 `Makefile` 中,`unmeow` 链接通过以下的方式来创建: ``` - # Makefile - ... - $(DECODER): $(ENCODER) -         $(LN) -f $< $@ -        ... +# Makefile +... +$(DECODER): $(ENCODER) + $(LN) -f $< $@ + ... ``` -我喜欢在 Makefile 中将所有内容参数化,很少使用 “裸” 字符串。我将所有的定义都放置在 Makefile 文件顶部,以便可以简单地找到并改变它们。当您尝试将程序移植到新的平台上时,需要将 `cc` 改变为 `xcc`时,这会产生很大影响。 +我倾向于在 `Makefile` 中将所有内容参数化,很少使用 “裸” 字符串。我将所有的定义都放置在 `Makefile` 文件顶部,以便可以简单地找到并改变它们。当你尝试将程序移植到新的平台上时,需要将 `cc` 改变为某个 `cc` 时,这会很方便。 -除了两个内置变量 `$@` 和 `$<` 之外,其余的变量显得很简单的。第一个便是创建目标的快捷方式,在本例中,`$(DECODER)` (我记忆它因为它看起来像一个目标)。第二个,`$<` 是规则依赖项,在本例中,它解析为 `$(ENCODER)`。 +除了两个内置变量 `$@` 和 `$<` 之外,该步骤recipe看起来相对简单。第一个便是该步骤的目标的快捷方式,在本例中是 `$(DECODER)`(我能记得这个是因为 `@` 符号看起来像是一个目标)。第二个,`$<` 是规则依赖项,在本例中,它解析为 `$(ENCODER)`。 -事情当然在变得复杂,但是它易于管理。 +事情肯定会变得复杂,但它还在管理之中。 -------------------------------------------------------------------------------- @@ -173,14 +173,14 @@ via: https://opensource.com/article/19/7/structure-multi-file-c-part-1 作者:[Erik O'Shaughnessy][a] 选题:[lujun9972][b] 译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions [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://opensource.com/article/19/5/how-write-good-c-main-function +[2]: https://linux.cn/article-10949-1.html [3]: https://en.wikipedia.org/wiki/Unix [4]: http://harmful.cat-v.org/cat-v/ [5]: http://www.jabberwocky.com/software/moomooencode.html From da291a3f7f84bf8f067eb8b4413d8a3b86f3f324 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 26 Feb 2020 21:46:29 +0800 Subject: [PATCH 003/207] PUB @mengxinayan https://linux.cn/article-11935-1.html --- ...0190729 How to structure a multi-file C program- Part 1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190729 How to structure a multi-file C program- Part 1.md (99%) diff --git a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md b/published/20190729 How to structure a multi-file C program- Part 1.md similarity index 99% rename from translated/tech/20190729 How to structure a multi-file C program- Part 1.md rename to published/20190729 How to structure a multi-file C program- Part 1.md index ec4c0dd961..196892cb41 100644 --- a/translated/tech/20190729 How to structure a multi-file C program- Part 1.md +++ b/published/20190729 How to structure a multi-file C program- Part 1.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11935-1.html) [#]: subject: (How to structure a multi-file C program: Part 1) [#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-1) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjnyhttps://opensource.com/users/jnyjnyhttps://opensource.com/users/jim-salterhttps://opensource.com/users/cldxsolutions) From 28aae540d8f46d7dd60aa47712d4dad91bcf96c0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 27 Feb 2020 00:56:35 +0800 Subject: [PATCH 004/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200226=20How=20?= =?UTF-8?q?we=20decide=20when=20to=20release=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200226 How we decide when to release Fedora.md --- ...26 How we decide when to release Fedora.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20200226 How we decide when to release Fedora.md diff --git a/sources/tech/20200226 How we decide when to release Fedora.md b/sources/tech/20200226 How we decide when to release Fedora.md new file mode 100644 index 0000000000..204a917ee4 --- /dev/null +++ b/sources/tech/20200226 How we decide when to release Fedora.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How we decide when to release Fedora) +[#]: via: (https://fedoramagazine.org/how-we-decide-when-to-release-fedora/) +[#]: author: (Ben Cotton https://fedoramagazine.org/author/bcotton/) + +How we decide when to release Fedora +====== + +![][1] + +Open source projects can use a variety of different models for deciding when to put out a release. Some projects release on a set schedule. Others decide on what the next release should contain and release whenever that is ready. Some just wake up one day and decide it’s time to release. And other projects go for a rolling release model, avoiding the question entirely. + +For Fedora, we go with a [schedule-based approach][2]. Releasing twice a year means we can give our contributors time to implement large changes while still keeping on the leading edge. Targeting releases for the end of April and the end of October gives everyone predictability: contributors, users, upstreams, and downstreams. + +But it’s not enough to release whatever’s ready on the scheduled date. We want to make sure that we’re releasing _quality_ software. Over the years, the Fedora community has developed a set of processes to help ensure we can meet both our time and and quality targets. + +### Changes process + +Meeting our goals starts months before the release. Contributors propose changes through our [Changes process][3], which ensures that the community has a chance to provide input and be aware of impacts. For changes with a broad impact (called “system-wide changes”), we require a contingency plan that describes how to back out the change if it’s broken or won’t be ready in time. In addition, the change process includes providing steps for testing. This helps make sure we can properly verify the results of a change. + +Change proposals are due 2-3 months before the beta release date. This gives the community time to evaluate the impact of the change and make adjustments necessary. For example, a new compiler release might require other package maintainers to fix bugs exposed by the new compiler or to make changes that take advantage of new capabilities. + +A few weeks before the beta and final releases, we enter a [code freeze][4]. This ensures a stable target for testing. Bugs identified as blockers and non-blocking bugs that are granted a freeze exception are updated in the repo, but everything else must wait. The freeze lasts until the release. + +### Blocker and freeze exception process + +In a project as large as Fedora, it’s impossible to test every possible combination of packages and configurations. So we have a set of test cases that we run to make sure the key features are covered. + +As much as we’d like to ship with zero bugs, if we waited until we reached that state, there’d never be another Fedora release again. Instead, we’ve defined release criteria that define what bugs can [block the release][5]. We have [basic release criteria][6] that apply to all release milestones, and then separate, cumulative criteria for [beta][7] and [final][8] releases. With beta releases, we’re generally a little more forgiving of rough edges. For a final release, it needs to pass all of beta’s criteria, plus some more that help make it a better user experience. + +The week before a scheduled release, we hold a “[go/no go meeting][9]“. During this meeting, the QA team, release engineering team, and the Fedora Engineering Steering Committee (FESCo) decide whether or not we will ship the release. As part of the decision process, we conduct a final review of blocker bugs. If any accepted blockers remain, we push the release back to a later date. + +Some bugs aren’t severe enough to block the release, but we still would like to get them fixed before the release. This is particularly true of bugs that affect the live image experience. In that case, we grant an [exception for updates that fix those bugs][10]. + +### How you can help + +In all my years as a Fedora contributor, I’ve never heard the QA team say “we don’t need any more help.” Contributing to the pre-release testing processes can be a great way to make your first Fedora contribution. + +The Blocker Review meetings happen most Mondays in #fedora-blocker-review on IRC. All members of the Fedora community are welcome to participate in the discussion and voting. One particularly useful contribution is to look at the [proposed blockers][11] and see if you can reproduce them. Knowing if a bug is widespread or not is important to the blocker decision. + +In addition, the QA team conducts test days and test weeks focused on various parts of the distribution: the kernel, GNOME, etc. Test days are announced on [Fedora Magazine][12]. + +There are plenty of other ways to contribute to the QA process. The Fedora wiki has a [list of tasks and how to contact the QA team][13]. The Fedora 32 Beta release is a few weeks away, so now’s a great time to get started! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-we-decide-when-to-release-fedora/ + +作者:[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://fedoramagazine.org/author/bcotton/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/releasing-fedora-1-816x345.png +[2]: https://fedoraproject.org/wiki/Fedora_Release_Life_Cycle#Development_Schedule +[3]: https://docs.fedoraproject.org/en-US/program_management/changes_policy/ +[4]: https://fedoraproject.org/wiki/Milestone_freezes +[5]: https://fedoraproject.org/wiki/QA:SOP_blocker_bug_process +[6]: https://fedoraproject.org/wiki/Basic_Release_Criteria +[7]: https://fedoraproject.org/wiki/Fedora_32_Beta_Release_Criteria +[8]: https://fedoraproject.org/wiki/Fedora_32_Final_Release_Criteria +[9]: https://fedoraproject.org/wiki/Go_No_Go_Meeting +[10]: https://fedoraproject.org/wiki/QA:SOP_freeze_exception_bug_process +[11]: https://qa.fedoraproject.org/blockerbugs/ +[12]: https://fedoramagazine.org/tag/test-day/ +[13]: https://fedoraproject.org/wiki/QA/Join From 98472bfae58d508cd4d16ee3d9b9edbc1b546fb6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Feb 2020 08:23:06 +0800 Subject: [PATCH 005/207] translated --- ... to use byobu to multiplex SSH sessions.md | 86 ------------------- ... to use byobu to multiplex SSH sessions.md | 79 +++++++++++++++++ 2 files changed, 79 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20200212 How to use byobu to multiplex SSH sessions.md create mode 100644 translated/tech/20200212 How to use byobu to multiplex SSH sessions.md diff --git a/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md b/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md deleted file mode 100644 index 7b79a351f8..0000000000 --- a/sources/tech/20200212 How to use byobu to multiplex SSH sessions.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to use byobu to multiplex SSH sessions) -[#]: via: (https://opensource.com/article/20/2/byobu-ssh) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -How to use byobu to multiplex SSH sessions -====== -Byobu allows you to maintain multiple terminal windows, connect via SSH, -disconnect, reconnect, and share access, all while keeping the session -alive. -![Person drinking a hat drink at the computer][1] - -[Byobu][2] is a text-based window manager and terminal multiplexer. It's similar to [GNU Screen][3] but more modern and more intuitive. It also works on most Linux, BSD, and Mac distributions. - -Byobu allows you to maintain multiple terminal windows, connect via SSH (secure shell), disconnect, reconnect, and even let other people access it, all while keeping the session alive. - -For example, if you are SSH'd into a Raspberry Pi or server and run (for example) **sudo apt update && sudo apt upgrade**—and lose your internet connection while it is running, your command will be lost to the void. However, if you start a byobu session first, it will continue running and, when you reconnect, you will find it's been running happily without your eyes on it. - -![The byobu logo is a fun play on screens.][4] - -Byobu is named for a Japanese term for decorative, multi-panel screens that serve as folding room dividers, which I think is quite fitting. - -To install byobu on Debian/Raspbian/Ubuntu: - -**sudo apt install byobu** - -Then enable it: - -**byobu-enable** - -Now drop out of your SSH session and log back in—you'll land in a byobu session. Run a command like **sudo apt update** and close the window (or enter the escape sequence ([**Enter**+**~**+**.**][5]) and log back in. You'll see the update running just as you left it. - -There are a _lot_ of features I don't use regularly or at all. The most common ones I use are: - - * **F2** – New window - * **F3/F4** – Navigate between windows - * **Ctrl**+**F2** – Split pane vertically - * **Shift**+**F2** – Split pane horizontally - * **Shift**+**Left arrow/Shift**+**Right arrow** – Navigate between splits - * **Shift**+**F11** – Zoom in (or out) on a split - - - -You can learn more by watching this video: - -### How we're using byobu - -Byobu has been great for the maintenance of [piwheels][6], the convenient, pre-compiled Python packages for Raspberry Pi. We have a horizontal split showing the piwheels monitor in the top half and the syslog entries scrolled in real time on the bottom half. Then, if we want to do something else, we switch to another window. It's particularly handy when we're investigating something collaboratively, as I can see what my colleague Dave types (and correct his typos) while we chat in IRC. - -I have byobu enabled on my home and work servers, so when I log into either machine, everything is as I left it—multiple jobs running, a window left in a particular directory, running a process as another user, that kind of thing. - -![byobu screenshot][7] - -Byobu is handy for development on Raspberry Pis, too. You can launch it on the desktop, run a command, then SSH in and attach yourself to the session where that command is running. Just note that enabling byobu won't change what the terminal launcher does. Just run **byobu** to launch it. - -* * * - -_This article originally appeared on Ben Nuttall's [Tooling blog][8] and is reused with permission._ - -Enter the black raspberry. Rubus occidentalis . It's an ominous name for an ominous fruit: the... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/byobu-ssh - -作者:[Ben Nuttall][a] -选题:[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/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) -[2]: https://byobu.org/ -[3]: http://www.gnu.org/software/screen/ -[4]: https://opensource.com/sites/default/files/uploads/byobu.png (byobu screen) -[5]: https://www.google.com/search?client=ubuntu&channel=fs&q=Enter-tilde-dot&ie=utf-8&oe=utf-8 -[6]: https://opensource.com/article/20/1/piwheels -[7]: https://opensource.com/sites/default/files/uploads/byobu-screenshot.png (byobu screenshot) -[8]: https://tooling.bennuttall.com/byobu/ diff --git a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md b/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md new file mode 100644 index 0000000000..9c871b4840 --- /dev/null +++ b/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use byobu to multiplex SSH sessions) +[#]: via: (https://opensource.com/article/20/2/byobu-ssh) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +如何使用 byobu 复用 SSH 会话 +====== +Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH 连接、断开、重连以及共享访问。 +![Person drinking a hat drink at the computer][1] + +[Byobu][2] 是基于文本的窗口管理器和终端多路复用器。它类似于 [GNU Screen][3],但更现代,更直观。它还适用于大多数 Linux、BSD 和 Mac 发行版。 + +Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH (secure shell)连接、断开、重连,甚至让其他人访问。 + +比如,你 SSH 进入树莓派或服务器,并运行(比如) **sudo apt update && sudo apt upgrade**,然后你在它运行的时候失去了互联网连接,你的命令会丢失无效。然而,如果你首先启动 byobu 会话,那么它会继续运行,在你重连后,你会发现它仍在继续运行。 + +![The byobu logo is a fun play on screens.][4] + +Byobu 的日语术语是指装饰性多面板屏风,可作为折叠式隔断,我认为这很合适。 + +要在 Debian/Raspbian/Ubuntu 上安装 byobu: + +**sudo apt install byobu** + +接着启用它 + +**byobu-enable** + +现在,请退出 SSH 会话并重新登录,你将会在 byobu 会话中登录。运行类似 **sudo apt update** 命令并关闭窗口(或输入转义序列([**Enter**+**~**+**.**][5])并重新登录。你将看到更新在你离开后还在运行。 + +有_很多_我不常使用的功能。我通常使用的是: + + * **F2** – 新窗口 + * **F3/F4** – 在窗口间导航 + * **Ctrl**+**F2** – 垂直拆分窗格 + * **Shift**+**F2** – 水平拆分窗格 + * **Shift**+**左箭头/Shift**+**右箭头** – 在拆分窗格间导航 + * **Shift**+**F11** – 放大(或缩小)拆分窗格 + + +### 我们如何使用 byobu + +Byobu 对于 [piwheels][6](一个用于树莓派的方便的,预编译 Python 包)的维护很方便。我门水平拆分了窗格,在上半部分显示了 piwheels 监视器,在下半部分实时显示了 syslog 条目。接着,如果我们想要做其他事情,我们可以切换到另外一个窗口。当我们进行协作调查时,这特别方便,因为当我在 IRC 中聊天时,我可以看到我的同事 Dave 输入了什么(并纠正他的错字)。 + +我在家庭和办公服务器上启用了 byobu,因此,当我登录到任何一台计算机时,一切都与我离开时一样。它正在运行多个作业、在特定目录中保留一个窗口,以另一个用户身份运行进程等。 + +![byobu screenshot][7] + +Byobu 也很方便用于在树莓派上进行开发。你可以在桌面上启动它,运行命令,然后 SSH 进入,并连接到该命令运行所在的会话。请注意,启用 byobu 不会更改终端启动器的功能。只需运行 **byobu** 即可启动它。 + +* * * + +_本文最初发表在 Ben Nuttall 的 [Tooling blog][8] 中,并获许重用_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/byobu-ssh + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://byobu.org/ +[3]: http://www.gnu.org/software/screen/ +[4]: https://opensource.com/sites/default/files/uploads/byobu.png (byobu screen) +[5]: https://www.google.com/search?client=ubuntu&channel=fs&q=Enter-tilde-dot&ie=utf-8&oe=utf-8 +[6]: https://opensource.com/article/20/1/piwheels +[7]: https://opensource.com/sites/default/files/uploads/byobu-screenshot.png (byobu screenshot) +[8]: https://tooling.bennuttall.com/byobu/ From 65562443cff06ba0b4e75cb180d500ad2f749896 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Feb 2020 08:43:21 +0800 Subject: [PATCH 006/207] translating --- ... Build your own cloud with Fedora 31 and Nextcloud Server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md index 69b8ad9e06..5aa4ee5023 100644 --- a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md +++ b/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5b335551e91e6cfc08dcd5bc47fdc56f1a47f9d3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 27 Feb 2020 09:41:36 +0800 Subject: [PATCH 007/207] Rename sources/tech/20200226 How we decide when to release Fedora.md to sources/talk/20200226 How we decide when to release Fedora.md --- .../20200226 How we decide when to release Fedora.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200226 How we decide when to release Fedora.md (100%) diff --git a/sources/tech/20200226 How we decide when to release Fedora.md b/sources/talk/20200226 How we decide when to release Fedora.md similarity index 100% rename from sources/tech/20200226 How we decide when to release Fedora.md rename to sources/talk/20200226 How we decide when to release Fedora.md From 5c2e49cb9fe68f98e0df10b3b27bef7e18c6e953 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 10:29:42 +0800 Subject: [PATCH 008/207] PRF @geekpi --- ...0 Scan Kubernetes for errors with KRAWL.md | 186 +++++++++--------- 1 file changed, 92 insertions(+), 94 deletions(-) diff --git a/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md b/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md index dae3043217..ef33fd24c8 100644 --- a/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md +++ b/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Scan Kubernetes for errors with KRAWL) @@ -9,25 +9,25 @@ 使用 KRAWL 扫描 Kubernetes 错误 ====== -用 KRAWL 脚本来标识 Kubernetes pod 和容器中的错误。 + +> 用 KRAWL 脚本来识别 Kubernetes Pod 和容器中的错误。 + ![Ship captain sailing the Kubernetes seas][1] -当你使用 Kubernetes 运行容器时,你通常会发现它们堆积。这是设计使然。它是容器的优点之一:每当需要新的容器时,它们启动成本都很低。你可以使用前端(如 OpenShift 或 OKD)来管理 pod 和容器。这些工具使可视化设置变得容易,并且它具有一组丰富的用于快速交互的命令。 +当你使用 Kubernetes 运行容器时,你通常会发现它们堆积在一起。这是设计使然。它是容器的优点之一:每当需要新的容器时,它们启动成本都很低。你可以使用前端工具(如 OpenShift 或 OKD)来管理 Pod 和容器。这些工具使可视化设置变得容易,并且它具有一组丰富的用于快速交互的命令。 -如果管理容器的平台不符合你的要求,你也可以仅使用 Kubernetes 工具链获取这些信息,但这需要大量命令才能全面了解复杂环境。出于这个原因,我编写了 [KRAWL][2],这是一个简单的脚本,可用于扫描 Kubernetes 集群命名空间下的 pod 和容器,并在发现任何事件时,显示事件的输出。它也可用作为 Kubernetes 插件使用。这是获取大量有用信息的快速简便方法。 - -### 预先条件 - - * 必须安装 kubectl。 - * 集群的 kubeconfig 配置必须在它的默认位置 ($HOME/.kube/config) 或已被导出。 +如果管理容器的平台不符合你的要求,你也可以仅使用 Kubernetes 工具链获取这些信息,但这需要大量命令才能全面了解复杂环境。出于这个原因,我编写了 [KRAWL][2],这是一个简单的脚本,可用于扫描 Kubernetes 集群命名空间下的 Pod 和容器,并在发现任何事件时,显示事件的输出。它也可用作为 Kubernetes 插件使用。这是获取大量有用信息的快速简便方法。 +### 先决条件 + * 必须安装 `kubectl`。 + * 集群的 kubeconfig 配置必须在它的默认位置(`$HOME/.kube/config`)或已被导出到环境变量(`KUBECONFIG=/path/to/kubeconfig`)。 ### 使用 ``` -`$ ./krawl` +$ ./krawl ``` ![KRAWL script][3] @@ -38,20 +38,20 @@ ``` #!/bin/bash # AUTHOR: Abhishek Tamrakar -# EMAIL: [abhishek.tamrakar08@gmail.com][4] +# EMAIL: abhishek.tamrakar08@gmail.com # LICENSE: Copyright (C) 2018 Abhishek Tamrakar # -#  Licensed under the Apache License, Version 2.0 (the "License"); -#  you may not use this file except in compliance with the License. -#  You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -#       +# http://www.apache.org/licenses/LICENSE-2.0 # -#   Unless required by applicable law or agreed to in writing, software -#   distributed under the License is distributed on an "AS IS" BASIS, -#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#   See the License for the specific language governing permissions and -#   limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. ## #define the variables KUBE_LOC=~/.kube/config @@ -66,102 +66,102 @@ normal=$(tput sgr0) # wrapper for printing info messages info() { -  printf '\n\e[34m%s\e[m: %s\n' "INFO" "$@" + printf '\n\e[34m%s\e[m: %s\n' "INFO" "$@" } # cleanup when all done cleanup() { -  rm -f results.csv + rm -f results.csv } # just check if the command we are about to call is available checkcmd() { -  #check if command exists -  local cmd=$1 -  if [ -z "${!cmd}" ] -  then -    printf '\n\e[31m%s\e[m: %s\n' "ERROR"  "check if $1 is installed !!!" -    exit 1 -  fi + #check if command exists + local cmd=$1 + if [ -z "${!cmd}" ] + then + printf '\n\e[31m%s\e[m: %s\n' "ERROR" "check if $1 is installed !!!" + exit 1 + fi } get_namespaces() { -  #get namespaces -  namespaces=( \ -          $($KUBECTL get namespaces --ignore-not-found=true | \ -          $AWK '/Active/ {print $1}' \ -          ORS=" ") \ -          ) + #get namespaces + namespaces=( \ + $($KUBECTL get namespaces --ignore-not-found=true | \ + $AWK '/Active/ {print $1}' \ + ORS=" ") \ + ) #exit if namespaces are not found if [ ${#namespaces[@]} -eq 0 ] then -  printf '\n\e[31m%s\e[m: %s\n' "ERROR"  "No namespaces found!!" -  exit 1 + printf '\n\e[31m%s\e[m: %s\n' "ERROR" "No namespaces found!!" + exit 1 fi } #get events for pods in errored state get_pod_events() { -  printf '\n' -  if [ ${#ERRORED[@]} -ne 0 ] -  then -      info "${#ERRORED[@]} errored pods found." -      for CULPRIT in ${ERRORED[@]} -      do -        info "POD: $CULPRIT" -        info -        $KUBECTL get events \ -        --field-selector=involvedObject.name=$CULPRIT \ -        -ocustom-columns=LASTSEEN:.lastTimestamp,REASON:.reason,MESSAGE:.message \ -        --all-namespaces \ -        --ignore-not-found=true -      done -  else -      info "0 pods with errored events found." -  fi + printf '\n' + if [ ${#ERRORED[@]} -ne 0 ] + then + info "${#ERRORED[@]} errored pods found." + for CULPRIT in ${ERRORED[@]} + do + info "POD: $CULPRIT" + info + $KUBECTL get events \ + --field-selector=involvedObject.name=$CULPRIT \ + -ocustom-columns=LASTSEEN:.lastTimestamp,REASON:.reason,MESSAGE:.message \ + --all-namespaces \ + --ignore-not-found=true + done + else + info "0 pods with errored events found." + fi } #define the logic get_pod_errors() { -  printf "%s %s %s\n" "NAMESPACE,POD_NAME,CONTAINER_NAME,ERRORS" > results.csv -  printf "%s %s %s\n" "---------,--------,--------------,------" >> results.csv -  for NAMESPACE in ${namespaces[@]} -  do -    while IFS=' ' read -r POD CONTAINERS -    do -      for CONTAINER in ${CONTAINERS//,/ } -      do -        COUNT=$($KUBECTL logs --since=1h --tail=20 $POD -c $CONTAINER -n $NAMESPACE 2>/dev/null| \ -        $GET -c '^error|Error|ERROR|Warn|WARN') -        if [ $COUNT -gt 0 ] -        then -            STATE=("${STATE[@]}" "$NAMESPACE,$POD,$CONTAINER,$COUNT") -        else -        #catch pods in errored state -            ERRORED=($($KUBECTL get pods -n $NAMESPACE --no-headers=true | \ -                awk '!/Running/ {print $1}' ORS=" ") \ -                ) -        fi -      done -    done< <($KUBECTL get pods -n $NAMESPACE --ignore-not-found=true -o=custom-columns=NAME:.metadata.name,CONTAINERS:.spec.containers[*].name --no-headers=true) -  done -  printf "%s\n" ${STATE[@]:-None} >> results.csv -  STATE=() + printf "%s %s %s\n" "NAMESPACE,POD_NAME,CONTAINER_NAME,ERRORS" > results.csv + printf "%s %s %s\n" "---------,--------,--------------,------" >> results.csv + for NAMESPACE in ${namespaces[@]} + do + while IFS=' ' read -r POD CONTAINERS + do + for CONTAINER in ${CONTAINERS//,/ } + do + COUNT=$($KUBECTL logs --since=1h --tail=20 $POD -c $CONTAINER -n $NAMESPACE 2>/dev/null| \ + $GET -c '^error|Error|ERROR|Warn|WARN') + if [ $COUNT -gt 0 ] + then + STATE=("${STATE[@]}" "$NAMESPACE,$POD,$CONTAINER,$COUNT") + else + #catch pods in errored state + ERRORED=($($KUBECTL get pods -n $NAMESPACE --no-headers=true | \ + awk '!/Running/ {print $1}' ORS=" ") \ + ) + fi + done + done< <($KUBECTL get pods -n $NAMESPACE --ignore-not-found=true -o=custom-columns=NAME:.metadata.name,CONTAINERS:.spec.containers[*].name --no-headers=true) + done + printf "%s\n" ${STATE[@]:-None} >> results.csv + STATE=() } #define usage for seprate run usage() { -cat << EOF +cat << EOF -  USAGE: "${0##*/} </path/to/kube-config>(optional)" + USAGE: "${0##*/} (optional)" -  This program is a free software under the terms of Apache 2.0 License. -  COPYRIGHT (C) 2018 Abhishek Tamrakar + This program is a free software under the terms of Apache 2.0 License. + COPYRIGHT (C) 2018 Abhishek Tamrakar EOF exit 0 @@ -173,17 +173,17 @@ checkcmd KUBECTL # #set the ground if [ $# -lt 1 ]; then -  if [ ! -e ${KUBE_LOC} -a ! -s ${KUBE_LOC} ] -  then -    info "A readable kube config location is required!!" -    usage -  fi + if [ ! -e ${KUBE_LOC} -a ! -s ${KUBE_LOC} ] + then + info "A readable kube config location is required!!" + usage + fi elif [ $# -eq 1 ] then -  export KUBECONFIG=$1 + export KUBECONFIG=$1 elif [ $# -gt 1 ] then -  usage + usage fi #play get_namespaces @@ -191,7 +191,7 @@ get_pod_errors printf '\n%40s\n' 'KRAWL' printf '%s\n' '---------------------------------------------------------------------------------' -printf '%s\n' '  Krawl is a command line utility to scan pods and prints name of errored pods   ' +printf '%s\n' ' Krawl is a command line utility to scan pods and prints name of errored pods ' printf '%s\n\n' ' +and containers within. To use it as kubernetes plugin, please check their page ' printf '%s\n' '=================================================================================' @@ -199,9 +199,7 @@ cat results.csv | sed 's/,/,|/g'| column -s ',' -t get_pod_events ``` -* * * - -_此文最初发布在 [KRAWL 的 GitHub 仓库][2]下的 README 中,并被或许重用。_ +此文最初发布在 [KRAWL 的 GitHub 仓库][2]下的 README 中,并被或许重用。 -------------------------------------------------------------------------------- @@ -210,7 +208,7 @@ via: https://opensource.com/article/20/2/kubernetes-scanner 作者:[Abhishek Tamrakar][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 14bb061b533ed2726d5822aca0860a03fc80a7a8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 10:30:13 +0800 Subject: [PATCH 009/207] PUB @geekpi https://linux.cn/article-11936-1.html --- .../20200210 Scan Kubernetes for errors with KRAWL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200210 Scan Kubernetes for errors with KRAWL.md (98%) diff --git a/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md b/published/20200210 Scan Kubernetes for errors with KRAWL.md similarity index 98% rename from translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md rename to published/20200210 Scan Kubernetes for errors with KRAWL.md index ef33fd24c8..22fcd2a098 100644 --- a/translated/tech/20200210 Scan Kubernetes for errors with KRAWL.md +++ b/published/20200210 Scan Kubernetes for errors with KRAWL.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11936-1.html) [#]: subject: (Scan Kubernetes for errors with KRAWL) [#]: via: (https://opensource.com/article/20/2/kubernetes-scanner) [#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakar) From 9ca40c0db824d6b8733b90eaac1a63ab903c0d62 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 12:06:17 +0800 Subject: [PATCH 010/207] PRF @lujun9972 --- ...ice for How to Make Emacs Tetris Harder.md | 61 ++++++++----------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md index 81d107ec69..8a93358ece 100644 --- a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md +++ b/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md @@ -1,30 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Some Advice for How to Make Emacs Tetris Harder) [#]: via: (https://nickdrozd.github.io/2019/01/14/tetris.html) [#]: author: (nickdrozd https://nickdrozd.github.io) -让 Emacs 俄罗斯方块变得更难的一些建议 (Advice) +如何让 Emacs 俄罗斯方块变得更难 ====== -你知道吗,**Emacs** 与 **俄罗斯方块** 的实现捆绑在一起了?只需要输入 `M-x tetris` 就行了。 +你知道吗,Emacs 捆绑了一个俄罗斯方块的实现?只需要输入 `M-x tetris` 就行了。 -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-normal.png) +![](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-normal.png) -在文本编辑器讨论中,Emacs 倡导者经常提到这一点。“没错,但是那个编辑器能运行俄罗斯方块吗?” -我很好奇,这会让大家相信 Emacs 更优秀吗?比如,为什么有人会关心他们是否可以在文本编辑器中玩游戏呢?“是的,但是那台吸尘器能播放 mp3 吗?” +在对文本编辑器的讨论中,Emacs 鼓吹者经常提到这一点。“没错,但是你那个编辑器能运行俄罗斯方块吗?”我很好奇,这会让大家相信 Emacs 更优秀吗?比如,为什么有人会关心他们是否可以在文本编辑器中玩游戏呢?“没错,但是你那台吸尘器能播放 mp3 吗?” -有人说,俄罗斯方块总是很有趣的。像 Emacs 中的所有东西一样,它的源代码是开放的,易于检查和修改,因此 **我们可以使它变得更加有趣**。所谓更多的乐趣,我意思是更难。 +有人说,俄罗斯方块总是很有趣的。像 Emacs 中的所有东西一样,它的源代码是开放的,易于检查和修改,因此 **我们可以使它变得更加有趣**。所谓更加有趣,我的意思是更难。 -让游戏变得更困难的一个最简单的方法就是“不要下一个块预览”。你无法再在知道下一个块会填满空间的情况下有意地将 S/Z 块放在一个危险的位置——你必须碰碰运气,希望出现最好的情况。 -下面是没有预览的情况(如你所见,没有预览,我做出的某些选择带来了“可怕的后果”): +让游戏变得更难的一个最简单的方法就是“隐藏下一个块预览”。你无法在知道下一个块会填满空间的情况下有意地将 S/Z 块放在一个危险的位置——你必须碰碰运气,希望出现最好的情况。下面是没有预览的情况(如你所见,没有预览,我做出的某些选择带来了“可怕的后果”): -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-no-preview.png) +![](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-no-preview.png) -预览框由一个名为 `tetris-draw-next-shape` 的函数设置: +预览框由一个名为 `tetris-draw-next-shape` [^1] 的函数设置: ``` (defun tetris-draw-next-shape () @@ -43,7 +41,7 @@ tetris-shape)))) ``` -首先,我们引入一个标志,决定是否允许显示下一个预览块: +首先,我们引入一个标志,决定是否允许显示下一个预览块 [^2]: ``` (defvar tetris-preview-next-shape nil @@ -63,7 +61,7 @@ 一个更好的方法是使用 **advice**。Emacs 的 advice 类似于 **Python 装饰器**,但是更加灵活,因为 advice 可以从任何地方添加到函数中。这意味着我们可以修改函数而不影响原始的源文件。 -有很多不同的方法使用 Emacs advice([ 查看手册 ][4]),但是这里我们只使用 `advice-add` 函数和 `:around` 标志。advise 函数将原始函数作为参数,原始函数可能执行也可能不执行。我们这里,我们让原始函数只有在预览标志是非空的情况下才能执行: +有很多不同的方法使用 Emacs advice([查看手册][4]),但是这里我们只使用 `advice-add` 函数和 `:around` 标志。advice 函数将原始函数作为参数,原始函数可能执行也可能不执行。我们这里,我们让原始函数只有在预览标志是非空的情况下才能执行: ``` (defun tetris-maybe-draw-next-shape (tetris-draw-next-shape) @@ -75,11 +73,11 @@ 这段代码将修改 `tetris-draw-next-shape` 的行为,而且它可以存储在配置文件中,与实际的俄罗斯方块代码分离。 -去掉预览框是一个简单的改变。一个更激烈的变化是,**让块随机停止在空中**: +去掉预览框是一个简单的改变。一个更激烈的变化是,**让块随机停止在空中**: -![img](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-air.png) +![](https://nickdrozd.github.io/assets/2019-01-14-tetris/tetris-air.png) -本图中,红色的 I 和绿色的 T 部分没有掉下来,它们被固定下来了。这会让游戏变得 **及其难玩**,但却很容易实现。 +本图中,红色的 I 和绿色的 T 部分没有掉下来,它们被固定下来了。这会让游戏变得 **极其困难**,但却很容易实现。 和前面一样,我们首先定义一个标志: @@ -88,10 +86,9 @@ "If non-nil, pieces will sometimes stop in the air.") ``` -目前,**Emacs 俄罗斯方块的工作方式** 类似这样子:活动部件有 x 和 y 坐标。在每个时钟滴答声中,y 坐标递增(块向下移动一行),然后检查是否有与现存的块重叠。 -如果检测到重叠,则将该块回退(其 y 坐标递减)并设置该活动块到位。为了让一个块在半空中停下来,我们所要做的就是破解检测函数 `tetris-test-shape`。 +目前,**Emacs 俄罗斯方块的工作方式** 类似这样子:活动部件有 x 和 y 坐标。在每个时钟滴答声中,y 坐标递增(块向下移动一行),然后检查是否有与现存的块重叠。如果检测到重叠,则将该块回退(其 y 坐标递减)并设置该活动块到位。为了让一个块在半空中停下来,我们所要做的就是破解检测函数 `tetris-test-shape`。 -**这个函数内部做什么并不重要** —— 重要的是它是一个返回布尔值的无参数函数。我们需要它在正常情况下返回布尔值 true( 否则我们将出现奇怪的重叠情况),但在其他时候也需要它返回 true。我相信有很多方法可以做到这一点,以下是我的方法的: +**这个函数内部做什么并不重要** —— 重要的是它是一个返回布尔值的无参数函数。我们需要它在正常情况下返回布尔值 true(否则我们将出现奇怪的重叠情况),但在其他时候也需要它返回 true。我相信有很多方法可以做到这一点,以下是我的方法的: ``` (defun tetris-test-shape-random (tetris-test-shape) @@ -114,7 +111,7 @@ 这里的硬编码参数使游戏变得更困难,但仍然可玩。当时我在飞机上喝醉了,所以它们可能需要进一步调整。 -顺便说一下,根据我的 `tetris-scores` 文件,我的 **最高分** 是 +顺便说一下,根据我的 `tetris-scores` 文件,我的 **最高分** 是: ``` 01389 Wed Dec 5 15:32:19 2018 @@ -122,23 +119,15 @@ 该文件中列出的分数默认最多为五位数,因此这个分数看起来不是很好。 -**给读者的练习** +### 给读者的练习 -1。使用 advice 修改 Emacs 俄罗斯方块,使得每当方块下移动时就闪烁显示讯息 “OH SHIT”。消息的大小与块堆的高度成比例(当没有块时,消息应该很小的或不存在的,当最高块接近天花板时,消息应该很大)。 +1. 使用 advice 修改 Emacs 俄罗斯方块,使得每当方块下移动时就闪烁显示讯息 “OH SHIT”。消息的大小与块堆的高度成比例(当没有块时,消息应该很小的或不存在的,当最高块接近天花板时,消息应该很大)。 +2. 在这里给出的 `tetris-test-shape-random` 版本中,每隔七格就有一个半空中停止。一个玩家有可能能计算出时间间隔,并利用它来获得优势。修改它,使间隔随机在一些合理的范围内(例如,每 5 到 10 格)。 +3. 另一个对使用 Tetris 使用 advise 的场景,你可以试试 [autotetris-mode][1]。 +4. 想出一个有趣的方法来打乱块的旋转机制,然后使用 advice 来实现它。 -2。在这里给出的 `tetris-test-shape-random` 版本中,每隔七格就有一个半空中停止。一个玩家有可能能计算出时间间隔,并利用它来获得优势。修改它,使间隔随机在一些合理的范围内(例如,每 5 到 10 格)。 - -3。另一个对使用 Tetris 使用 advise 的场景,你可以试试 [`autotetris-mode`][1]。 - -4。想出一个有趣的方法来打乱块的旋转机制,然后使用 advice 来实现它。 - - -附注 -============================================================ - -[1][5] Emacs 只有一个巨大的全局命名空间,因此函数和变量名一般以包名做前缀以避免冲突。 - -[2][6] 很多人会说你不应该使用已有的命名空间前缀而且应该将自己定义的所有东西都放在一个预留的命名空间中,比如像这样 `my/tetris-preview-next-shape`,然而这样很难看而且没什么意义,因此我不会这么干。 +[^1]: Emacs 只有一个巨大的全局命名空间,因此函数和变量名一般以包名做前缀以避免冲突。 +[^2]: 很多人会说你不应该使用已有的命名空间前缀而且应该将自己定义的所有东西都放在一个预留的命名空间中,比如像这样 `my/tetris-preview-next-shape`,然而这样很难看而且没什么意义,因此我不会这么干。 -------------------------------------------------------------------------------- @@ -147,7 +136,7 @@ via: https://nickdrozd.github.io/2019/01/14/tetris.html 作者:[nickdrozd][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 69f356b6eaeb02e45e1a1e1128f55f3a714b6311 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 12:06:49 +0800 Subject: [PATCH 011/207] PUB @lujun9972 https://linux.cn/article-11938-1.html --- ...0190114 Some Advice for How to Make Emacs Tetris Harder.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190114 Some Advice for How to Make Emacs Tetris Harder.md (99%) diff --git a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/published/20190114 Some Advice for How to Make Emacs Tetris Harder.md similarity index 99% rename from translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md rename to published/20190114 Some Advice for How to Make Emacs Tetris Harder.md index 8a93358ece..7e06e1b241 100644 --- a/translated/tech/20190114 Some Advice for How to Make Emacs Tetris Harder.md +++ b/published/20190114 Some Advice for How to Make Emacs Tetris Harder.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11938-1.html) [#]: subject: (Some Advice for How to Make Emacs Tetris Harder) [#]: via: (https://nickdrozd.github.io/2019/01/14/tetris.html) [#]: author: (nickdrozd https://nickdrozd.github.io) From 3b44f1508fa2c6725ece77dedc6f7ec3a27de0db Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Thu, 27 Feb 2020 13:15:30 +0800 Subject: [PATCH 012/207] hankchow translating --- ...t developers need to know about domain-specific languages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200224 What developers need to know about domain-specific languages.md b/sources/tech/20200224 What developers need to know about domain-specific languages.md index 8c274f42b8..422d91eb22 100644 --- a/sources/tech/20200224 What developers need to know about domain-specific languages.md +++ b/sources/tech/20200224 What developers need to know about domain-specific languages.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e00988555ae953b8b8f4d94e40f564f444052f65 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Thu, 27 Feb 2020 20:30:15 +0800 Subject: [PATCH 013/207] hankchow translated --- ...to know about domain-specific languages.md | 130 ------------------ ...to know about domain-specific languages.md | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 130 deletions(-) delete mode 100644 sources/tech/20200224 What developers need to know about domain-specific languages.md create mode 100644 translated/tech/20200224 What developers need to know about domain-specific languages.md diff --git a/sources/tech/20200224 What developers need to know about domain-specific languages.md b/sources/tech/20200224 What developers need to know about domain-specific languages.md deleted file mode 100644 index 422d91eb22..0000000000 --- a/sources/tech/20200224 What developers need to know about domain-specific languages.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What developers need to know about domain-specific languages) -[#]: via: (https://opensource.com/article/20/2/domain-specific-languages) -[#]: author: (Girish Managoli https://opensource.com/users/gammay) - -What developers need to know about domain-specific languages -====== -DSLs are used for a specific context in a particular domain. Learn more -about what they are and why you might want to use one. -![Various programming languages in use][1] - -A [domain-specific language][2] (DSL) is a language meant for use in the context of a particular domain. A domain could be a business context (e.g., banking, insurance, etc.) or an application context (e.g., a web application, database, etc.) In contrast, a general-purpose language (GPL) can be used for a wide range of business problems and applications. - -A DSL does not attempt to please all. Instead, it is created for a limited sphere of applicability and use, but it's powerful enough to represent and address the problems and solutions in that sphere. A good example of a DSL is HTML. It is a language for the web application domain. It can't be used for, say, number crunching, but it is clear how widely used HTML is on the web. - -A GPL creator does not know where the language might be used or the problems the user intends to solve with it. So, a GPL is created with generic constructs that potentially are usable for any problem, solution, business, or need. Java is a GPL, as it's used on desktops and mobile devices, embedded in the web across banking, finance, insurance, manufacturing, etc., and more. - -### Classifying DSLs - -In the DSL world, there are two types of languages: - - * **Domain-specific language (DSL):** The language in which a DSL is written or presented - * **Host language:** The language in which a DSL is executed or processed - - - -A DSL written in a distinct language and processed by another host language is called an **external** DSL. - -This is a DSL in SQL that can be processed in a host language: - - -``` -SELECT account -FROM accounts -WHERE account = '123' AND branch = 'abc' AND amount >= 1000 -``` - -For that matter, a DSL could be written in English with a defined vocabulary and form that can be processed in another host language using a parser generator like ANTLR: - - -``` -`if smokes then increase premium by 10%` -``` - -If the DSL and host language are the same, then the DSL type is **internal**, where the DSL is written in the language's semantics and processed by it. These are also referred to as **embedded** DSLs. Here are two examples. - - * A Bash DSL that can be executed in a Bash engine: [code]`if today_is_christmas; then apply_christmas_discount; fi` [/code] This is valid Bash that is written like English. - * A DSL written in a GPL like Java: [code] orderValue = orderValue -                .applyFestivalDiscount() -                .applyCustomerLoyalityDiscount() -                .applyCustomerAgeDiscount(); [/code] This uses a fluent style and is readable like English. - - - -Yes, the boundaries between DSL and GPL sometimes blur. - -### DSL examples - -Some languages used for DSLs include: - - * Web: HTML - * Shell: sh, Bash, CSH, and the likes for *nix; MS-DOS, Windows Terminal, PowerShell for Windows - * Markup languages: XML - * Modeling: UML - * Data management: SQL and its variants - * Business rules: Drools - * Hardware: Verilog, VHD - * Build tools: Maven, Gradle - * Numerical computation and simulation: MATLAB (commercial), GNU Octave, Scilab - * Various types of parsers and generators: Lex, YACC, GNU Bison, ANTLR - - - -### Why DSL? - -The purpose of a DSL is to capture or document the requirements and behavior of one domain. A DSL's usage might be even narrower for particular aspects within the domain (e.g., commodities trading in finance). DSLs bring business and technical teams together. This does not imply a DSL is for business use alone. For example, designers and developers can use a DSL to represent or design an application. - -A DSL can also be used to generate source code for an addressed domain or problem. However, code generation from a DSL is not considered mandatory, as its primary purpose is domain knowledge. However, when it is used, code generation is a serious advantage in domain engineering. - -### DSL pros and cons - -On the plus side, DSLs are powerful for capturing a domain's attributes. Also, since DSLs are small, they are easy to learn and use. Finally, a DSL offers a language for domain experts and between domain experts and developers. - -On the downside, a DSL is narrowly used within the intended domain and purpose. Also, a DSL has a learning curve, although it may not be very high. Additionally, although there may be advantages to using tools for DSL capture, they are not essential, and the development or configuration of such tools is an added effort. Finally, DSL creators need domain knowledge as well as language-development knowledge, and individuals rarely have both. - -### DSL software options - -Open source DSL software options include: - - * **Xtext:** Xtext enables the development of DSLs and is integrated with Eclipse. It makes code generation possible and has been used by several open source and commercial products to provide specific functions. [MADS][3] (Multipurpose Agricultural Data System) is an interesting idea based on Xtext for "modeling and analysis of agricultural activities" (however, the project seems to be no longer active). - * **JetBrains MPS:** JetBrains MPS is an integrated development environment (IDE) to create DSLs. It calls itself a projectional editor that stores a document as its underlying abstract tree structure. (This concept is also used by programs such as Microsoft Word.) JetBrains MPS also supports code generation to Java, C, JavaScript, or XML. - - - -### DSL best practices - -Want to use a DSL? Here are a few tips: - - * DSLs are not GPLs. Try to address limited ranges of problems in the definitive domain. - * You do not need to define your own DSL. That would be tedious. Look for an existing DSL that solves your need on sites like [DSLFIN][4], which lists DSLs for the finance domain. If you are unable to find a suitable DSL, you could define your own. - * It is better to make DSLs "like English" rather than too technical. - * Code generation from a DSL is not mandatory, but it offers significant and productive advantages when it is done. - * DSLs are called languages but, unlike GPLs, they need not be executable. Being executable is not the intent of a DSL. - * DSLs can be written with word processors. However, using a DSL editor makes syntax and semantics checks easier. - - - -If you are using DSL now or plan to do so in the future, please share your experience in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/domain-specific-languages - -作者:[Girish Managoli][a] -选题:[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/gammay -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_language_c.png?itok=mPwqDAD9 (Various programming languages in use) -[2]: https://en.wikipedia.org/wiki/Domain-specific_language -[3]: http://mads.sourceforge.net/ -[4]: http://www.dslfin.org/resources.html diff --git a/translated/tech/20200224 What developers need to know about domain-specific languages.md b/translated/tech/20200224 What developers need to know about domain-specific languages.md new file mode 100644 index 0000000000..299ed726fc --- /dev/null +++ b/translated/tech/20200224 What developers need to know about domain-specific languages.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What developers need to know about domain-specific languages) +[#]: via: (https://opensource.com/article/20/2/domain-specific-languages) +[#]: author: (Girish Managoli https://opensource.com/users/gammay) + + +开发者需要了解的领域特定语言 +====== +> 领域特定语言是在特定领域下用于特定上下文的语言。作为开发者,很有必要了解领域特定语言的含义,以及为什么要使用特定领域语言。 + +![Various programming languages in use][1] + +领域特定语言domain-specific language(DSL)是在特定领域下用于特定上下文的语言。这里的领域是指某种商业上的(例如银行业、保险业等)上下文,也可以指某种应用程序的(例如 Web 应用、数据库等)上下文。与之相比的另一个概念是通用语言general-purpose language(GPL),通用语言则可以广泛应用于各种商业或应用问题当中。 + +DSL 并不具备很强的普适性,它是仅为某个适用的领域而设计的,但它也足以用于表示这个领域中的问题以及构建对应的解决方案。HTML 是 DSL 的一个典型,它是在 Web 应用上使用的语言,尽管 HTML 无法进行数字运算,但也不影响它在这方面的广泛应用。 + +而 GPL 则没有特定针对的领域,GPL 的设计者不可能知道这种语言会在什么领域被使用,更不清楚用户打算解决的问题是什么,因此 GPL 会被设计成可用于解决任何一种问题、适合任何一种业务、满足任何一种需求。例如 Java 就属于 GPL,它可以在 PC 或移动设备上运行,嵌入到银行、金融、保险、制造业等各种行业的应用中去。 + +### DSL 的类别 + +从使用方式的角度,语言可以划分出以下两类: + + * DSL:使用 DSL 形式编写或表示的语言 + * 宿主语言host language:用于执行或处理 DSL 的语言 + +当 DSL 以独有的形式表达,并由另一种宿主语言来处理时,这种 DSL 称为外部external DSL。 + +以下就是可以在宿主语言中处理的 SQL: + + +``` +SELECT account +FROM accounts +WHERE account = '123' AND branch = 'abc' AND amount >= 1000 +``` + +因此,只要在规定了词汇和语法的情况下,DSL 也可以直接使用英语来编写,并使用诸如 ANTLR 这样的解析器生成器parser generator以另一种宿主语言来处理 DSL: + + +``` +`if smokes then increase premium by 10%` +``` + +如果 DSL 和宿主语言是同一种语言,这种 DSL 称为内部internal DSL,其中 DSL 由以同一种语义的宿主语言编写和处理,因此又称为嵌入式embedded DSL。以下是两个例子: + + * Bash 形式的 DSL 可以由 Bash 解释器执行:`if today_is_christmas; then apply_christmas_discount; fi` 同时这也是一段看起来符合英语语法的 Bash。 + * 使用类似 Java 语法编写的 DSL: +``` +orderValue = orderValue + .applyFestivalDiscount() + .applyCustomerLoyalityDiscount() + .applyCustomerAgeDiscount(); +``` +这一段的可读性也相当强。 + +实际上,DSL 和 GPL 之间并没有非常明确的界限。 + +### DSL 家族 + +以下这些语言都可以作为 DSL 使用: + + * Web 应用:HTML + * Shell:用于类 Unix 系统的 sh、Bash、CSH 等;用于 Windows 系统的 MS-DOS、Windows Terminal、PowerShell 等 + * 标记语言:XML + * 建模:UML + * 数据处理:SQL 及其变体 + * 业务规则管理:Drools + * 硬件:Verilog、VHD + * 构建工具:Maven、Gradle + * 数值计算和模拟:MATLAB(商业)、GNU Octave、Scilab + * 解析器和生成器:Lex、YACC、GNU Bison、ANTLR + + + +### 为什么要使用 DSL? + +DSL 的目的是在某个领域中记录一些需求和行为,在某些方面(例如金融商品交易)中,DSL 的适用场景可能更加狭窄。业务团队和技术团队能通过 DSL 有效地协同工作,因此 DSL 除了在业务用途上有所发挥,还可以让设计人员和开发人员用于设计和开发应用程序。 + +DSL 还可以用于生成一些用于解决特定问题的代码,但生成代码并不是 DSL 的重点并不在此,而是对专业领域知识的结合。当然,代码生成在领域工程中是一个巨大的优势。 + +### DSL 的优点和缺点 + +DSL 的优点是,它对于领域的特征捕捉得非常好,同时它不像 GPL 那样包罗万有,学习和使用起来相对比较简单。因此,它在专业人员之间、专业人员和开发人员之间都提供了一个沟通的桥梁。 + +而 DSL 最显著的缺点就在于它只能用于一个特定的领域和目标。尽管学习起来不算太难,但学习成本仍然存在。如果使用到 DSL 相关的工具,即使对工作效率有所提升,但开发或配置这些工具也会增加一定的工作负担。另外,如果要设计一款 DSL,设计者必须具备专业领域知识和语言开发知识,而同时具备这两种知识的人却少之又少。 + +### DSL 相关软件 + +开源的 DSL 软件包括: + + * Xtext:Xtext 可以与 Eclipse 集成,并支持 DSL 开发。它能够实现代码生成,因此一些开源和商业产品都用它来提供特定的功能。用于农业活动建模分析的多用途农业数据系统Multipurpose Agricultural Data System(MADS)就是基于 Xtext 实现的一个项目,可惜的是这个项目现在已经不太活跃了。 + * JetBrains MPS:JetBrains MPS 是一个可供开发 DSL 的集成开发环境Integrated Development Environment,它将文档在底层存储为一个抽象树结构(Microsoft Word 也使用了这一概念),因此它也自称为一个投影编辑器projectional editor。JetBrains MPS 支持 Java、C、JavaScript 和 XML 的代码生成。 + +### DSL 的最佳实践 + +如果你想使用 DSL,记住以下几点: + + * DSL 不同于 GPL,DSL 只能用于解决特定领域中有限范围内的问题。 + * 不必动辄建立自己的 DSL,可以首先尝试寻找已有的 DSL。例如 [DSLFIN][4] 这个网站就提供了很多金融方面的 DSL。在实在找不到合适的 DSL 的情况下,才需要建立自己的 DSL。 + * DSL 最好像平常的语言一样具有可读性。 + * 尽管代码生成不是一项必需的工作,但它确实会大大提高工作效率。 + * 虽然 DSL 被称为语言,但 DSL 不需要像 GPL 一样可以被执行,可执行性并不是 DSL 需要达到的目的。 + * DSL 可以使用文本编辑器编写,但专门的 DSL 编辑器可以更轻松地完成 DSL 的语法和语义检查。 + + + +如果你正在使用或将要使用 DSL,欢迎在评论区留言。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/domain-specific-languages + +作者:[Girish Managoli][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gammay +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_language_c.png?itok=mPwqDAD9 (Various programming languages in use) +[2]: https://en.wikipedia.org/wiki/Domain-specific_language +[3]: http://mads.sourceforge.net/ +[4]: http://www.dslfin.org/resources.html From d240a751f23172fb579968220c48b787d4191db6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 22:17:07 +0800 Subject: [PATCH 014/207] APL --- ... You Can Buy Open Source Apps for Your Linux Distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md index 1019db718d..903c8418e1 100644 --- a/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md +++ b/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5665e4c58295257ed44cb1aa10949b3141ac68f0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 27 Feb 2020 23:33:28 +0800 Subject: [PATCH 015/207] TSL&PRF --- ...Source Apps for Your Linux Distribution.md | 97 ------------------- ...Source Apps for Your Linux Distribution.md | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md create mode 100644 translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md diff --git a/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md deleted file mode 100644 index 903c8418e1..0000000000 --- a/sources/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution) -[#]: via: (https://itsfoss.com/appcenter-for-everyone/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution -====== - -_**Brief: elementary OS is building an app center ecosystem where you can buy open source applications for your Linux distribution.**_ - -### Crowdfunding to build an open source AppCenter for everyone - -![][1] - -[elementary OS][2] recently announced that it is [crowdfunding a campaign to build an app center][3] from where you can buy open source applications. The applications in the app center will be in Flatpak format. - -Though it’s an initiative taken by elementary OS, this new app center will be available for other distributions as well. - -The campaign aims to fund a week of in-person development sprint in Denver, Colorado (USA) featuring developers from elementary OS, [Endless][4], [Flathub][5] and [GNOME][6]. - -The crowdfunding campaign has already crossed its goal of raising $10,000. You can still fund it as additional funds will be used for the development of elementary OS. - -[Crowdfunding Campaign][3] - -### What features this AppCenter brings - -The focus is on providing ‘secure’ applications and hence [Flatpak][7] apps are used to provide confined applications. In this format, apps will be restricted from accessing system or personal files and will be isolated from other apps on a technical level by default. - -Apps will have access to operating system and personal files only if you explicitly provide your consent for it. - -Apart from security, [Flatpak][8] also bundles all the dependencies. This way, app developers can utilize the cutting edge technologies even if it is not available on the current Linux distribution. - -AppCenter will also have the wallet feature to save your card details. This enables you to quickly pay for apps without entering the card details each time. - -![][9] - -This new open source ‘app center’ will be available for other Linux distributions as well. - -### Inspired by the success of elementary OS’s own ‘Pay What You Want’ app center model - -A couple of years ago, elementary OS launched its own app center. The ‘pay what you want’ approach for the app center was quite a hit. The developers can put a minimum amount for their open source apps and the users can choose to pay an amount equal to or more than the minimum amount. - -![][10] - -This helped several indie developers get paid for their open source applications. The app store now has around 160 native applications and elementary OS says that thousands of dollars have been paid to the developers through the app center. - -Inspired by the success of this app center experiment in elementary OS, they now want to bring this app center approach to other distributions as well. - -### If the applications are open source, how can you charge money for it? - -Some people still get confused with the idea of FOSS (free and open source). Here, the **source** code of the software is **open** and anyone is **free** to modify it and redistribute it. - -It doesn’t mean that open source software has to be free of cost. Some developers rely on donations while some charge a fee for support. - -Getting paid for the open source apps may encourage developers to create [applications for Linux][11]. - -### Let’s see if it could work - -![][12] - -Personally, I am not a huge fan of Flatpak or Snap packaging format. They do have their benefits but they take relatively more time to start and they are huge in size. If you install several such Snaps or Flatpaks, your disk space may start running out of free space. - -There is also a need to be vigilant about the fake and scam developers in this new app ecosystem. Imagine if some scammers starts creating Flatpak package of obscure open source applications and put it on the app center? I hope the developers put some sort of mechanism to weed out such apps. - -I do hope that this new AppCenter replicates the success it has seen in elementary OS. We definitely need a better ecosystem for open source apps for desktop Linux. - -What are your views on it? Is it the right approach? What suggestions do you have for the improvement of the AppCenter? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/appcenter-for-everyone/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter.png?ssl=1 -[2]: https://elementary.io/ -[3]: https://www.indiegogo.com/projects/appcenter-for-everyone/ -[4]: https://itsfoss.com/endless-linux-computers/ -[5]: https://flathub.org/ -[6]: https://www.gnome.org/ -[7]: https://flatpak.org/ -[8]: https://itsfoss.com/flatpak-guide/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter-wallet.png?ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter-payment.png?ssl=1 -[11]: https://itsfoss.com/essential-linux-applications/ -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/open_source_app_center.png?ssl=1 diff --git a/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md new file mode 100644 index 0000000000..fdc7ac1132 --- /dev/null +++ b/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution) +[#]: via: (https://itsfoss.com/appcenter-for-everyone/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +elementary OS 正在构建一个可以买应用的开源应用商店 +====== + +> elementary OS 正在构建一个应用中心生态系统,你可以在其中购买用于 Linux 发行版的开源应用程序。 + +### 众筹构建一个开源应用中心 + +![][1] + +[elementary OS][2] 最近宣布,它正在[众筹举办一个构建应用中心的活动][3],你可以从这个应用中心购买开源应用程序。应用中心中的应用程序将为 Flatpak 格式。 + +尽管这是 elementary OS 发起的活动,但这个新的应用中心也将适用于其他发行版。 + +该活动旨在资助在美国科罗拉多州丹佛市进行的一项一周个人开发冲刺活动,其中包括来自 elementary OS、[Endless][4]、[Flathub][5] 和 [GNOME][6] 的开发人员。 + +众筹活动已经超过了筹集 1 万美元的目标(LCTT 译注:截止至本译文发布,已近 15000 美金)。但你仍然可以为其提供资金,因为其他资金将用于开发 elementary OS。 + +### 这个应用中心将带来什么功能 + +其重点是提供“安全”应用程序,因此使用 [Flatpak][7] 应用来提供受限的应用程序。在这种格式下,默认情况下将会限制应用程序访问系统或个人文件,并在技术层面上将它们与其他应用程序隔离。 + +仅当你明确表示同意时,应用程序才能访问操作系统和个人文件。 + +除了安全性,[Flatpak][8] 还捆绑了所有依赖项。这样,即使当前 Linux 发行版中不提供这些依赖项,应用程序开发人员也可以利用这种最先进的技术使用它。 + +AppCenter 还具有钱包功能,可以保存你的信用卡详细信息。这样,你无需每次输入卡的详细信息即可快速为应用付费。 + +![][9] + +这个新的开源“应用中心”也将适用于其他 Linux 发行版。 + +### 受到了 elementary OS 自己的“按需付费”应用中心模型成功的启发 + +几年前,elementary OS 推出了自己的应用中心。应用中心的“按需付费”方法很受欢迎。开发人员可以为其开源应用设置最低金额,而用户可以选择支付等于或高于最低金额的金额。 + +![][10] + +这帮助了几位独立开发人员可以对其开源应用程序接受付款。该应用中心现在拥有约 160 个原生应用程序,elementary OS 表示已通过应用中心向开发人员支付了数千美元。 + +受到此应用中心实验在 elementary OS 中的成功的启发,他们现在也希望将此应用中心的方法也引入其他发行版。 + +### 如果应用程序是开源的,你怎么为此付费? + +某些人仍然对 FOSS(自由而开源)的概念感到困惑。在这里,该软件的“源代码”是“开源的”,任何人都可以“自由”进行修改和重新分发。 + +但这并不意味着开源软件必须免费。一些开发者依靠捐赠,而另一些则收取支持费用。 + +获得开源应用程序的报酬可能会鼓励开发人员创建 [Linux 应用程序][11]。 + +### 让我们拭目以待 + +![][12] + +就个人而言,我不是 Flatpak 或 Snap 包格式的忠实拥护者。它们确实有其优点,但是它们花费了相对更多的时间来启动,并且它们的包大小很大。如果安装了多个此类 Snap 或 Flatpak 软件包,磁盘空间就会慢慢耗尽。 + +也需要对这个新的应用程序生态系统中的假冒和欺诈开发者保持警惕。想象一下,如果某些骗子开始创建冷门的开源应用程序的 Flatpak 程序包,并将其放在应用中心上?我希望开发人员采用某种机制来淘汰此类应用程序。 + +我确实希望这个新的应用中心能够复制在 elementary OS 中已经看到的成功。对于桌面 Linux 的开源应用程序,我们绝对需要更好的生态系统。 + +你对此有何看法?这是正确的方法吗?你对改进应用中心有什么建议? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/appcenter-for-everyone/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter.png?ssl=1 +[2]: https://elementary.io/ +[3]: https://www.indiegogo.com/projects/appcenter-for-everyone/ +[4]: https://itsfoss.com/endless-linux-computers/ +[5]: https://flathub.org/ +[6]: https://www.gnome.org/ +[7]: https://flatpak.org/ +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter-wallet.png?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/appcenter-payment.png?ssl=1 +[11]: https://itsfoss.com/essential-linux-applications/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/open_source_app_center.png?ssl=1 From 09fe9739520ea6a08cd58836c64e61b33c4dfa29 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 00:10:43 +0800 Subject: [PATCH 016/207] PUB @wxy https://linux.cn/article-11939-1.html --- ...ou Can Buy Open Source Apps for Your Linux Distribution.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md (98%) diff --git a/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md similarity index 98% rename from translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md rename to published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md index fdc7ac1132..6619254799 100644 --- a/translated/tech/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md +++ b/published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11939-1.html) [#]: subject: (elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution) [#]: via: (https://itsfoss.com/appcenter-for-everyone/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From a1cd1e2f36a35ef899bdd050ef406d6005bb6803 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 Feb 2020 01:02:06 +0800 Subject: [PATCH 017/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200226=20Mirant?= =?UTF-8?q?is:=20Balancing=20Open=20Source=20with=20Guardrails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md --- ...- Balancing Open Source with Guardrails.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md diff --git a/sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md b/sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md new file mode 100644 index 0000000000..5eeb400060 --- /dev/null +++ b/sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mirantis: Balancing Open Source with Guardrails) +[#]: via: (https://www.linux.com/articles/mirantis-balancing-open-source-with-guardrails/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +Mirantis: Balancing Open Source with Guardrails +====== + +[![][1]][2] + +[![][1]][2] + +Mirantis, an open infrastructure company that rose to popularity with its OpenStack offering, is now moving into the Kubernetes space very aggressively. [Last year, the company acquired the Docker Enterprise business from Docker.][3] [This week, it announced that they were hiring the Kubernetes experts from the Finnish company Kontena a][4]nd established a Mirantis office in Finland, expanding the company’s footprint in Europe. Mirantis already has a significant presence in Europe due to large customers such as Bosch and [Volkswagen][5]. + +The Kontena team primarily focused on two technologies. One was a Kubernetes distro called [Pharos][6], which differentiated itself from other distributions by specializing in addressing life cycle management challenges. They had developed some unique capabilities for deployment and for updating Kubernetes itself. + +The second product by Kontena is [Lens][6]. “It’s like a Kubernetes dashboard on steroids. In addition to offering the standard dashboard functions, it went multiple steps further by providing a terminal for command line interfacing to nodes and containers, and additional real-time insights, role-based access controls and a number of other capabilities that are currently absent from the Kubernetes dashboard,” said [Dave Van Everen][7], SVP of Marketing at Mirantis. + +Everything that Kontena does is open source. These open source projects are already used by hundreds of organizations around the world. “They have a proven track record of contributing valuable technology pieces to the Kubernetes ecosystem, and we saw an opportunity to bring the team on board and capitalized on that opportunity as quickly as we could,” said Van Everen. + +Mirantis will integrate many of the technology concepts and benefits from Pharos into its Docker Enterprise offering. With Kontena engineers on board, Mirantis expects to incorporate the best of what Kontena offered into its commercially supported Docker Enterprise and [Kubernetes][8] technology. + +With this acquisition, Mirantis has hinted at a very aggressive 2020. The company is weeks away from launching the first Docker Enterprise release since the acquisition. The release brings many new capabilities on top of Docker Enterprise 3.0. The company is working on merging the [Mirantis KaaS][9] capabilities with Docker Enterprise. “We will add new capabilities, including multi-cluster management and continuous automated updates to the Kubernetes that’s already within Docker Enterprise,” said Van Everen. + +**What is Mirantis today?** + +Mirantis started out as a pure-play OpenStack company, but as the market dynamics changed, the company adjusted its own positioning and bet on CD platforms like Spinnaker and container orchestration technologies like Kubernetes. So, what are they focusing on today? + +Van Everen said that Mirantis is definitely embracing Kubernetes as the open standard used by enterprises for modern applications. Kubernetes itself has a massive ecosystem of technologies that a customer needs to leverage. “When we speak about Kubernetes, we speak about full-stack Kubernetes, which includes that ecosystem consisting of a couple dozen components in a typical cluster deployment. Our job as a trusted partner in helping our customers accelerate their path to modern applications is to streamline and automate all of the infrastructure and DevOps tooling supporting their app development lifecycle,” san Van Everen. + +In a nutshell, Mirantis is making it easier for customers to use Kubernetes. + +Over the years, [Mirantis][10] has gained expertise in IaaS with the work they did on OpenStack. “All of that plays a role in helping companies move faster and become more agile as they’re modernizing their applications. We apply many of those same strengths to the Kubernetes ecosystem,” he said. + +Mirantis is also building expertise in continuous delivery platforms like [Argo CD][11] and is offering customers a spectrum of professional services around application modernization, from writing code that is based in microservices architecture, to integrating CI/CD pipelines and modernizing the tooling for CI/CD to better support cloud-native patterns. By supporting Kubernetes technology with app modernization services, Mirantis is helping customers wherever they are in their digital transformation and cloud-native journey. + +“All of those things that our services team provides are complementary to the technology. That’s a unique value that only Mirantis can provide to the market, where we can couple open source technologies with strong services to ensure that companies really get the most out of that open source technology and fulfill their ultimate goal, which is to accelerate their pace of innovation,” Van Everen said. + +Container networking is a critical piece of the cloud-native world and Mirantis already has expertise in the area, thanks to their work on OpenStack. The company recently joined the Linux Foundation’s [LF Networking project][12] which is home to [Tungsten Fabric][13] (formerly known as OpenContrail), a technology that Mirantis uses for its [OpenStack][14] offerings. + +He explains, “While we use Calico for the container networking, Tungsten Fabric would be an important part of the underlying networking supporting Kubernetes deployments. Staying true to our heritage, we want to be involved in the open community and have both a voice and a stake in the direction the communities are moving in.” + +[As for the ongoing debate or controversy around two competing service mesh technologies Istio and Linkerd,][15] the company has made its bet on Istio. A few months ago, Mirantis announced a training program for Istio, which was bundled with Mirantis’ KaaS offerings. + +“We include Istio as a service mesh by default in child clusters under Mirantis KaaS management. It’ll be used as an ingress with Docker Enterprise initially. Moving forward, we’re still looking at how to best deploy it in a service mesh configuration by default and provide a configurable but still functional default deployment for Istio as a service mesh,” said Van Everen. + +It might seem like Mirantis is latching on to the latest hot technologies like OpenStack, [Spinnaker][16], Docker Enterprise, Kubernetes, and Istio to see what sticks. In reality, there is a method to it: the company is going where its customers are going, with the technologies that customers are using. It’s a fine balancing act. + +“That’s the type of technology challenge that Mirantis embraces. We are open source experts and continue to provide the greatest flexibility and choice in our industry, but we do it in such a way that there are guardrails in place so that companies don’t end up having something that’s overly complex and unmanageable, or configured incorrectly,” he concluded. + +Note: Cross posted to [TFIR][17] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/mirantis-balancing-open-source-with-guardrails/ + +作者:[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 +[1]: https://www.linux.com/wp-content/uploads/2019/09/world-network-1068x713.jpg (world-network) +[2]: https://www.linux.com/wp-content/uploads/2019/09/world-network.jpg +[3]: https://www.youtube.com/watch?v=cBOrVKuomcU&feature=emb_title +[4]: https://containerjournal.com/topics/container-ecosystems/mirantis-acquires-kubernetes-assets-from-kontena/ +[5]: https://www.mirantis.com/company/press-center/company-news/volkswagen-group-selects-mirantis-openstack-software-next-generation-cloud/ +[6]: https://github.com/kontena +[7]: https://twitter.com/davidvaneveren?lang=en +[8]: https://kubernetes.io/ +[9]: https://www.tfir.io/mirantis-launches-kaas-across-bare-metal-public-and-private-clouds/ +[10]: https://www.mirantis.com/ +[11]: https://argoproj.github.io/argo-cd/ +[12]: https://www.linuxfoundation.org/projects/networking/ +[13]: https://tungsten.io/ +[14]: https://www.openstack.org/ +[15]: https://twitter.com/hashtag/istio?lang=en +[16]: https://www.tfir.io/?s=spinnaker +[17]: https://www.tfir.io/mirantis-balancing-open-source-with-guardrails/ From 5fd81991eeac517453619507dbff21bd3cb485ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 Feb 2020 01:03:07 +0800 Subject: [PATCH 018/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20No=20M?= =?UTF-8?q?ore=20WhatsApp!=20The=20EU=20Commission=20Switches=20To=20?= =?UTF-8?q?=E2=80=98Signal=E2=80=99=20For=20Internal=20Communication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md --- ... To ‘Signal- For Internal Communication.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md diff --git a/sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md b/sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md new file mode 100644 index 0000000000..8b47602a54 --- /dev/null +++ b/sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (No More WhatsApp! The EU Commission Switches To ‘Signal’ For Internal Communication) +[#]: via: (https://itsfoss.com/eu-commission-switches-to-signal/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +No More WhatsApp! The EU Commission Switches To ‘Signal’ For Internal Communication +====== + +_**In a move to improve the cyber-security, EU has recommended its staff to use open source secure messaging app Signal instead of the popular apps like WhatsApp.**_ + +[Signal is an open source secure messaging application][1] with end to end encryption. It is praised by the likes of [Edward Snowden][2] and other privacy activists, journalists and researchers. We’ve recently covered it in our ‘[open source app of the week][3]‘ series. + +[Signal][4] is in news for good reasons. The European Union Commissions have instructed its staff to use Signal for public instant messaging. + +This is part of EU”s new cybersecurity strategy. There has been cases of data leaks and hacking against EU diplomats and thus policy is being put in place to encourage better security practices. + +### Governments recommending open source technology is a good sign + +![][5] + +No matter what the reason is, Government bodies recommending open-source services for better security is definitely a good thing for the open-source community in general. + +[Politico][6] originally reported this by mentioning that the EU instructed its staff to use Signal as the recommended public instant messaging app: + +> The instruction appeared on internal messaging boards in early February, notifying employees that “Signal has been selected as the recommended application for public instant messaging.” + +The report also mentioned the potential advantage of Signal (which is why the EU is considering using it): + +> “It’s like Facebook’s WhatsApp and Apple’s iMessage but it’s based on an encryption protocol that’s very innovative,” said Bart Preneel, cryptography expert at the University of Leuven. “Because it’s open-source, you can check what’s happening under the hood,” he added. + +Even though they just want to secure their communication or want to prevent high-profile leaks, switching to an open-source solution instead of [WhatsApp][7] sounds good to me. + +### Signal gets a deserving promotion + +Even though Signal is a centralized solution that requires a phone number as of now, it is still a no-nonsense open-source messaging app that you may trust. + +Privacy enthusiasts already know a lot of services (or alternatives) to keep up with the latest security and privacy threats. However, with the EU Commission recommending it to its staff, Signal will get an indirect promotion for common mobile and desktop users. + +### Wrapping Up + +It is still an irony that some Government bodies hate encrypted solutions while opting to use them for their own requirement. + +Nevertheless, it is good progress for open-source services and tech, in general, is recommended as a secure alternative. + +What do you think about the EU’s decision on switching to the Signal app for its internal communication? Feel free to let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/eu-commission-switches-to-signal/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/signal-messaging-app/ +[2]: https://en.wikipedia.org/wiki/Edward_Snowden +[3]: https://itsfoss.com/tag/app-of-the-week/ +[4]: https://www.signal.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/Signal-eu.jpg?ssl=1 +[6]: https://www.politico.eu/pro/eu-commission-to-staff-switch-to-signal-messaging-app/ +[7]: https://www.whatsapp.com/ From df37dc49cd4f83d1bab0ea689ddf4556a61549ee Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 28 Feb 2020 01:07:15 +0800 Subject: [PATCH 019/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200226=20Use=20?= =?UTF-8?q?logzero=20for=20simple=20logging=20in=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200226 Use logzero for simple logging in Python.md --- ...se logzero for simple logging in Python.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20200226 Use logzero for simple logging in Python.md diff --git a/sources/tech/20200226 Use logzero for simple logging in Python.md b/sources/tech/20200226 Use logzero for simple logging in Python.md new file mode 100644 index 0000000000..1fbd61b68f --- /dev/null +++ b/sources/tech/20200226 Use logzero for simple logging in Python.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use logzero for simple logging in Python) +[#]: via: (https://opensource.com/article/20/2/logzero-python) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +Use logzero for simple logging in Python +====== +A quick primer on the handy log library that can help you master this +important programming concept. +![Snake charmer cartoon with a yellow snake and a blue snake][1] + +The logzero library makes logging as easy as a print statement, which is quite a feat of simplicity. I'm not sure whether logzero took its name to fit in with the series of "zero boilerplate" libraries like pygame-zero, GPIO Zero, and guizero, but it's certainly in that category. It's a Python library that makes logging straightforward. + +You can just use its basic logging to stdout the same way you might use print for information and debugging purposes, and it has a smooth learning curve towards more advanced logging, like logging to a file. + +To start, install logzero with pip: + + +``` +`$ sudo pip3 install logzero` +``` + +Now in a Python file, import logger and try one or all of these logging examples: + + +``` +from logzero import logger + +logger.debug("hello") +logger.info("info") +logger.warning("warning") +logger.error("error") +``` + +The output is automatically colored in an easy-to-read way: + +![Python, Raspberry Pi: import logger][2] + +So now, instead of using **print** to figure out what's going on, use logger instead, with the relevant log level. + +### Writing logs to a file in Python + +If you only read this far and make that one change in the way you write code, that's good enough for me. If you want to go further, read on! + +Writing to **stdout** is fun for testing a new program, but it is only useful if you are logged into the computer where the script is running. Many times when using an application you'll want to execute the code remotely and review errors after the fact. That's when it's helpful to log to a file instead. Let's try it: + + +``` +from logzero import logger, logfile + +logfile('/home/pi/test.log') +``` + +Now your log entries will be logged into the file **test.log**. Remember to make sure that the [script has permission][3] to write to that file and its directory structure. + +You can specify some more options too: + + +``` +`logfile(’/home/pi/test.log’, maxBytes=1e6, backupCount=3)` +``` + +Now when the file provided to **logfile** reaches 1MB (1×106 bytes), it will rotate entries through **test.log.1**, **test.log.2**, and so on. This behavior is nice to avoid generating a massive log file that is I/O intensive for the system to open and close. You might also want to log to **/var/log** like a pro. Assuming you're on Linux, you a directory and make your user the owner so they can write to it: + + +``` +$ sudo mkdir /var/log/test +$ sudo chown pi /var/log/test +``` + +Then in your Python code, change the **logfile** path: + + +``` +`logfile(’/var/log/test/test.log’, maxBytes=1e6, backupCount=3)` +``` + +When it comes to catching exceptions in your **logfile**, you can either use **logging.exception:** + + +``` +try: +    c = a / b +except Exception as e: +    logger.exception(e) +``` + +This will produce the following (in the case that b is zero): + + +``` +[E 190422 23:41:59 test:9] division by zero +     Traceback (most recent call last): +       File "test.py", line 7, in +         c = a / b +     ZeroDivisionError: division by zero +``` + +You get the log entry, followed by the full traceback. Alternatively, you could use **logging.error** and hide the traceback: + + +``` +try: +    c = a / b +except Exception as e: +    logger.error(f"{e.__class__.__name__}: {e}") +``` + +Now this will produce the more succinct: + + +``` +`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero` +``` + +* * * + +* * * + +* * * + +**![Logging output][4]** + +There are plenty more options which you can read in the docs at [logzero.readthedocs.io][5]. + +### logzero shines for education + +Logging can be a challenging concept for a new programmer. Most frameworks depend on flow control and lots of variable manipulation to make a meaningful log, but logzero is different. With its syntax being similar to a print statement, it is a big win for education as it saves from explaining another concept. Give it a try on your next project. + +\-- + +_This article was originally written on [my blog][6] and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/logzero-python + +作者:[Ben Nuttall][a] +选题:[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/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake) +[2]: https://opensource.com/sites/default/files/uploads/rpi_ben_1.png (Python, Raspberry Pi: import logger) +[3]: https://opensource.com/article/19/6/understanding-linux-permissions +[4]: https://opensource.com/sites/default/files/uploads/rpi_ben_2.png (Logging output) +[5]: https://logzero.readthedocs.io/en/latest/ +[6]: https://tooling.bennuttall.com/logzero/ From e811f79f7b1831f2290a37cf9f56a1e3144e3865 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 28 Feb 2020 08:28:12 +0800 Subject: [PATCH 020/207] translated --- ...hing- Open Source P2P File Syncing Tool.md | 146 ------------------ ...hing- Open Source P2P File Syncing Tool.md | 146 ++++++++++++++++++ 2 files changed, 146 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md create mode 100644 translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md diff --git a/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md deleted file mode 100644 index fe48819ada..0000000000 --- a/sources/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Syncthing: Open Source P2P File Syncing Tool) -[#]: via: (https://itsfoss.com/syncthing/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Syncthing: Open Source P2P File Syncing Tool -====== - -_**Brief: Syncthing is an open-source peer-to-peer file synchronization tool that you can use for syncing files between multiple devices (including an Android phone).**_ - -Usually, we have a cloud sync solution like [MEGA][1] or Dropbox to have a backup of our files on the cloud while making it easier to share it. - -But, what do you do if you want to sync your files across multiple devices without storing them on the cloud? - -That is where [Syncthing][2] comes to the rescue. - -### Syncthing: An open source tool to synchronize files across devices - -![][3] - -Syncthing lets you sync your files across multiple devices (including the support for Android smartphones). It primarily works through a web UI on Linux but also offers a GUI (to separately install). - -However, Syncthing does not utilize the cloud at all – it is a [peer-to-peer][4] file synchronization tool. Your data doesn’t go to a central server. Instead, the data is synced with all the devices between them. So, it does not really replace the [typical cloud storage services on Linux][5]. - -To add remote devices, you just need the device ID (or simply scan the QR code), no IP addresses involved. - -If you want a remote backup of your files – you should probably rely on the cloud. - -![Syncthing GUI][6] - -All things considered, Syncthing can come in handy for a lot of things. Technically, you can have your important files accessible on multiple systems securely and privately without worrying about anyone spying on your data. - -For instance, you may not want to store some of the sensitive files on the cloud – so you can add other trusted devices to sync and keep a copy of those files. - -Even though I described it briefly, there’s more to it and than meets the eye. I’d also recommend reading the [official FAQ][7] to clear some confusion on how it works – if you’re interested. - -### Features of Syncthing - -You probably do not want a lot of options in a synchronization tool – it should be dead simple to work reliably to sync your files. - -Syncthing is indeed quite simple and easy to understand – even though it is recommended that you should go through the [documentation][8] if you want to use every bit of its functionality. - -Here, I’ll highlight a few useful features of Syncthing: - -#### Cross-Platform Support - -![Syncthing on Android][9] - -Being an open-source solution, it does support Windows, Linux, and macOS. - -In addition to that, it also supports Android smartphones. You’ll be disappointed if you have an iOS device – so far, no plans for iOS support. - -#### File Versioning - -![Syncthing File Versioning][10] - -Syncthing utilizes a variety of [File Versioning methods][11] to archive the old files if they are replaced or deleted. - -By default, you won’t find it enabled. But, when you create a folder to sync, that’s when you will find the option to toggle the file versioning to your preferred method. - -#### Easy To Use - -While being a peer-to-peer file synchronization tool, it just works out of the box with no advanced tweaks. - -However, it does let you configure advanced settings when needed. - -#### Security & Privacy - -Even though you do not share your data with any cloud service providers, there are still some connections made that might gain the attention of an eavesdropper. So, Syncthing makes sure the communication is secured using TLS. - -In addition to that, there are solid authentication methods to ensure that only the devices/connections you allow explicitly will be granted access to sync/read data. - -For Android smartphones, you can also force the traffic through Tor if you’re using the [Orbot app][12]. You’ll find several other options for Android as well. - -#### Other Functionalities - -![][13] - -When exploring the tool yourself, you will notice that there are no limits to how many folders you can sync and the number of devices that you can sync. - -So, being a free and open-source solution with lots of useful features makes it an impressive choice for Linux users looking to have a peer-to-peer sync client. - -### Installing Syncthing on Linux - -You may not observe a .deb file or an .AppImage file for it on its official download webpage. But, you do get a snap package on the [Snap store][14] – if you’re curious you can read about [using snap apps][15] on Linux to get started. - -You may not find it in the software center (if you do – it may not be the latest version). - -**Note:** _There’s also a [Syncthing-GTK][16] available if you want a GUI to manage that – instead of a browser._ - -[Syncthing][2] - -You can also utilize the terminal to get it installed if you have a Debian-based distro – the instructions are on the [official download page][17]. - -### My experience with Syncthing - -Personally, I got it installed on Pop!_OS 19.10 and used it for a while before writing this up. - -I tried syncing folders, removing them, adding duplicate files to see how the file versioning works, and so on. It worked just fine. - -However, when I tried syncing it to a phone (Android) – the sync started a bit late, it wasn’t very quick. So, if we could have an option to explicitly force sync, that could help. Or, did I miss the option? Let me know in the comments if I did. - -Technically, it uses the resources of your system to work – so if you have a number of devices connected to sync, it should potentially improve the sync speed (upload/download). - -Overall, it works quite well – but I must say that you shouldn’t rely on it as the only backup solution to your data. - -**Wrapping Up** - -Have you tried Syncthing yet? If yes, how was your experience with it? Feel free to share it in the comments below. - -Also, if you know about some awesome alternatives to this – let me know about it as well. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/syncthing/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-mega-cloud-storage-linux/ -[2]: https://syncthing.net/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot.jpg?ssl=1 -[4]: https://en.wikipedia.org/wiki/Peer-to-peer -[5]: https://itsfoss.com/cloud-services-linux/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-gtk.png?ssl=1 -[7]: https://docs.syncthing.net/users/faq.html -[8]: https://docs.syncthing.net/users/index.html -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-android.jpg?ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-file-versioning.jpg?ssl=1 -[11]: https://docs.syncthing.net/users/versioning.html -[12]: https://play.google.com/store/apps/details?id=org.torproject.android&hl=en_IN -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot1.jpg?ssl=1 -[14]: https://snapcraft.io/syncthing -[15]: https://itsfoss.com/install-snap-linux/ -[16]: https://github.com/syncthing/syncthing-gtk/releases/latest -[17]: https://syncthing.net/downloads/ diff --git a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md new file mode 100644 index 0000000000..013a3569a4 --- /dev/null +++ b/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Syncthing: Open Source P2P File Syncing Tool) +[#]: via: (https://itsfoss.com/syncthing/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Syncthing:开源 P2P 文件同步工具 +====== + +_ **简介:Syncthing 是一个开源的 P2P 文件同步工具,可用于在多个设备(包括 Android 手机)之间同步文件。** _ + +通常,我们有 [MEGA][1] 或 Dropbox 之类的云同步解决方案,以便在云上备份我们的文件,同时更易于共享。 + +但是,如果要跨多个设备同步文件而不将其存储在云中怎么办? + +这就是 [Syncthing][2] 派上用场的地方了。 + +### Syncthing:一个跨设备同步文件的开源工具 + +![][3] + +Syncthing 可让你跨多个设备同步文件(包括对 Android 智能手机的支持)。它主要通过 Linux上 的 Web UI 进行工作,但也提供了 GUI(需要单独安装)。 + +然而,Syncthing 完全没有利用云,它是 [P2P][4] 文件同步工具。你的数据不会被发送到中央服务器。而是会在所有设备之间同步。因此,它并不能真正取代 [Linux 上的典型云存储服务][5]。 + +要添加远程设备,你只需要设备 ID(或直接扫描二维码),而无需 IP 地址。 + +如果你想要远程备份文件,那么你可能应该依靠云。 + +![Syncthing GUI][6] + +考虑到所有因素,Syncthing 可以在很多方面派上用场。从技术上讲,你可以安全、私密地在多个系统上访问重要文件,而不必担心有人监视你的数据。 + +例如,你可能不想在云上存储一些敏感文件,因此你可以添加其他受信任的设备来同步并保留这些文件的副本。 + +即使我简单描述了它,但它并不像看到的那么简单。如果你感兴趣的话,我建议你阅读[官方 FAQ][7] 来了解它如何工作的。 + +### Syncthing 的特性 + +你可能不希望同步工具中有很多选项。它要可靠地同步文件,应该非常简单。 + +Syncthing 确实非常简单且易于理解。即使这样,如果你想使用它的所有功能,那么也建议你阅读它的[文档][8]。 + +在这里,我将重点介绍 Syncthing 的一些有用特性: + +#### 跨平台支持 + +![Syncthing on Android][9] + +作为开源解决方案,它支持 Windows、Linux 和 macOS。 + +除此之外,它还支持 Android 智能手机。如果你使用的是 iOS 设备,那么你会感到失望。到目前为止,它还没有支持 iOS 的计划。 + +#### 文件版本控制 + +![Syncthing File Versioning][10] + +如果替换或删除了旧文件,那么 Syncthing 会利用各种[文件版本控制方法][11]来存档旧文件。 + +默认情况下,你不会发现它启用。但是,当你创建一个要同步的文件夹时,你将找到将文件版本控制切换为首选方法的选项。 + +#### 易于使用 + +作为 P2P 文件同步工具,它无需高级调整即可使用。 + +但是,它允许你在需要时配置高级设置。 + +#### 安全和隐私 + +即使你不与任何云服务提供商共享数据,仍会有一些连接可能会引起窃听者的注意。因此,Syncthing 使用 TLS 保护通信。 + +此外,它还有可靠的身份验证方法,以确保仅授予只有你允许的设备/连接能够取得同步/读取数据的权限。 + +对于 Android 智能手机,如果你使用 [Orbot 应用][12],你还可以强制将流量通过 Tor。在 Android 中你还有几个不同选择。 + +#### 其他功能 + +![][13] + +当你探索这个工具时,你会注意到可以同步的文件夹数和可同步的设备数没有限制。 + +因此,作为一个有着丰富有用特性的自由开源解决方案,对于在寻找 P2P 同步客户端的 Linux 用户而言是一个令人印象深刻的选择。 + +### 在 Linux 上安装 Syncthing + +你可能无法在官网上找到 .deb 或者 .AppImage 文件。但是,你可在 [Snap 商店][14]中找到 snap 包。如果你好奇,你可以阅读在 Linux 上[使用 snap 应用][15]的文章来开始使用。 + +你可能无法在软件中心找到它(如果你找到了,那它可能不是最新版本)。 + +**注意:**_如果你需要一个 GUI 而不是浏览器来管理它,它还有一个 [Syncthing-GTK][16]。_ + +[Syncthing][2] + +如果你有基于 Debian 的发行版,你也可以利用终端来安装它,这些说明位于[官方下载页面][17] 上。 + +### 我在 Syncthing 方面的体验 + +就个人而言,我把它安装在 Pop!\_OS 19.10 上,并在写这篇文章之前用了一会儿。 + +我尝试同步文件夹、删除它们、添加重复文件以查看文件版本控制是否工作,等等。它工作良好。 + +然而,当我尝试同步它到手机(安卓),同步启动有点晚,它不是很快。因此,如果我们可以选择显式强制同步,那会有所帮助。或者,我错过了什么选项吗?如果是的话,请在评论中让我知道。 + +从技术上讲,它使用系统资源来工作,因此,如果你连接了多个设备进行同步,这可能会提高同步速度(上传/下载)。 + +总体而言,它工作良好,但我必须说,你不应该依赖它作为唯一的数据备份方案。 + +**总结** + +你试过 Syncthing 了吗?如果有的话,你的体验如何?欢迎在下面的评论中分享。 + +此外,如果你知道一些不错的替代品,也请让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/syncthing/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-mega-cloud-storage-linux/ +[2]: https://syncthing.net/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot.jpg?ssl=1 +[4]: https://en.wikipedia.org/wiki/Peer-to-peer +[5]: https://itsfoss.com/cloud-services-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-gtk.png?ssl=1 +[7]: https://docs.syncthing.net/users/faq.html +[8]: https://docs.syncthing.net/users/index.html +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-android.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-file-versioning.jpg?ssl=1 +[11]: https://docs.syncthing.net/users/versioning.html +[12]: https://play.google.com/store/apps/details?id=org.torproject.android&hl=en_IN +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/syncthing-screenshot1.jpg?ssl=1 +[14]: https://snapcraft.io/syncthing +[15]: https://itsfoss.com/install-snap-linux/ +[16]: https://github.com/syncthing/syncthing-gtk/releases/latest +[17]: https://syncthing.net/downloads/ From ac5171ccda017e545b5c0895bd654127657efdcb Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 28 Feb 2020 08:32:28 +0800 Subject: [PATCH 021/207] translating --- sources/tech/20200214 PHP Development on Fedora with Eclipse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md b/sources/tech/20200214 PHP Development on Fedora with Eclipse.md index a682381686..24ecdcb232 100644 --- a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md +++ b/sources/tech/20200214 PHP Development on Fedora with Eclipse.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c97e47b5c0b4cb7789082f1acdf7c024445dd8fe Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 28 Feb 2020 09:25:49 +0800 Subject: [PATCH 022/207] Rename sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md to sources/talk/20200226 Mirantis- Balancing Open Source with Guardrails.md --- .../20200226 Mirantis- Balancing Open Source with Guardrails.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200226 Mirantis- Balancing Open Source with Guardrails.md (100%) diff --git a/sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md b/sources/talk/20200226 Mirantis- Balancing Open Source with Guardrails.md similarity index 100% rename from sources/tech/20200226 Mirantis- Balancing Open Source with Guardrails.md rename to sources/talk/20200226 Mirantis- Balancing Open Source with Guardrails.md From 465776f4d618d910e6d4b0783287d484a929b10a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 28 Feb 2020 09:27:18 +0800 Subject: [PATCH 023/207] =?UTF-8?q?Rename=20sources/tech/20200228=20No=20M?= =?UTF-8?q?ore=20WhatsApp-=20The=20EU=20Commission=20Switches=20To=20?= =?UTF-8?q?=E2=80=98Signal-=20For=20Internal=20Communication.md=20to=20sou?= =?UTF-8?q?rces/talk/20200228=20No=20More=20WhatsApp-=20The=20EU=20Commiss?= =?UTF-8?q?ion=20Switches=20To=20=E2=80=98Signal-=20For=20Internal=20Commu?= =?UTF-8?q?nication.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Commission Switches To ‘Signal- For Internal Communication.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md (100%) diff --git a/sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md b/sources/talk/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md similarity index 100% rename from sources/tech/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md rename to sources/talk/20200228 No More WhatsApp- The EU Commission Switches To ‘Signal- For Internal Communication.md From f05ea42dbb0cda276a889994225f9f3e52698abc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 12:46:57 +0800 Subject: [PATCH 024/207] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lujun9972 这篇不错 --- .../tech/20170918 Fun and Games in Emacs.md | 137 ++++++++---------- 1 file changed, 57 insertions(+), 80 deletions(-) diff --git a/translated/tech/20170918 Fun and Games in Emacs.md b/translated/tech/20170918 Fun and Games in Emacs.md index b4baee63b4..9b547de0de 100644 --- a/translated/tech/20170918 Fun and Games in Emacs.md +++ b/translated/tech/20170918 Fun and Games in Emacs.md @@ -7,106 +7,91 @@ [#]: via: (https://www.masteringemacs.org/article/fun-games-in-emacs) [#]: author: (Mickey Petersen https://www.masteringemacs.org/about) -Emacs 中的游戏与乐趣 +“Emacs 游戏机”完全指南 ====== -又是周一,你正在为你的老板 Lumbergh 努力倒腾那些 [无聊之极的文档 ][1]。为什么不玩玩 Emacs 中类似 zork 的文本冒险游戏来让你的大脑从单调的工作中解脱出来呢? - -但说真的,Emacs 中既有游戏,也有古怪的玩物。有些你可能有所耳闻。这些玩意唯一的共同点就是,它们大多是很久以前就添加到 Emacs 中的:有些东西真的是相当古怪(如您将在下面看到的),而另一些则显然是由无聊的员工或毕业生编写的。 -它们中都带着一种奇思妙想和随意性,这在今天的 Emacs 中很少见。 -Emacs 现在变得十分严肃,在某种程度上,它已经与 20 世纪 80 年代那些玩意被编写出来的时候大不一样。 +又是周一,你正在为你的老板 Lumbergh (LCTT 译注:《上班一条虫》中的副总裁)努力倒腾那些 [无聊之极的文档][1]。为什么不玩玩 Emacs 中类似 zork 的文字冒险游戏来让你的大脑从单调的工作中解脱出来呢? +但说真的,Emacs 中既有游戏,也有古怪的玩物。有些你可能有所耳闻。这些玩意唯一的共同点就是,它们大多是很久以前就添加到 Emacs 中的:有些东西真的是相当古怪(如你将在下面看到的),而另一些则显然是由无聊的员工或学生们编写的。它们全有一个共同点,都带着一种奇思妙想和随意性,这在今天的 Emacs 中很少见。Emacs 现在变得十分严肃,在某种程度上,它已经与 20 世纪 80 年代那些游戏被编写出来的时候大不一样。 ### 汉诺塔 -[汉诺塔 ][2] 是一款古老的数学解密游戏,有些人可能对它很熟悉,因为它的递归和迭代解决方案经常被用与计算机科学教学辅助。 - +[汉诺塔][2] 是一款古老的数学解密游戏,有些人可能对它很熟悉,因为它的递归和迭代解决方案经常被用于计算机科学教学辅助。 ![Tower of Hanoi Screenshot](https://www.masteringemacs.org/static/uploads/hanoi.png) -Emacs 中有三个命令可以运行汉诺塔:`M-x hanoi` 默认为 3 个碟子; `M-x hanoi-unix` 和 `M-x hanoi-unix-64` 使用 unix 时间戳的位数 (32bit 或 64bit) 作为默认盘子的个数,并且每秒钟自动移动一次,两者不同之处在于后者假装使用 64 位时钟(因此有 64 个碟子)。 +Emacs 中有三个命令可以运行汉诺塔:`M-x hanoi` 默认为 3 个碟子; `M-x hanoi-unix` 和 `M-x hanoi-unix-64` 使用 unix 时间戳的位数(32 位或 64 位)作为默认盘子的个数,并且每秒钟自动移动一次,两者不同之处在于后者假装使用 64 位时钟(因此有 64 个碟子)。 -Emacs 中汉诺塔的实现可以追溯到 20 世纪 80 年代中期——确实是久得可怕。它有一些自定义选项 (`M-x customize-group RET hanoi RET`),如启用彩色光盘等。 -当你离开汉诺塔缓冲区或输入一个字符,你会收到一个讽刺的告别信息(见上文)。 +Emacs 中汉诺塔的实现可以追溯到 20 世纪 80 年代中期——确实是久得可怕。它有一些自定义选项(`M-x customize-group RET hanoi RET`),如启用彩色碟子等。当你离开汉诺塔缓冲区或输入一个字符,你会收到一个讽刺的告别信息(见上图)。 ### 5x5 ![5x5 game grid](https://www.masteringemacs.org/static/uploads/5x5.png) +5x5 的游戏是一个逻辑解密游戏:你有一个 5x5 的网格,中间的十字被填满;你的目标是通过按正确的顺序切换它们的空满状态来填充所有的单元格,从而获得胜利。这并不像听起来那么容易! -5x5 的游戏是一个逻辑解密游戏:你有一个 5x5 的网格,中间的十字被填满;你的目标是通过按正确的顺序切换它们的空满状态来填充所有的单元格,从而获得胜利。这并不像听起来那么容易! +输入 `M-x 5x5` 就可以开始玩了,使用可选的数字参数可以改变网格的大小。这款游戏的有趣之处在于它能向你建议下一步行动并尝试找到该游戏网格的解法。它用到了 Emacs 自己的一款非常酷的符号 RPN 计算器 `M-x calc`(在《[Emacs 快乐计算][3]》这篇文章中,我使用它来解决了一个简单的问题)。 -输入 `M-x 5x5` 就可以开始玩了,使用可选的数字参数可以改变网格的大小。 -这款游戏的有趣之处在于它能向你建议下一步行动并尝试解决该游戏网格。它用到了了 Emacs 自己的一款非常酷的符号 RPN 计算器 `M-x calc` (在 [Fun with Emacs Calc][3] 这篇文章中,我使用它来解决了一个简单的问题。) +所以我喜欢这个游戏的原因是它提供了一个非常复杂的解题器——真的,你应该通过 `M-x find-library RET 5x5` 来阅读其源代码——这是一个试图通过暴力破解游戏解法的“破解器”。 -所以我喜欢这个游戏的原因是它提供了一个非常复杂的解决器——真的,你应该通过 `M-x find-library RET 5x5` 来阅读其源代码——和一个试图通过强力破解游戏的“破解器”。 +创建一个更大的游戏网格,例如输入 `M-10 M-x 5x5`,然后运行下面某个 `crack` 命令。破解器将尝试通过迭代获得最佳解决方案。它会实时运行该游戏,观看起来非常有趣: -创建一个更大的游戏网格,例如输入 `M-10 M-x 5x5`,然后运行下面某个 `crack` 命令。破坏者将尝试通过迭代获得最佳解决方案。它会实时运行该游戏,观看起来非常有趣: - -- `M-x 5x5-crack-mutating-best`: 试图通过修改最佳解决方案来破解 5x5。 - -- `M-x 5x5-crack-mutating-current`: 试图通过修改当前解决方案来破解 5x5。 - -- `M-x 5x5-crack-random`: 尝试使用随机方案解破解 5x5。 - -- `M-x 5x5-crack-xor-mutate`: 尝试通过将当前方案和最佳方案进行异或运算来破解 5x5。 +- `M-x 5x5-crack-mutating-best`: 试图通过变异最佳解决方案来破解 5x5。 +- `M-x 5x5-crack-mutating-current`: 试图通过变异当前解决方案来破解 5x5。 +- `M-x 5x5-crack-random`: 尝试使用随机方案解破解 5x5。 +- `M-x 5x5-crack-xor-mutate`: 尝试通过将当前方案和最佳方案进行异或运算来破解 5x5。 ### 文本动画 -您可以通过运行 `M-x animation-birthday-present` 并给出名字来显示一个奇特的生日礼物动画。它看起来很酷! +你可以通过运行 `M-x animation-birthday-present` 并给出你的名字来显示一个奇特的生日礼物动画。它看起来很酷! ![xkcd](https://imgs.xkcd.com/comics/real_programmers.png) -`M-x butterfly` 命令中也使用了 `animate` 包,butterfly 命令被添加到 Emacs 中,以向上面的 [XKCD][4] 漫画致敬。当然,漫画中的 Emacs 命令在技术上是无效的,但它的幽默足以弥补这一点。 +这里用的 `animate` 包也用在了 `M-x butterfly` 命令中,这是一个向上面的 [XKCD][4] 漫画致敬而添加到 Emacs 中的命令。当然,漫画中的 Emacs 命令在技术上是无效的,但它的幽默足以弥补这一点。 ### 黑箱 我将逐字引用这款游戏的目标: > 游戏的目标是通过向黑盒子发射光线来找到四个隐藏的球。有四种可能: -> 1) 射线将通过盒子不受干扰, -> 2) 它将击中一个球并被吸收, +> 1) 射线将通过盒子不受干扰; +> 2) 它将击中一个球并被吸收; > 3) 它将偏转并退出盒子,或 -> 4) 立即偏转,甚至不被允许进入盒子。 +> 4) 立即偏转,甚至不能进入盒子。 -所以,这有点像我们小时候玩的 [Battleship][5],但是……是专为物理专业高学历的人准备的? +所以,这有点像我们小时候玩的[战舰游戏][5],但是……是专为物理专业高学历的人准备的吧? -这是另一款添加于 20 世纪 80 年代的游戏。我建议你输入 `C-h f blackbox` 来阅读玩法说明(文档巨大)。 +这是另一款添加于 20 世纪 80 年代的游戏。我建议你输入 `C-h f blackbox` 来阅读玩法说明(文档巨大)。 ### 泡泡 ![Bubbles game](https://www.masteringemacs.org/static/uploads/bubbles.png) +`M-x bubble` 游戏相当简单:你必须用尽可能少移动清除尽可能多的“泡泡”。当你移除气泡时,其他气泡会掉落并粘在一起。这是一款有趣的游戏,此外如果你使用 Emacs 的图形用户界面,它还支持图像显示。而且它还支持鼠标。 -`M-x bubble` 游戏相当简单:你必须用尽可能少移动清除尽可能多的“泡泡”。当你移除气泡时,其他气泡会掉落并粘在一起。 -这是一款有趣的游戏,此外如果你使用 Emacs 的图形用户界面,它还支持图像现实。而且它还支持鼠标。 - -您可以通过调用 `M-x bubbles-set-game-< 难度>` 来设置难度,其中嗯 `<难度>` 可以是其中之一:`easy`,`medium=,=difficult`,`hard`,或 `userdefined`。 -此外,您可以使用:`M-x custom-group bubbles` 来更改图形、网格大小和颜色。 +你可以通过调用 `M-x bubbles-set-game-` 来设置难度,其中 `` 可以是这些之一:`easy`、`medium`、`difficult`、`hard` 或 `userdefined`。此外,你可以使用:`M-x custom-group bubbles` 来更改图形、网格大小和颜色。 由于它即简单又有趣,这是 Emacs 中我最喜欢的游戏之一。 ### 幸运饼干 -我喜欢 `fortune` 命令。每当我启动一个新 shell 时,就会有刻薄、无益、常常带有讽刺意味的“建议(以及文学摘要,谜语)”就会点亮我的一天。 +我喜欢 `fortune` 命令。每当我启动一个新 shell 时,这些与文学片段、谜语相结合的刻薄、无益、常常带有讽刺意味的“建议”就会点亮我的一天。 -令人困惑的是,Emacs 中有两个包做了类似的事情:`fortune` 和 `cookie`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 +令人困惑的是,Emacs 中有两个包或多或少地做着类似的事情:`fortune` 和 `cookie1`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 -不管怎样,使用 Emacs 的 `cookie` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 +不管怎样,使用 Emacs 的 `cookie1` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 如果你的操作系统是 Ubuntu,那么你先安装 `fortune` 软件包,然后就能在 `/usr/share/games/fortune/` 目录中找到这些文件了。 -之后你就可以调用 `M-x cookie` 随机显示 fortune 内容,或者,如果你想的话,也可以调用 `M-x cookie-apropos` 查找所有匹配的 cookie。 +之后你就可以调用 `M-x cookie` 随机显示 fortune 内容,或者,如果你想的话,也可以调用 `M-x cookie-apropos` 查找所有匹配的饼干。 -### Decipher +### 破译器 -这个包完美地抓住了 Emacs 的实用本质:这个包为你破解简单的替换密码(如密码谜题)提供了一个很有用的界面。 -你知道,二十多年前,某人确实迫切需要破解很多基础密码。正是像这个模块这样的小玩意让我非常高兴地用起 Emacs 来:这个模块只对少数人有用,但是,如果你突然需要它了,那么它就在那里等着你。 +这个包完美地抓住了 Emacs 的功利本质:这个包为你破解简单的替换密码(如“密码谜题”)提供了一个很有用的界面。你知道,二十多年前,有些人确实迫切需要破解很多基本的密码。正是像这个模块这样的小玩意让我非常高兴地用起 Emacs 来:一个只对少数人有用的模块,但是,如果你突然需要它了,那么它就在那里等着你。 那么如何使用它呢?让我们假设使用 “rot13” 密码:在 26 个字符的字母表中,将字符旋转 13 个位置。 -通过 `M-x ielm` (Emacs 用于 [运行 Elisp][6] 的 REPL 环境)可以很容易在 Emacs 中进行尝试: - +通过 `M-x ielm` (Emacs 用于 [运行 Elisp][6] 的 REPL 环境)可以很容易在 Emacs 中进行尝试: ``` *** Welcome to IELM *** Type (describe-mode) for help. @@ -117,21 +102,20 @@ ELISP> (rot13 "Uryyb, Jbeyq") ELISP> ``` -那么,decipher 模块又是如何帮助我们的呢?让我们创建一个新的缓冲区 `test-cipher` 并输入您的密码文本(在我的例子中是 `Uryyb,Jbeyq`) +简而言之,你将明文旋转了 13 个位置,就得到了密文。你又旋转了一次 13 个位置,就返回了最初的明文。 这就是这个包可以帮助你解决的问题。 + +那么,decipher 模块又是如何帮助我们的呢?让我们创建一个新的缓冲区 `test-cipher` 并输入你的密文(在我的例子中是 `Uryyb,Jbeyq`)。 ![cipher](https://www.masteringemacs.org/static/uploads/cipher.png) -您现在面对的是一个相当复杂的接口。现在把光标放在紫行秘文中的任意字符上,猜猜这个字符可能是什么:Emacs 将根据你的选择更新其他明文的猜测结果,并告诉你字母表中的字符是如何分配的。 +你现在面对的是一个相当复杂的界面。现在把光标放在紫色行的密文的任意字符上,并猜测这个字符可能是什么:Emacs 将根据你的选择更新其他明文的猜测结果,并告诉你目前为止字母表中的字符是如何分配的。 -您现在可以下面各种 helper 命令来帮助推断密码字符可能对应的明文字符: +你现在可以用下面各种助手命令来关闭选项,以帮助推断密码字符可能对应的明文字符: -- **`D`:** 显示数字符号(密码中两个字符组合)及其频率的列表 - -- **`F`:** 表示每个密文字母的频率 - -- **`N`:** 显示字符的邻接信息。我不确定这是干啥的。 - -- **`M` 和 `R`:** 保存和恢复一个检查点,允许你对工作进行分支以探索破解密码的不同方法。 +- `D`: 列出示意图(该加密算法中双字符对)及其频率 +- `F`: 表示每个密文字母的频率 +- `N`: 显示字符的邻近信息。我不确定这是干啥的。 +- `M` 和 `R`: 保存和恢复一个检查点,允许你对工作进行分支以探索破解密码的不同方法。 总而言之,对于这样一个深奥的任务,这个包是相当令人印象深刻的!如果你经常破解密码,也许这个程序包能帮上忙? @@ -139,36 +123,35 @@ ELISP> ![doctor](https://www.masteringemacs.org/static/uploads/doctor.png) -啊,Emacs 医生。其基于最初的 [ELIZA][7],“ 医生”试图对你说的话进行心理分析,并试图把问题复述给你。体验它的那几分钟相当有趣,它也是 Emacs 中最著名的古怪玩意之一。你可以使用 `M-x doctor` 来运行它。 +啊,Emacs 医生。其基于最初的 [ELIZA][7],“医生”试图对你说的话进行心理分析,并试图把问题复述给你。体验几分钟,相当有趣,它也是 Emacs 中最著名的古怪玩意之一。你可以使用 `M-x doctor` 来运行它。 ### Dunnet -Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩了。 -这是一款相当不错的游戏,虽然时间不长,但非常著名,很少有人真正玩到最后。 +Emacs 自己特有的类 Zork 文字冒险游戏。输入 `M-x dunnet` 就能玩了。这是一款相当不错的游戏,简单的说,它是另一款非常著名的 Emacs 游戏,很少有人真正玩到通关。 如果你发现自己能在无聊的文档工作之间空出时间来,那么这是一个超级棒的游戏,内置“老板屏幕”,因为它是纯文本的。 -哦,还有,不要吃掉那块 CPU 卡 :) +哦,还有,不要想着吃掉那块 CPU 卡 :) ### 五子棋 ![gomoku](https://www.masteringemacs.org/static/uploads/gomoku.png) -另一款写于 20 世纪 80 年代的游戏。你必须连接 5 个方块,井字游戏风格。你可以运行 `M-x gomoku` 来与 Emacs 对抗。游戏还支持鼠标,非常方便。您也可以自定义 `gomoku` 组来调整网格的大小。 +另一款写于 20 世纪 80 年代的游戏。你必须将 5 个方块连成一条线,井字棋风格。你可以运行 `M-x gomoku` 来与 Emacs 对抗。游戏还支持鼠标,非常方便。你也可以自定义 `gomoku` 组来调整网格的大小。 ### 生命游戏 -[Conway 的生命游戏 ][8] 是细胞自动机的一个著名例子。Emacs 版本提供了一些启动模式,你可以(通过 elisp 编程)通过调整 `life-patterns` 变量来更改这些模式。 +[康威的生命游戏][8] 是细胞自动机的一个著名例子。Emacs 版本提供了一些启动模式,你可以(通过 elisp 编程)调整 `life-patterns` 变量来更改这些模式。 -你可以用 `M-x life` 触发生命游戏。事实上,所有的东西,包括代码,注释和所有的东西,总共不到 300 行,这也让人印象深刻。 +你可以用 `M-x life` 触发生命游戏。事实上,所有的东西,包括显示代码、注释等等一切,总共不到 300 行,这也让人印象深刻。 ### 乒乓,贪吃蛇和俄罗斯方块 ![tetris](https://www.masteringemacs.org/static/uploads/tetris.png) -这些经典游戏都是使用 Emacs 包 `gamegrid` 实现的,这是一个用于构建网格游戏(如俄罗斯方块和贪吃蛇)的通用框架。gamegrid 包的伟大之处在于它同时兼容图形化和终端 Emacs: 如果你在 GUI 中运行 Emacs,你会得到精美的图形;如果你没有,你得到简单的 ASCII 艺术。 +这些经典游戏都是使用 Emacs 包 `gamegrid` 实现的,这是一个用于构建网格游戏(如俄罗斯方块和贪吃蛇)的通用框架。gamegrid 包的伟大之处在于它同时兼容图形化和终端 Emacs:如果你在 GUI 中运行 Emacs,你会得到精美的图形;如果你没有,你看到简单的 ASCII 艺术。 -你可以通过输入 `M-x pong`,`M-x snake`,`M-x tetris` 来运行这些游戏。 +你可以通过输入 `M-x pong`、`M-x snake`、`M-x tetris` 来运行这些游戏。 特别是俄罗斯方块游戏实现的非常到位,会逐渐增加速度并且能够滑块。而且既然你已经有了源代码,你完全可以移除那个讨厌的 Z 形块,没人喜欢它! @@ -176,8 +159,7 @@ Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩 ![solitaire image](https://www.masteringemacs.org/static/uploads/solitaire.png) -可惜,这不是纸牌游戏,而是一个基于 peg 的游戏,你可以选择一块石头 (`o`) 并“跳过”相邻的石头进入洞中(`。`),并在这个过程中去掉你跳过的那些石头,最终只能在棋盘上留下一块石头, -重复该过程直到板子被请空(只保留一个石头)。 +可惜,这不是纸牌游戏,而是一个基于“钉子”的游戏,你可以选择一块石头(`o`)并“跳过”相邻的石头进入洞中(`.`),并在这个过程中去掉你跳过的石头,最终只能在棋盘上留下一块石头,重复该过程直到棋盘被请空(只保留一个石头)。 如果你卡住了,有一个内置的解题器名为 `M-x solitire-solve`。 @@ -187,16 +169,15 @@ Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩 输入 `M-x zone`,然后看看屏幕上发生了什么! -您可以通过运行 `M-x zone-when-idle` (或从 elisp 调用它)来配置屏幕保护程序的空闲时间,时间以秒为单位。 -您也可以通过 `M-x zone-leave-me-alone` 来关闭它。 +你可以通过运行 `M-x zone-when-idle`(或从 elisp 调用它)来配置屏幕保护程序的空闲时间,时间以秒为单位。你也可以通过 `M-x zone-leave-me-alone` 来关闭它。 -如果它在你的同事看着的时候被启动,你的同事肯定会抓狂的。 +如果在你的同事看着的时候启动它,你的同事肯定会抓狂的。 ### 乘法解谜 ![mpuz](https://www.masteringemacs.org/static/uploads/mpuz.png) -这是另一个脑筋急转弯的益智游戏。当您运行 `M-x mpuz` 时,将看到一个乘法解谜题,你必须将字母替换为对应的数字,并确保数字相加(相乘?)符合结果 +这是另一个脑筋急转弯的益智游戏。当你运行 `M-x mpuz` 时,将看到一个乘法解谜题,你必须将字母替换为对应的数字,并确保数字相加(相乘?)符合结果。 如果遇到难题,可以运行 `M-x mpuz-show-solution` 来解决。 @@ -205,19 +186,15 @@ Emacs 自己特有的类 Zork 文本冒险游戏。输入 `M-x dunnet` 就能玩 还有更多好玩的东西,但它们就不如刚才那些那么好玩好用了: - 你可以通过 `M-x morse-region` 和 `M-x unmorse-region` 将一个区域翻译成莫尔斯电码。 -- Dissociated Press 是一个非常简单的命令,它将类似随机游动 markov 链生成器应用到 buffer 中的文本中,并以此生成无意义的文本。试一下 `M-x dissociated-press`。 -- Gamegrid 包是构建网格游戏的通用框架。到目前为止,只有俄罗斯方块,乒乓和贪吃蛇使用了它。其名为 `gamegrid`。 +- Dissociated Press 是一个非常简单的命令,它将一个类似随机穿行的马尔可夫链生成器应用到缓冲区中的文本中,并以此生成无意义的文本。试一下 `M-x dissociated-press`。 - `gametree` 软件包是一个通过电子邮件记录和跟踪国际象棋游戏的复杂方法。 -- `M-x spook` 命令插入随机单词(通常是在电子邮件中),目的是混淆/超载 “NSA trukn trawler”—— 记住,这个模块可以追溯到 20 世纪 80 年代和 90 年代——那时应该有间谍们在监听各种单词。当然,即使是在十年前,这样做也会显得非常偏执和古怪,不过现在看来已经不那么奇怪了…… +- `M-x spook` 命令插入随机单词(通常是到电子邮件中),目的是混淆/超载 “NSA 拖网渔船” —— 记住,这个模块可以追溯到 20 世纪 80 年代和 90 年代,那时应该有间谍们在监听各种单词。当然,即使是在十年前,这样做也会显得非常偏执和古怪,不过现在看来已经不那么奇怪了…… +### 总结 -### 结论 +我喜欢 Emacs 附带的游戏和玩具。它们大多来自于,嗯,我们姑且称之为一个不同的时代:一个允许或甚至鼓励奇思妙想的时代。有些玩意非常经典(如俄罗斯方块和汉诺塔),有些对经典游戏进行了有趣的变种(如黑盒)——但我很高兴这么多年后它们依然存在于 Emacs 中。我想知道时至今日,类似这些的玩意是否还会再纳入 Emacs 的代码库中;嗯,它们很可能不会——它们将被归入包管理仓库中,而在这个干净而无菌的世界中,它们无疑属于包管理仓库。 -我喜欢 Emacs 附带的游戏和玩具。它们大多来自于,嗯,我们姑且称之为一个不同的时代:一个允许或甚至鼓励奇思妙想的时代。 -有些玩意非常经典(如俄罗斯方块和汉诺塔),有些对经典游戏进行了有趣的变种(如黑盒)——但我很高兴这么多年后他们依然在 Emacs 中。 -我想知道时至今日,这些玩意是否还会纳入 Emacs 的代码库中;嗯,它们很可能不会——它们将被归入包管理仓库中,而在这个干净而贫瘠的世界中,它们无疑属于包管理仓库。 - -Emacs 要求将对 Emacs 体验不重要的内容转移到包管理仓库 ELPA 中。我的意思是,作为一个开发者,这是有道理的,但是……对于每一个被移出并流放到 ELPA 的包,我们都在蚕食 Emacs 的精髓。 +Emacs 要求将对 Emacs 体验不重要的内容转移到包管理仓库 ELPA 中。我的意思是,作为一个开发者,这是有道理的,但是……对于每一个被移出并流放到 ELPA 的包,我们是不是在蚕食 Emacs 的精髓? -------------------------------------------------------------------------------- @@ -227,7 +204,7 @@ via: https://www.masteringemacs.org/article/fun-games-in-emacs 作者:[Mickey Petersen][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bcf69025122cd9c1fc1454d83b3702a09e2b5ced Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 13:12:25 +0800 Subject: [PATCH 025/207] PRF @heguangzhi --- ...came the Standard for Compute Resources.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md b/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md index 901635d6a5..135cfc1b07 100644 --- a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md +++ b/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How Kubernetes Became the Standard for Compute Resources) @@ -10,28 +10,27 @@ Kubernetes 如何成为计算资源的标准 ====== +![](https://www.linux.com/wp-content/uploads/2019/08/elevator-1598431_1920.jpg) - +对于原生云生态系统来说,2019 年是改变游戏规则的一年。有大的[并购][1],如 Red Hat Docker 和 Pivotal,并出现其他的玩家,如 Rancher Labs 和 Mirantis。 -对于原生云生态系统来说,2019年是改变游戏规则的一年。有大的[并购][1),如 Red Hat Docker 和 Pivotal,并出现其他的玩家 如Rancher Labs 和 Mirantis 。 +Rancher Labs (一家为采用容器的团队提供完整软件栈的公司)的联合创始人兼首席执行官盛亮表示:“所有这些整合和并购,都表明这一领域的市场成熟的速度很快。” -“所有这些并购",Rancher Labs (一家为采用容器的团队提供完整软件栈的公司) 的联合创始人兼首席执行官盛亮表示:“这一领域的成功表明市场成熟的速度很快。”。 +传统上,像 Kubernetes 和 Docker 这样的新兴技术吸引着开发者和像脸书和谷歌这样的超级用户。除了这群人之外则没什么兴趣。然而,这两种技术都在企业层面得到了广泛采用。突然间,出现了一个巨大的市场,有着巨大的机会。几乎每个人都跳了进去。有人带来了创新的解决方案,也有人试图赶上其他人。它很快变得非常拥挤和热闹起来。 -传统上,像 Kubernetes 和 Docker 这样的新兴技术吸引着开发者和像脸书和谷歌这样的超级用户。这群人之外没什么其他的兴趣。然而,这两种技术都在企业层面得到了广泛采用。突然间,有了一个巨大的市场,有了巨大的机会。几乎每个人都跳了进去。有人带来了创新的解决方案,也有人试图赶上其他人。它很快变得非常拥挤和热闹起来。 +它也改变了创新的方式。[早期采用者通常是精通技术的公司][2]。现在,几乎每个人都在使用它,即使是在不被认为是 Kubernetes 地盘的地方。它改变了市场动态,像 Rancher Labs 这样的公司见证了独特的用例。 -它也改变了创新的方式。[早期采用者通常是精通技术的公司。][2]现在,几乎每个人都在使用它,即使是在不被认为是 Kubernetes 地盘的地方。它改变了市场动态,像 Rancher Labs 这样的公司见证了独特的用例。 - -梁补充道,“我从来没有经历过像 Kubernete 这样快速、动态的市场或这样的技术进化。当我们五年前开始的时候,这是一个非常拥挤的空间。随着时间的推移,我们大多数的同龄人因为这样或那样的原因消失了。他们要么无法适应变化,要么选择不适应某些变化。” +盛亮补充道,“我从来没有经历过像 Kubernete 这样快速、动态的市场或技术演变。当我们五年前开始的时候,这是一个非常拥挤的空间。随着时间的推移,我们大多数的友商因为这样或那样的原因消失了。他们要么无法适应变化,要么选择不适应某些变化。” 在 Kubernetes 的早期,最明显的机会是建立 Kubernetes 发行版本和 Kubernetes 业务。这是新技术。众所周知,它的安装、升级和操作相当的复杂。 -当谷歌、AWS 和微软进入市场时,一切都变了。当时,有一群供应商蜂拥而至,为平台提供解决方案。梁表示:“一旦像谷歌这样的云提供商决定将Kubernetes 作为一项服务,并亏本出售的商品免费提供,以推动基础设施消费;我们就知道,运营和支持 Kubernetes 业务的优势将非常有限了。”。 +当谷歌、AWS 和微软进入市场时,一切都变了。当时,一群供应商蜂拥而至,为平台提供解决方案。盛亮表示:“一旦像谷歌这样的云提供商决定将 Kubernetes 作为一项服务,并免费提供亏本出售的商品,以推动基础设施消费;我们就知道,运营和支持 Kubernetes 业务的优势将非常有限了。” -对非谷歌玩家来说,并非一切都不好。由于云供应商通过将它作为服务来提供,消除了 Kubernetes 带来的所有复杂性,这意味着更广泛地采用该技术,即使是那些由于运营成本而不愿使用该技术的人也是如此。这意味着 Kubernetes 将变得无处不在,并将成为一个行业标准。 +对谷歌之外的其它玩家来说,并非一切都不好。由于云供应商通过将它作为服务来提供,消除了 Kubernetes 带来的所有复杂性,这意味着更广泛地采用该技术,即使是那些由于运营成本而不愿使用该技术的人也是如此。这意味着 Kubernetes 将变得无处不在,并将成为一个行业标准。 -“Rancher Labs 是极少数将此视为机遇并比其他公司看得更远的公司之一。我们意识到 Kubernetes 将成为新的计算标准,就像TCP/IP成为网络标准一样,”梁说。 +“Rancher Labs 是极少数将此视为机遇并比其他公司看得更远的公司之一。我们意识到 Kubernetes 将成为新的计算标准,就像 TCP/IP 成为网络标准一样,”盛亮说。 -CNCF围绕 Kubernetes 构建一个充满活力的生态系统方面发挥着至关重要的作用,创建了一个庞大的社区来构建、培育和商业化原生云开源技术。 +CNCF 在围绕 Kubernetes 构建一个充满活力的生态系统方面发挥着至关重要的作用,创建了一个庞大的社区来构建、培育和商业化原生云开源技术。 -------------------------------------------------------------------------------- @@ -40,7 +39,7 @@ via: https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compu 作者:[Swapnil Bhartiya][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 18a96ff143d250f947aac6e59e7e5a237c6032a5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 13:17:56 +0800 Subject: [PATCH 026/207] PUB @heguangzhi https://linux.cn/article-11940-1.html --- ... Kubernetes Became the Standard for Compute Resources.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200219 How Kubernetes Became the Standard for Compute Resources.md (96%) diff --git a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md b/published/20200219 How Kubernetes Became the Standard for Compute Resources.md similarity index 96% rename from translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md rename to published/20200219 How Kubernetes Became the Standard for Compute Resources.md index 135cfc1b07..3d1a903916 100644 --- a/translated/tech/20200219 How Kubernetes Became the Standard for Compute Resources.md +++ b/published/20200219 How Kubernetes Became the Standard for Compute Resources.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11940-1.html) [#]: subject: (How Kubernetes Became the Standard for Compute Resources) [#]: via: (https://www.linux.com/articles/how-kubernetes-became-the-standard-for-compute-resources/) [#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) @@ -10,7 +10,7 @@ Kubernetes 如何成为计算资源的标准 ====== -![](https://www.linux.com/wp-content/uploads/2019/08/elevator-1598431_1920.jpg) +![](https://img.linux.net.cn/data/attachment/album/202002/28/131634mwzyylmv93m4ccws.jpg) 对于原生云生态系统来说,2019 年是改变游戏规则的一年。有大的[并购][1],如 Red Hat Docker 和 Pivotal,并出现其他的玩家,如 Rancher Labs 和 Mirantis。 From f70ccaf54e435f48a09810655536dfd538a0bade Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 14:27:25 +0800 Subject: [PATCH 027/207] PRF @geekpi --- ...217 How to get MongoDB Server on Fedora.md | 87 ++++++++----------- 1 file changed, 35 insertions(+), 52 deletions(-) diff --git a/translated/tech/20200217 How to get MongoDB Server on Fedora.md b/translated/tech/20200217 How to get MongoDB Server on Fedora.md index c7da999f65..604e85c184 100644 --- a/translated/tech/20200217 How to get MongoDB Server on Fedora.md +++ b/translated/tech/20200217 How to get MongoDB Server on Fedora.md @@ -1,116 +1,99 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to get MongoDB Server on Fedora) [#]: via: (https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/) [#]: author: (Honza Horak https://fedoramagazine.org/author/hhorak/) -如何在 Fedora 上获取 MongoDB 服务器 +如何在 Fedora 上安装 MongoDB 服务器 ====== ![][1] -Mongo(来自 “humongous”)是一个高性能,开源,无模式的面向文档的数据库,它是最受欢迎的 [NoSQL][2] 数据库之一。它使用 JSON 作为文档格式,并且可以在多个服务器节点之间进行扩展和复制。 +Mongo(来自 “humongous” —— 巨大的)是一个高性能、开源、无模式的、面向文档的数据库,它是最受欢迎的 [NoSQL][2] 数据库之一。它使用 JSON 作为文档格式,并且可以在多个服务器节点之间进行扩展和复制。 ### 有关许可证更改的故事 -上游 MongoD 决定更改服务器代码的许可证已经一年多了。先前的许可证是 GNU Affero General Public License v3(AGPLv3)。但是,上游写了一个新许可证,为了使运行 MongoDB 即服务的公司回馈社区。新许可证称为 Server Side Public License(SSPLv1),关于这个及其原理的更多说明,请参见[MongoDB SSPL FAQ][3]。 +MongoDB 上游决定更改服务器代码的许可证已经一年多了。先前的许可证是 GNU Affero General Public License v3(AGPLv3)。但是,上游公司写了一个新许可证,旨在使运行 MongoDB 即服务的公司可以回馈社区。新许可证称为 Server Side Public License(SSPLv1),关于这个举措及其解释的更多说明,请参见 [MongoDB SSPL FAQ][3]。 -Fedora 一直只包含自由软件。当 SSPL 发布后,Fedora [确定][4]它并不是自由软件许可。许可证更改日期(2018 年 10 月)之前发布的所有 MongoDB 版本都可保留在 Fedora 中,但之后再也不更新软件包会带来安全问题。因此,从 Fedora 30 开始,Fedora 社区决定完全[移除 MongoDB 服务器][5]。 +Fedora 一直只包含自由软件。当 SSPL 发布后,Fedora [确定][4]它并不是自由软件许可证。许可证更改日期(2018 年 10 月)之前发布的所有 MongoDB 版本都可保留在 Fedora 中,但之后再也不更新的软件包会带来安全问题。因此,从 Fedora 30 开始,Fedora 社区决定完全[移除 MongoDB 服务器][5]。 ### 开发人员还有哪些选择? 是的,还有替代方案,例如 PostgreSQL 在最新版本中也支持 JSON,它可以在无法再使用 MongoDB 的情况下使用它。使用 JSONB 类型,索引在 PostgreSQL 中可以很好地工作,其性能可与 MongoDB 媲美,甚至不会受到 ACID 的影响。 -开发人员可能选择 MongoDB 的技术原因并未随许可证而改变,因此许多人仍想使用它。重要的是要意识到,SSPL 许可证仅更改仅针对 MongoDB 服务器。MongoDB 上游还开发了其他项目,例如 MongoDB 工具,C 和 C++ 客户端库以及用于各种动态语言的连接器,这些项目在客户端(要通过网络与服务器通信的应用中)使用。由于这些包的许可证是自由的(主要是 Apache 许可证),因此它们保留在 Fedora 仓库中,因此用户可以将其用于应用开发。 +开发人员可能选择 MongoDB 的技术原因并未随许可证而改变,因此许多人仍想使用它。重要的是要意识到,SSPL 许可证仅更改仅针对 MongoDB 服务器。MongoDB 上游还开发了其他项目,例如 MongoDB 工具、C 和 C++ 客户端库以及用于各种动态语言的连接器,这些项目在客户端使用(通过网络与服务器通信的应用中)。由于这些包的许可证人保持自由(主要是 Apache 许可证),因此它们保留在 Fedora 仓库中,因此用户可以将其用于应用开发。 -唯一的变化实际是服务器包本身,它已从 Fedora 仓库中完全删除。让我们看看 Fedora 用户可以如何获取非自由的包。 +唯一的变化实际是服务器软件包本身,它已从 Fedora 仓库中完全删除。让我们看看 Fedora 用户可以如何获取非自由的包。 ### 如何从上游安装 MongoDB 服务器 当 Fedora 用户想要安装 MongoDB 服务器时,他们需要直接向上游获取 MongoDB。但是,上游不为 Fedora 提供 RPM 包。相反,MongoDB 服务器可以获取源码 tarball,用户需要自己进行编译(这需要一些开发知识),或者 Fedora 用户可以使用一些兼容的包。在兼容的选项中,最好的选择是 RHEL-8 RPM。以下步骤描述了如何安装它们以及如何启动守护进程。 -#### 1\. 使用上游 RPM 创建仓库(RHEL-8 构建) -``` +#### 1、使用上游 RPM 创建仓库(RHEL-8 构建) ``` - -$ sudo cat > /etc/yum.repos.d/mongodb.repo &lt;&lt;EOF +$ sudo cat > /etc/yum.repos.d/mongodb.repo >>EOF [mongodb-upstream] name=MongoDB Upstream Repository -baseurl= +baseurl=https://repo.mongodb.org/yum/redhat/8Server/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 -gpgkey= +gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc EOF ``` -``` - -#### 2\. 安装元软件包,来拉取服务器和工具包 -``` +#### 2、安装元软件包,来拉取服务器和工具包 ``` - $ sudo dnf install mongodb-org -&lt;snipped> +...... Installed: -  mongodb-org-4.2.3-1.el8.x86_64           mongodb-org-mongos-4.2.3-1.el8.x86_64   -  mongodb-org-server-4.2.3-1.el8.x86_64    mongodb-org-shell-4.2.3-1.el8.x86_64 -  mongodb-org-tools-4.2.3-1.el8.x86_64           + mongodb-org-4.2.3-1.el8.x86_64 mongodb-org-mongos-4.2.3-1.el8.x86_64 + mongodb-org-server-4.2.3-1.el8.x86_64 mongodb-org-shell-4.2.3-1.el8.x86_64 + mongodb-org-tools-4.2.3-1.el8.x86_64 Complete! ``` -``` - -#### 3\. 启动 MongoDB 守护进程 -``` +#### 3、启动 MongoDB 守护进程 ``` - $ sudo systemctl status mongod ● mongod.service - MongoDB Database Server -   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) -   Active: active (running) since Sat 2020-02-08 12:33:45 EST; 2s ago -     Docs: -  Process: 15768 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15770 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) -  Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS) - Main PID: 15773 (mongod) -   Memory: 70.4M -      CPU: 611ms -   CGroup: /system.slice/mongod.service -           └─15773 /usr/bin/mongod -f /etc/mongod.conf -``` + Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled) + Active: active (running) since Sat 2020-02-08 12:33:45 EST; 2s ago + Docs: https://docs.mongodb.org/manual + Process: 15768 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS) + Process: 15769 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS) + Process: 15770 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS) + Process: 15771 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS) + Main PID: 15773 (mongod) + Memory: 70.4M + CPU: 611ms + CGroup: /system.slice/mongod.service ``` -#### 4\. 通过 mongo shell 连接服务器来验证是否运行 -``` +#### 4、通过 mongo shell 连接服务器来验证是否运行 ``` - $ mongo MongoDB shell version v4.2.3 -connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&amp;gssapiServiceName=mongodb +connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("20b6e61f-c7cc-4e9b-a25e-5e306d60482f") } MongoDB server version: 4.2.3 Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see -    -\--- - -> _ + http://docs.mongodb.org/ +--- ``` + -``` - -就是这样了。如你所见,RHEL-8 包完美兼容,只要 Fedora 包还与 RHEL-8 兼容,它就应该会一直兼容。 请注意,在使用时必须遵守 SSPLv1 许可证。 +就是这样了。如你所见,RHEL-8 包完美兼容,只要 Fedora 包还与 RHEL-8 兼容,它就应该会一直兼容。请注意,在使用时必须遵守 SSPLv1 许可证。 -------------------------------------------------------------------------------- @@ -119,7 +102,7 @@ via: https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/ 作者:[Honza Horak][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 394d4d2e958fdff1a5a304894c1735c753211f8c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 28 Feb 2020 14:29:01 +0800 Subject: [PATCH 028/207] PUB @geekpi https://linux.cn/article-11942-1.html --- .../20200217 How to get MongoDB Server on Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200217 How to get MongoDB Server on Fedora.md (98%) diff --git a/translated/tech/20200217 How to get MongoDB Server on Fedora.md b/published/20200217 How to get MongoDB Server on Fedora.md similarity index 98% rename from translated/tech/20200217 How to get MongoDB Server on Fedora.md rename to published/20200217 How to get MongoDB Server on Fedora.md index 604e85c184..8c5522b477 100644 --- a/translated/tech/20200217 How to get MongoDB Server on Fedora.md +++ b/published/20200217 How to get MongoDB Server on Fedora.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11942-1.html) [#]: subject: (How to get MongoDB Server on Fedora) [#]: via: (https://fedoramagazine.org/how-to-get-mongodb-server-on-fedora/) [#]: author: (Honza Horak https://fedoramagazine.org/author/hhorak/) From 8204a45dd2b7d1b57bea285c58790b88156e2314 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 00:55:39 +0800 Subject: [PATCH 029/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Fedora?= =?UTF-8?q?=E2=80=99s=20gaggle=20of=20desktops?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 Fedora-s gaggle of desktops.md --- .../20200228 Fedora-s gaggle of desktops.md | 411 ++++++++++++++++++ 1 file changed, 411 insertions(+) create mode 100644 sources/tech/20200228 Fedora-s gaggle of desktops.md diff --git a/sources/tech/20200228 Fedora-s gaggle of desktops.md b/sources/tech/20200228 Fedora-s gaggle of desktops.md new file mode 100644 index 0000000000..d92d84344a --- /dev/null +++ b/sources/tech/20200228 Fedora-s gaggle of desktops.md @@ -0,0 +1,411 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora’s gaggle of desktops) +[#]: via: (https://fedoramagazine.org/fedoras-gaggle-of-desktops/) +[#]: author: (Troy Dawson https://fedoramagazine.org/author/tdawson/) + +Fedora’s gaggle of desktops +====== + +![][1] + +There are 38 different desktops or window managers in Fedora 31. You could try a different one every day for a month, and still have some left over. Some have very few features. Some have so many features they are called a desktop environment. This article can’t go into detail on each, but it’s interesting to see the whole list in one place. + +### Criteria for desktops + +To be on this list, the desktop must show up on the desktop manager’s selection list. If the desktop has more than one entry in the desktop manager list, they are counted just as that one desktop. An example is “GNOME”, “GNOME Classic” and “GNOME (Wayland).” These all show up on the desktop manager list, but they are still just GNOME. + +### List of desktops +``` + +``` + +#### [**9wm**][2] + +``` +Emulation of the Plan 9 window manager 8 1/2 + dnf install 9wm +``` + +#### [**awesome**][3] + +``` +Highly configurable, framework window manager for X. Fast, light and extensible +https://fedoramagazine.org/5-cool-tiling-window-managers/ + dnf install awesome +``` + +#### [**blackbox**][4] + +``` +Very small and fast Window Manager +Fedora uses the maintained fork on github + dnf install blackbox +``` + +#### [**bspwm**][5] + +``` +A tiling window manager based on binary space partitioning +https://github.com/windelicato/dotfiles/wiki/bspwm-for-dummies + dnf install bspwm +``` + +#### **[byobu][6]** + +``` +Light-weight, configurable window manager built upon GNU screen + dnf install byobu +``` + +#### **[Cinnamon][7]** + +``` +Cinnamon provides a desktop with a traditional layout, advanced features, easy to use, powerful and flexible. +https://projects.linuxmint.com/cinnamon/ +https://opensource.com/article/19/12/cinnamon-linux-desktop + dnf group install "Cinnamon Desktop" +``` + +#### **[cwm][8]** + +``` +Calm Window Manager by OpenBSD project +https://steemit.com/technology/@jamesdeagle/the-calm-window-manager-cwm-a-quick-start-guide + dnf install cwm +``` + +#### **[Deepin][9]** + +``` +Deepin desktop is the desktop environment released with deepin (the linux distribution). It aims at being elegant and easy to use. + dnf group install "Deepin Desktop" + (optional) dnf group install "Deepin Desktop Office" "Media packages for Deepin Desktop" +``` + +#### **[dwm][10]** + +``` +Dynamic window manager for X +https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/ +https://fedoramagazine.org/5-cool-tiling-window-managers/ + dnf install dwm + (optional) dnf install dwm-user +``` + +#### **[enlightenment][11]** + +``` +Enlightenment window manager +https://opensource.com/article/19/12/linux-enlightenment-desktop + dnf install enlightenment +``` + +#### **[e16][11]** + +``` +The Enlightenment window manager, DR16 + dnf install e16 + (optional) dnf install e16-epplets e16-keyedit e16-themes +``` + +#### **[fluxbox][12]** + +``` +Window Manager based on Blackbox + dnf install fluxbox + (optional) dnf install fluxbox-pulseaudio fluxbox-vim-syntax +``` + +#### **[fvwm][13]** + +``` +Highly configurable multiple virtual desktop window manager +http://www.fvwm.org/ +https://opensource.com/article/19/12/fvwm-linux-desktop + dnf install fvwm +``` + +#### **[GNOME][14]** + +``` +GNOME is a highly intuitive and user friendly desktop environment. +* both X11 and wayland +https://opensource.com/article/19/12/gnome-linux-desktop +https://fedoramagazine.org/3-simple-and-useful-gnome-shell-extensions/ + dnf group install "GNOME" + (optional but large) dnf group install "Fedora Workstation" +``` + +#### **[herbstluftwm][15]** + +``` +A manual tiling window manager +https://opensource.com/article/19/12/herbstluftwm-linux-desktop + dnf install herbstluftwm + (optional) dnf install herbstluftwm-zsh herbstluftwm-fish +``` + +#### **[i3][16]** + +``` +Improved tiling window manager +https://fedoramagazine.org/getting-started-i3-window-manager/ +https://fedoramagazine.org/using-i3-with-multiple-monitors/ + dnf install i3 + (optional) dnf install i3-doc i3-ipc +``` + +#### **[icewm][17]** + +``` +Window manager designed for speed, usability, and consistency +https://fedoramagazine.org/icewm-a-really-cool-desktop/ + dnf install icewm + (optional) dnf install icewm-minimal-session +``` + +#### **[jwm][18]** + +``` +Joe's Window Manager +https://opensource.com/article/19/12/joes-window-manager-linux-desktop + dnf install jwm +``` + +#### **[KDE Plasma Desktop][19]** + +``` +The KDE Plasma Workspaces, a highly-configurable graphical user interface which includes a panel, desktop, system icons and desktop widgets, and many powerful KDE applications. +* both X11 and wayland +https://opensource.com/article/19/12/linux-kde-plasma +https://fedoramagazine.org/installing-kde-plasma-5/ + dnf group install "KDE Plasma Workspaces" + (optional) dnf group install "KDE Applications" "KDE Educational applications" "KDE Multimedia support" "KDE Office" "KDE Telepathy" + (optional for wayland) dnf install kwin-wayland plasma-workspace-wayland +``` + +#### **[lumina][20]** + +``` +A lightweight, portable desktop environment +https://opensource.com/article/19/12/linux-lumina-desktop + dnf install lumina-desktop + (optional) dnf install lumina-* +``` + +#### **[LXDE][21]** + +``` +LXDE is a lightweight X11 desktop environment designed for computers with low hardware specifications like netbooks, mobile devices or older computers. +https://opensource.com/article/19/12/lxqt-lxde-linux-desktop + dnf group install "LXDE Desktop" + (optional) dnf group install "LXDE Office" "Multimedia support for LXDE" +``` + +#### **[LXQt][22]** + +``` +LXQt is a lightweight X11 desktop environment designed for computers with low hardware specifications like netbooks, mobile devices or older computers. +https://opensource.com/article/19/12/lxqt-lxde-linux-desktop + dnf group install "LXQt Desktop" + (optional) dnf group install "LXQt Office" "Multimedia support for LXQt" +``` + +#### **[MATE][23]** + +``` +MATE Desktop is based on GNOME 2 and provides a powerful graphical user interface for users who seek a simple easy to use traditional desktop interface. +https://opensource.com/article/19/12/mate-linux-desktop +https://fedoramagazine.org/installing-another-desktop/ + dnf group install "MATE Desktop" + (optional) dnf group install "MATE Applications" +``` + +#### **[musca][24]** + +``` +A simple dynamic window manager fox X + dnf install musca +``` + +#### **[openbox][25]** + +``` +A highly configurable and standards-compliant X11 window manager +https://opensource.com/article/19/12/openbox-linux-desktop +https://fedoramagazine.org/openbox-fedora/ + dnf install openbox + (optional) dnf install openbox-kde openbox-theme-mistral-thin-dark +``` + +#### **[Pantheon][26]** + +``` +The Pantheon desktop environment is the DE that powers elementaryOS. +https://github.com/elementary +https://opensource.com/article/19/12/pantheon-linux-desktop + dnf group install "Pantheon Desktop" + (optional) dnf install elementary-capnet-assist elementary-greeter elementary-shortcut-overlay +``` + +#### **[pekwm][27]** + +``` +A small and flexible window manager +https://opensource.com/article/19/12/pekwm-linux-desktop + dnf install pekwm +``` + +#### **[qtile][28]** + +``` +A pure-Python tiling window manager +https://fedoramagazine.org/5-cool-tiling-window-managers/ + dnf install qtile +``` + +#### **[ratpoison][29]** + +``` +Minimalistic window manager +https://opensource.com/article/19/12/ratpoison-linux-desktop + dnf install ratpoison +``` + +#### **[sawfish][30]** + +``` +An extensible window manager for the X Window System + dnf install sawfish + (optional) dnf install sawfish-pager +``` + +#### **[spectrwm][31]** + +``` +Minimalist tiling window manager written in C + dnf install spectrwm +``` + +#### **[Sugar][32]** + +``` +A software playground for learning about learning. +* Possibly the most unique desktop of this list. + dnf group install "Sugar Desktop Environment" + (optional) dnf group install "Additional Sugar Activities" +``` + +#### **[sway][33]** + +``` +i3-compatible window manager for Wayland +* Wayland only +https://fedoramagazine.org/setting-up-the-sway-window-manager-on-fedora/ +https://fedoramagazine.org/5-cool-tiling-window-managers/ + dnf install sway +``` + +#### **[twm][34]** + +``` +X.Org X11 twm window manager +https://en.wikipedia.org/wiki/Twm +https://opensource.com/article/19/12/twm-linux-desktop + dnf install xorg-x11-twm +``` + +#### **[WindowMaker][35]** + +``` +A fast, feature rich Window Manager +https://opensource.com/article/19/12/linux-window-maker-desktop + dnf install WindowMaker + (optional) dnf install WindowMaker-extra +``` + +#### **[wmx][36]** + +``` +A really simple window manager for X + dnf install wmx +``` + +#### **[XFCE][37]** + +``` +A lightweight desktop environment that works well on low end machines. +https://opensource.com/article/19/12/xfce-linux-desktop + dnf group install "Xfce Desktop" + (optional) dnf group install "Applications for the Xfce Desktop" "Extra plugins for the Xfce panel" "Multimedia support for Xfce" "Xfce Office" +``` + +#### **[xmonad][38]** + +``` +A tiling window manager + dnf install xmonad + (optional) dnf install xmonad-mate +``` + +* * * + +_Photo by [Annie Spratt][39] on [Unsplash][40]._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedoras-gaggle-of-desktops/ + +作者:[Troy Dawson][a] +选题:[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/tdawson/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/gaggle-desktops-816x345.jpg +[2]: https://github.com/9wm/9wm +[3]: https://awesomewm.org/ +[4]: https://github.com/bbidulock/blackboxwm +[5]: https://github.com/baskerville/bspwm +[6]: https://byobu.org/ +[7]: https://github.com/linuxmint/cinnamon +[8]: https://github.com/leahneukirchen/cwm +[9]: https://www.deepin.org/en/dde/ +[10]: http://dwm.suckless.org/ +[11]: https://www.enlightenment.org/ +[12]: http://fluxbox.org/ +[13]: https://github.com/fvwmorg/fvwm +[14]: https://www.gnome.org/ +[15]: http://herbstluftwm.org/ +[16]: https://i3wm.org/ +[17]: https://ice-wm.org/ +[18]: http://joewing.net/projects/jwm/ +[19]: https://kde.org/ +[20]: https://lumina-desktop.org/ +[21]: https://lxde.org/ +[22]: https://lxqt.org/ +[23]: https://mate-desktop.org/ +[24]: https://github.com/enticeing/musca +[25]: http://openbox.org +[26]: https://elementary.io/ +[27]: http://www.pekwm.org/ +[28]: http://qtile.org +[29]: http://www.nongnu.org/ratpoison/ +[30]: http://sawfish.wikia.com/ +[31]: https://github.com/conformal/spectrwm +[32]: https://sugarlabs.org/ +[33]: https://github.com/swaywm/sway +[34]: https://www.x.org/releases/X11R7.6/doc/man/man1/twm.1.xhtml +[35]: http://www.windowmaker.org +[36]: http://www.all-day-breakfast.com/wmx/ +[37]: https://www.xfce.org/ +[38]: https://hackage.haskell.org/package/xmonad +[39]: https://unsplash.com/@anniespratt?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[40]: https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 0b2183cb55f3cd4014954ff38357691a09d62d87 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:01:50 +0800 Subject: [PATCH 030/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200227=20How=20?= =?UTF-8?q?Melissa=20Di=20Donato=20Is=20Going=20To=20Reinvent=20SUSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md --- ...ssa Di Donato Is Going To Reinvent SUSE.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md diff --git a/sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md b/sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md new file mode 100644 index 0000000000..eb5fa59eb0 --- /dev/null +++ b/sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Melissa Di Donato Is Going To Reinvent SUSE) +[#]: via: (https://www.linux.com/articles/how-melissa-di-donato-is-going-to-reinvent-suse/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +How Melissa Di Donato Is Going To Reinvent SUSE +====== + +[![][1]][2] + +[![][1]][2] + +SUSE is one of the oldest open source companies and the first to market Linux for the enterprise. Even though it has undergone several acquisitions and a merger, it remains a strong player in the business. It has maintained its integrity and core values around open source. It continues to rely on its tried-and-tested Linux business and European markets, and generally shies away from making big moves taking big risks. + +Until now. + +[SUSE appointed Melissa Di Donato as its first female CEO][3]. She is making some serious changes to the company, from building a diverse and inclusive culture to betting on emerging technologies and taking risks. + +Soon after taking the helm last year, Di Donato spent the first few months traveling around the globe to meet SUSE teams and customers and get a better sense of the perception of the market about the company. + +Just like [Red Hat CEO Jim Whitehurst,][4] Di Donato didn’t come to the company from an open source background. She had spent the last 25 years of her career as a SUSE customer, so she did have an outsider’s perspective of the company. + +“I am not interested in what SUSE was when I joined. I am more interested in what we want to become,” she said. + +**Innovating for customers** + +After her 100-day global tour, Di Donato had a much clearer picture of the company. She found that more than 80% of SUSE customers were still traditionalists, i.e., companies such as Walgreens and Daimler who have been around for a long time. + +Over the years, these customers brought technologies into their environments to simplify things, but they ended up creating more complexities. It’s a tall order to weave through the legacy technical debt they incurred and embrace emerging technologies such as Cloud Foundry, Kubernetes and so on. + +These customers want to modernize their legacy environments and workloads, but they can’t do that with the complex environments they have built. They can’t iterate faster; they can’t respond to new opportunities and new competitors faster. + +They want to leverage cloud-native technologies like Kubernetes and containers, but it is overwhelming to evaluate technologies that are emerging at such a rapid pace. Which ones are just shiny new things and which ones do they really need them to accelerate their business goals? + +“We have to help our customers simplify their infrastructure and environment so that they can start modernizing it and start leveraging new technologies,” Di Donato said. + +While SUSE will continue to focus on core Linux OS, it will also invest in the next generation of Linux. It has been working on technologies like Kubic and MicroOS that change the way Linux is installed, managed, and operated. + +She explains, “We are going to reinvent the way operating systems are used. We are going to make sure that we provide solutions that help our customers optimize their environment, automate components to help the applications run in a much more efficient and modern way. That’s what SUSE is going to be — an innovator. We’re not there quite yet, but that’s our focus.”. + +**Evolving the company ** + +Historically, SUSE has been a fairly conservative company compared to other companies like Red Hat, which has been embracing emerging technologies at a much faster rate than any other open source software vendor. + +“We have not been in a place where we’ve been considered the risk taker. We’re the steady, stable provider of the most comprehensive unbreakable solutions in the market,” Di Donato admitted. “But we need to take that strong foundation and begin to become a bit of a risk taker, and begin to become very innovative.” + +She is also gunning for explosive growth. “We’re going to double in size by 2023. We have to go from just under half-a-billion in revenue to a billion.” + +To achieve that, SUSE will be looking at both organic and inorganic growth, including acquisition of companies, talent and technologies. “We are going to be the default choice for innovation. We are going to be the default choice for highly innovative technologies that really change the landscape,” Di Donato said. + +**Refining the brand** + +Aside from making significant changes within the company, Di Donato is working on refining the SUSE brand. She hired seasoned Ivo Totev to lead Product and Marketing and showcase the company’s differentiation. + +“We’re trying to get into the psychology of reinventing the brand,” Di Donato said. Her goal is to allocate 30-40% of SUSE’s total revenue outside of the core Linux OS towards emerging markets and develop the technologies that they’ve already built. + +SUSE _is_ home to many innovative technologies that are being used by other open source communities, even its competitors. It just didn’t market them the way Red Hat would market its technologies and projects. Even though SUSE started before Red Hat, the latter has much more visibility around the globe. + +“It’s a matter of getting the word out. We build things, but we don’t talk about it or do anything about it. We actually have to put a package around it and start selling it so people can see who we are and what value we bring to them.” + +In Di Donato’s eyes, though, good marketing isn’t everything. She argued that customers are going to demand flexibility and they are going to demand innovation that is not tied to the stack of a company. “Red Hat has a very locked-in stack that doesn’t allow them to be agnostic at all.” + +It’s quite true that unlike Red Hat, SUSE is known as an “open open-source company”, one that believes in working with partners to create an ecosystem around open source, instead of creating a tightly integrated stack that locks everyone out. + +She believes that eventually, customers would want the freedom and flexibility of picking and choosing the components they want in their stack. + +**Conclusion** + +Expect some big moves from SUSE in the near future. Less than a year into the company, new CEO Di Donato has developed a very clear vision. “We’re going to build this company based on an innovative and agile mindset. We’re not going to give up the stability and the quality of our core. What we are going to do is surround the core with really innovative thought-leading technologies that are going to set us apart from our competition… You are going to feel and experience a very different sense of excitement because we’re going to be talking much, much louder than we’ve ever talked about it before.” + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/how-melissa-di-donato-is-going-to-reinvent-suse/ + +作者:[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 +[1]: https://www.linux.com/wp-content/uploads/2020/02/Melissa-Di-Donato-1068x763.jpg (Melissa Di Donato) +[2]: https://www.linux.com/wp-content/uploads/2020/02/Melissa-Di-Donato-scaled.jpg +[3]: https://www.tfir.io/suse-gets-its-first-female-ceo-melissa-di-donato/ +[4]: https://www.cio.com/article/3090140/jim-whitehurst-if-its-important-to-the-linux-community-its-important-to-red-hat.html From f513b255ef9fcce40917f1311436b205f5bede02 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:02:45 +0800 Subject: [PATCH 031/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200229=20Solus?= =?UTF-8?q?=20Linux=20Creator=20Ikey=20Doherty=20Enters=20the=20Game=20Dev?= =?UTF-8?q?=20Business=20With=20a=20New=20Open=20Source=20Game=20Engine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md --- ...ness With a New Open Source Game Engine.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md diff --git a/sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md b/sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md new file mode 100644 index 0000000000..a61dfca27f --- /dev/null +++ b/sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine) +[#]: via: (https://itsfoss.com/ikey-doherty-serpent-interview/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine +====== + +[Ikey Doherty][1], the creator and former lead dev of [Solus][2], is back with a new project. His new company, [Lispy Snake, Ltd][3], uses open source technology to create games, with a focus on Linux support. + +I asked Ikey some questions about his new project. Here are his answers. + +![][4] + +_**It’s FOSS: What made you decide to get into game development?**_ + +**Ikey**: Honestly I would have to say a respect for older games. The creativity that came from so much limitation is frankly amazing. If you think of how limited the NES or C64 were, (or indeed my [Amstrad CPC][5]) – yet how much joy people experienced from those platforms. It’s a buzz I can’t avoid. Even though we’re a long way now from that world, I still look to model that technical excellence and creativity as best I can. I’m a sucker for good stories. + +_**It’s FOSS: There are already several open-source game engines. Why did you decide to make your own? What is Serpent’s killer feature?**_ + +**Ikey**: There are a good number of open and closed source ones, each with a great set of features. However, I’m a pretty old school developer and there is nothing I hate more than an IDE or ‘drag n drop’ codeless environment. I simply wanted to create indie games with the least fuss possible and using a framework where I didn’t have to compromise. Once you get to ‘must work nicely on Linux and be open source’ you’re kinda short on choice. + +I collected a set of projects that I’d use as the foundation for Lispy Snake’s first games, but needed something of a framework to tie them all together, as a reusable codebase across all games and updates. + +I wouldn’t say killer features are present yet – just a set of sensible decisions. Serpent is written in D so it’s highly performant with a lower barrier of entry than say C or C++. It’s allowing me to flesh out a framework that suits my development ideals and pays attention to industry requirements, such as a performant multithreading Entity Component System or the sprite batching system. + +When you rope together all the features and decisions, you get a portable codebase, that thanks to its choice of libraries like SDL and bgfx, will eventually run on all major platforms with minimal effort on our part. That basically means we’re getting OpenGL, DirectX, Vulkan and Metal “for free”. + +Being able to target the latest APIs and create indie games easily, with industry standard features emerging constantly, from a framework that doesn’t impose itself on your workflow…that’s a pretty good combination. + +![][6] + +_**It’s FOSS: Why did you name your company LispySnake? Did you have a pet snake with a speech impediment when you were a kid?**_ + +**Ikey**: Honestly? [Naughty Dog][7] was taken. Gotta love some Bandicoot. Plus, originally we were taking on some Python contracting work and I found the name amusing. It’s pretty much a nonsensical name like many of my previous projects (Like Dave. Or Dave2.) + +_**It’s FOSS: After being an operating system developer for many years, how does it feel to be working on something smaller? Would you say that your time as an OS developer gives you an edge as a game dev?**_ + +**Ikey**: OS dev needs a very high level view constantly, with the ability to context switch from macro to micro and back again. Many, many moving parts in a large ecosystem. + +Serpent is much more task orientated – though similarities in the workflow exist in terms of defining macro systems and interleaving micro features to build a cohesive whole. My background in OS dev is obviously a huge help here. + +Where it especially shines is dealing with the ‘guts’. I think a lot of indie devs (forgive me for being sweeping) are generally happy to just build from an existing kit and either embrace it or workaround the issues. There are some true gems out there like Factorio that go above and beyond and I have to hold my hat to them. + +In terms of building a new kit we get to think, properly, about cache coherency, parallel performance, memory fragmentation, context switching and such. + +Consumers of Serpent (when released in a more stable form) will know that the framework has been designed to leverage Linux features, not just spitting out builds for it. + +![][8] + +_**It’s FOSS: Recently you ported your [Serpent][9] game engine from C to the [D language][10]. Why did you make this move? What features does D have over C?**_ + +**Ikey**: Yeah honestly that was an interesting move. We were originally working on a project called lispysnake2d which was to be a trivial wrapper around SDL to give us a micro-game library. This simply used SDL_Renderer APIs to blit 2D sprites and initially seemed sufficient. Unfortunately as development progressed it was clear we needed a 3D pipeline for 2D, so we could utilize shaders and special effects. At that point SDL_Renderer is no good to you anymore and you need to go with Vulkan or OpenGL. We began abstracting the pipelines and saw the madness ensue. + +After taking a step back, I analyzed all the shortcomings in the approach, and tired of the portability issues that would definitely arise. I’m not talking in terms of libraries, I’m talking about dealing with various filepaths, encodings, Win32 APIs, DirectX vs OpenGL vs Vulkan…etc. Then whack in boilerplate time, C string shortcomings, and the amount of reinventing required to avoid linking to bloated “cross-platform” standard library style libraries. It was a bad picture. + +Having done a lot of [Go][11] development, I started researching alternatives to C that were concurrency-aware, string-sane, and packed with a powerful cross-platform standard library. This is the part where everyone will automatically tell you to use Rust. + +Unfortunately, I’m too stupid to use [Rust][12] because the syntax literally offends my eyes. I don’t get it, and I never will. Rust is a fantastic language and as academic endeavours go, highly successful. Unfortunately, I’m too practically minded and seek comfort in C-style languages, having lived in that world too long. So, D was the best candidate to tick all the boxes, whilst having C & C++ interoptability. + +It took us a while to restore feature parity but now we have a concurrency-friendly framework which is tested with both OpenGL and Vulkan, supports sprite batching and has nice APIs. Plus, much of the reinvention is gone as we’re leveraging all the features of SDL, bgfx and the DLang standard library. Win win. + +![The first game from LispySnake][13] + +_**It’s FOSS: How are you planning to distribute your games?**_ + +**Ikey**: Demo wise we’ll initially only focus on Linux, and it’s looking like we’ll use Flatpak for that. As time goes on, when we’ve introduced support and testing for macOS + Windows, we’ll likely look to the Steam Store. Despite the closed source nature, Valve have been far more friendly and supportive of Linux over the years, whilst the likes of Epic Games have a long history of being highly anti-Linux. So that’s a no go. + +_**It’s FOSS: How can people support and contribute to the development of the Serpent game engine?**_ + +**Ikey**: We have a few different methods, for what it’s worth. The easiest is to [buy a Lifetime License][14] – which is $20. This grants you lifetime access to all of our 2D games and helps fund development of our game titles and Serpent. + +Alternatively, you can [sponsor me directly on GitHub][15] to work on Serpent and upstream where needed. Bit of FOSS love. + +[Support with Lifetime License][16] + +[Sponsor the development on GitHub][15] + +* * * + +I would like to thank Ikey for taking the time to answer my questions about his latest project. + +Have any of you created a game with open source tools? If so, what tools and how was the experience? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][17]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ikey-doherty-serpent-interview/ + +作者:[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://twitter.com/ikey_doherty +[2]: https://getsol.us/home/ +[3]: https://lispysnake.com/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/ikey_doherty_serpent_interview.png?ssl=1 +[5]: https://en.wikipedia.org/wiki/Amstrad_CPC +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/lipsy_snake_screenshot.png?ssl=1 +[7]: https://www.naughtydog.com/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/lipsy_snake.png?ssl=1 +[9]: https://github.com/lispysnake/serpent +[10]: https://dlang.org/ +[11]: https://golang.org/ +[12]: https://www.rust-lang.org/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/last_peacekeeper_game.png?ssl=1 +[14]: https://lispysnake.com/the-game-raiser/ +[15]: https://github.com/sponsors/ikeycode +[16]: https://lispysnake.com/the-game-raiser +[17]: https://reddit.com/r/linuxusersgroup From 8396b2482b57da9a4a7235813a52ae60bb2df1a7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:04:05 +0800 Subject: [PATCH 032/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20How=20?= =?UTF-8?q?to=20process=20real-time=20data=20with=20Apache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 How to process real-time data with Apache.md --- ...w to process real-time data with Apache.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20200228 How to process real-time data with Apache.md diff --git a/sources/tech/20200228 How to process real-time data with Apache.md b/sources/tech/20200228 How to process real-time data with Apache.md new file mode 100644 index 0000000000..7bf16741b4 --- /dev/null +++ b/sources/tech/20200228 How to process real-time data with Apache.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to process real-time data with Apache) +[#]: via: (https://opensource.com/article/20/2/real-time-data-processing) +[#]: author: (Simon Crosby https://opensource.com/users/simon-crosby) + +How to process real-time data with Apache +====== +Open source is leading the way with a rich canvas of projects for +processing real-time events. +![Alarm clocks with different time][1] + +In the "always-on" future with billions of connected devices, storing raw data for analysis later will not be an option because users want accurate responses in real time. Prediction of failures and other context-sensitive conditions require data to be processed in real time—certainly before it hits a database. + +It's tempting to simply say "the cloud will scale" to meet demands to process streaming data in real time, but some simple examples show that it can never meet the need for real-time responsiveness to boundless data streams. In these situations—from mobile devices to IoT—a new paradigm is needed. Whereas cloud computing relies on a "store then analyze" big data approach, there is a critical need for software frameworks that are comfortable instantly processing endless, noisy, and voluminous streams of data as they arrive to permit a real-time response, prediction, or insight. + +For example, the city of Palo Alto, Calif. produces more streaming data from its traffic infrastructure per day than the Twitter Firehose. That's a lot of data. Predicting city traffic for consumers like Uber, Lyft, and FedEx requires real-time analysis, learning, and prediction. Event processing in the cloud leads to an inescapable latency of about half a second per event. + +We need a simple yet powerful programming paradigm that lets applications process boundless data streams on the fly in these and similar situations: + + * Data volumes are huge, or moving raw data is expensive. + * Data is generated by widely distributed assets (such as mobile devices). + * Data is of ephemeral value, and analysis can't wait. + * It is critical to always have the latest insight, and extrapolation won't do. + + + +### Publish and subscribe + +A key architectural pattern in the domain of event-driven systems is the concept of pub/sub or publish/subscribe messaging. This is an asynchronous communication method in which messages are delivered from _publishers_ (anything producing data) to *subscribers (*applications that process data). Pub/sub decouples arbitrary numbers of senders from an unknown set of consumers. + +In pub/sub, sources _publish_ events for a _topic_ to a _broker_ that stores them in the order in which they are received. An application _subscribes_ to one or more _topics_, and the _broker_ forwards matching events. Apache Kafka and Pulsar and CNCF NATS are pub/sub systems. Cloud services for pub/sub include Google Pub/Sub, AWS Kinesis, Azure Service Bus, Confluent Cloud, and others. + +Pub/sub systems do not _run_ subscriber applications—they simply _deliver_ data to topic subscribers. + +Streaming data often contains events that are updates to the state of applications or infrastructure. When choosing an architecture to process data, the role of a data-distribution system such as a pub/sub framework is limited. The "how" of the consumer application lies beyond the scope of the pub/sub system. This leaves an enormous amount of complexity for the developer to manage. So-called stream processors are a special kind of subscriber that analyzes data on the fly and delivers results back to the same broker. + +### Apache Spark + +[Apache Spark][2] is a unified analytics engine for large-scale data processing. Often, Apache Spark Streaming is used as a stream processor, for example, to feed machine learning models with new data. Spark Streaming breaks data into mini-batches that are each independently analyzed by a Spark model or some other system. The stream of events is grouped into mini-batches for analysis, but the stream processor itself must be elastic: + + * The stream processor must be capable of scaling with the data rate, even across servers and clouds, and also balance load across instances, ensuring resilience and other application-layer needs. + * It must be able to analyze data from sources that report at widely different rates, meaning it must be stateful—or store state in a database. This latter approach is often used when Spark Streaming is used as the stream processor and can cause performance problems when ultra-low latency responses are needed. + + + +A related project, [Apache Samza][3], offers a way to process real-time event streams, and to scale elastically using [Hadoop Yarn][4] or [Apache Mesos][5] to manage compute resources. + +### Solving the problem of scaling data + +It's important to note that even Samza cannot entirely alleviate data processing demands for the application developer. Scaling data rates mean that tasks to process events need to be load-balanced across many instances, and the only way to share the resulting application-layer state between instances is to use a database. However, the moment state coordination between tasks of an application devolves to a database, there is an inevitable knock-on effect upon performance. Moreover, the choice of database is crucial. As the system scales, cluster management for the database becomes the next potential bottleneck. + +This can be solved with alternative solutions that are stateful, elastic, and can be used in place of a stream processor. At the application level (within each container or instance), these solutions build a stateful model of concurrent, interlinked "web agents" on the fly from streaming updates. Agents are concurrent "nano-services" that consume raw data for a single source and maintain their state. Agents interlink to share state based on real-world relationships between sources found in the data, such as containment and proximity. Agents thus form a graph of concurrent services that can analyze their own state and the states of agents to which they are linked. Each agent provides a nano-service for a single data source that converts from raw data to state and analyzes, learns, and predicts from its own changes and those of its linked subgraph. + +These solutions simplify application architecture by allowing agents—digital twins of real-world sources—to be widely distributed, even while maintaining the distributed graph that interlinks them at the application layer. This is because the links are URLs that map to the current runtime execution instance of the solution and the agent itself. In this way, the application seamlessly scales across instances without DevOps concerns. Agents consume data and maintain state. They also compute over their own state and that of other agents. Because agents are stateful, there is no need for a database, and insights are computed at memory speed. + +### Reading world data with open source + +There is a sea change afoot in the way we view data: Instead of the database being the system of record, the real world is, and digital twins of real-world things can continuously stream their state. Fortunately, the open source community is leading the way with a rich canvas of projects for processing real-time events. From pub/sub, where the most active communities are Apache Kafka, Pulsar, and CNCF NATS, to the analytical frameworks that continually process streamed data, including Apache Spark, [Flink][6], [Beam][7], Samza, and Apache-licensed [SwimOS][8] and [Hazelcast][9], developers have the widest choices of software systems. Specifically, there is no richer set of proprietary software frameworks available. Developers have spoken, and the future of software is open source. + +Introduction to Apache Hadoop, an open source software framework for storage and large scale... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/real-time-data-processing + +作者:[Simon Crosby][a] +选题:[lujun9972][b] +译者:[译者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/simon-crosby +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time) +[2]: https://spark.apache.org/ +[3]: https://samza.apache.org/ +[4]: https://hadoop.apache.org/ +[5]: http://mesos.apache.org/ +[6]: https://flink.apache.org/ +[7]: https://beam.apache.org +[8]: https://github.com/swimos/swim +[9]: https://hazelcast.com/ From 668e3a1e8b9db7eb73cdcdeaeade068b539de720 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:04:54 +0800 Subject: [PATCH 033/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Revive?= =?UTF-8?q?=20your=20RSS=20feed=20with=20Newsboat=20in=20the=20Linux=20ter?= =?UTF-8?q?minal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md --- ...eed with Newsboat in the Linux terminal.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md diff --git a/sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md b/sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md new file mode 100644 index 0000000000..27a8d6ecbd --- /dev/null +++ b/sources/tech/20200228 Revive your RSS feed with Newsboat in the Linux terminal.md @@ -0,0 +1,152 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Revive your RSS feed with Newsboat in the Linux terminal) +[#]: via: (https://opensource.com/article/20/2/newsboat) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Revive your RSS feed with Newsboat in the Linux terminal +====== +Newsboat is an excellent RSS reader, whether you need a basic set of +features or want your application to do a whole lot more. +![Boat on the ocean with Creative Commons sail][1] + +Psst. Word on the web is that RSS died in 2013. That's when Google pulled the plug on Google Reader. + +Don't believe everything that you hear. RSS is alive. It's well. It's still a great way to choose the information you want to read without algorithms making the decision for you. All you need is the [right feed reader][2]. + +Back in January, Opensource.com Correspondent [Kevin Sonney][3] introduced a nifty terminal RSS reader [called Newsboat][4]. In his article, Kevin scratched Newsboat's surface. I figured it was time to take a deeper dive into what Newsboat can do. + +### Adding RSS feeds to Newsboat + +As Kevin writes, "installing Newsboat is pretty easy since it is included with most distributions (and Homebrew on macOS)." You can, as Kevin also notes, import a [file containing RSS feeds][5] from another reader. If this is your first kick at the RSS can or it's been a while since you've used an RSS reader, chances are you don't have one of those files handy. + +Not to worry. You just need to do some copying and pasting. Go to the folder **.newsboat** in your **/home** directory. Once you're there, open the file **urls** in a text editor. Then, go to the websites you want to read, find the links to their RSS feeds, and copy and paste them into the **urls** file. + +![Newsboat urls file][6] + +Start Newsboat, and you're ready to get reading. + +### Reading your feeds + +As Kevin Sonney points out, you refresh your feeds by pressing the **r** or **R** keys on your keyboard. To read the articles from a feed, press **Enter** to open that feed and scroll down the list. Then, press **Enter** to read an item. + +![Newsboat reading][7] + +Return to the list of articles by pressing **q**. Press **q** again to return to your list of feeds. + +Every so often, you might run into a feed that shows just part of an article. That can be annoying. To get the full article, press **o** to open it in your desktop's default web browser. On my desktop, for example, that's Firefox. You can change the browser Newsboat works with; I'll explain that below. + +### Following links + +Hyperlinking has been a staple of the web since its beginnings at CERN in the early 1990s. It's hard to find an article published online that doesn't contain at least a couple of links that point elsewhere. + +Instead of leaving links embedded in an article or post, Newsboat gathers them into a numbered list at the end of the article or post. + +![Hyperlinks in Newsboat][8] + +To follow a link, press the number beside it. In the screenshot above, you'd press **4** to open the link to the homepage of one of the contributors to that article. The link, as you've probably guessed, opens in your default browser. + +### Using Newsboat as a client for other feed readers + +You might use a web-based feed reader, but might also want to read your RSS feeds in something a bit more minimal on your desktop. Newsboat can do that. + +It works with several feed readers, including The Old Reader, Inoreader, Newsblur, Tiny Tiny RSS, FeedHQ, and the newsreader apps for [ownCloud][9] and [Nextcloud][10]. Before you can read feeds from any of them, you'll need to do a little work. + +Go back to the **.newsboat** folder in your **/home** directory and create a file named **config**. Then add the settings that hook Newsboat into one of the RSS readers it supports. You can find more information about the specific settings for each reader in [Newsboat's documentation][11]. + +Here's an example of the settings I use to connect Newsboat with the newsreader app in my instance of Nextcloud: + + +``` +urls-source "ocnews" +ocnews-url "" +ocnews-login "myUserName" +ocnews-password "NotTellingYouThat!" +``` + +I've tested this with Nextcloud, The Old Reader, Inoreader, and Newsblur. Newsboat worked seamlessly with all of them. + +![Newsboat with The Old Reader][12] + +### Other useful configuration tricks + +You can really unleash Newsboat's power and flexibility by tapping into [its configuration options][13]. That includes changing text colors, the order Newsboat sorts feeds, where it saves articles, the length of time Newsboat keeps articles, and more. + +Below are a few of the options I've added to my configuration file. + +#### Change Newsboat's default browser + +As I mentioned a few paragraphs back, Newsboat opens articles in your default graphical web browser. If you want to read feeds in a [text-only browser][14] like w3m or ELinks, add this to your Newsboat configuration file: + + +``` +`browser "/path/to/browser %u"` +``` + +In my configuration file, I've set w3m up as my browser: + + +``` +`browser "/usr/bin/w3m %u"` +``` + +![Newsboat with w3m][15] + +#### Remove read articles + +I like an uncluttered RSS feed. That means getting rid of articles I've already read. Add this setting to the configuration file to have Newsboat do that automatically: + + +``` +`show-read-feeds  no` +``` + +#### Refresh feeds at launch + +Life gets busy. Sometimes, I go a day or two without checking my RSS feeds. That means having to refresh them after I fire Newsboat up. Sure, I can press **r** or **R**, but why not have the application do it for me? I've added this setting to my configuration file to have Newsboat refresh all of my feeds when I launch it: + + +``` +`refresh-on-startup  yes` +``` + +If you have a lot of feeds, it can take a while to refresh them. I have around 80 feeds, and it takes over a minute to get new content from all of them. + +### Is that everything? + +Not even close. In addition to all of its configuration options, Newsboat also has a number of command-line switches you can use when you fire it up. Read more about them in the [documentation][16]. + +On the surface, Newsboat is simple. But a lot of power and flexibility hides under its hood. That makes Newsboat an excellent RSS reader for anyone who needs a basic set of features or for someone who needs their RSS reader to do a whole lot more. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/newsboat + +作者:[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/lead-images/CreativeCommons_ideas_520x292_1112JS.png?itok=otei0vKb (Boat on the ocean with Creative Commons sail) +[2]: https://opensource.com/article/17/3/rss-feed-readers +[3]: https://opensource.com/users/ksonney +[4]: https://opensource.com/article/20/1/open-source-rss-feed-reader +[5]: https://en.wikipedia.org/wiki/OPML +[6]: https://opensource.com/sites/default/files/uploads/newsboat-urls-file.png (Newsboat urls file) +[7]: https://opensource.com/sites/default/files/uploads/newsboat-reading.png (Newsboat reading) +[8]: https://opensource.com/sites/default/files/uploads/newsboat-links.png (Hyperlinks in Newsboat) +[9]: https://github.com/owncloudarchive/news +[10]: https://github.com/nextcloud/news +[11]: https://newsboat.org/releases/2.18/docs/newsboat.html#_newsboat_as_a_client_for_newsreading_services +[12]: https://opensource.com/sites/default/files/uploads/newsboat-oldreader.png (Newsboat with The Old Reader) +[13]: https://newsboat.org/releases/2.18/docs/newsboat.html#_example_configuration +[14]: https://opensource.com/article/16/12/web-browsers-linux-command-line +[15]: https://opensource.com/sites/default/files/uploads/newsboat-read-with-w3m.png (Newsboat with w3m) +[16]: https://newsboat.org/releases/2.18/docs/newsboat.html From 326eff472a6031364315642d540e388e846deacb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:05:34 +0800 Subject: [PATCH 034/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Gettin?= =?UTF-8?q?g=20started=20with=20Linux=20firewalls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 Getting started with Linux firewalls.md --- ...28 Getting started with Linux firewalls.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/tech/20200228 Getting started with Linux firewalls.md diff --git a/sources/tech/20200228 Getting started with Linux firewalls.md b/sources/tech/20200228 Getting started with Linux firewalls.md new file mode 100644 index 0000000000..c77d60b618 --- /dev/null +++ b/sources/tech/20200228 Getting started with Linux firewalls.md @@ -0,0 +1,128 @@ +[#]: 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 +<?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> +``` + +### 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 From 51cacd4975666515c89f6873b608ac6eb7499a89 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:06:19 +0800 Subject: [PATCH 035/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=204=20te?= =?UTF-8?q?chnologists=20on=20careers=20in=20tech=20for=20minorities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 4 technologists on careers in tech for minorities.md --- ...gists on careers in tech for minorities.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20200228 4 technologists on careers in tech for minorities.md diff --git a/sources/tech/20200228 4 technologists on careers in tech for minorities.md b/sources/tech/20200228 4 technologists on careers in tech for minorities.md new file mode 100644 index 0000000000..806300d5db --- /dev/null +++ b/sources/tech/20200228 4 technologists on careers in tech for minorities.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 technologists on careers in tech for minorities) +[#]: via: (https://opensource.com/article/20/2/careers-tech-minorities) +[#]: author: (Shilla Saebi https://opensource.com/users/shillasaebi) + +4 technologists on careers in tech for minorities +====== +Learn what Black History Month means to them, what influences their +career, resources for minorities wanting to break into tech, and more. +![Team meeting][1] + +In honor of Black History Month, I've garnered the opinions of a few of my favorite technology professionals and open source contributors. These four individuals are paving the way for the next generation alongside the work they're doing in the technology industry. Learn what Black History Month means to them, what influences their career, resources for minorities wanting to break into tech, and more. + +**[Tameika Reed][2], founder of Women In Linux** + +Since its launch, Tameika leads initiatives with a focus on exploring careers in infrastructure, cybersecurity, DevOps and IoT, pivoting into leadership and continuous skill-building. As a self-taught system administrator, Tameika believes the best way to learn tech is by just diving in. In efforts to give women a 360° view of tech, Tameika hosts a weekly virtual meetup to explore outside the norm of just Linux but introducing hyperledger, Kubernetes, microservices, and high-performance computing. Tameika’s career includes different conference talks from OSCon, LISA 2018, Seagl, HashiCorp EU 2019, and various local events. + +**[Michael Scott Winslow][3], Director, Core Applications and Platforms, Comcast** + +"I'm a father, husband, brother, and son. I come from a small family so I have fun turning friends into an extended family. When I attach my name to something, I obsess over its success, so I am very careful what I agree to be a part of. Oh, so as far as my career I have been involved with software development for decades. I solve problems. I work with others to help solve large problems. I lead, guide and mentor newer software engineers while observing others that I want to learn from." + +**[Bryan Liles][4], senior staff engineer, VMware** + +"I’m working with our team to rethink how developers interact with Kubernetes. When not working, I’m out in the community trying to inspire the next generation of software engineers and building robots." + +**[Mutale Nkonde][5], founding CEO of AI For the People (AFP)** + +AFP is a nonprofit creative agency. Prior to starting a nonprofit she worked in AI Governance. During that time she was part of the team that introduced the Algorithmic and Deep Fakes Algorithmic Acts, as well as the No Biometric Barriers to Housing Act to the US House of Representatives. Nkonde started her career as a broadcast journalist and worked at the BBC, CNN & ABC. She also writes widely on race and tech, as well as holding fellowships at Harvard and Stanford. + +### What influenced you to pursue a career in technology? + +My fear of the computer when I went back to college. I was afraid of the computer because I dropped out of college. After and going back, I made it my mission to learn all I can. This is still my motto to this day, learning never stops. —Tameika Reed + +I won’t mince words, I was a child geek! At 10 years old I started writing GW-BASIC from code that I read in printed magazines. Every single day. I gave it a bit of a break to have a life while I went to high school, but when it came time to pick a major for college, it was an easy choice. I stayed in technology thanks to the amazing mentors and colleagues I’ve had along the way. —Michael Scott Winslow + +I’ve been writing software since I was in middle school. I like being able to tell computers to do things and seeing the results. As an adult, I quickly realized that having a job that gave me satisfaction and paid well was the way to go. —Bryan Liles + +I wanted to explore the questions around why so few black women were being hired by tech companies. —Mutale Nkonde + +### Is there a particular person or people in open source and the tech world who have inspired you? + +I get inspired by a lot of other people and projects. For example, I love seeing others come to [Women In Linux][6] and are sure where they want to go. I try to give people a 360-view of tech so they can make a decision on what they like. Its easy to say I want to be in tech but it’s hard to get started and stay. You don’t have to be just a coder/programmer but you can be a cloud architect. —Tameika Reed + +[Kelsey Hightower][7], [Bryan Liles][4], and Kim Scott inspire me very much. They are so REAL! They say things that I feel and experience every day. Get your job done! Stop complaining! Own your actions and understand how you contribute to your situation! [Gene Kim][8] is a big inspiration as well. As a leader in the DevOps movement, I see myself following and emulating a lot of things he does. —Michael Scott Winslow + +No. I didn’t see the inspiration I wanted, so I’ve worked hard to be the inspiration I needed 20 years ago. —Bryan Liles + +There are so many! One of my favorites is [Dorothy Vaughan][9]: She was the first person in the US to program an IBM Watson computer. Her story is captured in the movie Hidden Figures. —Mutale Nkonde + +### Are there particular resources you would recommend for minorities wanting to break into tech? + +Yes, I recommend finding folks on Twitter and just ask questions. Here is a list of people I follow and admire in tech: —Tameika Reed + + * [@techgirl1908][10] + * [@bryanl][4] + * [@kelseyhightower][7] + * [@kstewart][11] + * [@tiffani][12] + * [@EricaJoy][13] + * [@womeninlinux][6] + * [@ArlanWasHere][14] + * [@blkintechnology][15] + * [@digundiv][16] + + + +Respected bootcamps are really cutting down the time it takes to break into the tech industry. I’ve met several professionals who went through bootcamps who have outshined their 4-year institution counterparts. I think we can really start respecting everything that people bring to the table, rather than technical fluency. —Michael Scott Winslow + +I’m not sure I can recommend anything specific. Tech is a big thing and there isn’t an easy answer. My advice is to pick something you think will be interested in and work to become an expert on the topic. Start asking why instead of how, and also start understanding how things work together. — Bryan Liles + +It really depends on the type of work they want to do. For people working at the intersection of tech and social justice, I would recommend the book [Algorithms of Oppression][17] by Safiya Noble. —Mutale Nkonde + +### What advice would you give to a person of color considering technology as their career? + +I suggest you study your craft. You will be a forever learner. There will always be someone or something in your way how you respond and move will be on you. Never take the first offer push back and know your worth. I look at tech like I look at art. It takes time to develop so be patient with yourself. It's okay to unplug and say no. —Tameika Reed + +As someone who is a bit of a protector of the industry, I don’t want people who are not suited for technology. So really decide if you have the personality for tech. Are you a problem solver? Are you more logical than emotional? Do you constantly find yourself creating processes? If so, no matter your background, I think you can find a home in tech. —Michael Scott Winslow + +It is not going to be simple. Your progress will be slowed because of your race. You will have to work harder. Use this adversity as a strength. You will be better prepared than those around you and when the opportunity arises, you will be able to tackle it. Find a network of those who look like you. Air grievances in private and show strength in public. You belong and you can succeed. —Bryan Liles + +To think beyond working for a company, the field of public interest tech is growing, our work centers on how technology impacts real people. Many of the people leading this work are women of color and Black women are making huge strides. Mutale Nkonde + +### What does Black History Month mean to you? + +It means never stop because you can never forget. —Tameika Reed + +Black History Month to me means focusing on the Tuskegee Airmen and not slavery. Highlighting how we contributed to history and not how were victims of it. I want people to understand where our pride comes from and not our anger. There are a lot of really bad things that happened to our people and we are still right here. Strong! —Michael Scott Winslow + +Black History Month is a time to reflect on the forgotten history of black people in the United States. I take it as a time to be thankful for the sacrifices my ancestors made. —Bryan Liles + +It is a time to center the contributions black people have made across the globe. I love it, it is one of my favorite times of year. —Mutale Nkonde + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/careers-tech-minorities + +作者:[Shilla Saebi][a] +选题:[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/shillasaebi +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting-team-listen-communicate.png?itok=KEBP6vZ_ (Team meeting) +[2]: https://www.linkedin.com/in/tameika-reed-1a7290128/ +[3]: https://twitter.com/michaelswinslow +[4]: https://twitter.com/bryanl +[5]: https://twitter.com/mutalenkonde +[6]: https://twitter.com/WomenInLinux +[7]: https://twitter.com/kelseyhightower +[8]: https://twitter.com/RealGeneKim +[9]: https://en.wikipedia.org/wiki/Dorothy_Vaughan +[10]: https://twitter.com/techgirl1908 +[11]: https://twitter.com/kstewart +[12]: https://twitter.com/tiffani +[13]: https://twitter.com/EricaJoy +[14]: https://twitter.com/ArlanWasHere +[15]: https://twitter.com/blkintechnology +[16]: https://twitter.com/digundiv +[17]: http://algorithmsofoppression.com/ From 06f08a2029e56fe85c2b6164e12a9dc205924238 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:08:56 +0800 Subject: [PATCH 036/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Intel?= =?UTF-8?q?=20takes=20aim=20at=20Huawei=205G=20market=20presence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md --- ... takes aim at Huawei 5G market presence.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md diff --git a/sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md b/sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md new file mode 100644 index 0000000000..22caa3c0f6 --- /dev/null +++ b/sources/talk/20200228 Intel takes aim at Huawei 5G market presence.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel takes aim at Huawei 5G market presence) +[#]: via: (https://www.networkworld.com/article/3529354/intel-takes-aim-at-huawei-5g-market-presence.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel takes aim at Huawei 5G market presence +====== +Intel has ambitious plans to grab the 5G base station marketplace, which is still in its infancy. +Christopher Hebert/IDG + +Intel on Monday introduced a raft of new processors, and while updates to the Xeon Scalable lineup led the parade, the real news is Intel's efforts to go after the embattled Huawei Technologies in the 5G market. + +Intel unveiled its first ever 5G integrated chip platform, the Atom P5900, for use in base stations. Navin Shenoy, executive vice president and general manager of the data platforms group at Intel, said the product is designed for 5G's high bandwidth and low latency and combines compute, 100Gb performance and acceleration into a single SoC. + +"It delivers a performance punch in packet security throughput, and improved packet balancing throughput versus using software alone," Shenoy said in the video accompanying the announcement. Intel claims the dynamic load balancer native to the Atom P5900 chip is 3.7 times more efficient at packet balancing throughput than software alone. + +Shenoy said Ericsson, Nokia, and ZTE have announced that they will use the Atom P5900 in their base stations. Intel hopes to be the market leader for silicon base station chips by 2021, aiming for 40% of the market and six million 5G base stations by 2024. + +That's pretty aggressive, but the 5G fields are very green and there is plenty of room for growth. Despite all the mobile provider's commercials boasting of 5G availability, the fact is, true 5G phones are only just coming to market now, and the number of base stations is minimal. 5G has a long ramp ahead. + +The Atom P5900 puts Intel in competition with China's Huawei, which U.S. federal authorities have repeatedly labeled a security risk. Huawei has been barred from several nations, including the U.S., England, Japan, and Australia. However, Huawei also said it has secured more than 90 commercial 5G contracts globally. + +Until now, Ericsson and Nokia have asked developers such as Broadcom to help develop base station chips, while Samsung designs and manufactures its own 5G base station chips. + +**[ [Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][1] ]** + +### Second Generation Xeon Scalable processors + +Intel's latest launch also includes 18 2nd Gen Xeon Scalable processors; one is branded Bronze, four are Silver, and 13 are Gold. The upgraded lineup targets the entry-level to medium-range market, leaving the Platinum to duke it out with the high end AMD Epyc processors. + +The new processors range from 8 to 28 cores and include a variety of clock speeds that go down as the core count goes up. They have TDP ratings that range from 85 watts for the eight-core, 1.9Ghz Bronze 3206R to 205 watts for the 28-core, 2.7Ghz Gold 6258R. (Intel and other chip makers measure a processor's power draw with a specification called thermal design power, or TDP.) ** +** + +While most of the chips are meant for standard data center use, some processors – including the Xeon Gold 6200U, Silver 4200R, Sliver 4210T and Bronze 3200R – are specifically meant for single-socket, entry-level servers, as well as edge, networking and IoT uses. + +Intel also introduced the Intel Ethernet 700 Network Adapter, which comes with hardware-enhanced precision timing designed specifically for 5G and other scenarios with very low latency and timing requirements. + +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/3529354/intel-takes-aim-at-huawei-5g-market-presence.html + +作者:[Andy Patrizio][a] +选题:[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/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From 0ae335104bb7c430b4afec3b44532b1ee6d0a40b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 29 Feb 2020 01:10:25 +0800 Subject: [PATCH 037/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200228=20Conver?= =?UTF-8?q?ting=20between=20uppercase=20and=20lowercase=20on=20the=20Linux?= =?UTF-8?q?=20command=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md --- ...and lowercase on the Linux command line.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md diff --git a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md new file mode 100644 index 0000000000..a2819e3ff7 --- /dev/null +++ b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Converting between uppercase and lowercase on the Linux command line) +[#]: via: (https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Converting between uppercase and lowercase on the Linux command line +====== +Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. +[andy.brandon50][1] [(CC BY-SA 2.0)][2] + +There are many ways to change text on the Linux command line from lowercase to uppercase and vice versa. In fact, you have an impressive set of commands to choose from. This post examines some of the best commands for the job and how you can get them to do just what you want. + +### Using tr + +The **tr** (translate) command is one of the easiest to use on the command line or within a script. If you have a string that you want to be sure is in uppercase, you just pass it through a **tr** command like this: + +``` +$ echo Hello There | tr [:lower:] [:upper:] +HELLO THERE +``` + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +Below is an example of using this kind of command in a script when you want to be sure that all of the text that is added to a file is in uppercase for consistency: + +``` +#!/bin/bash + +echo -n "Enter department name: " +read dept +echo $dept | tr [:lower:] [:upper:] >> depts +``` + +Switching the order to [:upper:] [:lower:] would have the opposite effect, putting all the department names in lowercase: + +``` +echo $dept | tr [:upper:] [:lower:] >> depts +``` + +Similarly, you could use the **sed** command's **A-Z** and **a-z** strings to accomplish the same thing: + +``` +echo $dept | tr a-z A-Z >> depts +``` + +As you undoubtedly suspect, reversing the order of the a-z and A-Z strings will have the opposite effect, turning the text to all lowercase. + +### Using awk + +The **awk** command lets you do the same thing with its **toupper** and **tolower** options. The command in the script shown in the previous example could be done this way instead: + +[][4] + +``` +echo $dept | awk '{print toupper($0)}' >> depts +``` + +The reverse (switching to lowercase) would look like this: + +``` +echo $dept | awk '{print tolower($0)}' >> depts +``` + +### Using sed + +The **sed** (stream editor) command also does a great job of switching between upper- and lowercase. This command would have the same effect as the first of the two shown above. + +``` +echo $dept | sed 's/[a-z]/\U&/g' >> depts +``` + +Switching from uppercase to lowercase would simply involve replacing the **U** near the end of the line with an **L**. + +``` +echo $dept | sed 's/[A-Z]/\L&/g' >> depts +``` + +### Manipulating text in a file + +Both **awk** and **sed** also allow you to change the case of text for entire files. So, you just found out your boss wanted those department names in all lowercase? No problem. Just run a command like this with the file name provided: + +``` +$ awk '{print tolower($0)}' depts +finance +billing +bookkeeping +``` + +If you want to overwrite the **depts** file, instead of just displaying its contents in lowercase, you would need to do something like this: + +``` +$ awk '{print tolower($0)}' depts > depts- +$ mv depts- depts +``` + +Making the change with **sed**, however, you can avoid that last step because **sed** can edit a file "in place" as shown here, leaving the file intact, but the text in all lowercase: + +``` +$ sed 's/[A-Z]/\L&/g' depts +``` + +### Capitalizing first letters only + +To capitalize only the first letters of words in a string, you can do something like this: + +``` +$ echo design \& engineering| sed -e "s/\b\(.\)/\u\1/g" +Design & Engineering +``` + +That command will ensure that first letters are capitalized, but won't change the rest of the letters. + +### Making sure only first letters are uppercase + +It's a little more challenging when you want to change text so that only first letters are in uppercase. Say you're manipulating a list of staff members' names and you want them to be formatted in the normal Firstname Lastname manner. + +##### with sed + +You could use a considerably more complex **sed** command to ensure this result: + +``` +$ echo design \& ENGINEERING | sed 's/\b\([[:alpha:]]\)\([[:alpha:]]*\)\b/\u\1\L\2/g' +Design & Engineering +``` + +##### with python + +If you have python loaded, you can run a command like this that also formats text so that only the first letters of each word are capitalized and the command may be a little easier to parse than the **sed** command shown above: + +``` +$ echo -n "design & engineering" | python3 -c "import sys; print(sys.stdin.read().title())" +Design & Engineering +``` + +There are many ways to change the formatting of text between upper- and lowercase. Which works best depends in part of whether you're manipulating a single string or an entire file and how you want the end result to look. + +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/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.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.flickr.com/photos/54027476@N07/4999959929 +[2]: https://creativecommons.org/licenses/by-sa/2.0/legalcode +[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 From dd6a1537e8aa381ddf567afe9929f2a0f321a0a8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 11:47:56 +0800 Subject: [PATCH 038/207] PRF @heguangzhi --- ...sing Python and GNU Octave to plot data.md | 388 ++++-------------- 1 file changed, 90 insertions(+), 298 deletions(-) diff --git a/translated/tech/20200220 Using Python and GNU Octave to plot data.md b/translated/tech/20200220 Using Python and GNU Octave to plot data.md index 0c11406995..f0728a32d4 100644 --- a/translated/tech/20200220 Using Python and GNU Octave to plot data.md +++ b/translated/tech/20200220 Using Python and GNU Octave to plot data.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using Python and GNU Octave to plot data) @@ -10,270 +10,69 @@ 使用 Python 和 GNU Octave 绘制数据 ====== -了解如何使用 Python 和 GNU Octave 完成一项常见的数据科学任务。 -![分析:图表和图形][1] +> 了解如何使用 Python 和 GNU Octave 完成一项常见的数据科学任务。 -数据科学是跨越编程语言的知识领域。有些人以解决这一领域的问题而闻名,而另一些人则鲜为人知。这篇文章将帮助你熟悉用一些流行语言做数据科学。 +![](https://img.linux.net.cn/data/attachment/album/202002/29/114750tr7qykssk90yrvyz.jpg) -### 为数据科学选择 Python 和 GNU Octave +数据科学是跨越编程语言的知识领域。有些语言以解决这一领域的问题而闻名,而另一些则鲜为人知。这篇文章将帮助你熟悉用一些流行的语言完成数据科学的工作。 -我经常尝试学习一种新的编程语言。为什么?这主要是对旧方式的厌倦和对新方式的好奇的结合。当我开始编程时,我唯一知道的语言是 C 语言。那些年的编程生涯既艰难又危险,因为我不得不手动分配内存,管理指针,并记得释放内存。 +### 选择 Python 和 GNU Octave 做数据科学工作 -然后一个朋友建议我试试 Python,现在编程生活变得简单多了。虽然程序运行变得慢多了,但我不必通过编写分析软件来受苦了。然而,我很快就意识到每种语言都有比其他语言更适合自己应用场景。后来我学习了其他一些语言,每种语言都给我带来了一些新的启发。发现新的编程风格让我可以将一些解决方案移植到其他语言中,这样一切都变得有趣多了。 +我经常尝试学习一种新的编程语言。为什么?这既有对旧方式的厌倦,也有对新方式的好奇。当我开始学习编程时,我唯一知道的语言是 C 语言。那些年的编程生涯既艰难又危险,因为我必须手动分配内存、管理指针、并记得释放内存。 -为了对一种新的编程语言(及其文档)有所了解,我总是从编写一些执行我熟悉的任务的示例程序开始。为此,我将解释如何用 Python 和 GNU Octave 编写一个程序来完成一个你可以归类为数据科学的特殊任务。如果你已经熟悉其中一种语言,从中开始,浏览其他语言,寻找相似之处和不同之处。这并不是对编程语言的详尽比较,只是一个小小的展示。 +后来一个朋友建议我试试 Python,现在我的编程生活变得轻松多了。虽然程序运行变得慢多了,但我不必通过编写分析软件来受苦了。然而,我很快就意识到每种语言都有比其它语言更适合自己的应用场景。后来我学习了一些其它语言,每种语言都给我带来了一些新的启发。发现新的编程风格让我可以将一些解决方案移植到其他语言中,这样一切都变得有趣多了。 -所有的程序都应该在[命令行][2]上运行,而不是用[图形用户界面][3](GUI)。完整的例子可以在[多语种知识库][4]中找到。 +为了对一种新的编程语言(及其文档)有所了解,我总是从编写一些执行我熟悉的任务的示例程序开始。为此,我将解释如何用 Python 和 GNU Octave 编写一个程序来完成一个你可以归类为数据科学的特殊任务。如果你已经熟悉其中一种语言,从它开始,然后通过其他语言寻找相似之处和不同之处。这篇文章并不是对编程语言的详尽比较,只是一个小小的展示。 + +所有的程序都应该在[命令行][2]上运行,而不是用[图形用户界面][3](GUI)。完整的例子可以在 [polyglot_fit 存储库][4]中找到。 ### 编程任务 你将在本系列中编写的程序: - * 从[CSV文件][5]中读取数据 - * 用直线插入数据(例如 _f(x)=m ⋅ x + q_) + * 从 [CSV 文件][5]中读取数据 + * 用直线插入数据(例如 `f(x)=m ⋅ x + q`) * 将结果生成图像文件 -这是许多数据科学家遇到的常见情况。示例数据是第一组[Anscombe's quartet][6],如下表所示。这是一组人工构建的数据,当用直线拟合时会给出相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,以制表符作为列分隔,以几行作为标题。此任务将仅使用第一组(例如:前两列)。 - -I - -II - -III - -IV - -x - -y - -x - -y - -x - -y - -x - -y - -10.0 - -8.04 - -10.0 - -9.14 - -10.0 - -7.46 - -8.0 - -6.58 - -8.0 - -6.95 - -8.0 - -8.14 - -8.0 - -6.77 - -8.0 - -5.76 - -13.0 - -7.58 - -13.0 - -8.74 - -13.0 - -12.74 - -8.0 - -7.71 - -9.0 - -8.81 - -9.0 - -8.77 - -9.0 - -7.11 - -8.0 - -8.84 - -11.0 - -8.33 - -11.0 - -9.26 - -11.0 - -7.81 - -8.0 - -8.47 - -14.0 - -9.96 - -14.0 - -8.10 - -14.0 - -8.84 - -8.0 - -7.04 - -6.0 - -7.24 - -6.0 - -6.13 - -6.0 - -6.08 - -8.0 - -5.25 - -4.0 - -4.26 - -4.0 - -3.10 - -4.0 - -5.39 - -19.0 - -12.50 - -12.0 - -10.84 - -12.0 - -9.13 - -12.0 - -8.15 - -8.0 - -5.56 - -7.0 - -4.82 - -7.0 - -7.26 - -7.0 - -6.42 - -8.0 - -7.91 - -5.0 - -5.68 - -5.0 - -4.74 - -5.0 - -5.73 - -8.0 - -6.89 +这是许多数据科学家遇到的常见情况。示例数据是 [Anscombe 的四重奏][6]的第一组,如下表所示。这是一组人工构建的数据,当用直线拟合时会给出相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,以制表符作为列分隔符,开头几行作为标题。此任务将仅使用第一组(即前两列)。 ### Python 方式 - -[Python][7]是一种通用编程语言,是当今最流行的语言之一(从[TIOBE index][8]、[RedMonk编程语言排名][9]、[编程语言流行指数][10]、[State of the Octoverse of GitHub][11]和其他来源的调查结果可以看出)。这是一种[解释的语言][12];因此,源代码由执行指令的程序读取和评估。它有一个全面的[标准库][13]并且总体上非常好用(我没有参考这最后一句话;这只是我的拙见)。 +[Python][7] 是一种通用编程语言,是当今最流行的语言之一(依据 [TIOBE 指数][8]、[RedMonk 编程语言排名][9]、[编程语言流行指数][10]、[GitHub Octoverse 状态][11]和其他来源的调查结果)。它是一种[解释型语言][12];因此,源代码由执行该指令的程序读取和评估。它有一个全面的[标准库][13]并且总体上非常好用(我对这最后一句话没有证据;这只是我的拙见)。 #### 安装 -要使用 Python 开发,你需要解释器和一些库。最低要求是: +要使用 Python 开发,你需要解释器和一些库。最低要求是: - * [NumPy][14]用于合适的数组和矩阵操作 - * [SciPy][15]进行数据科学 - * [Matplotlib][16]绘图 +* [NumPy][14] 用于简化数组和矩阵的操作 +* [SciPy][15] 用于数据科学 +* [Matplotlib][16] 用于绘图 在 [Fedora][17] 安装它们是很容易的: - ``` -`sudo dnf install python3 python3-numpy python3-scipy python3-matplotlib` +sudo dnf install python3 python3-numpy python3-scipy python3-matplotlib ``` -#### 注释代码 +#### 代码注释 - -在 Python中,[注释][18]是通过在行首添加一个 **#** 来实现的,该行的其余部分将被解释器丢弃: +在 Python中,[注释][18]是通过在行首添加一个 `#` 来实现的,该行的其余部分将被解释器丢弃: ``` -`# This is a comment ignored by the interpreter.` +# 这是被解释器忽略的注释。 ``` -[fitting_python.py][19]示例使用注释在源代码中插入许可信息,第一行是[特殊注释][20],它允许在命令行上执行脚本: +[fitting_python.py][19] 示例使用注释在源代码中插入许可证信息,第一行是[特殊注释][20],它允许该脚本在命令行上执行: ``` -`#! /usr/bin/env python3` +#!/usr/bin/env python3 ``` -这一行通知命令行解释器,脚本需要由程序**python3**执行。 -#### Required libraries +这一行通知命令行解释器,该脚本需要由程序 `python3` 执行。 -在 Python 中,库和模块可以作为一个对象导入(如示例中的第一行),其中包含库的所有函数和成员。通过使用 **as** 规范可以用于定义标签并重命名它们: +#### 需要的库 + +在 Python 中,库和模块可以作为一个对象导入(如示例中的第一行),其中包含库的所有函数和成员。可以通过使用 `as` 方式用自定义标签重命名它们: ``` import numpy as np @@ -281,11 +80,11 @@ from scipy import stats import matplotlib.pyplot as plt ``` -你也可以决定只导入一个子模块(如第二行和第三行)。语法有两个(或多或少)等效选项: **import module.submodule** 和 **from module import submodule**。 +你也可以决定只导入一个子模块(如第二行和第三行)。语法有两个(基本上)等效的方式:`import module.submodule` 和 `from module import submodule`。 #### 定义变量 -Python 的变量是在第一次赋值时被声明的: +Python 的变量是在第一次赋值时被声明的: ``` input_file_name = "anscombe.csv" @@ -295,48 +94,46 @@ column_x = 0 column_y = 1 ``` -变量类型由分配给变量的值推断。没有常量值的变量,除非它们在模块中声明并且只能被读取。习惯上,不被修改的变量应该用大写字母命名。 +变量类型由分配给变量的值推断。没有具有常量值的变量,除非它们在模块中声明并且只能被读取。习惯上,不应被修改的变量应该用大写字母命名。 #### 打印输出 -通过命令行运行程序意味着输出只能打印在终端上。Python 有[**print()**][21]函数,默认情况下,该函数打印其参数,并在输出的末尾添加一个换行符: +通过命令行运行程序意味着输出只能打印在终端上。Python 有 [print()][21] 函数,默认情况下,该函数打印其参数,并在输出的末尾添加一个换行符: ``` -`print("#### Anscombe's first set with Python ####")` +print("#### Anscombe's first set with Python ####") ``` -在 Python 中,可以将**print()**函数与[字符串类][23]的[格式化能力][22]相结合。字符串具有**format**方法,可用于向字符串本身添加一些格式化文本。例如,可以添加格式化的浮点数,例如: - +在 Python 中,可以将 `print()` 函数与[字符串类][23]的[格式化能力][22]相结合。字符串具有`format` 方法,可用于向字符串本身添加一些格式化文本。例如,可以添加格式化的浮点数,例如: ``` -`print("Slope: {:f}".format(slope))` +print("Slope: {:f}".format(slope)) ``` #### 读取数据 -使用 NumPy 和 函数[**genfromtxt()**][24]读取CSV文件非常容易,该函数生成[NumPy数组][25]: - +使用 NumPy 和函数 [genfromtxt()][24] 读取 CSV 文件非常容易,该函数生成 [NumPy 数组][25]: ``` -`data = np.genfromtxt(input_file_name, delimiter = delimiter, skip_header = skip_header)` +data = np.genfromtxt(input_file_name, delimiter = delimiter, skip_header = skip_header) ``` -在 Python中,一个函数可以有可变数量的参数,您可以通过指定所需的参数来让它传递一个子集。数组是非常强大的矩阵状对象,可以很容易地分割成更小的数组: +在 Python 中,一个函数可以有数量可变的参数,你可以通过指定所需的参数来传递一个参数的子集。数组是非常强大的矩阵状对象,可以很容易地分割成更小的数组: ``` x = data[:, column_x] y = data[:, column_y] ``` -冒号选择整个范围,也可以用来选择子范围。例如,要选择数组的前两行,可以使用: +冒号选择整个范围,也可以用来选择子范围。例如,要选择数组的前两行,可以使用: ``` -`first_two_rows = data[0:1, :]` +first_two_rows = data[0:1, :] ``` #### 拟合数据 -SciPy提供了方便的数据拟合功能,例如[**linregress()**][26]功能。该函数提供了一些与拟合相关的重要值,如斜率、截距和两个数据集的相关系数: +SciPy 提供了方便的数据拟合功能,例如 [linregress()][26] 功能。该函数提供了一些与拟合相关的重要值,如斜率、截距和两个数据集的相关系数: ``` slope, intercept, r_value, p_value, std_err = stats.linregress(x, y) @@ -346,25 +143,25 @@ print("Intercept: {:f}".format(intercept)) print("Correlation coefficient: {:f}".format(r_value)) ``` -因为**linregress()**提供了几条信息,所以结果可以同时保存到几个变量中。 +因为 `linregress()` 提供了几条信息,所以结果可以同时保存到几个变量中。 #### 绘图 -Matplotlib 库仅仅绘制数据点,因此,你应该定义要绘制的点的坐标。已经定义了**x** 和 **y** 数组,所以你可以直接绘制它们,但是你还需要代表直线的数据点。 +Matplotlib 库仅仅绘制数据点,因此,你应该定义要绘制的点的坐标。已经定义了 `x` 和 `y` 数组,所以你可以直接绘制它们,但是你还需要代表直线的数据点。 ``` -`fit_x = np.linspace(x.min() - 1, x.max() + 1, 100)` +fit_x = np.linspace(x.min() - 1, x.max() + 1, 100) ``` -[**linspace()**][27]函数可以方便地在两个值之间生成一组等距值。利用强大的 NumPy 数组可以轻松计算纵坐标,该数组可以像普通数值变量一样在公式中使用: +[linspace()][27] 函数可以方便地在两个值之间生成一组等距值。利用强大的 NumPy 数组可以轻松计算纵坐标,该数组可以像普通数值变量一样在公式中使用: ``` -`fit_y = slope * fit_x + intercept` +fit_y = slope * fit_x + intercept ``` -公式在数组中逐元素应用;因此,结果在初始数组中具有相同数量的条目。 +该公式在数组中逐元素应用;因此,结果在初始数组中具有相同数量的条目。 -要绘图,首先,定义一个包含所有图形的[图形对象][28]: +要绘图,首先,定义一个包含所有图形的[图形对象][28]: ``` fig_width = 7 #inch @@ -374,7 +171,7 @@ fig_dpi = 100 fig = plt.figure(figsize = (fig_width, fig_height), dpi = fig_dpi) ``` -一个图形可以画几个图;在 Matplotlib 中,这些图块被称为[轴][29]。本示例定义一个单轴对象来绘制数据点: +一个图形可以画几个图;在 Matplotlib 中,这些图被称为[轴][29]。本示例定义一个单轴对象来绘制数据点: ``` ax = fig.add_subplot(111) @@ -389,26 +186,25 @@ ax.set_xlabel('x') ax.set_ylabel('y') ``` -将该图保存到[PNG image file][30]中,有: +将该图保存到 [PNG 图形文件][30]中,有: ``` -`fig.savefig('fit_python.png')` +fig.savefig('fit_python.png') ``` -如果要显示(而不是保存)绘图,请调用: - +如果要显示(而不是保存)该绘图,请调用: ``` -`plt.show()` +plt.show() ``` -此示例引用了绘图部分中使用的所有对象:它定义了对象 **fig** 和对象 **ax**。这种技术细节是不必要的,因为 **plt** 对象可以直接用于绘制数据集。《[Matplotlib 教程][31]展示了这样一个界面: +此示例引用了绘图部分中使用的所有对象:它定义了对象 `fig` 和对象 `ax`。这在技术上是不必要的,因为 `plt` 对象可以直接用于绘制数据集。《[Matplotlib 教程][31]》展示了这样一个接口: ``` -`plt.plot(fit_x, fit_y)` +plt.plot(fit_x, fit_y) ``` -坦率地说,我不喜欢这种方法,因为它隐藏了各种对象之间发生的重要的的交互。不幸的是,有时[官方的例子][32]有点令人困惑,因为他们倾向于使用不同的方法。在这个简单的例子中,引用图形对象是不必要的,但是在更复杂的例子中(例如在图形用户界面中嵌入图形时),引用图形对象就变得很重要了。 +坦率地说,我不喜欢这种方法,因为它隐藏了各种对象之间发生的重要交互。不幸的是,有时[官方的例子][32]有点令人困惑,因为他们倾向于使用不同的方法。在这个简单的例子中,引用图形对象是不必要的,但是在更复杂的例子中(例如在图形用户界面中嵌入图形时),引用图形对象就变得很重要了。 #### 结果 @@ -427,27 +223,27 @@ Correlation coefficient: 0.816421 ### GNU Octave 方式 -[GNU Octave][34]语言主要用于数值计算。它提供了一个简单的操作向量和矩阵的语法,并且有一些强大的绘图工具。这是一种像 Python 一样的解释语言。由于 Octave的语法是[最兼容][35] [MATLAB][36],它经常被描述为一个免费的替代 MATLAB 的方案。Octave 没有被列为最流行的编程语言,但是 MATLAB 是,所以 Octave 在某种意义上是相当流行的。MATLAB 早于 NumPy,我觉得它是受到了前者的启发。当你看这个例子时,你会看到相似之处。 +[GNU Octave][34] 语言主要用于数值计算。它提供了一个简单的操作向量和矩阵的语法,并且有一些强大的绘图工具。这是一种像 Python 一样的解释语言。由于 Octave 的语法[几乎兼容][35] [MATLAB][36],它经常被描述为一个替代 MATLAB 的免费方案。Octave 没有被列为最流行的编程语言,而 MATLAB 则是,所以 Octave 在某种意义上是相当流行的。MATLAB 早于 NumPy,我觉得它是受到了前者的启发。当你看这个例子时,你会看到相似之处。 #### 安装 -[fitting_octave.m][37]的例子只需要基本的 Octave 包,在 Fedora 中安装相当简单: +[fitting_octave.m][37] 的例子只需要基本的 Octave 包,在 Fedora 中安装相当简单: ``` -`sudo dnf install octave` +sudo dnf install octave ``` -#### 注释代码 +#### 代码注释 -在Octave中,你可以用百分比符号(**%**)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 **#**。使用 **#** 的选项允许你从 Python 示例中编写相同的特殊注释行,以便直接在命令行上执行脚本。 +在 Octave 中,你可以用百分比符号(``%`)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 `#`。使用 `#` 的选项允许你编写像 Python 示例一样的特殊注释行,以便直接在命令行上执行脚本。 #### 必要的库 -本例中使用的所有内容都包含在基本包中,因此你不需要加载任何新的库。如果你需要一个库,[语法][38]是 **pkg load module**。该命令将模块的功能添加到可用功能列表中。在这方面,Python 具有更大的灵活性。 +本例中使用的所有内容都包含在基本包中,因此你不需要加载任何新的库。如果你需要一个库,[语法][38]是 `pkg load module`。该命令将模块的功能添加到可用功能列表中。在这方面,Python 具有更大的灵活性。 #### 定义变量 -变量的定义与 Python 的语法基本相同: +变量的定义与 Python 的语法基本相同: ``` input_file_name = "anscombe.csv"; @@ -457,46 +253,45 @@ column_x = 1; column_y = 2; ``` -请注意,行尾有一个分号;这不是必需的,但是它会抑制行结果的输出。如果没有分号,解释器将打印表达式的结果: +请注意,行尾有一个分号;这不是必需的,但是它会抑制该行结果的输出。如果没有分号,解释器将打印表达式的结果: ``` -octave:1> input_file_name = "anscombe.csv" +octave:1> input_file_name = "anscombe.csv" input_file_name = anscombe.csv -octave:2> sqrt(2) -ans =  1.4142 +octave:2> sqrt(2) +ans = 1.4142 ``` #### 打印输出结果 -强大的功能[**printf()**][39]是用来在终端上打印的。与 Python 不同,**printf()** 函数不会自动在打印字符串的末尾添加换行,因此你必须添加它。第一个参数是一个字符串,可以包含要传递给函数的其他参数的格式信息,例如: +强大的函数 [printf()][39] 是用来在终端上打印的。与 Python 不同,`printf()` 函数不会自动在打印字符串的末尾添加换行,因此你必须添加它。第一个参数是一个字符串,可以包含要传递给函数的其他参数的格式信息,例如: ``` -`printf("Slope: %f\n", slope);` +printf("Slope: %f\n", slope); ``` -在 Python 中,格式是内置在字符串本身中的,但是在 Octave 中,它是特定于 **printf()** 函数。 +在 Python 中,格式是内置在字符串本身中的,但是在 Octave 中,它是特定于 `printf()` 函数。 #### 读取数据 -[**dlmread()**][40]函数可以读取类似CSV文件的文本内容: +[dlmread()][40] 函数可以读取类似 CSV 文件的文本内容: ``` -`data = dlmread(input_file_name, delimiter, skip_header, 0);` +data = dlmread(input_file_name, delimiter, skip_header, 0); ``` -结果是一个[矩阵][41]对象,这是 Octave 中的基本数据类型之一。矩阵可以用类似于 Python 的语法进行切片: +结果是一个[矩阵][41]对象,这是 Octave 中的基本数据类型之一。矩阵可以用类似于 Python 的语法进行切片: ``` x = data(:, column_x); y = data(:, column_y); ``` -根本的区别是索引从1开始,而不是从0开始。因此,在该示例中,__x__列是第一列。 +根本的区别是索引从 1 开始,而不是从 0 开始。因此,在该示例中,`x` 列是第一列。 #### 拟合数据 -要用直线拟合数据,可以使用[**polyfit()**][42]函数。它用一个多项式拟合输入数据,所以你只需要使用一阶多项式: - +要用直线拟合数据,可以使用 [polyfit()][42] 函数。它用一个多项式拟合输入数据,所以你只需要使用一阶多项式: ``` p = polyfit(x, y, 1); @@ -505,14 +300,13 @@ slope = p(1); intercept = p(2); ``` -结果是具有多项式系数的矩阵;因此,它选择前两个索引。要确定相关系数,请使用[**corr()**][43]函数: - +结果是具有多项式系数的矩阵;因此,它选择前两个索引。要确定相关系数,请使用 [corr()][43] 函数: ``` -`r_value = corr(x, y);` +r_value = corr(x, y); ``` -最后,使用 **printf()** 函数打印结果: +最后,使用 `printf()` 函数打印结果: ``` printf("Slope: %f\n", slope); @@ -529,9 +323,9 @@ fit_x = linspace(min(x) - 1, max(x) + 1, 100); fit_y = slope * fit_x + intercept; ``` -与 NumPy 的相似性也很明显,因为它使用了[**linspace()**][44]函数,其行为就像 Python 的等效版本一样。 +与 NumPy 的相似性也很明显,因为它使用了 [linspace()][44] 函数,其行为就像 Python 的等效版本一样。 -同样,与 Matplotlib 一样,首先创建一个[图][45]对象,然后创建一个[轴][46]对象来保存这些图: +同样,与 Matplotlib 一样,首先创建一个[图][45]对象,然后创建一个[轴][46]对象来保存这些图: ``` fig_width = 7; %inch @@ -547,8 +341,7 @@ set(ax, "fontsize", 14); set(ax, "linewidth", 2); ``` - -要设置轴对象的属性,请使用[**set()**][47]函数。然而,该接口相当混乱,因为该函数需要一个逗号分隔的属性和值对列表。这些对只是代表属性名的一个字符串和代表该属性值的第二个对象的连续。还有其他设置各种属性的功能: +要设置轴对象的属性,请使用 [set()][47] 函数。然而,该接口相当混乱,因为该函数需要一个逗号分隔的属性和值对列表。这些对只是代表属性名的一个字符串和代表该属性值的第二个对象的连续。还有其他设置各种属性的函数: ``` xlim(ax, [min(x) - 1, max(x) + 1]); @@ -557,8 +350,7 @@ xlabel(ax, 'x'); ylabel(ax, 'y'); ``` -标图是用[**plot()**][48]功能实现的。默认行为是每次调用都会重置坐标轴,因此需要使用函数[**hold()**][49]。 - +绘图是用 [plot()][48] 功能实现的。默认行为是每次调用都会重置坐标轴,因此需要使用函数 [hold()][49]。 ``` hold(ax, "on"); @@ -575,14 +367,14 @@ plot(ax, x, y, hold(ax, "off"); ``` -此外,还可以在 **plot()** 函数中添加属性和值对。[legend][50]必须单独创建,标签应手动声明: +此外,还可以在 `plot()` 函数中添加属性和值对。[legend][50] 必须单独创建,标签应手动声明: ``` lg = legend(ax, "Fit", "Data"); set(lg, "location", "northwest"); ``` -最后,将输出保存到PNG图像: +最后,将输出保存到 PNG 图像: ``` image_size = sprintf("-S%f,%f", fig_width * fig_dpi, fig_height * fig_dpi); @@ -594,13 +386,13 @@ print(fig, 'fit_octave.png',       image_resolution); ``` -令人困惑的是,在这种情况下,选项被作为一个字符串传递,带有属性名和值。因为在 Octave 字符串中没有 Python 的格式化工具,所以必须使用[**sprintf()**][51]函数。它的行为就像**printf()**函数,但是它的结果不是打印出来的,而是作为字符串返回的。 +令人困惑的是,在这种情况下,选项被作为一个字符串传递,带有属性名和值。因为在 Octave 字符串中没有 Python 的格式化工具,所以必须使用 [sprintf()][51] 函数。它的行为就像 `printf()` 函数,但是它的结果不是打印出来的,而是作为字符串返回的。 -在这个例子中,就像在 Python 中一样,图形对象很明显被引用以保持它们之间的交互。如果说 Python 在这方面的文档有点混乱,那么[Octave 的文档][52]就更糟糕了。我发现的大多数例子都不关心引用对象;相反,它们依赖于绘图命令作用于当前活动图形。全局[根图形对象][53]跟踪现有的图形和轴。 +在这个例子中,就像在 Python 中一样,图形对象很明显被引用以保持它们之间的交互。如果说 Python 在这方面的文档有点混乱,那么 [Octave 的文档][52]就更糟糕了。我发现的大多数例子都不关心引用对象;相反,它们依赖于绘图命令作用于当前活动图形。全局[根图形对象][53]跟踪现有的图形和轴。 #### 结果 -命令行上的结果输出是: +命令行上的结果输出是: ``` #### Anscombe's first set with Octave #### @@ -613,9 +405,9 @@ Correlation coefficient: 0.816421 ![Plot and fit of the dataset obtained with Octave][54] -### 下一个 +###接下来 -Python 和 GNU Octave 都可以绘制出相同的信息,尽管它们的实现方式不同。如果你想探索其他语言来完成类似的任务,我强烈建议你看看[Rosetta 代码][55]。这是一个了不起的资源,可以看到如何用多种语言解决同样的问题。 +Python 和 GNU Octave 都可以绘制出相同的信息,尽管它们的实现方式不同。如果你想探索其他语言来完成类似的任务,我强烈建议你看看 [Rosetta Code][55]。这是一个了不起的资源,可以看到如何用多种语言解决同样的问题。 你喜欢用什么语言绘制数据?在评论中分享你的想法。 @@ -626,7 +418,7 @@ via: https://opensource.com/article/20/2/python-gnu-octave-data-science 作者:[Cristiano L. Fontana][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 51190970f87ace21c1516d08ad4baa24ae394979 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 11:48:25 +0800 Subject: [PATCH 039/207] PUB @heguangzhi https://linux.cn/article-11943-1.html --- .../20200220 Using Python and GNU Octave to plot data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200220 Using Python and GNU Octave to plot data.md (99%) diff --git a/translated/tech/20200220 Using Python and GNU Octave to plot data.md b/published/20200220 Using Python and GNU Octave to plot data.md similarity index 99% rename from translated/tech/20200220 Using Python and GNU Octave to plot data.md rename to published/20200220 Using Python and GNU Octave to plot data.md index f0728a32d4..f2f773d67e 100644 --- a/translated/tech/20200220 Using Python and GNU Octave to plot data.md +++ b/published/20200220 Using Python and GNU Octave to plot data.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11943-1.html) [#]: subject: (Using Python and GNU Octave to plot data) [#]: via: (https://opensource.com/article/20/2/python-gnu-octave-data-science) [#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) From 86e28a40ab3652b66b0d68e84bd31e7220c105d1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 29 Feb 2020 12:19:28 +0800 Subject: [PATCH 040/207] Rename sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md to sources/talk/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md --- .../20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md (100%) diff --git a/sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md b/sources/talk/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md similarity index 100% rename from sources/tech/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md rename to sources/talk/20200227 How Melissa Di Donato Is Going To Reinvent SUSE.md From eb022d4afda3b7be570ce9ef6721ca3fff0db9d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 12:29:09 +0800 Subject: [PATCH 041/207] PRF --- .../20200220 Using Python and GNU Octave to plot data.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/published/20200220 Using Python and GNU Octave to plot data.md b/published/20200220 Using Python and GNU Octave to plot data.md index f2f773d67e..5f2b7dba66 100644 --- a/published/20200220 Using Python and GNU Octave to plot data.md +++ b/published/20200220 Using Python and GNU Octave to plot data.md @@ -36,6 +36,8 @@ 这是许多数据科学家遇到的常见情况。示例数据是 [Anscombe 的四重奏][6]的第一组,如下表所示。这是一组人工构建的数据,当用直线拟合时会给出相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,以制表符作为列分隔符,开头几行作为标题。此任务将仅使用第一组(即前两列)。 +![](https://img.linux.net.cn/data/attachment/album/202002/29/122805h3yrs1dkrgysssxk.png) + ### Python 方式 [Python][7] 是一种通用编程语言,是当今最流行的语言之一(依据 [TIOBE 指数][8]、[RedMonk 编程语言排名][9]、[编程语言流行指数][10]、[GitHub Octoverse 状态][11]和其他来源的调查结果)。它是一种[解释型语言][12];因此,源代码由执行该指令的程序读取和评估。它有一个全面的[标准库][13]并且总体上非常好用(我对这最后一句话没有证据;这只是我的拙见)。 @@ -235,7 +237,7 @@ sudo dnf install octave #### 代码注释 -在 Octave 中,你可以用百分比符号(``%`)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 `#`。使用 `#` 的选项允许你编写像 Python 示例一样的特殊注释行,以便直接在命令行上执行脚本。 +在 Octave 中,你可以用百分比符号(`%`)为代码添加注释,如果不需要与 MATLAB 兼容,你也可以使用 `#`。使用 `#` 的选项允许你编写像 Python 示例一样的特殊注释行,以便直接在命令行上执行脚本。 #### 必要的库 From 36acc8122a1f524e3a7d69d373686804504b8525 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 29 Feb 2020 12:31:33 +0800 Subject: [PATCH 042/207] Rename sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md to sources/talk/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md --- ...rs the Game Dev Business With a New Open Source Game Engine.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md (100%) diff --git a/sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md b/sources/talk/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md similarity index 100% rename from sources/tech/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md rename to sources/talk/20200229 Solus Linux Creator Ikey Doherty Enters the Game Dev Business With a New Open Source Game Engine.md From e35b0a7bb23ccfc3130b7067cef0771185db2d2b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 12:50:29 +0800 Subject: [PATCH 043/207] PRF @geekpi --- ... to use byobu to multiplex SSH sessions.md | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md b/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md index 9c871b4840..220223b8ac 100644 --- a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md +++ b/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to use byobu to multiplex SSH sessions) @@ -9,52 +9,55 @@ 如何使用 byobu 复用 SSH 会话 ====== -Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH 连接、断开、重连以及共享访问。 + +> Byobu 能让你在保持会话活跃的情况下维护多个终端窗口,通过 SSH 连接、断开、重连以及共享访问。 + ![Person drinking a hat drink at the computer][1] -[Byobu][2] 是基于文本的窗口管理器和终端多路复用器。它类似于 [GNU Screen][3],但更现代,更直观。它还适用于大多数 Linux、BSD 和 Mac 发行版。 +[Byobu][2] 是基于文本的窗口管理器和终端多路复用器。它类似于 [GNU Screen][3],但更现代、更直观。它还适用于大多数 Linux、BSD 和 Mac 发行版。 -Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH (secure shell)连接、断开、重连,甚至让其他人访问。 +Byobu 能让你在保持会话活跃的情况下维护多个终端窗口、通过 SSH(secure shell)连接、断开、重连,甚至让其他人访问。 -比如,你 SSH 进入树莓派或服务器,并运行(比如) **sudo apt update && sudo apt upgrade**,然后你在它运行的时候失去了互联网连接,你的命令会丢失无效。然而,如果你首先启动 byobu 会话,那么它会继续运行,在你重连后,你会发现它仍在继续运行。 +比如,你 SSH 进入树莓派或服务器,并运行(比如) `sudo apt update && sudo apt upgrade`,然后你在它运行的时候失去了互联网连接,你的命令会丢失无效。然而,如果你首先启动 byobu 会话,那么它会继续运行,在你重连后,你会发现它仍在继续运行。 ![The byobu logo is a fun play on screens.][4] -Byobu 的日语术语是指装饰性多面板屏风,可作为折叠式隔断,我认为这很合适。 +Byobu 名称来自于日语的装饰性多面板屏风,它可作为折叠式隔断,我认为这很合适。 要在 Debian/Raspbian/Ubuntu 上安装 byobu: -**sudo apt install byobu** +``` +sudo apt install byobu +``` -接着启用它 +接着启用它: -**byobu-enable** +``` +byobu-enable +``` -现在,请退出 SSH 会话并重新登录,你将会在 byobu 会话中登录。运行类似 **sudo apt update** 命令并关闭窗口(或输入转义序列([**Enter**+**~**+**.**][5])并重新登录。你将看到更新在你离开后还在运行。 +现在,请退出 SSH 会话并重新登录,你将会在 byobu 会话中登录。运行类似 `sudo apt update` 命令并关闭窗口(或输入转义序列([Enter + ~ + .][5])并重新登录。你将看到更新命令在你离开后还在运行。 -有_很多_我不常使用的功能。我通常使用的是: - - * **F2** – 新窗口 - * **F3/F4** – 在窗口间导航 - * **Ctrl**+**F2** – 垂直拆分窗格 - * **Shift**+**F2** – 水平拆分窗格 - * **Shift**+**左箭头/Shift**+**右箭头** – 在拆分窗格间导航 - * **Shift**+**F11** – 放大(或缩小)拆分窗格 +有*很多*我不常使用的功能。我通常使用的是: + * `F2` – 新窗口 + * `F3/F4` – 在窗口间导航 + * `Ctrl`+`F2` – 垂直拆分窗格 + * `Shift`+`F2` – 水平拆分窗格 + * `Shift`+`左箭头/Shift`+`右箭头` – 在拆分窗格间导航 + * `Shift`+`F11` – 放大(或缩小)拆分窗格 ### 我们如何使用 byobu -Byobu 对于 [piwheels][6](一个用于树莓派的方便的,预编译 Python 包)的维护很方便。我门水平拆分了窗格,在上半部分显示了 piwheels 监视器,在下半部分实时显示了 syslog 条目。接着,如果我们想要做其他事情,我们可以切换到另外一个窗口。当我们进行协作调查时,这特别方便,因为当我在 IRC 中聊天时,我可以看到我的同事 Dave 输入了什么(并纠正他的错字)。 +Byobu 对于维护 [piwheels][6](一个用于树莓派的方便的,预编译 Python 包)很好用。我水平拆分了窗格,在上半部分显示了 piwheels 监视器,在下半部分实时显示了 syslog 条目。接着,如果我们想要做其他事情,我们可以切换到另外一个窗口。当我们进行协作分析时,这特别方便,因为当我在 IRC 中聊天时,我可以看到我的同事 Dave 输入了什么(并纠正他的错字)。 我在家庭和办公服务器上启用了 byobu,因此,当我登录到任何一台计算机时,一切都与我离开时一样。它正在运行多个作业、在特定目录中保留一个窗口,以另一个用户身份运行进程等。 ![byobu screenshot][7] -Byobu 也很方便用于在树莓派上进行开发。你可以在桌面上启动它,运行命令,然后 SSH 进入,并连接到该命令运行所在的会话。请注意,启用 byobu 不会更改终端启动器的功能。只需运行 **byobu** 即可启动它。 +Byobu 对于在树莓派上进行开发也很方便。你可以在桌面上启动它,运行命令,然后 SSH 进入,并连接到该命令运行所在的会话。请注意,启用 byobu 不会更改终端启动器的功能。只需运行 `byobu` 即可启动它。 -* * * - -_本文最初发表在 Ben Nuttall 的 [Tooling blog][8] 中,并获许重用_ +本文最初发表在 Ben Nuttall 的 [Tooling blog][8] 中,并获许重用。 -------------------------------------------------------------------------------- @@ -63,7 +66,7 @@ via: https://opensource.com/article/20/2/byobu-ssh 作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 16b0bee0a9e0fc0ec81bb17196196c14596b4f44 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 29 Feb 2020 12:51:39 +0800 Subject: [PATCH 044/207] PUB @geekpi https://linux.cn/article-11944-1.html --- .../20200212 How to use byobu to multiplex SSH sessions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200212 How to use byobu to multiplex SSH sessions.md (98%) diff --git a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md b/published/20200212 How to use byobu to multiplex SSH sessions.md similarity index 98% rename from translated/tech/20200212 How to use byobu to multiplex SSH sessions.md rename to published/20200212 How to use byobu to multiplex SSH sessions.md index 220223b8ac..061ca4c41a 100644 --- a/translated/tech/20200212 How to use byobu to multiplex SSH sessions.md +++ b/published/20200212 How to use byobu to multiplex SSH sessions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11944-1.html) [#]: subject: (How to use byobu to multiplex SSH sessions) [#]: via: (https://opensource.com/article/20/2/byobu-ssh) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) From 627e8617369fe7b7eafc72c2bb964f9603451574 Mon Sep 17 00:00:00 2001 From: hj24 Date: Sat, 29 Feb 2020 23:21:19 +0800 Subject: [PATCH 045/207] translating by hj24 --- .../20190702 One CI-CD pipeline per product to rule them all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md b/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md index 2a7fcb31de..0fd04ee54a 100644 --- a/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md +++ b/sources/tech/20190702 One CI-CD pipeline per product to rule them all.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hj24) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b727c5df8020aa2589fefa0c525ccae3ea7d5412 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 1 Mar 2020 01:01:31 +0800 Subject: [PATCH 046/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200301=20Rememb?= =?UTF-8?q?er=20Unity8=20from=20Ubuntu=3F=20UBports=20is=20Renaming=20it?= =?UTF-8?q?=20to=20Lomiri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md --- ...buntu- UBports is Renaming it to Lomiri.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md diff --git a/sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md b/sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md new file mode 100644 index 0000000000..7badbfc8a2 --- /dev/null +++ b/sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Remember Unity8 from Ubuntu? UBports is Renaming it to Lomiri) +[#]: via: (https://itsfoss.com/unity8-lomiri/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Remember Unity8 from Ubuntu? UBports is Renaming it to Lomiri +====== + +Ever since Ubuntu abandoned the Unity project, UBports continued the maintenance and development of Unity. On February 27th 2020, [UBports][1] announced that they are giving Unity8 a new branding in the form of Lomiri. + +### Unity8 is now Lomiri + +![Unity8 in action | Image Credit: UBports][2] + +[UBports announced][3] that the Unity8 desktop environment would be renamed as Lomiri. They gave three reasons for this fairly drastic announcement. + +First, they want to avoid confusion with the [Unity game engine][4]. Quite a few people confused the two. UBports noted that they are frequently receiving questions regarding “how to import 3D models and meshes into our shell”. When you search “Unity” in your favorite search engine, most of the top links are for the game engine. + +The second reason for the name change has to do with the new effort to package Unity8 for Debian. Unfortunately, many of the Unity8’s dependencies have Ubuntu in the name, for example, _**ubuntu-ui-toolkit**_. Debian packagers warned that packages that have Ubuntu in the name may not be accepted into [Debian][5]. + +Finally, UBports said the name change would improve verbal communications. Saying Unity8 repeatedly can be a mouthful. People would not have to worry about confusing “users of Ubuntu Unity and Unity (the game engine)”. + +UBports went on to stress that the name change was not “triggered by any action from Canonical or the Ubuntu community, legal or otherwise”. + +They noted that this name change was the perfect time for them to switch to [GitHub alternative GitLab][6] for their development. + +Interestingly, the announcement did not explain how they picked Lomiri as the new name. All they said is that “We went through many different names before settling on Lomiri. All of them had problems with pronunciation, availability, or other related issues.” + +UBports noted that most Ubuntu Touch users would be unaffected by the name change. Developers and power users might notice some changes, but UBports “will strive to maintain backwards compatibility within Ubuntu Touch for the foreseeable future”. + +### What Exactly is Being Renamed? + +![][7] + +According to the announcement, packages that have either Ubuntu or Unity in the title will be affected. For example, + + * **unity8**, containing the shell, will become **lomiri** + * **ubuntu-ui-toolkit** will become **lomiri-ui-toolkit** + * **ubuntu-download-manager** will become **lomiri-download-manager** + + + +On top of this, interfaces call will change, as well. “For example, the **Ubuntu.Components** QML import will change to **Lomiri.Components**.” For the sake of backwards compatibility, Ubuntu Touch images will not change too much. “Developers will only need to update to the new API when they’d like to package their apps for other distributions.” + +### What Will Stay the Same? + +Since renaming packages can cause quite a few cascading problems, UBports wants to limit the number of packages they change. They don’t expect the following things to change. + + * Packages that don’t use the “Ubuntu” or “Unity” names + * Ubuntu Touch will remain the same + * Any components which are already used by other projects and accepted into other distributions + + + +### Final Thoughts + +![][8] + +Overall, I think this change will be good for Ubuntu Touch in the long run. I understand why [Canonical][9] picked the Unity name for their convergence desktop, but I think the desktop environment was overshadowed by the game engine from the beginning. This will give them room to breathe and also free up valuable coding time. The less time spent replying to questions about 3D models the more time that can be spent creating a convergent desktop. + +If you have any further questions or concerns about the name change, you visit the [UBports forms][10]. They have set up a thread specifically for this topic. + +Don’t hesitate to share our views on it in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/unity8-lomiri/ + +作者:[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://ubports.com/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/unity8_ubports.png?ssl=1 +[3]: https://ubports.com/blog/ubports-blog-1/post/lomiri-new-name-same-great-unity8-265 +[4]: https://en.wikipedia.org/wiki/Unity_(game_engine) +[5]: https://www.debian.org/ +[6]: https://itsfoss.com/github-alternatives/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/Unity8-lomiri.png?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/ubports.jpeg?ssl=1 +[9]: https://canonical.com/ +[10]: https://forums.ubports.com/topic/3874/unity8-is-now-lomiri From 80a007676b6f09812f1ed41cb99d8fe3231ab5d5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 1 Mar 2020 09:26:05 +0800 Subject: [PATCH 047/207] Rename sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md to sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md --- ...member Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md (100%) diff --git a/sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md b/sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md similarity index 100% rename from sources/tech/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md rename to sources/news/20200301 Remember Unity8 from Ubuntu- UBports is Renaming it to Lomiri.md From 58c05ae5709820e9091d40d901b605ea057e0f8e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 11:29:25 +0800 Subject: [PATCH 048/207] PRF @chenmu-kk --- .../20190113 Editing Subtitles in Linux.md | 146 +++++++++++++----- 1 file changed, 107 insertions(+), 39 deletions(-) diff --git a/translated/tech/20190113 Editing Subtitles in Linux.md b/translated/tech/20190113 Editing Subtitles in Linux.md index 84f299fbf4..24d66c4ad7 100644 --- a/translated/tech/20190113 Editing Subtitles in Linux.md +++ b/translated/tech/20190113 Editing Subtitles in Linux.md @@ -1,13 +1,13 @@ [#]: collector: (lujun9972) -[#]: translator: (chenmu-kk ) -[#]: reviewer: ( ) +[#]: translator: (chenmu-kk) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Editing Subtitles in Linux) [#]: via: (https://itsfoss.com/editing-subtitles) [#]: author: (Shirish https://itsfoss.com/author/shirish/) -在 Linux 中编辑字幕 +如何在 Linux 中编辑字幕 ====== 我作为一位世界电影和地区电影爱好者已经几十年了。这期间字幕是一个必不可少的工具,它可以使我享受来自不同国家不同语言的优秀电影。 @@ -20,15 +20,15 @@ ### 从闭路字幕数据中提取字幕 -大概在 2012,2013 年我开始了解到有一款叫做 [CCEextractor][2] 的工具。随着时间的推移,它已经成为我必不可少的工具之一 ,尤其是当我偶然发现一份内含有字幕的媒体文件。 +大概在 2012、2013 年我开始了解到有一款叫做 [CCEextractor][2] 的工具。随着时间的推移,它已经成为我必不可少的工具之一,尤其是当我偶然发现一份内含有字幕的媒体文件。 - CCExtractor 负责解析视频文件以及从闭路字幕数据中产生独立的字幕文件。 +CCExtractor 负责解析视频文件以及从闭路字幕closed captions数据中产生独立的字幕文件。 - CCExtractor 是一个跨平台、免费且开源的工具。自它形成的那年起该工具已经成熟了不少而如今已成为 [GSOC][3] 和谷歌编码输入的一部分。 +CCExtractor 是一个跨平台的、自由开源工具。自它形成的那年起该工具已经成熟了不少而如今已成为 [GSOC][3] 和谷歌编码输入的一部分。 -简单来说,这个工具是一系列或多或少的脚本,这些脚本以一种连续的顺序一个接着一个地给你提供提取到的字幕。 +简单来说,这个工具基本上是一系列脚本,这些脚本以一种顺序方式一个接着一个地给你提供提取到的字幕。 -你可以按照 [本页][5] 的 CCExtractor 安装指南进行操作。 +你可以按照[本页][5]的 CCExtractor 安装指南进行操作。 若安装后你想从媒体文件中提取字幕,请按以下步骤操作: @@ -38,13 +38,70 @@ ccextractor 该命令将会输出以下内容: -它会大致浏览媒体文件。在这个例子中,它发现媒体文件是马拉雅拉姆文并且格式是 .mkv[6] 。之后它将字幕文件提取出来,命名为源文件名并添加“_eng”后缀。 - - CCExtractor 是一款用来增强字幕功能和字幕编辑的优秀工具,我将在下一部分对它进行介绍。 - ``` -趣味阅读:在 [vicaps][7] 有一份有趣的字幕简介,会讲解和分享为何字幕对我们如此重要。对于那些对这类话题感兴趣的人来说,这里面也有许多电影制作的细节。 +$ ccextractor $something.mkv +CCExtractor 0.87, Carlos Fernandez Sanz, Volker Quetschke. +Teletext portions taken from Petr Kutalek's telxcc +-------------------------------------------------------------------------- +Input: $something.mkv +[Extract: 1] [Stream mode: Autodetect] +[Program : Auto ] [Hauppage mode: No] [Use MythTV code: Auto] +[Timing mode: Auto] [Debug: No] [Buffer input: No] +[Use pic_order_cnt_lsb for H.264: No] [Print CC decoder traces: No] +[Target format: .srt] [Encoding: UTF-8] [Delay: 0] [Trim lines: No] +[Add font color data: Yes] [Add font typesetting: Yes] +[Convert case: No] [Video-edit join: No] +[Extraction start time: not set (from start)] +[Extraction end time: not set (to end)] +[Live stream: No] [Clock frequency: 90000] +[Teletext page: Autodetect] +[Start credits text: None] +[Quantisation-mode: CCExtractor's internal function] +----------------------------------------------------------------- +Opening file: $something.mkv +File seems to be a Matroska/WebM container +Analyzing data in Matroska mode + +Document type: matroska +Timecode scale: 1000000 +Muxing app: libebml v1.3.1 + libmatroska v1.4.2 +Writing app: mkvmerge v8.2.0 ('World of Adventure') 64bit +Title: $something + +Track entry: + Track number: 1 + UID: 1 + Type: video + Codec ID: V_MPEG4/ISO/AVC + Language: mal + Name: $something + +Track entry: + Track number: 2 + UID: 2 + Type: audio + Codec ID: A_MPEG/L3 + Language: mal + Name: $something + +Track entry: + Track number: 3 + UID: somenumber + Type: subtitle + Codec ID: S_TEXT/UTF8 + Name: $something + 99% | 144:34 +100% | 144:34 +Output file: $something_eng.srt +Done, processing time = 6 seconds +Issues? Open a ticket here +https://github.com/CCExtractor/ccextractor/issues ``` +它会大致浏览媒体文件。在这个例子中,它发现该媒体文件是马拉雅拉姆语言(mal)并且格式是 [.mkv][6]。之后它将字幕文件提取出来,命名为源文件名并添加“_eng”后缀。 + +CCExtractor 是一款用来增强字幕功能和字幕编辑的优秀工具,我将在下一部分对它进行介绍。 + +> 趣味阅读:在 [vicaps][7] 有一份有趣的字幕提要,它讲解和分享为何字幕对我们如此重要。对于那些对这类话题感兴趣的人来说,这里面也有许多电影制作的细节。 ### 用 SubtitleEditor 工具编辑字幕 @@ -52,9 +109,22 @@ ccextractor 当进入一个简单的文本编辑器时,一个 srt 文件看起来会是这个样子: -我分享的节选字幕来自于一部非常老的德国电影 [卡里加里博士的小屋 (1920)][9] 。 +``` +1 +00:00:00,959 --> 00:00:13,744 +"THE CABINET +OF DR. CALIGARI" - Subtitleeditor 是一款非常棒的字幕编辑软件。字幕编辑器可以用来设置字幕持续时间、与多媒体文件同步的字幕帧率以及字幕间隔时间等等。接下来我将在这分享一些基本的字幕编辑。 +2 +00:00:40,084 --> 00:01:02,088 +A TALE of the modern re-appearance of an 11th Century Myth +involting the strange and mysterious influence +of a mountebank monk over a somnambulist. +``` + +我分享的节选字幕来自于一部非常老的德国电影《[卡里加里博士的小屋][9]》(1920)。 + +Subtitleeditor 是一款非常棒的字幕编辑软件。字幕编辑器可以用来设置字幕持续时间、与多媒体文件同步的字幕帧率以及字幕间隔时间等等。接下来我将在这分享一些基本的字幕编辑。 ![][10] @@ -70,35 +140,33 @@ sudo apt install subtitleeditor 如果你发现字幕与视频不同步,一个原因可能是视频文件的帧率与字幕文件的帧率并不一致。 -你如何得知这些文件的帧率呢,然后呢? +你如何得知这些文件的帧率呢,然后呢?为了获取视频文件的帧率,你可以使用 `mediainfo` 工具。首先你可能需要发行版的包管理器来安装它。 -为了获取视频文件的帧率,你可以使用 mediainfo 工具。首先你可能需要发行版的包管理器来安装它。 - -使用 mediainfo 非常得简单: +使用 `mediainfo` 非常简单: ``` $ mediainfo somefile.mkv | grep Frame - Format settings : CABAC / 4 Ref Frames - Format settings, ReFrames : 4 frames - Frame rate mode : Constant - Frame rate : 25.000 FPS - Bits/(Pixel*Frame) : 0.082 - Frame rate : 46.875 FPS (1024 SPF) + Format settings : CABAC / 4 Ref Frames + Format settings, ReFrames : 4 frames + Frame rate mode : Constant + Frame rate : 25.000 FPS + Bits/(Pixel*Frame) : 0.082 + Frame rate : 46.875 FPS (1024 SPF) ``` -现在你可以看到视频文件的帧率是 25.000 FPS 。我们看到的另一个帧率则是音频文件的帧率。虽然我会分享为何在视频解码和音频解码等地方会使用特定的 fps ,但这将会是一个不同的主题,与它相关的历史有很多。 +现在你可以看到视频文件的帧率是 25.000 FPS 。我们看到的另一个帧率则是音频文件的帧率。虽然我可以分享为何在视频解码和音频解码等地方会使用特定的 fps,但这将会是一个不同的主题,与它相关的历史信息有很多。 下一个问题是解决字幕文件的帧率,这个稍微有点复杂。 -通常情况下,大多数字幕都是压缩格式的。将.zip归档文件和字幕文件(以 XXX.srt 结尾)一起解压缩。除此之外,通常还会有一个同名的 .info 文件,该文件可能包含字幕的帧率。 +通常情况下,大多数字幕都是压缩格式的。将.zip 归档文件和字幕文件(以 XXX.srt 结尾)一起解压缩。除此之外,通常还会有一个同名的 .info 文件,该文件可能包含字幕的帧率。 -如果不是,那么通常最好去某个站点并从具有该帧速率信息的站点下载字幕。对于这个特定的德文文件,我将使用 [Opensubtitle.org][11] 。 +如果不是,那么通常最好去某个站点并从具有该帧速率信息的站点下载字幕。对于这个特定的德文文件,我使用 [Opensubtitle.org][11] 来找到它。 -正如你在链接中所看到的,字幕的帧率是 23.976 FPS 。将我的视频文件以 25.000 FPS 的帧率进行播放,显而易见结果并不好。 +正如你在链接中所看到的,字幕的帧率是 23.976 FPS 。很明显,它不能与帧率为 25.000 FPS 的视频文件一起很好地播放。 -在这种情况下,你可以使用字幕编辑工具来改变字幕文件的帧率: +在这种情况下,你可以使用字幕编辑工具来改变字幕文件的帧率。 -按下 CTRL+A 选择字幕文件中的全部内容。点击 Timings -> Change Framerate ,将 23.976 fps 改为 25.000 fps 或者你想要的其他帧率,保存已更改的文件。 +按下 `CTRL+A` 选择字幕文件中的全部内容。点击 “Timings -> Change Framerate” ,将 23.976 fps 改为 25.000 fps 或者你想要的其他帧率,保存已更改的文件。 ![synchronize frame rates of subtitles in Linux][12] @@ -110,7 +178,7 @@ $ mediainfo somefile.mkv | grep Frame 在这种情况下,请按以下步骤进行操作: -按下 CTRL+A 键选中字幕文件的全部内容。点击 Timings -> 选择 Move Subtitle 。 +按下 `CTRL+A` 键选中字幕文件的全部内容。点击 “Timings -> Select Move Subtitle” 。 ![Move subtitles using Subtitle Editor on Linux][13] @@ -118,17 +186,17 @@ $ mediainfo somefile.mkv | grep Frame ![Move subtitles using Subtitle Editor in Linux][14] -如果你想要时间更精确一点,那么可以使用 [mpv][15] 来查看电影或者媒体文件并点击 timing ,如果你点击了进度条(可以显示电影或者媒体文件的播放进度),它也会显示微秒。 +如果你想要时间更精确一点,那么可以使用 [mpv][15] 来查看电影或者媒体文件并点击进度条(可以显示电影或者媒体文件的播放进度),它也会显示微秒。 -通常我喜欢精准无误的操作,因此我会试着尽可能地仔细调节。相较于人类的反应时间来说,MPV中的反应时间很精确。如果我想要极其精确的时间,那么我可以使用像 [Audacity][16] 之类的东西,但是那是另一种工具,你可以在上面做更多的事情。那也将会是我未来博客中将要探讨的东西。 +通常我喜欢精准无误的操作,因此我会试着尽可能地仔细调节。相较于人类的反应时间来说,MPV 中的反应时间很精确。如果我想要极其精确的时间,那么我可以使用像 [Audacity][16] 之类的东西,但是那是另一种工具,你可以在上面做更多的事情。那也将会是我未来博客中将要探讨的东西。 #### 调整字幕间隔时间 -有时,两种方法都采用了还不够,甚至你可能需要缩短或曾加间隔时间以使其与媒体文件同步。这是较为繁琐的工作之一,因为你必须单独确定每个句子的间隔时间。尤其是在媒体文件中帧率可变的情况下(现已很少见,但你仍然会得到此类文件) +有时,两种方法都采用了还不够,甚至你可能需要缩短或增加间隔时间以使其与媒体文件同步。这是较为繁琐的工作之一,因为你必须单独确定每个句子的间隔时间。尤其是在媒体文件中帧率可变的情况下(现已很少见,但你仍然会得到此类文件) -在这种设想下,你可能因为无法实现自动编辑而不得不手动的修改间隔时间。最好的方式是修改视频文件(会降低视频质量)或者换另一个更高质量的片源,用你喜欢的设置对它进行 [转码][17] 。这又是一重大任务,以后我会在我的一些博客文章上阐明。 +在这种设想下,你可能因为无法实现自动编辑而不得不手动的修改间隔时间。最好的方式是修改视频文件(会降低视频质量)或者换另一个更高质量的片源,用你喜欢的设置对它进行[转码][17] 。这又是一重大任务,以后我会在我的一些博客文章上阐明。 -### 结论 +### 总结 以上我分享的内容或多或少是对现有字幕文件的改进。如果从头开始,你需要花费大量的时间。我完全没有分享这一点,因为一部电影或一个小时内的任何视频材料都可以轻易地花费 4-6 个小时,甚至更多的时间,这取决于字幕员的技巧、耐心、上下文、行话、口音、是否是以英语为母语的人、翻译等,所有的这些都会对字幕的质量产生影响。 @@ -140,8 +208,8 @@ via: https://itsfoss.com/editing-subtitles 作者:[Shirish][a] 选题:[lujun9972][b] -译者:[chenmu-kk](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[chenmu-kk](https://github.com/chenmu-kk) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7fc1cf392abba3e988c8dfadc25f7e4f9e4e7b0a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 11:35:25 +0800 Subject: [PATCH 049/207] PUB @chenmu-kk https://linux.cn/article-11946-1.html --- .../tech => published}/20190113 Editing Subtitles in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190113 Editing Subtitles in Linux.md (99%) diff --git a/translated/tech/20190113 Editing Subtitles in Linux.md b/published/20190113 Editing Subtitles in Linux.md similarity index 99% rename from translated/tech/20190113 Editing Subtitles in Linux.md rename to published/20190113 Editing Subtitles in Linux.md index 24d66c4ad7..fe3a66da99 100644 --- a/translated/tech/20190113 Editing Subtitles in Linux.md +++ b/published/20190113 Editing Subtitles in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chenmu-kk) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11946-1.html) [#]: subject: (Editing Subtitles in Linux) [#]: via: (https://itsfoss.com/editing-subtitles) [#]: author: (Shirish https://itsfoss.com/author/shirish/) From 8b0f8fff024f98d228f21bc33485e2d222c4ed7f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 11:36:50 +0800 Subject: [PATCH 050/207] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202002?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ur components of a distributed tracing system work together.md | 0 .../20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md | 0 .../20190114 Some Advice for How to Make Emacs Tetris Harder.md | 0 ...ing files on Linux- the many variations and how to use them.md | 0 ...190322 12 open source tools for natural language processing.md | 0 .../{ => 202002}/20190407 Manage multimedia files with Git.md | 0 .../20190729 How to structure a multi-file C program- Part 1.md | 0 .../20191022 How to Go About Linux Boot Time Optimisation.md | 0 ...id -words- Handle Chromium - Firefox sessions with org-mode.md | 0 .../20191225 8 Commands to Check Memory Usage on Linux.md | 0 .../20191227 Top CI-CD resources to set you up for success.md | 0 .../20200102 Data streaming and functional programming in Java.md | 0 .../{ => 202002}/20200103 Add scorekeeping to your Python game.md | 0 published/{ => 202002}/20200109 My favorite Bash hacks.md | 0 .../{ => 202002}/20200109 What-s HTTPS for secure computing.md | 0 .../20200112 What I learned going from prison to Python.md | 0 ...00117 Use this Python script to find bugs in your Overcloud.md | 0 ... Keep a journal of your activities with this Python program.md | 0 ...w to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md | 0 .../20200119 One open source chat tool to rule them all.md | 0 ...se this Twitter client for Linux to tweet from the terminal.md | 0 .../{ => 202002}/20200121 Read Reddit from the Linux terminal.md | 0 ... feeds and podcasts in one place with this open source tool.md | 0 ... Screenshot your Linux system configuration with Bash tools.md | 0 .../{ => 202002}/20200123 How to stop typosquatting attacks.md | 0 ...se this open source tool to get your local weather forecast.md | 0 .../20200124 3 handy command-line internet speed tests.md | 0 ...e consoles at once with this open source window environment.md | 0 .../20200125 Use tmux to create the console of your dreams.md | 0 .../20200126 Use Vim to send email and check your calendar.md | 0 .../20200126 What-s your favorite Linux distribution.md | 0 ... Vim to manage your task list and access Reddit and Twitter.md | 0 .../20200128 Send email and check your calendar with Emacs.md | 0 ...0200129 4 cool new projects to try in COPR for January 2020.md | 0 .../20200129 Joplin- The True Open Source Evernote Alternative.md | 0 .../20200129 Showing memory usage in Linux by process and user.md | 0 .../20200130 Meet FuryBSD- A New Desktop BSD Distribution.md | 0 .../{ => 202002}/20200131 Intro to the Linux command line.md | 0 .../20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md | 0 .../20200203 Give an old MacBook new life with Linux.md | 0 ... Troubleshoot Kubernetes with the power of tmux and kubectl.md | 0 ...ed End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md | 0 published/{ => 202002}/20200205 Getting started with GnuCash.md | 0 .../{ => 202002}/20200206 3 ways to use PostgreSQL commands.md | 0 ...ource eCommerce Platforms to Build Online Shopping Websites.md | 0 ...0200207 Connect Fedora to your Android phone with GSConnect.md | 0 ...7 Customize your internet with an open source search engine.md | 0 ... Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md | 0 ...0207 What is WireGuard- Why Linux Users Going Crazy Over it.md | 0 ...a Codecs in Ubuntu With This Single Command -Beginner-s Tip.md | 0 ... Playing Music on your Fedora Terminal with MPD and ncmpcpp.md | 0 .../20200210 Scan Kubernetes for errors with KRAWL.md | 0 .../20200210 Top hacks for the YaCy open source search engine.md | 0 .../20200211 Dino is a Modern Looking Open Source XMPP Client.md | 0 .../20200212 How to Change the Default Terminal in Ubuntu.md | 0 .../20200212 How to use byobu to multiplex SSH sessions.md | 0 ...re You Can Buy Open Source Apps for Your Linux Distribution.md | 0 .../{ => 202002}/20200213 Why developers like to code at night.md | 0 ...20200214 Digging up IP addresses with the Linux dig command.md | 0 .../{ => 202002}/20200217 How to get MongoDB Server on Fedora.md | 0 published/{ => 202002}/20200217 How to install Vim plugins.md | 0 published/{ => 202002}/20200219 Don-t like IDEs- Try grepgitvi.md | 0 ...19 How Kubernetes Became the Standard for Compute Resources.md | 0 .../20200219 How to Install Latest Git Version on Ubuntu.md | 0 .../20200220 Using Python and GNU Octave to plot data.md | 0 65 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202002}/20180503 How the four components of a distributed tracing system work together.md (100%) rename published/{ => 202002}/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md (100%) rename published/{ => 202002}/20190114 Some Advice for How to Make Emacs Tetris Harder.md (100%) rename published/{ => 202002}/20190116 Zipping files on Linux- the many variations and how to use them.md (100%) rename published/{ => 202002}/20190322 12 open source tools for natural language processing.md (100%) rename published/{ => 202002}/20190407 Manage multimedia files with Git.md (100%) rename published/{ => 202002}/20190729 How to structure a multi-file C program- Part 1.md (100%) rename published/{ => 202002}/20191022 How to Go About Linux Boot Time Optimisation.md (100%) rename published/{ => 202002}/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md (100%) rename published/{ => 202002}/20191225 8 Commands to Check Memory Usage on Linux.md (100%) rename published/{ => 202002}/20191227 Top CI-CD resources to set you up for success.md (100%) rename published/{ => 202002}/20200102 Data streaming and functional programming in Java.md (100%) rename published/{ => 202002}/20200103 Add scorekeeping to your Python game.md (100%) rename published/{ => 202002}/20200109 My favorite Bash hacks.md (100%) rename published/{ => 202002}/20200109 What-s HTTPS for secure computing.md (100%) rename published/{ => 202002}/20200112 What I learned going from prison to Python.md (100%) rename published/{ => 202002}/20200117 Use this Python script to find bugs in your Overcloud.md (100%) rename published/{ => 202002}/20200118 Keep a journal of your activities with this Python program.md (100%) rename published/{ => 202002}/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md (100%) rename published/{ => 202002}/20200119 One open source chat tool to rule them all.md (100%) rename published/{ => 202002}/20200120 Use this Twitter client for Linux to tweet from the terminal.md (100%) rename published/{ => 202002}/20200121 Read Reddit from the Linux terminal.md (100%) rename published/{ => 202002}/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md (100%) rename published/{ => 202002}/20200122 Screenshot your Linux system configuration with Bash tools.md (100%) rename published/{ => 202002}/20200123 How to stop typosquatting attacks.md (100%) rename published/{ => 202002}/20200123 Use this open source tool to get your local weather forecast.md (100%) rename published/{ => 202002}/20200124 3 handy command-line internet speed tests.md (100%) rename published/{ => 202002}/20200124 Run multiple consoles at once with this open source window environment.md (100%) rename published/{ => 202002}/20200125 Use tmux to create the console of your dreams.md (100%) rename published/{ => 202002}/20200126 Use Vim to send email and check your calendar.md (100%) rename published/{ => 202002}/20200126 What-s your favorite Linux distribution.md (100%) rename published/{ => 202002}/20200127 Use Vim to manage your task list and access Reddit and Twitter.md (100%) rename published/{ => 202002}/20200128 Send email and check your calendar with Emacs.md (100%) rename published/{ => 202002}/20200129 4 cool new projects to try in COPR for January 2020.md (100%) rename published/{ => 202002}/20200129 Joplin- The True Open Source Evernote Alternative.md (100%) rename published/{ => 202002}/20200129 Showing memory usage in Linux by process and user.md (100%) rename published/{ => 202002}/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md (100%) rename published/{ => 202002}/20200131 Intro to the Linux command line.md (100%) rename published/{ => 202002}/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md (100%) rename published/{ => 202002}/20200203 Give an old MacBook new life with Linux.md (100%) rename published/{ => 202002}/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md (100%) rename published/{ => 202002}/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md (100%) rename published/{ => 202002}/20200205 Getting started with GnuCash.md (100%) rename published/{ => 202002}/20200206 3 ways to use PostgreSQL commands.md (100%) rename published/{ => 202002}/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md (100%) rename published/{ => 202002}/20200207 Connect Fedora to your Android phone with GSConnect.md (100%) rename published/{ => 202002}/20200207 Customize your internet with an open source search engine.md (100%) rename published/{ => 202002}/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md (100%) rename published/{ => 202002}/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md (100%) rename published/{ => 202002}/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md (100%) rename published/{ => 202002}/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md (100%) rename published/{ => 202002}/20200210 Scan Kubernetes for errors with KRAWL.md (100%) rename published/{ => 202002}/20200210 Top hacks for the YaCy open source search engine.md (100%) rename published/{ => 202002}/20200211 Dino is a Modern Looking Open Source XMPP Client.md (100%) rename published/{ => 202002}/20200212 How to Change the Default Terminal in Ubuntu.md (100%) rename published/{ => 202002}/20200212 How to use byobu to multiplex SSH sessions.md (100%) rename published/{ => 202002}/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md (100%) rename published/{ => 202002}/20200213 Why developers like to code at night.md (100%) rename published/{ => 202002}/20200214 Digging up IP addresses with the Linux dig command.md (100%) rename published/{ => 202002}/20200217 How to get MongoDB Server on Fedora.md (100%) rename published/{ => 202002}/20200217 How to install Vim plugins.md (100%) rename published/{ => 202002}/20200219 Don-t like IDEs- Try grepgitvi.md (100%) rename published/{ => 202002}/20200219 How Kubernetes Became the Standard for Compute Resources.md (100%) rename published/{ => 202002}/20200219 How to Install Latest Git Version on Ubuntu.md (100%) rename published/{ => 202002}/20200220 Using Python and GNU Octave to plot data.md (100%) diff --git a/published/20180503 How the four components of a distributed tracing system work together.md b/published/202002/20180503 How the four components of a distributed tracing system work together.md similarity index 100% rename from published/20180503 How the four components of a distributed tracing system work together.md rename to published/202002/20180503 How the four components of a distributed tracing system work together.md diff --git a/published/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md b/published/202002/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md similarity index 100% rename from published/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md rename to published/202002/20180511 MidnightBSD Could Be Your Gateway to FreeBSD.md diff --git a/published/20190114 Some Advice for How to Make Emacs Tetris Harder.md b/published/202002/20190114 Some Advice for How to Make Emacs Tetris Harder.md similarity index 100% rename from published/20190114 Some Advice for How to Make Emacs Tetris Harder.md rename to published/202002/20190114 Some Advice for How to Make Emacs Tetris Harder.md diff --git a/published/20190116 Zipping files on Linux- the many variations and how to use them.md b/published/202002/20190116 Zipping files on Linux- the many variations and how to use them.md similarity index 100% rename from published/20190116 Zipping files on Linux- the many variations and how to use them.md rename to published/202002/20190116 Zipping files on Linux- the many variations and how to use them.md diff --git a/published/20190322 12 open source tools for natural language processing.md b/published/202002/20190322 12 open source tools for natural language processing.md similarity index 100% rename from published/20190322 12 open source tools for natural language processing.md rename to published/202002/20190322 12 open source tools for natural language processing.md diff --git a/published/20190407 Manage multimedia files with Git.md b/published/202002/20190407 Manage multimedia files with Git.md similarity index 100% rename from published/20190407 Manage multimedia files with Git.md rename to published/202002/20190407 Manage multimedia files with Git.md diff --git a/published/20190729 How to structure a multi-file C program- Part 1.md b/published/202002/20190729 How to structure a multi-file C program- Part 1.md similarity index 100% rename from published/20190729 How to structure a multi-file C program- Part 1.md rename to published/202002/20190729 How to structure a multi-file C program- Part 1.md diff --git a/published/20191022 How to Go About Linux Boot Time Optimisation.md b/published/202002/20191022 How to Go About Linux Boot Time Optimisation.md similarity index 100% rename from published/20191022 How to Go About Linux Boot Time Optimisation.md rename to published/202002/20191022 How to Go About Linux Boot Time Optimisation.md diff --git a/published/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md b/published/202002/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md similarity index 100% rename from published/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md rename to published/202002/20191204 --acid -words- Handle Chromium - Firefox sessions with org-mode.md diff --git a/published/20191225 8 Commands to Check Memory Usage on Linux.md b/published/202002/20191225 8 Commands to Check Memory Usage on Linux.md similarity index 100% rename from published/20191225 8 Commands to Check Memory Usage on Linux.md rename to published/202002/20191225 8 Commands to Check Memory Usage on Linux.md diff --git a/published/20191227 Top CI-CD resources to set you up for success.md b/published/202002/20191227 Top CI-CD resources to set you up for success.md similarity index 100% rename from published/20191227 Top CI-CD resources to set you up for success.md rename to published/202002/20191227 Top CI-CD resources to set you up for success.md diff --git a/published/20200102 Data streaming and functional programming in Java.md b/published/202002/20200102 Data streaming and functional programming in Java.md similarity index 100% rename from published/20200102 Data streaming and functional programming in Java.md rename to published/202002/20200102 Data streaming and functional programming in Java.md diff --git a/published/20200103 Add scorekeeping to your Python game.md b/published/202002/20200103 Add scorekeeping to your Python game.md similarity index 100% rename from published/20200103 Add scorekeeping to your Python game.md rename to published/202002/20200103 Add scorekeeping to your Python game.md diff --git a/published/20200109 My favorite Bash hacks.md b/published/202002/20200109 My favorite Bash hacks.md similarity index 100% rename from published/20200109 My favorite Bash hacks.md rename to published/202002/20200109 My favorite Bash hacks.md diff --git a/published/20200109 What-s HTTPS for secure computing.md b/published/202002/20200109 What-s HTTPS for secure computing.md similarity index 100% rename from published/20200109 What-s HTTPS for secure computing.md rename to published/202002/20200109 What-s HTTPS for secure computing.md diff --git a/published/20200112 What I learned going from prison to Python.md b/published/202002/20200112 What I learned going from prison to Python.md similarity index 100% rename from published/20200112 What I learned going from prison to Python.md rename to published/202002/20200112 What I learned going from prison to Python.md diff --git a/published/20200117 Use this Python script to find bugs in your Overcloud.md b/published/202002/20200117 Use this Python script to find bugs in your Overcloud.md similarity index 100% rename from published/20200117 Use this Python script to find bugs in your Overcloud.md rename to published/202002/20200117 Use this Python script to find bugs in your Overcloud.md diff --git a/published/20200118 Keep a journal of your activities with this Python program.md b/published/202002/20200118 Keep a journal of your activities with this Python program.md similarity index 100% rename from published/20200118 Keep a journal of your activities with this Python program.md rename to published/202002/20200118 Keep a journal of your activities with this Python program.md diff --git a/published/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md b/published/202002/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md similarity index 100% rename from published/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md rename to published/202002/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md diff --git a/published/20200119 One open source chat tool to rule them all.md b/published/202002/20200119 One open source chat tool to rule them all.md similarity index 100% rename from published/20200119 One open source chat tool to rule them all.md rename to published/202002/20200119 One open source chat tool to rule them all.md diff --git a/published/20200120 Use this Twitter client for Linux to tweet from the terminal.md b/published/202002/20200120 Use this Twitter client for Linux to tweet from the terminal.md similarity index 100% rename from published/20200120 Use this Twitter client for Linux to tweet from the terminal.md rename to published/202002/20200120 Use this Twitter client for Linux to tweet from the terminal.md diff --git a/published/20200121 Read Reddit from the Linux terminal.md b/published/202002/20200121 Read Reddit from the Linux terminal.md similarity index 100% rename from published/20200121 Read Reddit from the Linux terminal.md rename to published/202002/20200121 Read Reddit from the Linux terminal.md diff --git a/published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md b/published/202002/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md similarity index 100% rename from published/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md rename to published/202002/20200122 Get your RSS feeds and podcasts in one place with this open source tool.md diff --git a/published/20200122 Screenshot your Linux system configuration with Bash tools.md b/published/202002/20200122 Screenshot your Linux system configuration with Bash tools.md similarity index 100% rename from published/20200122 Screenshot your Linux system configuration with Bash tools.md rename to published/202002/20200122 Screenshot your Linux system configuration with Bash tools.md diff --git a/published/20200123 How to stop typosquatting attacks.md b/published/202002/20200123 How to stop typosquatting attacks.md similarity index 100% rename from published/20200123 How to stop typosquatting attacks.md rename to published/202002/20200123 How to stop typosquatting attacks.md diff --git a/published/20200123 Use this open source tool to get your local weather forecast.md b/published/202002/20200123 Use this open source tool to get your local weather forecast.md similarity index 100% rename from published/20200123 Use this open source tool to get your local weather forecast.md rename to published/202002/20200123 Use this open source tool to get your local weather forecast.md diff --git a/published/20200124 3 handy command-line internet speed tests.md b/published/202002/20200124 3 handy command-line internet speed tests.md similarity index 100% rename from published/20200124 3 handy command-line internet speed tests.md rename to published/202002/20200124 3 handy command-line internet speed tests.md diff --git a/published/20200124 Run multiple consoles at once with this open source window environment.md b/published/202002/20200124 Run multiple consoles at once with this open source window environment.md similarity index 100% rename from published/20200124 Run multiple consoles at once with this open source window environment.md rename to published/202002/20200124 Run multiple consoles at once with this open source window environment.md diff --git a/published/20200125 Use tmux to create the console of your dreams.md b/published/202002/20200125 Use tmux to create the console of your dreams.md similarity index 100% rename from published/20200125 Use tmux to create the console of your dreams.md rename to published/202002/20200125 Use tmux to create the console of your dreams.md diff --git a/published/20200126 Use Vim to send email and check your calendar.md b/published/202002/20200126 Use Vim to send email and check your calendar.md similarity index 100% rename from published/20200126 Use Vim to send email and check your calendar.md rename to published/202002/20200126 Use Vim to send email and check your calendar.md diff --git a/published/20200126 What-s your favorite Linux distribution.md b/published/202002/20200126 What-s your favorite Linux distribution.md similarity index 100% rename from published/20200126 What-s your favorite Linux distribution.md rename to published/202002/20200126 What-s your favorite Linux distribution.md diff --git a/published/20200127 Use Vim to manage your task list and access Reddit and Twitter.md b/published/202002/20200127 Use Vim to manage your task list and access Reddit and Twitter.md similarity index 100% rename from published/20200127 Use Vim to manage your task list and access Reddit and Twitter.md rename to published/202002/20200127 Use Vim to manage your task list and access Reddit and Twitter.md diff --git a/published/20200128 Send email and check your calendar with Emacs.md b/published/202002/20200128 Send email and check your calendar with Emacs.md similarity index 100% rename from published/20200128 Send email and check your calendar with Emacs.md rename to published/202002/20200128 Send email and check your calendar with Emacs.md diff --git a/published/20200129 4 cool new projects to try in COPR for January 2020.md b/published/202002/20200129 4 cool new projects to try in COPR for January 2020.md similarity index 100% rename from published/20200129 4 cool new projects to try in COPR for January 2020.md rename to published/202002/20200129 4 cool new projects to try in COPR for January 2020.md diff --git a/published/20200129 Joplin- The True Open Source Evernote Alternative.md b/published/202002/20200129 Joplin- The True Open Source Evernote Alternative.md similarity index 100% rename from published/20200129 Joplin- The True Open Source Evernote Alternative.md rename to published/202002/20200129 Joplin- The True Open Source Evernote Alternative.md diff --git a/published/20200129 Showing memory usage in Linux by process and user.md b/published/202002/20200129 Showing memory usage in Linux by process and user.md similarity index 100% rename from published/20200129 Showing memory usage in Linux by process and user.md rename to published/202002/20200129 Showing memory usage in Linux by process and user.md diff --git a/published/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md b/published/202002/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md similarity index 100% rename from published/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md rename to published/202002/20200130 Meet FuryBSD- A New Desktop BSD Distribution.md diff --git a/published/20200131 Intro to the Linux command line.md b/published/202002/20200131 Intro to the Linux command line.md similarity index 100% rename from published/20200131 Intro to the Linux command line.md rename to published/202002/20200131 Intro to the Linux command line.md diff --git a/published/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md b/published/202002/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md similarity index 100% rename from published/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md rename to published/202002/20200202 4 Key Changes to Look Out for in Linux Kernel 5.6.md diff --git a/published/20200203 Give an old MacBook new life with Linux.md b/published/202002/20200203 Give an old MacBook new life with Linux.md similarity index 100% rename from published/20200203 Give an old MacBook new life with Linux.md rename to published/202002/20200203 Give an old MacBook new life with Linux.md diff --git a/published/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md b/published/202002/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md similarity index 100% rename from published/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md rename to published/202002/20200203 Troubleshoot Kubernetes with the power of tmux and kubectl.md diff --git a/published/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md b/published/202002/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md similarity index 100% rename from published/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md rename to published/202002/20200204 Ubuntu 19.04 Has Reached End of Life- Existing Users Must Upgrade to Ubuntu 19.10.md diff --git a/published/20200205 Getting started with GnuCash.md b/published/202002/20200205 Getting started with GnuCash.md similarity index 100% rename from published/20200205 Getting started with GnuCash.md rename to published/202002/20200205 Getting started with GnuCash.md diff --git a/published/20200206 3 ways to use PostgreSQL commands.md b/published/202002/20200206 3 ways to use PostgreSQL commands.md similarity index 100% rename from published/20200206 3 ways to use PostgreSQL commands.md rename to published/202002/20200206 3 ways to use PostgreSQL commands.md diff --git a/published/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md b/published/202002/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md similarity index 100% rename from published/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md rename to published/202002/20200207 Best Open Source eCommerce Platforms to Build Online Shopping Websites.md diff --git a/published/20200207 Connect Fedora to your Android phone with GSConnect.md b/published/202002/20200207 Connect Fedora to your Android phone with GSConnect.md similarity index 100% rename from published/20200207 Connect Fedora to your Android phone with GSConnect.md rename to published/202002/20200207 Connect Fedora to your Android phone with GSConnect.md diff --git a/published/20200207 Customize your internet with an open source search engine.md b/published/202002/20200207 Customize your internet with an open source search engine.md similarity index 100% rename from published/20200207 Customize your internet with an open source search engine.md rename to published/202002/20200207 Customize your internet with an open source search engine.md diff --git a/published/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md b/published/202002/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md similarity index 100% rename from published/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md rename to published/202002/20200207 NVIDIA-s Cloud Gaming Service GeForce NOW Shamelessly Ignores Linux.md diff --git a/published/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md b/published/202002/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md similarity index 100% rename from published/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md rename to published/202002/20200207 What is WireGuard- Why Linux Users Going Crazy Over it.md diff --git a/published/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md b/published/202002/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md similarity index 100% rename from published/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md rename to published/202002/20200210 Install All Essential Media Codecs in Ubuntu With This Single Command -Beginner-s Tip.md diff --git a/published/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md b/published/202002/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md similarity index 100% rename from published/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md rename to published/202002/20200210 Playing Music on your Fedora Terminal with MPD and ncmpcpp.md diff --git a/published/20200210 Scan Kubernetes for errors with KRAWL.md b/published/202002/20200210 Scan Kubernetes for errors with KRAWL.md similarity index 100% rename from published/20200210 Scan Kubernetes for errors with KRAWL.md rename to published/202002/20200210 Scan Kubernetes for errors with KRAWL.md diff --git a/published/20200210 Top hacks for the YaCy open source search engine.md b/published/202002/20200210 Top hacks for the YaCy open source search engine.md similarity index 100% rename from published/20200210 Top hacks for the YaCy open source search engine.md rename to published/202002/20200210 Top hacks for the YaCy open source search engine.md diff --git a/published/20200211 Dino is a Modern Looking Open Source XMPP Client.md b/published/202002/20200211 Dino is a Modern Looking Open Source XMPP Client.md similarity index 100% rename from published/20200211 Dino is a Modern Looking Open Source XMPP Client.md rename to published/202002/20200211 Dino is a Modern Looking Open Source XMPP Client.md diff --git a/published/20200212 How to Change the Default Terminal in Ubuntu.md b/published/202002/20200212 How to Change the Default Terminal in Ubuntu.md similarity index 100% rename from published/20200212 How to Change the Default Terminal in Ubuntu.md rename to published/202002/20200212 How to Change the Default Terminal in Ubuntu.md diff --git a/published/20200212 How to use byobu to multiplex SSH sessions.md b/published/202002/20200212 How to use byobu to multiplex SSH sessions.md similarity index 100% rename from published/20200212 How to use byobu to multiplex SSH sessions.md rename to published/202002/20200212 How to use byobu to multiplex SSH sessions.md diff --git a/published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md b/published/202002/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md similarity index 100% rename from published/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md rename to published/202002/20200212 elementary OS is Building an App Center Where You Can Buy Open Source Apps for Your Linux Distribution.md diff --git a/published/20200213 Why developers like to code at night.md b/published/202002/20200213 Why developers like to code at night.md similarity index 100% rename from published/20200213 Why developers like to code at night.md rename to published/202002/20200213 Why developers like to code at night.md diff --git a/published/20200214 Digging up IP addresses with the Linux dig command.md b/published/202002/20200214 Digging up IP addresses with the Linux dig command.md similarity index 100% rename from published/20200214 Digging up IP addresses with the Linux dig command.md rename to published/202002/20200214 Digging up IP addresses with the Linux dig command.md diff --git a/published/20200217 How to get MongoDB Server on Fedora.md b/published/202002/20200217 How to get MongoDB Server on Fedora.md similarity index 100% rename from published/20200217 How to get MongoDB Server on Fedora.md rename to published/202002/20200217 How to get MongoDB Server on Fedora.md diff --git a/published/20200217 How to install Vim plugins.md b/published/202002/20200217 How to install Vim plugins.md similarity index 100% rename from published/20200217 How to install Vim plugins.md rename to published/202002/20200217 How to install Vim plugins.md diff --git a/published/20200219 Don-t like IDEs- Try grepgitvi.md b/published/202002/20200219 Don-t like IDEs- Try grepgitvi.md similarity index 100% rename from published/20200219 Don-t like IDEs- Try grepgitvi.md rename to published/202002/20200219 Don-t like IDEs- Try grepgitvi.md diff --git a/published/20200219 How Kubernetes Became the Standard for Compute Resources.md b/published/202002/20200219 How Kubernetes Became the Standard for Compute Resources.md similarity index 100% rename from published/20200219 How Kubernetes Became the Standard for Compute Resources.md rename to published/202002/20200219 How Kubernetes Became the Standard for Compute Resources.md diff --git a/published/20200219 How to Install Latest Git Version on Ubuntu.md b/published/202002/20200219 How to Install Latest Git Version on Ubuntu.md similarity index 100% rename from published/20200219 How to Install Latest Git Version on Ubuntu.md rename to published/202002/20200219 How to Install Latest Git Version on Ubuntu.md diff --git a/published/20200220 Using Python and GNU Octave to plot data.md b/published/202002/20200220 Using Python and GNU Octave to plot data.md similarity index 100% rename from published/20200220 Using Python and GNU Octave to plot data.md rename to published/202002/20200220 Using Python and GNU Octave to plot data.md From b91025ef63069c41651cb551bb9477ca26d71ed1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 12:23:41 +0800 Subject: [PATCH 051/207] PRF @wxy --- translated/tech/20200220 Tools for SSH key management.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20200220 Tools for SSH key management.md b/translated/tech/20200220 Tools for SSH key management.md index 0c9efe9752..be784e5b25 100644 --- a/translated/tech/20200220 Tools for SSH key management.md +++ b/translated/tech/20200220 Tools for SSH key management.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Tools for SSH key management) @@ -12,7 +12,7 @@ SSH 密钥管理工具 > 常用开源工具的省时快捷方式。 -![collection of hardware on blue backround][1] +![](https://img.linux.net.cn/data/attachment/album/202003/01/122336zyldgpse6eyrbymt.jpg) 我经常使用 SSH。我发现自己每天都要登录多个服务器和树莓派(与我位于同一房间,并接入互联网)。我有许多设备需要访问,并且获得访问权限的要求也不同,因此,除了使用各种 `ssh` / `scp` 命令选项之外,我还必须维护一个包含所有连接详细信息的配置文件。 @@ -60,7 +60,7 @@ $ ssh-import-id gh:waveform80 $ sudo pip3 install stormssh ``` -然后,你可以使用以下命令将 SSH 连接添加到配置中: +然后,你可以使用以下命令将 SSH 连接信息添加到配置中: ``` $ storm add pi3 pi@192.168.1.20 @@ -94,7 +94,7 @@ via: https://opensource.com/article/20/2/ssh-tools 作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 40b1c746562cb201e8b41e30c06fabfd20cb3784 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 1 Mar 2020 12:24:10 +0800 Subject: [PATCH 052/207] PUB @wxy https://linux.cn/article-11947-1.html --- .../20200220 Tools for SSH key management.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200220 Tools for SSH key management.md (98%) diff --git a/translated/tech/20200220 Tools for SSH key management.md b/published/20200220 Tools for SSH key management.md similarity index 98% rename from translated/tech/20200220 Tools for SSH key management.md rename to published/20200220 Tools for SSH key management.md index be784e5b25..9331cf701f 100644 --- a/translated/tech/20200220 Tools for SSH key management.md +++ b/published/20200220 Tools for SSH key management.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11947-1.html) [#]: subject: (Tools for SSH key management) [#]: via: (https://opensource.com/article/20/2/ssh-tools) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) From a785bde73f56b6dc99a8e33f7d5cceafe9956c8a Mon Sep 17 00:00:00 2001 From: Morisun029 <54652937+Morisun029@users.noreply.github.com> Date: Sun, 1 Mar 2020 17:47:09 +0800 Subject: [PATCH 053/207] Translated --- ...r writing an effective technical resume.md | 74 ------------------- ...r writing an effective technical resume.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 74 deletions(-) delete mode 100644 sources/talk/20200225 7 tips for writing an effective technical resume.md create mode 100644 translated/talk/20200225 7 tips for writing an effective technical resume.md diff --git a/sources/talk/20200225 7 tips for writing an effective technical resume.md b/sources/talk/20200225 7 tips for writing an effective technical resume.md deleted file mode 100644 index d91ab742d3..0000000000 --- a/sources/talk/20200225 7 tips for writing an effective technical resume.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Morisun029) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (7 tips for writing an effective technical resume) -[#]: via: (https://opensource.com/article/20/2/technical-resume-writing) -[#]: author: (Emily Brand https://opensource.com/users/emily-brand) - -7 tips for writing an effective technical resume -====== -Present yourself in the best light to potential employers by following -these essentials. -![Two hands holding a resume with computer, clock, and desk chair ][1] - -If you're a software engineer or a manager in the technology sector, creating or updating your resume can be a daunting task. What is most important to consider? How should you handle the formatting, the content, and your objective or summary? What work experience is relevant? How can you make sure automated recruitment tools don't filter out your resume? - -As a hiring manager over the last seven years, I have seen a wide range of resumes and CVs; while some have been impressive, many more have been terribly written. - -When writing or updating your resume, here are seven easy rules to follow. - -### 1\. Summary statement - -The short paragraph at the top of your resume should be clean and concise, have a clear purpose, and avoid excessive use of adjectives and adverbs. Words such as "impressive," "extensive," and "excellent" do not improve your hiring chances; instead, they look and feel like overused filler words. An important question to ask yourself regarding your objective is: **Does it tell the hiring manager what kind of job I'm looking for and how I can provide value to them?** If not, either strengthen and streamline it to answer that question or leave it out altogether. - -### 2\. Work experience - -Numbers, numbers, numbers. Hard facts help you convey your point far more than general statements such as "Helped build, manage, deliver many projects that directly contributed to my customers' bottom line." Your wording should include statistics such as "Directly impacted five projects with top banks that accelerated their time to market by 40%," how many lines of code you committed, or how many teams you managed. Data is far more effective than frilly language to showcase your abilities and value. - -If you are less-experienced and have fewer jobs to showcase, do not include irrelevant experience like part-time summer jobs. Instead, add detail about the specifics of your relevant experience and what you learned that would make you a better employee for the organization you are applying for. - -### 3\. Search terms and jargon - -With technology playing such a huge role in the hiring process, it is extremely important to make sure your resume gets flagged for the right positions—but do not oversell yourself on your resume. If you mention agile skills but do not know what kanban is, think twice. If you mention that you are skilled in Java but haven't used it in five years, beware. If there are languages and frameworks you are familiar with but not necessarily current in, create a different category or divide your experience into "proficient in" and "familiar with." - -### 4\. Education - -If you are not a recent college graduate, there is no need to include your GPA or the clubs or fraternities you participated in, unless you plan on using them as talking points to gain trust during an interview. Be sure that anything you have published or patented is included, even if it is not relevant to the job. If you do not have a college degree, add a certification section in place of education. If you were in the military, include your active duty and reserve time. - -### 5\. Certifications - -Do not include expired certifications unless you are trying to re-enter a field you have left, such as if you were a people manager and are now looking to get back into hands-on programming. If you have certifications that are no longer relevant to the field, do not include them since it can be distracting and unappealing. Leverage your LinkedIn profile to add more color to your resume, as most people will read your resume and your LinkedIn profile before they interview you. - -### 6\. Spelling and grammar - -Ask others to proofread your resume. So often, I have seen misspelled words in a resume or mistaken uses of words like their, they're, and there. These are avoidable and fixable errors that will create a negative impression. Ideally, your resume will be in active tense, but if that makes you uncomfortable, write it in past tense—the most important thing is to maintain a consistent tense throughout. Improper spelling and grammar will convey that you either do not really care about the job you are applying for or do not have the level of attention to detail necessary for the job. - -### 7\. Formatting - -Ensuring your resume looks up-to-date and appealing is an easy way to make a good first impression. Ensuring consistent formatting, e.g., similar margins, similar spacing, capitalization, and colors (but keep color palettes to a minimum) is the most mundane part of resume writing, but it's necessary to show that you take pride in your work and value yourself and your future employer. Use tables where appropriate to space information in a visually appealing way. If given the option, upload your resume in .pdf and .docx formats, and Google Docs exports to the .odt format, which can be opened easily in LibreOffice. Here is an easy Google Docs [resume template][2] that I recommend. You can also purchase templates from companies that do attractive designs for a small fee (under $10). - -### Update regularly - -Updating your resume regularly will minimize your stress if you're asked to (or want to) apply for a job, and it will help you create and maintain a more accurate version of yourself. When working on your resume, be forward-thinking and be sure to ask at least three other people to review it for content, spelling, and grammar. Even if you are recruited by or referred to a company, your interviewers may know you only by your resume, so ensure that it creates a positive first impression of you. - -_Do you have additional tips to add?_ - -Emily Dunham shares her technique for leveraging open source contributions to stand out as a great... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/technical-resume-writing - -作者:[Emily Brand][a] -选题:[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/emily-brand -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) -[2]: https://docs.google.com/document/d/1ARVyybC5qQEiCzUOLElwAdPpKOK0Qf88srr682eHdCQ/edit diff --git a/translated/talk/20200225 7 tips for writing an effective technical resume.md b/translated/talk/20200225 7 tips for writing an effective technical resume.md new file mode 100644 index 0000000000..20f7edf8f1 --- /dev/null +++ b/translated/talk/20200225 7 tips for writing an effective technical resume.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: (Morisun029) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 tips for writing an effective technical resume) +[#]: via: (https://opensource.com/article/20/2/technical-resume-writing) +[#]: author: (Emily Brand https://opensource.com/users/emily-brand) + +撰写有效技术简历的7个技巧 +====== +遵循以下这些要点,把自己最好的一面呈现给潜在雇主。 +![Two hands holding a resume with computer, clock, and desk chair ][1] + +如果你是一名软件工程师或技术领域的经理,那么创建或更新简历可能是一项艰巨的任务。 要考虑的重点是什么? 应该怎么处理格式,内容以及目标或摘要? 哪些工作经验相关? 如何确保自动招聘工具不会过滤掉你的简历? + +在过去的七年中,作为一名招聘经理,我看到了各种各样的简历; 尽管有些令人印象深刻,但还有很多人写的很糟糕。 + +在编写或更新简历时,请遵循以下七个简单原则。 + +### 1\. 概述 + +简历顶部的简短段落应简洁明了,目的明确,避免过多使用形容词和副词。 诸如“令人印象深刻”,“广泛”和“优秀”之类的词,这些词不会增加你的招聘机会; 相反,它们看起来和感觉上像是过度使用的填充词。 关于你的目标,问自己一个重要的问题: **它是否告诉招聘经理我正在寻找什么样的工作以及如何为他们提供价值?** 如果不是,请加强并简化它以回答该问题,或者将其完全排除在外。 + +### 2\. 工作经验 + +数字,数字,数字。 用事实传达观点远比一般的陈述,例如“帮助构建,管理,交付许多对客户利润有贡献的项目” 更能对你有帮助。 你的表达中应包括统计数据,例如“直接影响了五个顶级银行的项目,这些项目将其上市时间缩短了40%”,你提交了多少行代码或管理了几个团队。 数据比修饰语更能有效地展示你的能力和价值。 + +如果你经验不足,没有什么工作经验可展示,那无关的经验,如暑期兼职工作,就不要写了。 相反,将相关经验的细节以及你所学到的知识的详细信息写进简历,这些可以使你成为一个更好的候选人。 + +### 3\. 搜索术语和行话 + +随着技术在招聘过程中发挥如此巨大的作用,确保简历被标记为正确的职位非常重要,但不要在简历上过分吹嘘自己。 如果你提到敏捷技能但不知道看板是什么,请三思。 如果你提到自己精通Java,但是已经有五年都没有使用过Java了,请小心。 如果存在你熟悉但不一定是最新的语言和框架,请创建其他类别或将你的经验分为“精通”和“熟悉”。 + +### 4\. 教育 + +如果你不是应届大学毕业生,那就没必要再写你的GPA或你参加过的俱乐部或兄弟会,除非你计划将它们用作谈话要点以在面试中赢得信任。 确保你发表的或获取过专利的东西包括在内,即使与你的工作无关。 如果你没有大学学位,请添加一个证书部分代替教育背景部分。 如果你是军人,请包括现役和预备时间。 + +### 5\. 资质证书 + +除非你想重新进入之前离开的领域,否则不要写过期的证书,例如,如果你曾经是一名人事经理,而现在正寻求动手编程的工作。 如果你拥有与该领域不再相关的认证,就不要写这些认证,因为这些可能会分散招聘者的注意力,使你的简历失去吸引力。 利用你的 LinkedIn 个人资料为简历添加更多色彩,因为大多数人在面试之前都会阅读你的简历和 LinkedIn 个人资料。 + +### 6\. 拼写和语法 + + +让其他人对你的简历进行校对。 很多时候,我在简历中看到拼写错误的单词,或者错误用词,如“他们的”、“他们是”、“那些”。 这些可以避免和修复的错误会产生负面影响。 理想情况下,你的简历应用主动语态,但是如果这样会使你感到不舒服,那么就用过去时书写-最重要的是要始终保持一致。 不正确的拼写和语法会传递你要么不是很在乎所申请的工作,要么没有足够注意细节。 + +### 7\. 格式 + +确保你的简历是最新的并且富有吸引力,这是留下良好第一印象的简便方法。 确保格式一致,例如相同的页边距,相同的间距,大写字母和颜色(将调色板保持在最低水平)是简历写作中最基本的部分,但有必要表明你对工作感到豪感,并重视自己的价值和未来的雇主。 在适当的地方使用表格,以视觉吸引人的方式分配信息。 如果有给定模板,以 .pdf 和 .docx 格式上传简历,然后用 Google Docs 导出为 .odt 格式,这样可以在 LibreOffice 中轻松打开。 这是我推荐的简单的 Google 文档简历模板。 你还可以支付少量费用(不到10美元)从一些设计公司购买。 + +### 定期更新 + +如果你被要求(或希望)申请一份工作,定期更新简历可以最大程度地减少压力,也可以帮助你创建和维护更准确的简历版本。 撰写简历时,要有远见,确保至少让其他三个人对你的简历内容,拼写和语法进行检查。 即使你是由公司招募或其他人推荐给公司的,面试官也可能仅通过简历认识你,因此请确保它为你带来良好的第一印象。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/technical-resume-writing + +作者:[Emily Brand][a] +选题:[lujun9972][b] +译者:[Morisun029](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/emily-brand +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://docs.google.com/document/d/1ARVyybC5qQEiCzUOLElwAdPpKOK0Qf88srr682eHdCQ/edit From 9c574bbcc0dffe3b2bc92fa2c83e46ca9c83de82 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 2 Mar 2020 00:55:58 +0800 Subject: [PATCH 054/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200302=20How=20?= =?UTF-8?q?to=20Add=20New=20Brushes=20in=20GIMP=20[Quick=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md --- ...w to Add New Brushes in GIMP -Quick Tip.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md diff --git a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md new file mode 100644 index 0000000000..6443a00482 --- /dev/null +++ b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add New Brushes in GIMP [Quick Tip]) +[#]: via: (https://itsfoss.com/add-brushes-gimp/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +How to Add New Brushes in GIMP [Quick Tip] +====== + +[GIMP][1], is the most popular free and open-source image editor and perhaps the best [Adobe Photoshop alternative][2] on Linux. + +When you [install GIMP on Ubuntu][3] or any other operating system, you’ll find a few brushes already installed for basic image editing. If you need something more specific, you can always add new brushes in GIMP. + +How? Let me show you that in this quick tutorial. + +### How to add brushes in GIMP + +![][4] + +There are three steps involved in installing new brushes in GIMP: + + * Get new brush + * Put it in the designated folder + * Refresh the brushes in GIMP + + + +#### Step 1: Download new GIMP brushes + +The first step is to get new brushes for GIMP. Where do you get it from? From the internet, of course. + +You can search on Google or [alternative private search engines like Duck Duck Go][5] for ‘GIMP brushes’ and download the ones you like from a reputed website. + +GIMP brushes are usually available in .gbr and .gih file formats. The .gbr file is for regular brushes while .gih is used for animated brushes. + +Did you know? + +For the versions 2.4 and above, GIMP makes installing and using Photoshop brushes (.abr file) quite straightforward. All you need to do is place the Photoshop brush files in the proper folder. +Do keep in mind that the latest Photoshop brushes might not work with GIMP flawlessly. + +#### Step 2: Copy the new brushes into its location + +After you get your brush file, the next step is to copy and paste it to the right folder in GIMP configuration directory. + +On **Windows**, you’ll have to go to a folder like “**C:\Documents and Settings\myusername.gimp-2.10\brushes**“. + +I’ll show detailed steps for **Linux** because It’s FOSS is a Linux-focused website. + +After selecting the brush files press **Ctrl+h** in your **Home** folder to [see hidden files in Linux][6]. + +![Press Ctrl+H to see hidden files in the home directory][7] + +You should go to **.config/GIMP/2.10/brushes** folder (if you are using GIMP version 2.10). If you are using some other version, you should see an equivalent folder under .config/GIMP. + +![Adding New Brushes in GIMP][8] + +Paste the brush files in this folder. Optionally, you can hide the hidden files by pressing **Ctrl+h** again. + +#### Step 3: Refresh the brushes (to avoid restarting GIMP) + +GIMP will automatically load brushes when it’s launched. If you are already running it and don’t want to close it, you can refresh the brushes. + +In GIMP go to **Windows**->**Dockable Dialogues**->**Brushes** in the main menu. + +![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9] + +Locate the **refresh** icon in the **Brushes** dialog on the right side bar. + +![Refresh GIMP Brushes][10] + +If your brushes are not present, you can always try to restart GIMP. + +Bonus Tip! + +Adding new brushes in [GIMP also allows you easily watermark images][11]. Just use your logo as a brush and add it to the images in a single click. + +I hope you enjoyed this quick GIMP tip. Stay tuned for more. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/add-brushes-gimp/ + +作者:[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://www.gimp.org/ +[2]: https://itsfoss.com/open-source-photoshop-alternatives/ +[3]: https://itsfoss.com/gimp-2-10-release/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install-New-Brushes-in-GIMP.jpg?ssl=1 +[5]: https://itsfoss.com/privacy-search-engines/ +[6]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP-1.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP.png?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes-2.jpg?ssl=1 +[11]: https://itsfoss.com/add-watermark-gimp-linux/ From aa5987badd1b4d3514eb0fb955a3f64b56ec3593 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 2 Mar 2020 08:28:44 +0800 Subject: [PATCH 055/207] translated --- ...oud with Fedora 31 and Nextcloud Server.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) rename {sources => translated}/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md (63%) diff --git a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md similarity index 63% rename from sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md rename to translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md index 5aa4ee5023..c5cd454f7d 100644 --- a/sources/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md +++ b/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -7,57 +7,57 @@ [#]: via: (https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/) [#]: author: (storyteller https://fedoramagazine.org/author/storyteller/) -Build your own cloud with Fedora 31 and Nextcloud Server +使用 Fedora 31 和 Nextcloud 服务器构建自己的云 ====== ![][1] -[Nextcloud][2] is a software suite for storing and syncing your data across multiple devices. You can learn more about Nextcloud Server’s features from [https://github.com/nextcloud/server][3]. +[Nextcloud][2] 是用于跨多个设备存储和同步数据的软件套件。你可以从 [https://github.com/nextcloud/server][3] 了解有关 Nextcloud 服务器的更多特性信息。 -This article demonstrates how to build a personal cloud using Fedora and Nextcloud in a few simple steps. For this tutorial you will need a dedicated computer or a virtual machine running Fedora 31 server edition and an internet connection. +本文通过几个简单的步骤演示了如何使用 Fedora 和 Nextcloud 构建个人云。对于本教程,你将需要一台独立计算机或运行 Fedora 31 服务器版的虚拟机,还需要互联网连接。 -### Step 1: Install the prerequisites +### 步骤 1:预先安装条件 -Before installing and configuring Nextcloud, a few prerequisites must be satisfied. +在安装和配置 Nextcloud 之前,必须满足一些预先条件。 -First, install Apache web server: +首先,安装 Apache Web 服务器: ``` # dnf install httpd ``` -Next, install PHP and some additional modules. Make sure that the PHP version being installed meets [Nextcloud’s requirements][4]: +接下来,安装 PHP 和一些其他模块。确保所安装的 PHP 版本符合 [Nextcloud 的要求][4]: ``` # dnf install php php-gd php-mbstring php-intl php-pecl-apcu php-mysqlnd php-pecl-redis php-opcache php-imagick php-zip php-process ``` -After PHP is installed enable and start the Apache web server: +安装 PHP 后,启用并启动 Apache Web 服务器: ``` # systemctl enable --now httpd ``` -Next, allow _HTTP_ traffic through the firewall: +接下来,允许 _HTTP_ 流量穿过防火墙: ``` # firewall-cmd --permanent --add-service=http # firewall-cmd --reload ``` -Next, install the MariaDB server and client: +接下来,安装 MariaDB 服务器和客户端: ``` # dnf install mariadb mariadb-server ``` -Then enable and start the MariaDB server: +然后启用并启动 MariaDB 服务器 ``` # systemctl enable --now mariadb ``` -Now that MariaDB is running on your server, you can run the _mysql_secure_installation_ command to secure it: +现在,MariaDB 正在运行,你可以运行 _mysql_secure_installation_ 命令来保护它: ``` # mysql_secure_installation @@ -128,7 +128,7 @@ MariaDB installation should now be secure. Thanks for using MariaDB! ``` -Next, create a dedicated user and database for your Nextcloud instance: +接下来,为你的 Nextcloud 实例创建独立的用户和数据库: ``` # mysql -p @@ -139,23 +139,23 @@ Next, create a dedicated user and database for your Nextcloud instance: > exit; ``` -### Step 2: Install Nextcloud Server +### 步骤 2:安装 Nextcloud 服务器 -Now that the prerequisites for your Nextcloud installation have been satisfied, download and unzip [the Nextcloud archive][5]: +现在,你已满足 Nextcloud 安装的预先条件,请下载并解压 [Nextcloud 压缩包][5]: ``` # wget https://download.nextcloud.com/server/releases/nextcloud-17.0.2.zip # unzip nextcloud-17.0.2.zip -d /var/www/html/ ``` -Next, create a data folder and grant Apache read and write access to the _nextcloud_ directory tree: +接下来,创建一个数据文件夹,并授予 Apache 对 _nextcloud_ 目录树的读写访问权限: ``` # mkdir /var/www/html/nextcloud/data # chown -R apache:apache /var/www/html/nextcloud ``` -SELinux must be configured to work with Nextcloud. The basic commands are those bellow, but a lot more, by features used on nexcloud installation, are posted here: [Nextcloud SELinux configuration][6] +SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示,但在 nexcloud 安装中还有很多其他的命令,发布在这里:[Nextcloud SELinux 配置][6] ``` # semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?' @@ -166,30 +166,30 @@ SELinux must be configured to work with Nextcloud. The basic commands are those # restorecon -Rv '/var/www/html/nextcloud/' ``` -### Step 3: Configure N**extclou**d +### 步骤 3:配置 Nextcloud -Nextcloud can be configured using its web interface or from the command line. +可以使用它的 Web 界面或在命令行配置 Nextcloud。 -#### Using the web interface +#### 使用 Web 界面 -From your favorite browser, access __ and fill the fields: +在你喜欢的浏览器中,访问 __ 并输入字段: ![][7] -#### Using the command line +#### 使用命令行 -From the command line, just enter the following, substituting the values you used when you created a dedicated Nextcloud user in MariaDB earlier: +在命令行中,只需输入以下内容,使用你之前在 MariaDB 中创建的独立 Nextcloud 用户替换相应的值: ``` # sudo -u apache php occ maintenance:install --data-dir /var/www/html/nextcloud/data/ --database "mysql" --database-name "nextcloud" --database-user "nc_admin" --database-pass "DB_SeCuRe_PaSsWoRd" --admin-user "admin" --admin-pass "Admin_SeCuRe_PaSsWoRd" ``` -### Final Notes +### 最后几点 - * I used the _http_ protocol, but Nextcloud also works over _https_. I might write a follow-up about securing Nextcloud in a future article. - * I disabled SELinux, but your server will be more secure if you configure it. - * The recommend PHP memory limit for Nextcloud is 512M. To change it, edit the _memory_limit_ variable in the _/etc/php.ini_ configuration file and restart your _httpd_ service. - * By default, the web interface can only be accessed using the __ URL. If you want to allow access using other domain names, [you can do so by editing the _/var/www/html/nextcloud/config/config.php_ file][8]. The * character can be used to bypass the domain name restriction and allow the use of any URL that resolves to one of your server’s IP addresses. + * 我使用的是 _http_ 协议,但是 Nextcloud 也可以在 _https_ 上运行。我可能会在以后的文章中写一篇有关保护 Nextcloud 的文章。 +  * 我禁用了 SELinux,但是如果配置它,你的服务器将更加安全。 +  * Nextcloud 的建议 PHP 内存限制为 512M。要更改它,请编辑 _/etc/php.ini_ 配置文件中的 _memory_limit_ 变量,然后重新启动 _httpd_ 服务。 +  * 默认情况下,只能使用 __ URL 访问 Web 界面。如果要允许使用其他域名访问,[你可编辑 _/var/www/html/nextcloud/config/config.php_ 来进行此操作][8]。\* 字符可用于绕过域名限制,并允许任何解析为服务器 IP 的 URL 访问。 @@ -201,15 +201,13 @@ From the command line, just enter the following, substituting the values you use ), ``` -_— Updated on January 28th, 2020 to include SELinux configuration —_ - -------------------------------------------------------------------------------- via: https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/ 作者:[storyteller][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d1985dfa85a6178e5679dda0fea5b7758729b238 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 2 Mar 2020 08:34:10 +0800 Subject: [PATCH 056/207] translating --- .../tech/20200226 Use logzero for simple logging in Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200226 Use logzero for simple logging in Python.md b/sources/tech/20200226 Use logzero for simple logging in Python.md index 1fbd61b68f..467b30d968 100644 --- a/sources/tech/20200226 Use logzero for simple logging in Python.md +++ b/sources/tech/20200226 Use logzero for simple logging in Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 446b31046160a7375a66baaaba9f85bf2ce5a046 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 09:40:32 +0800 Subject: [PATCH 057/207] PUB @lujun9972 https://linux.cn/article-11949-1.html --- .../tech => published}/20170918 Fun and Games in Emacs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20170918 Fun and Games in Emacs.md (99%) diff --git a/translated/tech/20170918 Fun and Games in Emacs.md b/published/20170918 Fun and Games in Emacs.md similarity index 99% rename from translated/tech/20170918 Fun and Games in Emacs.md rename to published/20170918 Fun and Games in Emacs.md index 9b547de0de..beb061fb1b 100644 --- a/translated/tech/20170918 Fun and Games in Emacs.md +++ b/published/20170918 Fun and Games in Emacs.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11949-1.html) [#]: subject: (Fun and Games in Emacs) [#]: via: (https://www.masteringemacs.org/article/fun-games-in-emacs) [#]: author: (Mickey Petersen https://www.masteringemacs.org/about) From 524627ce1e7587eb7d5e1aac1087a677d900894d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 09:55:49 +0800 Subject: [PATCH 058/207] PRF --- published/20170918 Fun and Games in Emacs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20170918 Fun and Games in Emacs.md b/published/20170918 Fun and Games in Emacs.md index beb061fb1b..2602ba804c 100644 --- a/published/20170918 Fun and Games in Emacs.md +++ b/published/20170918 Fun and Games in Emacs.md @@ -78,9 +78,9 @@ Emacs 中汉诺塔的实现可以追溯到 20 世纪 80 年代中期——确实 我喜欢 `fortune` 命令。每当我启动一个新 shell 时,这些与文学片段、谜语相结合的刻薄、无益、常常带有讽刺意味的“建议”就会点亮我的一天。 -令人困惑的是,Emacs 中有两个包或多或少地做着类似的事情:`fortune` 和 `cookie1`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 +令人困惑的是,Emacs 中有两个包或多或少地做着类似的事情:`fortune` 和 `cookie`。前者主要用于在电子邮件签名中添加幸运饼干消息,而后者只是一个简单的 fortune 格式阅读器。 -不管怎样,使用 Emacs 的 `cookie1` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 +不管怎样,使用 Emacs 的 `cookie` 包前,你首先需要通过 `customize-option RET cookie RET` 来自定义变量 `cookie-file` 告诉它从哪找到 fortune 文件。 如果你的操作系统是 Ubuntu,那么你先安装 `fortune` 软件包,然后就能在 `/usr/share/games/fortune/` 目录中找到这些文件了。 From 63801b20077b070fea5cffc5e8e870a7f59df093 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 10:19:42 +0800 Subject: [PATCH 059/207] PRF @wxy --- ...200224 Using C and C-- for data science.md | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/translated/tech/20200224 Using C and C-- for data science.md b/translated/tech/20200224 Using C and C-- for data science.md index c2b3ca0a87..d6c30dec4b 100644 --- a/translated/tech/20200224 Using C and C-- for data science.md +++ b/translated/tech/20200224 Using C and C-- for data science.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using C and C++ for data science) @@ -10,30 +10,29 @@ 在数据科学中使用 C 和 C++ ====== -> 让我们使用 C99 和 C++ 11 完成常见的数据科学任务。 +> 让我们使用 C99 和 C++11 完成常见的数据科学任务。 ![metrics and data shown on a computer screen][1] 虽然 [Python][2] 和 [R][3] 之类的语言在数据科学中越来越受欢迎,但是 C 和 C++ 对于高效的数据科学来说是一个不错的选择。在本文中,我们将使用 [C99][4] 和 [C++11][5] 编写一个程序,该程序使用 [Anscombe 的四重奏][6]数据集,下面将对其进行解释。 -我在一篇涉及 [Python 和 GNU Octave][7] 的文章中写了我不断学习语言的动机,值得大家回顾。所有程序都应在[命令行][8]上运行,而不是在[图形用户界面(GUI)][9]上运行。完整的示例可在 [polyglot_fit 存储库][10]中找到。 +我在一篇涉及 [Python 和 GNU Octave][7] 的文章中写了我不断学习编程语言的动机,值得大家回顾。这里所有的程序都需要在[命令行][8]上运行,而不是在[图形用户界面(GUI)][9]上运行。完整的示例可在 [polyglot_fit 存储库][10]中找到。 ### 编程任务 你将在本系列中编写的程序: -* 从 [CSV 文件] [11]中读取数据 +* 从 [CSV 文件][11]中读取数据 * 用直线插值数据(即 `f(x)=m ⋅ x + q`) * 将结果绘制到图像文件 -这是许多数据科学家遇到的普遍情况。示例数据是 [Anscombe 的四重奏] [6]的第一组,如下表所示。这是一组人工构建的数据,当拟合直线时可以提供相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,其中的制表符用作列分隔符,几行作为标题。该任务将仅使用第一组(即前两列)。 - -[Anscombe 的四重奏][6] +这是许多数据科学家遇到的普遍情况。示例数据是 [Anscombe 的四重奏][6]的第一组,如下表所示。这是一组人工构建的数据,当拟合直线时可以提供相同的结果,但是它们的曲线非常不同。数据文件是一个文本文件,其中的制表符用作列分隔符,前几行作为标题。该任务将仅使用第一组(即前两列)。 +![](https://img.linux.net.cn/data/attachment/album/202002/29/122805h3yrs1dkrgysssxk.png) ### C 语言的方式 -[C][12] 语言是通用编程语言,是当今使用最广泛的语言之一(依据 [TIOBE 榜单][13]、[RedMonk 编程语言排名][14]、[编程语言流行度榜单][15]和 [GitHub Octoverse 状态][16])。这是一种相当古老的语言(大约诞生在 1973 年),并且用它编写了许多成功的程序(例如 Linux 内核和 Git 仅是其中两个例子)。它也是最接近计算机内部运行的语言之一,因为它直接用于操作内存。它是一种[编译语言] [17];因此,源代码必须由[编译器][18]转换为[机器代码][19]。它的[标准库][20]很小,功能也不多,因此开发了其他库来提供缺少的功能。 +[C][12] 语言是通用编程语言,是当今使用最广泛的语言之一(依据 [TIOBE 指数][13]、[RedMonk 编程语言排名][14]、[编程语言流行度指数][15]和 [GitHub Octoverse 状态][16] 得来)。这是一种相当古老的语言(大约诞生在 1973 年),并且用它编写了许多成功的程序(例如 Linux 内核和 Git 仅是其中的两个例子)。它也是最接近计算机内部运行机制的语言之一,因为它直接用于操作内存。它是一种[编译语言][17];因此,源代码必须由[编译器][18]转换为[机器代码][19]。它的[标准库][20]很小,功能也不多,因此人们开发了其它库来提供缺少的功能。 我最常在[数字运算][21]中使用该语言,主要是因为其性能。我觉得使用起来很繁琐,因为它需要很多[样板代码][22],但是它在各种环境中都得到了很好的支持。C99 标准是最新版本,增加了一些漂亮的功能,并且得到了编译器的良好支持。 @@ -41,7 +40,7 @@ #### 安装 -要使用 C99 进行开发,你需要一个编译器。我通常使用 [Clang][23],不过 [GCC][24] 是另一个有效的开源编译器。对于线性拟合,我选择使用 [GNU 科学库] [25]。对于绘图,我找不到任何明智的库,因此该程序依赖于外部程序:[Gnuplot] [26]。该示例还使用动态数据结构来存储数据,该结构在[伯克利软件分发版(BSD)][27]中定义。 +要使用 C99 进行开发,你需要一个编译器。我通常使用 [Clang][23],不过 [GCC][24] 是另一个有效的开源编译器。对于线性拟合,我选择使用 [GNU 科学库][25]。对于绘图,我找不到任何明智的库,因此该程序依赖于外部程序:[Gnuplot][26]。该示例还使用动态数据结构来存储数据,该结构在[伯克利软件分发版(BSD)][27]中定义。 在 [Fedora][28] 中安装很容易: @@ -49,7 +48,7 @@ sudo dnf install clang gnuplot gsl gsl-devel ``` -#### 注释代码 +#### 代码注释 在 C99 中,[注释][29]的格式是在行的开头放置 `//`,行的其它部分将被解释器丢弃。另外,`/*` 和 `*/` 之间的任何内容也将被丢弃。 @@ -65,7 +64,7 @@ sudo dnf install clang gnuplot gsl gsl-devel * [头文件][30],其中包含函数说明 * 包含函数定义的源文件 -头文件包含在源文件中,而库文件的源文件则与可执行文件[链接][31]。因此,此示例所需的头文件是: +头文件包含在源文件中,而库文件的源文件则[链接][31]到可执行文件。因此,此示例所需的头文件是: ``` // 输入/输出功能 @@ -83,7 +82,7 @@ sudo dnf install clang gnuplot gsl gsl-devel #### 主函数 -在 C 语言中,程序必须位于称为主函数 [main()][32]:的特殊函数内: +在 C 语言中,程序必须位于称为主函数 [main()][32] 的特殊函数内: ``` int main(void) { @@ -95,7 +94,7 @@ int main(void) { #### 定义变量 -在 C 语言中,变量必须在使用前声明,并且必须与类型关联。每当你要使用变量时,都必须决定要在其中存储哪种数据。你也可以指定是否打算将变量用作常量值,这不是必需的,但是编译器可以从此信息中受益。 来自存储库中的 [fitting_C99.c 程序] [33]: +在 C 语言中,变量必须在使用前声明,并且必须与类型关联。每当你要使用变量时,都必须决定要在其中存储哪种数据。你也可以指定是否打算将变量用作常量值,这不是必需的,但是编译器可以从此信息中受益。 以下来自存储库中的 [fitting_C99.c 程序][33]: ``` const char *input_file_name = "anscombe.csv"; @@ -113,7 +112,7 @@ C 语言中的数组不是动态的,从某种意义上说,数组的长度必 int data_array[1024]; ``` -由于你通常不知道文件中有多少个数据点,因此请使用[单链接列表][34]。这是一个动态数据结构,可以无限增长。幸运的是,BSD [提供了链表][35]。这是一个示例定义: +由于你通常不知道文件中有多少个数据点,因此请使用[单链列表][34]。这是一个动态数据结构,可以无限增长。幸运的是,BSD [提供了链表][35]。这是一个示例定义: ``` struct data_point { @@ -145,7 +144,7 @@ printf("Slope: %f\n", slope); #### 读取数据 -现在来到了困难的部分……有一些用 C 语言解析 CSV 文件的库,但是似乎没有一个库足够稳定或流行到可以放入到 Fedora 软件包存储库中。我没有为本教程添加依赖项,而是决定自己编写此部分。同样,讨论这些细节太啰嗦了,所以我只会解释大致的思路。为了简洁起见,将忽略源代码中的某些行,但是你可以在存储库中找到完整的示例。 +现在来到了困难的部分……有一些用 C 语言解析 CSV 文件的库,但是似乎没有一个库足够稳定或流行到可以放入到 Fedora 软件包存储库中。我没有为本教程添加依赖项,而是决定自己编写此部分。同样,讨论这些细节太啰嗦了,所以我只会解释大致的思路。为了简洁起见,将忽略源代码中的某些行,但是你可以在存储库中找到完整的示例代码。 首先,打开输入文件: @@ -210,7 +209,7 @@ double *x = malloc(sizeof(double) * entries_number); double *y = malloc(sizeof(double) * entries_number); ``` -然后,遍历链接列表以将相关数据保存到数组: +然后,遍历链表以将相关数据保存到数组: ``` SLIST_FOREACH(datum, &head, entries) { @@ -224,7 +223,7 @@ SLIST_FOREACH(datum, &head, entries) { } ``` -现在你已经完成了链接列表,请清理它。要**总是**释放已手动分配的内存,以防止[内存泄漏][48]。内存泄漏是糟糕的、糟糕的、糟糕的(重要的话说三遍)。每次内存没有释放时,花园侏儒都会找不到自己的头: +现在你已经处理完了链表,请清理它。要**总是**释放已手动分配的内存,以防止[内存泄漏][48]。内存泄漏是糟糕的、糟糕的、糟糕的(重要的话说三遍)。每次内存没有释放时,花园侏儒都会找不到自己的头: ``` while (!SLIST_EMPTY(&head)) { @@ -278,7 +277,7 @@ plot 'fit_C99.csv' using 1:2 with lines title 'Fit', 'anscombe.csv' using 1:2 wi clang -std=c99 -I/usr/include/ fitting_C99.c -L/usr/lib/ -L/usr/lib64/ -lgsl -lgslcblas -o fitting_C99 ``` -这个命令告诉编译器使用 C99 标准,读取 `fitting_C99.c` 文件,加载 `gsl` 和 `gslcblas` 库,并将结果保存到 `fitting_C99`。命令行上的结果输出为: +这个命令告诉编译器使用 C99 标准、读取 `fitting_C99.c` 文件、加载 `gsl` 和 `gslcblas` 库、并将结果保存到 `fitting_C99`。命令行上的结果输出为: ``` #### Anscombe's first set with C99 #### @@ -287,13 +286,13 @@ Intercept: 3.000091 Correlation coefficient: 0.816421 ``` -这是用 Gnuplot 生成的结果图像。 +这是用 Gnuplot 生成的结果图像: ![Plot and fit of the dataset obtained with C99][52] ### C++11 方式 -[C++][53] 语言是一种通用编程语言,也是当今使用的最受欢迎的语言之一。它是作为 [C 的继承人][54]创建的(诞生于 1983 年),重点是[面向对象程序设计(OOP)][55]。C++ 通常被视为 C 的超集,因此 C 程序应该能够使用 C++ 编译器进行编译。这并非完全正确,因为在某些极端情况下它们的行为有所不同。 根据我的经验,C++ 比 C 需要更少的样板代码,但是如果要进行对象开发,语法会更困难。C++11 标准是最新版本,增加了一些漂亮的功能,并且或多或少得到了编译器的支持。 +[C++][53] 语言是一种通用编程语言,也是当今使用的最受欢迎的语言之一。它是作为 [C 的继承人][54]创建的(诞生于 1983 年),重点是[面向对象程序设计(OOP)][55]。C++ 通常被视为 C 的超集,因此 C 程序应该能够使用 C++ 编译器进行编译。这并非完全正确,因为在某些极端情况下它们的行为有所不同。 根据我的经验,C++ 与 C 相比需要更少的样板代码,但是如果要进行面向对象开发,语法会更困难。C++11 标准是最新版本,增加了一些漂亮的功能,并且基本上得到了编译器的支持。 由于 C++ 在很大程度上与 C 兼容,因此我将仅强调两者之间的区别。我在本部分中没有涵盖的任何部分,则意味着它与 C 中的相同。 @@ -309,7 +308,6 @@ sudo dnf install clang gnuplot gsl gsl-devel 库的工作方式与 C 语言相同,但是 `include` 指令略有不同: - ``` #include #include @@ -325,7 +323,7 @@ extern "C" { } ``` -由于 GSL 库是用 C 编写的,因此你必须将这种特殊性告知编译器。 +由于 GSL 库是用 C 编写的,因此你必须将这个特殊情况告知编译器。 #### 定义变量 @@ -429,17 +427,17 @@ Intercept: 3.00009 Correlation coefficient: 0.816421 ``` -这就是用 Gnuplot 生成的结果图像。 +这就是用 Gnuplot 生成的结果图像: ![Plot and fit of the dataset obtained with C++11][58] ### 结论 -本文提供了用 C99 和 C++11 编写的数据拟合和绘图任务的示例。由于 C++ 在很大程度上与 C 兼容,因此本文利用了它们的相似性来编写了第二个示例。在某些方面,C++ 更易于使用,因为它部分减轻了显式管理内存的负担。但是其语法更加复杂,因为它引入了为 OOP 编写类的可能性。但是,仍然可以用 C 使用 OOP 方法编写软件。由于 OOP 是一种编程风格,因此可以以任何语言使用。在 C 中有一些很好的 OOP 示例,例如 [GObject][59] 和 [Jansson][60]库。 +本文提供了用 C99 和 C++11 编写的数据拟合和绘图任务的示例。由于 C++ 在很大程度上与 C 兼容,因此本文利用了它们的相似性来编写了第二个示例。在某些方面,C++ 更易于使用,因为它部分减轻了显式管理内存的负担。但是其语法更加复杂,因为它引入了为 OOP 编写类的可能性。但是,仍然可以用 C 使用 OOP 方法编写软件。由于 OOP 是一种编程风格,因此可以在任何语言中使用。在 C 中有一些很好的 OOP 示例,例如 [GObject][59] 和 [Jansson][60]库。 对于数字运算,我更喜欢在 C99 中进行,因为它的语法更简单并且得到了广泛的支持。直到最近,C++11 还没有得到广泛的支持,我倾向于避免使用先前版本中的粗糙不足之处。对于更复杂的软件,C++ 可能是一个不错的选择。 -你是否也将 C 或 C++ 用于数据科学? 在评论中分享你的经验。 +你是否也将 C 或 C++ 用于数据科学?在评论中分享你的经验。 -------------------------------------------------------------------------------- @@ -448,7 +446,7 @@ via: https://opensource.com/article/20/2/c-data-science 作者:[Cristiano L. Fontana][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/) 荣誉推出 @@ -460,7 +458,7 @@ via: https://opensource.com/article/20/2/c-data-science [4]: https://en.wikipedia.org/wiki/C99 [5]: https://en.wikipedia.org/wiki/C%2B%2B11 [6]: https://en.wikipedia.org/wiki/Anscombe%27s_quartet -[7]: https://opensource.com/article/20/2/python-gnu-octave-data-science +[7]: https://linux.cn/article-11943-1.html [8]: https://en.wikipedia.org/wiki/Command-line_interface [9]: https://en.wikipedia.org/wiki/Graphical_user_interface [10]: https://gitlab.com/cristiano.fontana/polyglot_fit From 998fa6d8041271294c6dbb2bd1570bcc7f0709b5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 10:20:21 +0800 Subject: [PATCH 060/207] PUB @wxy https://linux.cn/article-11950-1.html --- .../20200224 Using C and C-- for data science.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200224 Using C and C-- for data science.md (99%) diff --git a/translated/tech/20200224 Using C and C-- for data science.md b/published/20200224 Using C and C-- for data science.md similarity index 99% rename from translated/tech/20200224 Using C and C-- for data science.md rename to published/20200224 Using C and C-- for data science.md index d6c30dec4b..f1dfdce174 100644 --- a/translated/tech/20200224 Using C and C-- for data science.md +++ b/published/20200224 Using C and C-- for data science.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11950-1.html) [#]: subject: (Using C and C++ for data science) [#]: via: (https://opensource.com/article/20/2/c-data-science) [#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) From 69f04a92a8c9f3d4f555086a0b4a503119dc5e1e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 20:02:01 +0800 Subject: [PATCH 061/207] APL --- .../20200212 Extend the life of your SSD drive with fstrim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md index c8108d68c9..18af55a6d0 100644 --- a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md +++ b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 665f2f083cd647d127969f4dc4baae907ad7e924 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 20:36:59 +0800 Subject: [PATCH 062/207] TSL --- ... the life of your SSD drive with fstrim.md | 107 ++++++++---------- 1 file changed, 49 insertions(+), 58 deletions(-) diff --git a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md index 18af55a6d0..24ed876272 100644 --- a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md +++ b/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md @@ -7,95 +7,90 @@ [#]: via: (https://opensource.com/article/20/2/trim-solid-state-storage-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) -Extend the life of your SSD drive with fstrim +在 Linux 下使用 fstrim 延长 SSD 驱动器的寿命 ====== -A new systemd service to make your life easier. + +> 这个新的系统服务可以使你的生活更轻松。 + ![Linux keys on the keyboard for a desktop computer][1] -Over the past decade, solid-state drives (SSD) have brought about a new way of managing storage. SSDs have benefits like silent and cooler operation and a faster interface spec, compared to their elder spinning ancestors. Of course, new technology brings with it new methods of maintenance and management. SSDs have a feature called TRIM. This is essentially a method for reclaiming unused blocks on the device, which may have been previously written, but no longer contain valid data and therefore, can be returned to the general storage pool for reuse. Opensource.com’s Don Watkins first wrote about TRIM in his 2017 article ["Solid-state drives in Linux: Enabling TRIM for SSDs."][2] +在过去的十年中,固态驱动器(SSD)带来了一种管理存储的新方法。与上一代的转盘产品相比,SSD 具有无声、更冷却的操作和更快的接口规格等优点。当然,新技术带来了新的维护和管理方法。SSD 具有称为 TRIM 的功能。从本质上讲,这是一种用于回收设备上未使用的块的方法,该块可能先前已被写入,但不再包含有效数据,因此可以返回到通用存储池以供重用。Opensource.com 的 Don Watkins 在首先其 2017 年的文章《[Linux 固态驱动器:为 SSD 启用 TRIM][2]》中介绍了 TRIM 的内容。 -If you have been using this feature on your Linux system, then you are probably familiar with the two methods described below. +如果你一直在 Linux 系统上使用此功能,则你可能熟悉下面描述的两种方法。 -### The old ways +### 老的方式 -#### Discard - -I initially enabled this with the discard option to the mount command. The configuration is placed into the **/etc/fstab** file for each file system. +#### 丢弃选项 +我最初使用 `mount` 命令的 `discard` 选项启用了此功能。每个文件系统的配置都放在 `/etc/fstab` 文件中。 ``` # cat /etc/fstab UUID=3453g54-6628-2346-8123435f  /home  xfs  defaults,discard   0 0 ``` -The discard option enables automatic online TRIM. There has recently been debate on whether this is the best method due to possible negative performance impacts. Using this option causes a TRIM to be initiated every time new data is written to the drive. This may introduce additional activity that interferes with storage performance. +丢弃选项可启用自动的在线 TRIM。由于可能会对性能造成负面影响,最近关于这是否是最佳方法一直存在争议。使用此选项会在每次将新数据写入驱动器时启动 TRIM。这可能会引入其他活动,从而影响存储性能。 -#### Cron - -I removed the discard option from the **fstab** file. Then I created a cron job to call the command on a scheduled basis. +#### Cron 作业 +我从 `fstab` 文件中删除了丢弃选项。然后,我创建了一个 cron 作业来按计划调用该命令。 ``` # crontab -l @midnight /usr/bin/trim ``` -This is the method I used most recently on my Ubuntu Linux systems until I learned about another way. +这是我最近在 Ubuntu Linux 系统上使用的方法,直到我了解到另一种方法。 -### A new TRIM service +### 一个新的 TRIM 服务 -I recently discovered that a systemd service for TRIM exists. Fedora [introduced][3] this into their distribution in version 30, and, although it is not enabled by default in versions 30 and 31, it is planned to be in version 32. If you’re working on Fedora Workstation 31 and you want to begin using this feature, you can enable it very easily. I’ll also show you how to test it below. This service is not unique to Fedora. The existence and status will depend on an individual distribution basis. +我最近发现有一个用于 TRIM 的 systemd 服务。Fedora 在版本 30 中将其[引入][3],尽管默认情况下在版本 30 和 31 中未启用它,但计划在版本 32 中使用它。如果你使用的是 Fedora 工作站 31,并且你想要开始使用此功能,可以非常轻松地启用它。我还将在下面向你展示如何对其进行测试。该服务并非 Fedora 独有的服务。它是否存在和地位将因发行版而异。 -#### Test - -I like to test first, to better understand what is happening behind the scenes. I do this by opening a terminal and issuing the command that the service is configured to call. +#### 测试 +我喜欢先进行测试,以更好地了解幕后情况。我通过打开终端并发出配置服务调用的命令来执行此操作。 ``` -`/usr/sbin/fstrim --fstab --verbose --quiet` +/usr/sbin/fstrim --fstab --verbose --quiet ``` -The **–help** argument to **fstrim** will describe these and other arguments. - +`fstrim` 的 `-help` 参数将描述这些信息和其他参数。 ``` $ sudo /usr/sbin/fstrim --help Usage: - fstrim [options] <mount point> + fstrim [options] Discard unused blocks on a mounted filesystem. Options: - -a, --all           trim all supported mounted filesystems - -A, --fstab         trim all supported mounted filesystems from /etc/fstab - -o, --offset <num>  the offset in bytes to start discarding from - -l, --length <num>  the number of bytes to discard - -m, --minimum <num> the minimum extent length to discard - -v, --verbose       print number of discarded bytes -     --quiet         suppress error messages - -n, --dry-run       does everything, but trim + -a, --all trim all supported mounted filesystems + -A, --fstab trim all supported mounted filesystems from /etc/fstab + -o, --offset the offset in bytes to start discarding from + -l, --length the number of bytes to discard + -m, --minimum the minimum extent length to discard + -v, --verbose print number of discarded bytes + --quiet suppress error messages + -n, --dry-run does everything, but trim - -h, --help          display this help - -V, --version       display version + -h, --help display this help + -V, --version display version ``` -So, now I can see that the systemd service is configured to run the trim on all supported mounted filesystems in my **/etc/fstab** file **–fstab** and print the number of discarded bytes **–verbose** but suppress any error messages that might occur **–quiet**. Knowing these options is helpful for testing. For instance, I can start with the safest one, which is the dry run. I’ll also leave off the quiet argument so I can determine if any errors will occur with my drive setup. - +因此,现在我可以看到这个 systemd 服务已配置为在我的 `/etc/fstab` 文件中的所有受支持的挂载文件系统上运行该修剪操作( `-fstab`),并打印出丢弃的字节数(`-verbose`),但是抑制了任何可能会发生的错误消息(`–quiet`)。了解这些选项对测试很有帮助。例如,我可以从最安全的方法开始,即空运行。 我还将去掉 `-quiet` 参数,以便确定驱动器设置是否发生任何错误。 ``` -`$ sudo /usr/sbin/fstrim --fstab --verbose --dry-run` +$ sudo /usr/sbin/fstrim --fstab --verbose --dry-run ``` -This will simply show what the **fstrim** command will do based on the file systems that it finds configured in your **/etc/fstab** file. - +这就会显示 `fstrim` 命令根据在 `/etc/fstab` 文件中找到的文件系统要执行的操作。 ``` -`$ sudo /usr/sbin/fstrim --fstab --verbose` +$ sudo /usr/sbin/fstrim --fstab --verbose ``` -This will now send the TRIM operation to the drive and report on the number of discarded bytes from each file system. Below is an example after my recent fresh install of Fedora on a new NVME SSD. - +现在,这会将 TRIM 操作发送到驱动器,并报告每个文件系统中丢弃的字节数。以下是我最近在新的 NVME SSD 上全新安装 Fedora 之后的示例。 ``` /home: 291.5 GiB (313011310592 bytes) trimmed on /dev/mapper/wkst-home @@ -104,44 +99,40 @@ This will now send the TRIM operation to the drive and report on the number of d /: 60.7 GiB (65154805760 bytes) trimmed on /dev/mapper/wkst-root ``` -#### Enable - -Fedora Linux implements systemd timer service, scheduled to run on a weekly basis. To check the existence and current status, run **systemctl status**. +#### 启用 +Fedora Linux 实现了一个计划每周运行它的 systemd 计时器服务。要检查其是否存在和当前状态,请运行 `systemctl status`。 ``` -`$ sudo systemctl status fstrim.timer` +$ sudo systemctl status fstrim.timer ``` -Now, enable the service. - +现在,启用该服务。 ``` -`$ sudo systemctl enable fstrim.timer` +$ sudo systemctl enable fstrim.timer ``` -#### Verify - -Then you can verify that the timer is enabled by listing all of the timers. +#### 验证 +然后,你可以通过列出所有计时器来验证该计时器是否已启用。 ``` -`$ sudo systemctl list-timers --all` +$ sudo systemctl list-timers --all ``` -The following line referring to the **fstrim.timer** will appear. Notice that the timer actually activates **fstrim.service**. This is from where the actual **fstrim** is called. The time-related fields show **n/a** because the service has just been enabled and has not run yet. - +会显示出下列表明 `fstrim.timer` 存在的行。注意,该计时器实际上激活了 `fstrim.service`。这是 `fstrim` 实际调用的地方。与时间相关的字段显示为 `n/a`,因为该服务已启用且尚未运行。 ``` NEXT   LEFT    LAST   PASSED   UNIT           ACTIVATES n/a    n/a     n/a    n/a      fstrim.timer   fstrim.service ``` -### Conclusion +### 结论 -This service seems like the best way to run TRIM on your drives. It is much simpler than having to create your own crontab entry to call the **fstrim** command. It is also safer not having to edit the **fstab** file. It has been interesting to watch the evolution of solid-state storage technology and nice to know that it appears Linux is moving toward a standard and safe way to implement it. +该服务似乎是在驱动器上运行 TRIM 的最佳方法。这比必须创建自己的 crontab 条目来调用 `fstrim` 命令要简单得多。不必编辑 `fstab` 文件也更安全。观察固态存储技术的发展很有趣,并且我很高兴看到 Linux 似乎正在朝着标准且安全的方向实现它。 -In this article, learn how solid state drives differ from traditional hard drives and what it means... +在本文中,学习了固态驱动器与传统硬盘驱动器有何不同以及它的含义... -------------------------------------------------------------------------------- @@ -149,7 +140,7 @@ via: https://opensource.com/article/20/2/trim-solid-state-storage-linux 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -157,5 +148,5 @@ via: https://opensource.com/article/20/2/trim-solid-state-storage-linux [a]: https://opensource.com/users/alanfdoss [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/article/17/1/solid-state-drives-linux-enabling-trim-ssds +[2]: https://linux.cn/article-8177-1.html [3]: https://fedoraproject.org/wiki/Changes/EnableFSTrimTimer (Fedora Project WIKI: Changes/EnableFSTrimTimer) From 68205fa9cfa70b1a6529c166d36ad02517a4895e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 21:03:28 +0800 Subject: [PATCH 063/207] APL --- .../20200130 4 open source productivity tools on my wishlist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200130 4 open source productivity tools on my wishlist.md b/sources/tech/20200130 4 open source productivity tools on my wishlist.md index d36f020aa3..1b19980605 100644 --- a/sources/tech/20200130 4 open source productivity tools on my wishlist.md +++ b/sources/tech/20200130 4 open source productivity tools on my wishlist.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a6032e24bb9afc57f482ff07463a4c86db53ead4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 21:47:00 +0800 Subject: [PATCH 064/207] TSL --- ...ource productivity tools on my wishlist.md | 76 ------------------- ...ource productivity tools on my wishlist.md | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/20200130 4 open source productivity tools on my wishlist.md create mode 100644 translated/tech/20200130 4 open source productivity tools on my wishlist.md diff --git a/sources/tech/20200130 4 open source productivity tools on my wishlist.md b/sources/tech/20200130 4 open source productivity tools on my wishlist.md deleted file mode 100644 index 1b19980605..0000000000 --- a/sources/tech/20200130 4 open source productivity tools on my wishlist.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 open source productivity tools on my wishlist) -[#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -4 open source productivity tools on my wishlist -====== -Find out what the open source world needs to work on in the final -article in our series on 20 ways to be more productive with open source -in 2020. -![Two diverse hands holding a globe][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### But what about… - -When searching for productivity apps, I never find everything I want, and I almost always miss something great that my readers share with me. So, as I bring this series to a close, it's time [again][2] to talk about some of the topics I failed to cover in this year's series. - -![Desktop with Joplin, Emacs, and Firefox][3] - -#### Chatting in Vim - -I tried. I really, _really_ tried to get chat to work in Vim, but it was not to be. The one package I was able to find, [VimIRC.vim][4], never did work for me, and I tried for a few days to no avail. The other option I explored was [Irc it][5], which requires a lot more [effort to set up][6] than I could fit into my available space or time. I tried, I really did, and for the Vim users out there, I'm sorry I wasn't able to get something workable for you. - -#### Org mode - -![Org Mode in Emacs][7] - -I love [Org Mode][8], and I use it daily. I could spend several days _just_ talking about Org. It provides basic [task tracking][9]; Google [calendar][10] sync and [CalFW][11] integration; rich text documents, websites, and presentations; linking to all the things; and; and; and… - -I expect you will hear more from me about Org in 2020 because it really is pretty cool. - -#### GUI programs - -In 2019's productivity series, I shared a lot of programs with a graphical user interface (GUI), and this year almost all are command-line applications. There are some great graphical programs to help with some of the things I talked about this year—[mail][12] programs to talk to Maildir mailboxes, calendar programs to read local calendar files, [weather][13] apps, and so on. I even tried several new-to-me things to see if they would fit with the overall theme. With the exception of [twin][14], I didn't feel that there were any GUI programs that were new (to me) or notable (again, to me) to write about this year. And that brings me to… - -#### Mobile - -More and more people are using tablets (sometimes in conjunction with a laptop) as their primary device. I use my phone for most of my social media and instant messaging, and, more often than not, I use my tablet (OK, let's be honest, _tablets_) to read or browse the web. It isn't that open source mobile apps aren't out there, that's for sure, but they didn't fit with my themes this year. There is a lot going on with open source and mobile apps, and I'm watching carefully for things that can help me be more productive on my phone and tablet. - -### Your turn - -Thank you very much for reading the series this year. Please comment with what you think I missed or need to look at for 2021. And as I say on the [Productivity Alchemy][15] podcast: "Remember folks: Stay productive!" - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/open-source-productivity-tools - -作者:[Kevin Sonney][a] -选题:[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/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe) -[2]: https://opensource.com/article/19/1/productivity-tool-wish-list -[3]: https://opensource.com/sites/default/files/uploads/productivity_20-1.png (Desktop with Joplin, Emacs, and Firefox) -[4]: https://github.com/vim-scripts/VimIRC.vim -[5]: https://tools.suckless.org/ii/ -[6]: https://www.reddit.com/r/vim/comments/48t7ws/vim_ii_irc_client_xpost_runixporn/d0macnl/ -[7]: https://opensource.com/sites/default/files/uploads/productivity_20-2.png (Org Mode in Emacs) -[8]: https://orgmode.org/ -[9]: https://opensource.com/article/20/1/open-source-to-do-list -[10]: https://opensource.com/article/20/1/open-source-calendar -[11]: https://github.com/kiwanami/emacs-calfw -[12]: https://opensource.com/article/20/1/organize-email-notmuch -[13]: https://opensource.com/article/20/1/open-source-weather-forecast -[14]: https://github.com/cosmos72/twin -[15]: https://productivityalchemy.com diff --git a/translated/tech/20200130 4 open source productivity tools on my wishlist.md b/translated/tech/20200130 4 open source productivity tools on my wishlist.md new file mode 100644 index 0000000000..eaebf35f1d --- /dev/null +++ b/translated/tech/20200130 4 open source productivity tools on my wishlist.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source productivity tools on my wishlist) +[#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +我的愿望清单上的 4 个开源生产力工具 +====== + +> 在 2020 年用开源实现更高生产力的二十种方式的最后一篇文章中,了解开源世界需要做什么。 + +![Two diverse hands holding a globe][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 不过… + +在搜索生产力应用程序时,我找不到想要的一切应用,而且几乎总是会丢失一些读者与我分享的精彩内容。 因此,当我结束本系列文章时,是时候[再次][2]谈论我在本年度系列文章中未能涵盖的一些主题。 + +![Desktop with Joplin, Emacs, and Firefox][3] + +#### 在 Vim 中聊天 + +我试过了。我真的非常非常想能够在 Vim 中聊天,但我做不到。我找到的一个软件包 [VimIRC.vim][4] 一直就工作不起来,我试了几天也没用。我探索的另一个选项是 [Irc it][5],这需要我付出更多的[努力去设置][6],超过了我正常可以付出的耐心或时间。我尝试过了,也确实做到了,但对于同处于相同境地的 Vim 用户,对不起,我无法帮到你。 + +#### Org 模式 + +![Org Mode in Emacs][7] + +我喜欢 [Org 模式][8],并且每天都使用它。关于 Org 模式我可以滔滔不绝的说上几天。它提供了基本的[任务跟踪][9];谷歌[日历][10]同步和 [CalFW][11] 集成;富文本文档、网站和演示文稿;链接到任何事物;等等、等等…… + +我希望你会在 2020 年从我这里收到更多有关 Org 模式的信息,因为它真的很酷。 + +#### 图形用户界面程序 + +在 2019 年的生产力系列中,我共享了很多图形用户界面程序,而今年几乎都是命令行应用程序。有一些很棒的图形程序可以帮助解决我今年谈论的一些问题,例如可以使用 Maildir 邮箱的[邮件][12]程序、用于读取本地日历文件的日历程序、[天气][13]应用程序等等。我甚至尝试了几项对我而言新奇的事物,看它们是否适合这个主题。除了 [twin][14] 之外,我没有感觉到有什么图形用户界面程序是新颖的(对我而言)或值得注意的(同样对我而言)今年要写的。至于…… + +#### 移动应用程序 + +越来越多的人将平板电脑(有时与笔记本电脑结合使用)作为主要设备。我将手机用于大多数社交媒体和即时消息传递,并且经常使用平板电脑(好的,老实说,好几个平板电脑)来阅读或浏览网络。可以肯定的是,并不是开源移动应用程序不存在,但是它们与我今年的主题不符。开源和移动应用程序正在发生很多变化,我正在仔细地寻找可以帮助我在手机和平板电脑上提高工作效率的事物。 + +### 该你了 + +非常感谢你阅读今年的系列文章。请你发表评论,告诉我错过的或需要在 2021 年看到的内容。正如我在 [Productivity Alchemy] [15] 播客上所说:“哥们,记着:保持生产力!” + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-productivity-tools + +作者:[Kevin Sonney][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/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE (Two diverse hands holding a globe) +[2]: https://opensource.com/article/19/1/productivity-tool-wish-list +[3]: https://opensource.com/sites/default/files/uploads/productivity_20-1.png (Desktop with Joplin, Emacs, and Firefox) +[4]: https://github.com/vim-scripts/VimIRC.vim +[5]: https://tools.suckless.org/ii/ +[6]: https://www.reddit.com/r/vim/comments/48t7ws/vim_ii_irc_client_xpost_runixporn/d0macnl/ +[7]: https://opensource.com/sites/default/files/uploads/productivity_20-2.png (Org Mode in Emacs) +[8]: https://orgmode.org/ +[9]: https://opensource.com/article/20/1/open-source-to-do-list +[10]: https://opensource.com/article/20/1/open-source-calendar +[11]: https://github.com/kiwanami/emacs-calfw +[12]: https://opensource.com/article/20/1/organize-email-notmuch +[13]: https://opensource.com/article/20/1/open-source-weather-forecast +[14]: https://github.com/cosmos72/twin +[15]: https://productivityalchemy.com From e410bb05f7ce7a1be8a7994b8baa48019ed5edd9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 22:04:23 +0800 Subject: [PATCH 065/207] TSL --- .../20200212 Extend the life of your SSD drive with fstrim.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200212 Extend the life of your SSD drive with fstrim.md (100%) diff --git a/sources/tech/20200212 Extend the life of your SSD drive with fstrim.md b/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md similarity index 100% rename from sources/tech/20200212 Extend the life of your SSD drive with fstrim.md rename to translated/tech/20200212 Extend the life of your SSD drive with fstrim.md From 964218debcd387146e69fc5c57f1442cd0fb2999 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 22:28:26 +0800 Subject: [PATCH 066/207] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Morisun029 @lixin555 @nacyro @lnrCoder @summer2233 @BrunoJu @lxbwolf --- ...ear in review, and more industry trends.md | 71 ---------- ... years of Java, and other industry news.md | 71 ---------- ...wered by Ceph, and more industry trends.md | 66 ---------- ...a Major Update With Version 2.5 Release.md | 115 ----------------- ...sma 5.18 LTS Released With New Features.md | 121 ------------------ ...GNU-Linux is Turning into Hyperbola BSD.md | 2 +- ...r your System Drive using Software RAID.md | 2 +- ...your awk skills with two easy tutorials.md | 2 +- ...1 A guide to intermediate awk scripting.md | 2 +- ...8 How to use regular expressions in awk.md | 2 +- ...and tutorials for beginners and experts.md | 2 +- ...ll No Longer Have The Default Root User.md | 87 ------------- ...113 How to setup a DNS server with bind.md | 2 +- 13 files changed, 7 insertions(+), 538 deletions(-) delete mode 100644 sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md delete mode 100644 sources/news/20200205 The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news.md delete mode 100644 sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md delete mode 100644 sources/news/20200212 OpenShot Video Editor Gets a Major Update With Version 2.5 Release.md delete mode 100644 sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md delete mode 100644 sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md diff --git a/sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md b/sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md deleted file mode 100644 index 7a3a40d845..0000000000 --- a/sources/news/20200130 NSA cloud advice, Facebook open source year in review, and more industry trends.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (NSA cloud advice, Facebook open source year in review, and more industry trends) -[#]: via: (https://opensource.com/article/20/1/nsa-facebook-more-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -NSA cloud advice, Facebook open source year in review, 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. - -## [Facebook open source year in review][2] - -> Last year was a busy one for our [open source][3] engineers. In 2019 we released 170 new open source projects, bringing our portfolio to a total of 579 [active repositories][3]. While it’s important for our internal engineers to contribute to these projects (and they certainly do — with more than 82,000 commits this year), we are also incredibly grateful for the massive support from external contributors. Approximately 2,500 external contributors committed more than 32,000 changes. In addition to these contributions, nearly 93,000 new people starred our projects this year, growing the most important component of any open source project — the community! Facebook Open Source would not be here without your contributions, so we want to thank you for your participation in 2019. - -**The impact**: Facebook got ~33% more changes than they would have had they decided to develop these as closed projects. Organizations addressing similar challenges got an 82,000-commit boost in exchange. What a clear illustration of the business impact of open source development. - -## [Cloud advice from the NSA][4] - -> This document divides cloud vulnerabilities into four classes (misconfiguration, poor access control, shared tenancy vulnerabilities, and supply chain vulnerabilities) that encompass the vast majority of known vulnerabilities. Cloud customers have a critical role in mitigating misconfiguration and poor access control, but can also take actions to protect cloud resources from the exploitation of shared tenancy and supply chain vulnerabilities. Descriptions of each vulnerability class along with the most effective mitigations are provided to help organizations lock down their cloud resources. By taking a risk-based approach to cloud adoption, organizations can securely benefit from the cloud’s extensive capabilities. - -**The impact**: The Fear, Uncertainty, and Doubt (FUD) that has been associated with cloud adoption is being debunked more all the time. None other then the US Department of Defense has done a lot of the thinking so you don't have to, and there is a good chance that their concerns are at least as dire as yours are. - -## [With Kubernetes, China Minsheng Bank transformed its legacy applications][5] - -> But all of CMBC’s legacy applications—for example, the core banking system, payment systems, and channel systems—were written in C and Java, using traditional architecture. “We wanted to do distributed applications because in the past we used VMs in our own data center, and that was quite expensive and with low resource utilization rate,” says Zhang. “Our biggest challenge is how to make our traditional legacy applications adaptable to the cloud native environment.” So far, around 20 applications are running in production on the Kubernetes platform, and 30 new applications are in active development to adopt the Kubernetes platform. - -**The impact**: This illustrates nicely the challenges and opportunities facing businesses in a competitive environment, and suggests a common adoption pattern. Do new stuff the new way, and move the old stuff as it makes sense. - -## [The '5 Rs' of the move to cloud native: Re-platform, re-host, re-factor, replace, retire][6] - -> The bottom line is that telcos and service providers will go cloud native when it is cheaper for them to migrate to the cloud and pay cloud costs than it is to remain in the data centre. That time is now and by adhering to the "5 Rs" of the move to cloud native, Re-platform, Re-host, Re-factor, Replace and/or Retire, the path is open, clearly marked and the goal eminently achievable. - -**The impact**: Cloud-native is basically used as a synonym for open source in this interview; there is no other type of technology that will deliver the same lift. - -## [Fedora CoreOS out of preview][7] - -> Fedora CoreOS is a new Fedora Edition built specifically for running containerized workloads securely and at scale. It’s the successor to both [Fedora Atomic Host][8] and [CoreOS Container Linux][9] and is part of our effort to explore new ways of assembling and updating an OS. Fedora CoreOS combines the provisioning tools and automatic update model of Container Linux with the packaging technology, OCI support, and SELinux security of Atomic Host.  For more on the Fedora CoreOS philosophy, goals, and design, see the [announcement of the preview release][10]. - -**The impact**: Collapsing these two branches of the Linux family tree into one another moves the state of the art forward for everyone (once you get through the migration). - -_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/nsa-facebook-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://opensource.com/article/20/1/hybrid-developer-future-industry-trends -[3]: https://opensource.facebook.com/ -[4]: https://media.defense.gov/2020/Jan/22/2002237484/-1/-1/0/CSI-MITIGATING-CLOUD-VULNERABILITIES_20200121.PDF -[5]: https://www.cncf.io/blog/2020/01/23/with-kubernetes-china-minsheng-bank-transformed-its-legacy-applications-and-moved-into-ai-blockchain-and-big-data/ -[6]: https://www.telecomtv.com/content/cloud-native/the-5-rs-of-the-move-to-cloud-native-re-platform-re-host-re-factor-replace-retire-37473/ -[7]: https://fedoramagazine.org/fedora-coreos-out-of-preview/ -[8]: https://www.projectatomic.io/ -[9]: https://coreos.com/os/docs/latest/ -[10]: https://fedoramagazine.org/introducing-fedora-coreos/ diff --git a/sources/news/20200205 The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news.md b/sources/news/20200205 The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news.md deleted file mode 100644 index 2e814fdfc0..0000000000 --- a/sources/news/20200205 The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news) -[#]: via: (https://opensource.com/article/20/2/linux-java-and-other-industry-news) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -The Y2038 problem in the Linux kernel, 25 years of Java, and other industry news -====== -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. - -## [Need 32-bit Linux to run past 2038? When version 5.6 of the kernel pops, you're in for a treat][2] - -> Arnd Bergmann, an engineer working on the thorny Y2038 problem in the Linux kernel, posted to the [mailing list][3] that, yup, Linux 5.6 "should be the first release that can serve as a base for a 32-bit system designed to run beyond year 2038." - -**The impact:** Y2K didn't get fixed; it just got bigger and delayed. There is no magic in software or computers; just people trying to solve complicated problems as best they can, and some times introducing more complicated problems for different people to solve at some point in the future. - -## [What the dev? Celebrating Java's 25th anniversary][4] - -> Java is coming up on a big milestone: Its 25th anniversary! To celebrate, we take a look back over the last 25 years to see how Java has evolved over time. In this episode, Social Media and Online Editor Jenna Sargent talks to Rich Sharples, senior director of product management for middleware at Red Hat, to learn more. - -**The impact:** There is something comforting about immersing yourself in a deep well of lived experience. Rich clearly lived through what he is talking about and shares insider knowlege with you (and his dog). - -## [Do I need an API Gateway if I use a service mesh?][5] - -> This post may not be able to break through the noise around API Gateways and Service Mesh. However, it’s 2020 and there is still abundant confusion around these topics. I have chosen to write this to help bring real concrete explanation to help clarify differences, overlap, and when to use which. Feel free to [@ me on twitter (@christianposta)][6] if you feel I’m adding to the confusion, disagree, or wish to buy me a beer (and these are not mutually exclusive reasons). - -**The impact:** Yes, though they use similar terms and concepts they have different concerns and scopes. - -## [What Australia's AGL Energy learned about Cloud Native compliance][7] - -> This is really at the heart of what open source is, enabling everybody to contribute equally. Within large enterprises, there are controls that are needed, but if we can automate the management of the majority of these controls, we can enable an amazing culture and development experience. - -**The impact:** They say "software is eating the world" and "developers are the new kingmakers." The fact that compliance in an energy utility is subject to developer experience improvement basically proves both statements. - -## [Monoliths are the future][8] - -> And then what they end up doing is creating 50 deployables, but it’s really a _distributed_ monolith. So it’s actually the same thing, but instead of function calls and class instantiation, they’re initiating things and throwing it over a network and hoping that it comes back. And since they can’t reliably _make it_ come back, they introduce things like [Prometheus][9], [OpenTracing][10], all of this stuff. I’m like, **“What are you doing?!”** - -**The impact:** Do things for real reasons with a clear-eyed understanding of what those reasons are and how they'll make your business or your organization better. - -_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/linux-java-and-other-industry-news - -作者:[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.theregister.co.uk/2020/01/30/linux_5_6_2038/ -[3]: https://lkml.org/lkml/2020/1/29/355 -[4]: https://whatthedev.buzzsprout.com/673192/2543290-celebrating-java-s-25th-anniversary-episode-16 -[5]: https://blog.christianposta.com/microservices/do-i-need-an-api-gateway-if-i-have-a-service-mesh/ (Do I Need an API Gateway if I Use a Service Mesh?) -[6]: http://twitter.com/christianposta?lang=en -[7]: https://thenewstack.io/what-australias-agl-energy-learned-about-cloud-native-compliance/ -[8]: https://changelog.com/posts/monoliths-are-the-future -[9]: https://prometheus.io/ -[10]: https://opentracing.io diff --git a/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md b/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md deleted file mode 100644 index 424f69bcc2..0000000000 --- a/sources/news/20200211 Building a Linux desktop, CERN powered by Ceph, and more industry trends.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Building a Linux desktop, CERN powered by Ceph, and more industry trends) -[#]: via: (https://opensource.com/article/20/2/linux-desktop-cern-more-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -Building a Linux desktop, CERN powered by Ceph, 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. - -## [Building a Linux desktop for cloud-native development][2] - -> This post covers the building of my Linux Desktop PC for Cloud Native Development. I'll be covering everything from parts, to peripherals, to CLIs, to SaaS software with as many links and snippets as I can manage. I hope that you enjoy reading about my experience, learn something, and possibly go on to build your own Linux Desktop. - -**The impact**: I hope the irony is not lost on anyone that step 1, when doing cloud-native software development, is to install Linux on a physical computer. - -## [Enabling CERN’s particle physics research with open source][3] - -> Ceph is an open-source software-defined storage platform. While it’s not often in the spotlight, it’s working hard behind the scenes, playing a crucial role in enabling ambitious, world-renowned projects such as CERN’s particle physics research, Immunity Bio’s cancer research, The Human Brain Project, MeerKat radio telescope, and more. These ventures are propelling the collective understanding of our planet and the human race beyond imaginable realms, and the outcomes will forever change how we perceive our existence and potential.  - -**The impact**: It is not often that you get to see a straight line drawn between storage and the perception of human existence. Thanks for that, CERN! - -## [2020 cloud predictions][4] - -> "Serverless" as a concept provides a simplified developer experience that will become a platform feature. More platform-as-a-service providers will incorporate serverless traits into the daily activities developers perform when building cloud-native applications, becoming the default computing paradigm for the cloud. - -**The impact:** All of the trends in the predictions in this post are basically about maturation as ideas like serverless, edge computing, DevOps, and other cloud-adjacent buzz words move from the early adopters into the early majority phase of the adoption curve. - -## [End-of-life announcement for CoreOS Container Linux][5] - -> As we've [previously announced][6], [Fedora CoreOS][7] is the official successor to CoreOS Container Linux. Fedora CoreOS is a [new Fedora Edition][8] built specifically for running containerized workloads securely and at scale. It combines the provisioning tools and automatic update model of Container Linux with the packaging technology, OCI support, and SELinux security of Atomic Host. For more on the Fedora CoreOS philosophy, goals, and design, see the [announcement of the preview release][9] and the [Fedora CoreOS documentation][10]. - -**The impact**: Milestones like this are often bittersweet for both creators and users. The CoreOS team built something that their community loved to use, which is something to be celebrated. Hopefully, that community can find a [new home][11] in the wider [Fedora ecosystem][8]. - -_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/2/linux-desktop-cern-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://blog.alexellis.io/building-a-linux-desktop-for-cloud-native-development/ -[3]: https://insidehpc.com/2020/02/how-ceph-powers-exciting-research-with-open-source/ -[4]: https://www.devopsdigest.com/2020-cloud-predictions-2 -[5]: https://coreos.com/os/eol/ -[6]: https://groups.google.com/d/msg/coreos-user/zgqkG88DS3U/PFP9yrKbAgAJ -[7]: https://getfedora.org/coreos/ -[8]: https://fedoramagazine.org/fedora-coreos-out-of-preview/ -[9]: https://fedoramagazine.org/introducing-fedora-coreos/ -[10]: https://docs.fedoraproject.org/en-US/fedora-coreos/ -[11]: https://getfedora.org/en/coreos/ diff --git a/sources/news/20200212 OpenShot Video Editor Gets a Major Update With Version 2.5 Release.md b/sources/news/20200212 OpenShot Video Editor Gets a Major Update With Version 2.5 Release.md deleted file mode 100644 index bb3b2dc59a..0000000000 --- a/sources/news/20200212 OpenShot Video Editor Gets a Major Update With Version 2.5 Release.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (OpenShot Video Editor Gets a Major Update With Version 2.5 Release) -[#]: via: (https://itsfoss.com/openshot-2-5-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -OpenShot Video Editor Gets a Major Update With Version 2.5 Release -====== - -[OpenShot][1] is one of the [best open-source video editors][2] out there. With all the features that it offered – it was already a good video editor on Linux. - -Now, with a major update to it (**v.2.5.0**), OpenShot has added a lot of new improvements and features. And, trust me, it’s not just any regular release – it is a huge release packed with features that you probably wanted for a very long time. - -In this article, I will briefly mention the key changes involved in the latest release. - -![][3] - -### OpenShot 2.5.0 Key Features - -Here are some of the major new features and improvements in OpenShot 2.5: - -#### Hardware Acceleration Support - -The hardware acceleration support is still an experimental addition – however, it is a useful feature to have. - -Instead of relying on your CPU to do all the hard work, you can utilize your GPU to encode/decode video data when working with MP4/H.264 video files. - -This will affect (or improve) the performance of OpenShot in a meaningful way. - -#### Support Importing/Exporting Files From Final Cut Pro & Premiere - -![][4] - -[Final Cut Pro][5] and [Adobe Premiere][6] are the two popular video editors for professional content creators. OpenShot 2.5 now allows you to work on projects created on these platforms. It can import (or export) the files from Final Cut Pro & Premiere in EDL & XML formats. - -#### Thumbnail Generation Improved - -This isn’t a big feature – but a necessary improvement to most of the video editors. You don’t want broken images in the thumbnails (your timeline/library). So, with this update, OpenShot now generates the thumbnails using a local HTTP server, can check multiple folder locations, and regenerate missing ones. - -#### Blender 2.8+ Support - -The new OpenShot release also supports the latest [Blender][7] (.blend) format – so it should come in handy if you’re using Blender as well. - -#### Easily Recover Previous Saves & Improved Auto-backup - -![][8] - -It was always a horror to lose your timeline work after you accidentally deleted it – which was then auto-saved to overwrite your saved project. - -Now, the auto-backup feature has improved with an added ability to easily recover your previous saved version of the project. - -Even though you can recover your previous saves now – you will find a limited number of the saved versions, so you have to still remain careful. - -#### Other Improvements - -In addition to all the key highlights mentioned above, you will also notice a performance improvement when using the keyframe system. - -Several other issues like SVG compatibility, exporting & modifying keyframe data, and resizable preview window have been fixed in this major update. For privacy-concerned users, OpenShot no longer sends usage data unless you opt-in to share it with them. - -For more information, you can take a look at [OpenShot’s official blog post][9] to get the release notes. - -### Installing OpenShot 2.5 on Linux - -You can simply download the .AppImage file from its [official download page][10] to [install the latest OpenShot version][11]. If you’re new to AppImage, you should also check out [how to use AppImage][12] on Linux to easily launch OpenShot. - -[Download Latest OpenShot Release][10] - -Some distributions like Arch Linux may also provide the latest OpenShot release with regular system updates. - -#### PPA available for Ubuntu-based distributions - -On Ubuntu-based distributions, if you don’t want to use AppImage, you can [use the official PPA][13] from OpenShot: - -``` -sudo add-apt-repository ppa:openshot.developers/ppa -sudo apt update -sudo apt install openshot-qt -``` - -You may want to know how to remove PPA if you want to uninstall it later. - -**Wrapping Up** - -With all the latest changes/improvements considered, do you see [OpenShot][11] as your primary [video editor on Linux][14]? If not, what more do you expect to see in OpenShot? Feel free to share your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/openshot-2-5-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://www.openshot.org/ -[2]: https://itsfoss.com/open-source-video-editors/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/openshot-2-5-0.png?ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/openshot-xml-edl.png?ssl=1 -[5]: https://www.apple.com/in/final-cut-pro/ -[6]: https://www.adobe.com/in/products/premiere.html -[7]: https://www.blender.org/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/openshot-recovery.jpg?ssl=1 -[9]: https://www.openshot.org/blog/2020/02/08/openshot-250-released-video-editing-hardware-acceleration/ -[10]: https://www.openshot.org/download/ -[11]: https://itsfoss.com/openshot-video-editor-release/ -[12]: https://itsfoss.com/use-appimage-linux/ -[13]: https://itsfoss.com/ppa-guide/ -[14]: https://itsfoss.com/best-video-editing-software-linux/ diff --git a/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md b/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md deleted file mode 100644 index 8100290280..0000000000 --- a/sources/news/20200213 KDE Plasma 5.18 LTS Released With New Features.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (KDE Plasma 5.18 LTS Released With New Features) -[#]: via: (https://itsfoss.com/kde-plasma-5-18-release/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -KDE Plasma 5.18 LTS Released With New Features -====== - -[KDE plasma][1] desktop is undoubtedly one of the most impressive [Linux desktop environments][2] available out there right now. - -Now, with the latest release, the KDE Plasma desktop just got more awesome! - -KDE Plasma 5.18 marks itself as an LTS (Long Term Support) release i.e it will be maintained by the KDE contributors for the next 2 years while the regular versions are maintained for just 4 months. - -![KDE Plasma 5.18 on KDE Neon][3] - -So, if you want more stability on your KDE-powered Linux system, it would be a good idea to upgrade to KDE’s Plasma 5.18 LTS release. - -### KDE Plasma 5.18 LTS Features - -Here are the main new features added in this release: - -#### Emoji Selector - -![Emoji Selector in KDE][4] - -Normally, you would Google an emoji to copy it to your clipboard or simply use the good-old emoticons to express yourself. - -Now, with the latest update, you get an emoji selector in Plasma Desktop. You can simply find it by searching for it in the application launcher or by just pressing (Windows key/Meta/Super Key) + . (**period/dot)**. - -The shortcut should come in handy when you need to use an emoji while sending an email or any other sort of messages. - -#### Global Edit Mode - -![Global Edit Mode][5] - -You probably would have used the old desktop toolbox on the top-right corner of the screen in the Plasma desktop, but the new release gets rid of that and instead – provides you with a global edit mode when you right-click on the desktop and click on “**Customize Layout**“. - -#### Night Color Control - -![Night Color Control][6] - -Now, you can easily toggle the night color mode right from the system tray. In addition to that, you can even choose to set a keyboard shortcut for both night color and the do not disturb mode. - -#### Privacy Improvements For User Feedback - -![Improved Privacy][7] - -It is worth noting that KDE Plasma lets you control the user feedback information that you share with them. - -You can either choose to disable sharing any information at all or control the level of information you share (basic, intermediate, and detailed). - -#### Global Themes - -![Themes][8] - -You can either choose from the default global themes available or download community-crafted themes to set up on your system. - -#### UI Improvements - -There are several subtle improvements and changes. For instance, the look and feel of the notifications have improved. - -You can also notice a couple of differences in the software center (Discover) to help you easily install apps. - -Not just limited to that, but you also get the ability to mute the volume of a window from the taskbar (just like you normally do on your browser’s tab). Similarly, there are a couple of changes here and there to improve the KDE Plasma experience. - -#### Other Changes - -In addition to the visual changes and customization ability, the performance of KDE Plasma has improved when coupled with a graphics hardware. - -To know more about the changes, you can refer the [official announcement post][9] for KDE Plasma 5.18 LTS. - -[Subscribe to our YouTube channel for more Linux videos][10] - -### How To Get KDE Plasma 5.18 LTS? - -If you are using a rolling release distribution like Arch Linux, you might have got it with the system updates. If you haven’t performed an update yet, simply check for updates from the system settings. - -If you are using Kubuntu, you can add the Kubuntu backports PPA to update the Plasma desktop with the following commands: - -``` -sudo add-apt-repository ppa:kubuntu-ppa/backports -sudo apt update && sudo apt full-upgrade -``` - -If you do not have KDE as your desktop environment, you can refer our article on [how to install KDE on Ubuntu][11] to get started. - -**Wrapping Up** - -KDE Plasma 5.18 may not involve a whole lot of changes – but being an LTS release, the key new features seem helpful and should come in handy to improve the Plasma desktop experience for everyone. - -What do you think about the latest Plasma desktop release? Feel free to let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/kde-plasma-5-18-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://kde.org/plasma-desktop/ -[2]: https://itsfoss.com/best-linux-desktop-environments/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-5-18-info.jpg?ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-emoji-pick.jpg?ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-global-editor.jpg?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-night-color.jpg?ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/user-feedback-kde-plasma.png?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/kde-plasma-global-themes.jpg?ssl=1 -[9]: https://kde.org/announcements/plasma-5.18.0.php -[10]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[11]: https://itsfoss.com/install-kde-on-ubuntu/ diff --git a/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md b/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md index a2bca0089f..68ede9acfa 100644 --- a/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md +++ b/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Morisun029) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20190503 Mirror your System Drive using Software RAID.md b/sources/tech/20190503 Mirror your System Drive using Software RAID.md index e72f3a5722..ba62a2f21a 100644 --- a/sources/tech/20190503 Mirror your System Drive using Software RAID.md +++ b/sources/tech/20190503 Mirror your System Drive using Software RAID.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (lixin555) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20191031 Advance your awk skills with two easy tutorials.md b/sources/tech/20191031 Advance your awk skills with two easy tutorials.md index 76f7a54e5f..f84e4ebe3a 100644 --- a/sources/tech/20191031 Advance your awk skills with two easy tutorials.md +++ b/sources/tech/20191031 Advance your awk skills with two easy tutorials.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (nacyro) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20191111 A guide to intermediate awk scripting.md b/sources/tech/20191111 A guide to intermediate awk scripting.md index 7e788b2adc..53e7126eb1 100644 --- a/sources/tech/20191111 A guide to intermediate awk scripting.md +++ b/sources/tech/20191111 A guide to intermediate awk scripting.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (lnrCoder) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20191118 How to use regular expressions in awk.md b/sources/tech/20191118 How to use regular expressions in awk.md index a0be0df4d7..2cf5881263 100644 --- a/sources/tech/20191118 How to use regular expressions in awk.md +++ b/sources/tech/20191118 How to use regular expressions in awk.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (lixin555) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md index 03fc77a8e1..3172f26ea1 100644 --- a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md +++ b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (summer2233) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md b/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md deleted file mode 100644 index 0f087529b9..0000000000 --- a/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (BrunoJu) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Kali Linux Will No Longer Have The Default Root User) -[#]: via: (https://itsfoss.com/kali-linux-root-user/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Kali Linux Will No Longer Have The Default Root User -====== - -Kali Linux is a specialized Linux distribution for cyber security testing and hacking related tasks. - -If you’ve used [Kali Linux][1], you probably know that it followed a default root user policy. In other words, you are always root in Kali Linux. Whatever you do – you will be accessing tools/applications as root by default. - -It looks like everything back then was kind of “root for all” for everything. So, the default root user policy existed. - -They also explained the history for this in their [announcement post][2]: - -> A lot of those tools back then either required root access to run or ran better when ran as root. With this operating system that would be ran from a CD, never be updated, and had a lot of tools that needed root access to run it was a simple decision to have a “everything as root” security model. It made complete sense for the time. - -### Kali Linux will now have a default non-root user (like most other distributions) - -![][3] - -A default non-root model was necessary because a lot of users now use Kali Linux as their daily driver. - -Of course, they [do not recommend using Kali Linux][4] as a replacement for stable distributions like Ubuntu/Fedora/Manjaro – however, with its active development, some users do consider using it on a day-to-day basis instead of just using it for its tools. - -So, with a wide mainstream usage of the distro, the Kali Linux team thought of switching to a default non-root model because nowadays a lot of applications/tools do not require root access. - -> While we don’t encourage people to run Kali as their day to day operating system, over the last few years more and more users have started to do so _(even if they are not using it to do penetration testing full time)_, including some members of the Kali development team. When people do so, they obviously don’t run as default root user. With this usage over time, there is the obvious conclusion that default root user is no longer necessary and Kali will be better off moving to a more traditional security model. - -So I am reiterating that you should not consider Kali Linux to be fit for your daily tasks if you do not utilize security-related [Kali Linux tools][5]. Feel free to experiment – but I wouldn’t be so sure to rely on it. - -So from the next release, when you install Kali Linux, you’ll be asked to create non-root user that will have admin privileges. Tools and commands that require root access will be run with sudo. - -![][6] - -#### [Pretend to be Using Windows with Kali Linux Undercover Mode][7] - -The new undercover mode in Kali Linux switches the desktop layout to make it look like Windows 10. Find out how to activate the undercover mode. - -### New default user and password for Kali Linux live mode - -![Kali Linux has new user-password in the live system][8] - -Technically, you won’t find a groundbreaking difference. Just note that the default user ID and password in live mode is “**kali**“. - -You can find the new non-root model implemented in the new daily/weekly builds if you want to test it early. - -In either case, you can wait for the 2020.1 release scheduled for late January to take a look at the new default non-root user model. - -### Getting back the old root model in Kali Linux - -If you are a long time Kali Linux user, you may not find it convenient to add sudo before commands and then manually enter the password. - -The good news here is that you can still get the old password-less root rights with this command: - -``` -sudo dpkg-reconfigure kali-grant-root -``` - -What do you think about the default non-root user model? Is it a good decision? Let me know your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/kali-linux-root-user/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://www.kali.org/ -[2]: https://www.kali.org/news/kali-default-non-root-user/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/kali_linux_default_root_user.png?ssl=1 -[4]: https://itsfoss.com/kali-linux-review/ -[5]: https://itsfoss.com/best-kali-linux-tools/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/kali_linux_undercover_mode.jpg?fit=800%2C450&ssl=1 -[7]: https://itsfoss.com/kali-linux-undercover-mode/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/kali-linux-live-password.png?ssl=1 diff --git a/sources/tech/20200113 How to setup a DNS server with bind.md b/sources/tech/20200113 How to setup a DNS server with bind.md index 74cc32e747..897dc825a8 100644 --- a/sources/tech/20200113 How to setup a DNS server with bind.md +++ b/sources/tech/20200113 How to setup a DNS server with bind.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (lxbwolf) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8850cbbdc4f4fdc054733314702fd3e369847a4e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 22:40:49 +0800 Subject: [PATCH 067/207] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MonkeyDEcho --- sources/tech/20180416 Cgo and Python.md | 1 - ...181105 5 Minimal Web Browsers for Linux.md | 171 ------------------ 2 files changed, 172 deletions(-) delete mode 100644 sources/tech/20181105 5 Minimal Web Browsers for Linux.md diff --git a/sources/tech/20180416 Cgo and Python.md b/sources/tech/20180416 Cgo and Python.md index c78a820276..e5688d43c8 100644 --- a/sources/tech/20180416 Cgo and Python.md +++ b/sources/tech/20180416 Cgo and Python.md @@ -1,5 +1,4 @@ Cgo and Python -[#] MonkeyDEcho translating ============================================================ ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_hero.png?auto=format&w=1900&dpr=1) diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md deleted file mode 100644 index 34c0c1e18e..0000000000 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MonkeyDEcho ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (5 Minimal Web Browsers for Linux) -[#]: via: (https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) -[#]: url: ( ) - -5 Minimal Web Browsers for Linux -====== -linux上的五种微型浏览器 -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) - -There are so many reasons to enjoy the Linux desktop. One reason I often state up front is the almost unlimited number of choices to be found at almost every conceivable level. From how you interact with the operating system (via a desktop interface), to how daemons run, to what tools you use, you have a multitude of options. -有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 - -The same thing goes for web browsers. You can use anything from open source favorites, such as [Firefox][1] and [Chromium][2], or closed sourced industry darlings like [Vivaldi][3] and [Chrome][4]. Those options are full-fledged browsers with every possible bell and whistle you’ll ever need. For some, these feature-rich browsers are perfect for everyday needs. -web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 - -There are those, however, who prefer using a web browser without all the frills. In fact, there are many reasons why you might prefer a minimal browser over a standard browser. For some, it’s about browser security, while others look at a web browser as a single-function tool (as opposed to a one-stop shop application). Still others might be running low-powered machines that cannot handle the requirements of, say, Firefox or Chrome. Regardless of the reason, Linux has you covered. -但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 - -Let’s take a look at five of the minimal browsers that can be installed on Linux. I’ll be demonstrating these browsers on the Elementary OS platform, but each of these browsers are available to nearly every distribution in the known Linuxverse. Let’s dive in. -让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! - -### GNOME Web - -GNOME Web (codename Epiphany, which means [“a usually sudden manifestation or perception of the essential nature or meaning of something”][5]) is the default web browser for Elementary OS, but it can be installed from the standard repositories. (Note, however, that the recommended installation of Epiphany is via Flatpak or Snap). If you choose to install via the standard package manager, issue a command such as sudo apt-get install epiphany-browser -y for successful installation. -GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 - -Epiphany uses the WebKit rendering engine, which is the same engine used in Apple’s Safari browser. Couple that rendering engine with the fact that Epiphany has very little in terms of bloat to get in the way, you will enjoy very fast page-rendering speeds. Epiphany development follows strict adherence to the following guidelines: - - * Simplicity - Feature bloat and user interface clutter are considered evil. - - * Standards compliance - No non-standard features will ever be introduced to the codebase. - - * Software freedom - Epiphany will always be released under a license that respects freedom. - - * Human interface - Epiphany follows the [GNOME Human Interface Guidelines][6]. - - * Minimal preferences - Preferences are only added when they make sense and after careful consideration. - - * Target audience - Non-technical users are the primary target audience (which helps to define the types of features that are included). - - - - -GNOME Web is as clean and simple a web browser as you’ll find (Figure 1). - -![GNOME Web][8] - -Figure 1: The GNOME Web browser displaying a minimal amount of preferences for the user. - -[Used with permission][9] - -The GNOME Web manifesto reads: - -A web browser is more than an application: it is a way of thinking, a way of seeing the world. Epiphany's principles are simplicity, standards compliance, and software freedom. - -### Netsurf - -The [Netsurf][10] minimal web browser opens almost faster than you can release the mouse button. Netsurf uses its own layout and rendering engine (designed completely from scratch), which is rather hit and miss in its rendering (Figure 2). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_2.jpg?itok=KhGhIKlj) - -Although you might find Netsurf to suffer from rendering issues on certain sites, understand the Hubbub HTML parser is following the work-in-progress HTML5 specification, so there will be issues popup now and then. To ease those rendering headaches, Netsurf does include HTTPS support, web page thumbnailing, URL completion, scale view, bookmarks, full-screen mode, keyboard shorts, and no particular GUI toolkit requirements. That last bit is important, especially when you switch from one desktop to another. - -For those curious as to the requirements for Netsurf, the browser can run on a machine as slow as a 30Mhz ARM 6 computer with 16MB of RAM. That’s impressive, by today’s standard. - -### QupZilla - -If you’re looking for a minimal browser that uses the Qt Framework and the QtWebKit rendering engine, [QupZilla][11] might be exactly what you’re looking for. QupZilla does include all the standard features and functions you’d expect from a web browser, such as bookmarks, history, sidebar, tabs, RSS feeds, ad blocking, flash blocking, and CA Certificates management. Even with those features, QupZilla still manages to remain a very fast lightweight web browser. Other features include: Fast startup, speed dial homepage, built-in screenshot tool, browser themes, and more. -One feature that should appeal to average users is that QupZilla has a more standard preferences tools than found in many lightweight browsers (Figure 3). So, if going too far outside the lines isn’t your style, but you still want something lighter weight, QupZilla is the browser for you. - -![QupZilla][13] - -Figure 3: The QupZilla preferences tool. - -[Used with permission][9] - -### Otter Browser - -Otter Browser is a free, open source attempt to recreate the closed-source offerings found in the Opera Browser. Otter Browser uses the WebKit rendering engine and has an interface that should be immediately familiar with any user. Although lightweight, Otter Browser does include full-blown features such as: - - * Passwords manager - - * Add-on manager - - * Content blocking - - * Spell checking - - * Customizable GUI - - * URL completion - - * Speed dial (Figure 4) - - * Bookmarks and various related features - - * Mouse gestures - - * User style sheets - - * Built-in Note tool - - -![Otter][15] - -Figure 4: The Otter Browser Speed Dial tab. - -[Used with permission][9] - -Otter Browser can be run on nearly any Linux distribution from an [AppImage][16], so there’s no installation required. Just download the AppImage file, give the file executable permissions (with the command chmod u+x otter-browser-*.AppImage), and then launch the app with the command ./otter-browser*.AppImage. - -Otter Browser does an outstanding job of rendering websites and could function as your go-to minimal browser with ease. - -### Lynx - -Let’s get really minimal. When I first started using Linux, back in ‘97, one of the web browsers I often turned to was a text-only take on the app called [Lynx][17]. It should come as no surprise that Lynx is still around and available for installation from the standard repositories. As you might expect, Lynx works from the terminal window and doesn’t display pretty pictures or render much in the way of advanced features (Figure 5). In fact, Lynx is as bare-bones a browser as you will find available. Because of how bare-bones this web browser is, it’s not recommended for everyone. But if you happen to have a gui-less web server and you have a need to be able to read the occasional website, Lynx can be a real lifesaver. - -![Lynx][19] - -Figure 5: The Lynx browser rendering the Linux.com page. - -[Used with permission][9] - -I have also found Lynx an invaluable tool when troubleshooting certain aspects of a website (or if some feature on a website is preventing me from viewing the content in a regular browser). Another good reason to use Lynx is when you only want to view the content (and not the extraneous elements). - -### Plenty More Where This Came From - -There are plenty more minimal browsers than this. But the list presented here should get you started down the path of minimalism. One (or more) of these browsers are sure to fill that need, whether you’re running it on a low-powered machine or not. - -Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux - -作者:[Jack Wallen][a] -选题:[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/users/jlwallen -[b]: https://github.com/lujun9972 -[1]: https://www.mozilla.org/en-US/firefox/new/ -[2]: https://www.chromium.org/ -[3]: https://vivaldi.com/ -[4]: https://www.google.com/chrome/ -[5]: https://www.merriam-webster.com/dictionary/epiphany -[6]: https://developer.gnome.org/hig/stable/ -[7]: /files/images/minimalbrowsers1jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_1.jpg?itok=Q7wZLF8B (GNOME Web) -[9]: /licenses/category/used-permission -[10]: https://www.netsurf-browser.org/ -[11]: https://qupzilla.com/ -[12]: /files/images/minimalbrowsers3jpg -[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_3.jpg?itok=O8iMALWO (QupZilla) -[14]: /files/images/minimalbrowsers4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_4.jpg?itok=5bCa0z-e (Otter) -[16]: https://sourceforge.net/projects/otter-browser/files/ -[17]: https://lynx.browser.org/ -[18]: /files/images/minimalbrowsers5jpg -[19]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_5.jpg?itok=p_Lmiuxh (Lynx) -[20]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From cd96fd2215eb1dcb5e92974e060d9f9c62c117b1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 2 Mar 2020 22:45:05 +0800 Subject: [PATCH 068/207] TSL --- .../tech/20181231 Troubleshooting hardware problems in Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20181231 Troubleshooting hardware problems in Linux.md (100%) diff --git a/sources/tech/20181231 Troubleshooting hardware problems in Linux.md b/translated/tech/20181231 Troubleshooting hardware problems in Linux.md similarity index 100% rename from sources/tech/20181231 Troubleshooting hardware problems in Linux.md rename to translated/tech/20181231 Troubleshooting hardware problems in Linux.md From 90a3e3db8f716d7d398d4ba3181cf04429d1ce1b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 3 Mar 2020 00:54:20 +0800 Subject: [PATCH 069/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Sessio?= =?UTF-8?q?n:=20An=20Open=20Source=20Private=20Messenger=20That=20Doesn?= =?UTF-8?q?=E2=80=99t=20Need=20Your=20Phone=20Number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md --- ...ger That Doesn-t Need Your Phone Number.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md diff --git a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md new file mode 100644 index 0000000000..bc4dece67e --- /dev/null +++ b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) +[#]: via: (https://itsfoss.com/session-messenger/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number +====== + +_**Brief: Our open source software highlight of the week is Session. It is a fork of another increasingly popular private messenger Signal. Session doesn’t even need your phone number to operate.**_ + +### Session: A private messenger in true sense + +![][1] + +Privacy concerned people are always in the search of an ultimate service that lets you communicate securely while respecting our privacy across multiple platforms. + +Recently, I came across an interesting open-source messaging app “[Session][2]” by [Loki Foundation][3], which is technically a fork of another [open source encrypted messenger Signal][4]. + +In this article, I’ll be sharing my experience with the Session app while highlighting the features it offers. + +Session is fairly new to the scene – I’ve mentioned some of the bugs that I encountered at the bottom of the article. + +### Features of Session Messenger + +I’ll highlight the key features of Session that will help you decide if it’s good enough for you to try. + +#### Session does not require a phone number + +![][5] + +For privacy-enthusiasts, registering the phone number with Signal or other such applications is a potential risk. + +But, with Session, you do not need a phone number, simply click on “**Create Account**” after you install it on your desktop or phone and it will simply generate a random (unique) **Session ID**. + +It’ll look something like this: **05652245af9a8bfee4f5a8138fd5c……..** + +So, you just have to share your Session ID with the contact you want to add. Or, you can also opt to get the **QR Code** after account creation which you can share with your friends to add you back. + +#### Session uses blockchain (and other crypto tech) + +![Session ID][6] + +For the users who’re aware of what a [blockchain][7] is – they’ve been waiting for real-world applications that an average user can utilize. Session is one such example that utilizes blockchain at its core and you don’t need to know it’s there. + +If you’re curious about how it works, you can take a look at their [official blog post][8] explaining it. + +#### Cross-Platform Support + +![][9] + +For something strictly privacy-focused, you’d also want it to be available across multiple platforms. + +Of course, primarily, I’d focus on the Linux and Android support but it also supports Windows/Mac/iOS. So, you can easily sync between multiple devices cross-platform. + +#### Includes Essential Privacy Options + +![][10] + +Undoubtedly, it offers some essential privacy-focused features that will help make the experience more secure. + +For starters, you have the following options: + + * **Message TTL**: This lets you control how long the message exists before the recipient sees the message. + * **Read Receipts**: Let others know that you’ve seen the message or if your message has been read. + + + +#### Session uses a decentralized network and protects your metadata + +Even though Session isn’t a peer-to-peer technology, it does not have a central server for the network. + +It takes a decentralized approach to how the messages are transmitted (or routed). If you’ve no idea what I’m talking about, you can follow Session’s official blog post to know the [difference between centralization and decentralization][11] and explore how it potentially works. + +And, this approach of network helps them to protect the metadata (the information associated with a message like IP address). + +#### Other Features + +Not just limited to the latest/greatest privacy-friendly features, but it also supports group chats, voice messages, and also allows you to send attachments. + +### Installing Session on Linux + +If you head to the [official download page][12], you will be able to download an .**AppImage** file. In case you have no clue how it works, you should take a look at our article on [how to use AppImage][13]. + +In either case, you can also head to their [GitHub releases page][14] and grab the **.deb** file. + +[Download Session][12] + +### My Experience On Using Session App + +I’ve managed to try it on multiple platforms. For the desktop, I utilized the .AppImage file on **Pop!_OS 19.10** to run Session. + +Overall, the user experience was impressive and had no UI glitches. + +It’s also easy to recover your account once you’ve backed up your secret code (which is known as **seed**) from the settings. + +![][15] + +But, I also noticed a couple of issues- which can be fixed/improved: + + * Delay in accepting a friend request + * The way of linking devices is not intuitive + * Sometimes when you reply from two separate devices (using the same ID), the receiver gets two different conversations. + + + +**Conclusion** + +Of course, nothing’s ever perfect. For now, I’m thinking of keeping it installed and considering Session’s features, it is definitely something a privacy-focused user should try. + +What do you think about it? Feel free to let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/session-messenger/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-app.jpg?ssl=1 +[2]: https://getsession.org/ +[3]: https://loki.foundation/ +[4]: https://itsfoss.com/signal-messaging-app/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-create.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/session-application-id.jpg?ssl=1 +[7]: https://en.wikipedia.org/wiki/Blockchain +[8]: https://getsession.org/how-session-protects-your-anonymity-with-blockchain-and-crypto/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-cross-platform.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-settings.jpg?fit=800%2C512&ssl=1 +[11]: https://getsession.org/centralisation-vs-decentralisation-in-private-messaging/ +[12]: https://getsession.org/download/ +[13]: https://itsfoss.com/use-appimage-linux/ +[14]: https://github.com/loki-project/session-desktop/releases +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-seed.jpg?ssl=1 From 64c310139c390e7d12d9075d3ee858edbe1cd3fb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 3 Mar 2020 00:55:35 +0800 Subject: [PATCH 070/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200302=20Instal?= =?UTF-8?q?l=20GNU=20Emacs=20on=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200302 Install GNU Emacs on Windows.md --- .../20200302 Install GNU Emacs on Windows.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20200302 Install GNU Emacs on Windows.md diff --git a/sources/tech/20200302 Install GNU Emacs on Windows.md b/sources/tech/20200302 Install GNU Emacs on Windows.md new file mode 100644 index 0000000000..be429efe50 --- /dev/null +++ b/sources/tech/20200302 Install GNU Emacs on Windows.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Install GNU Emacs on Windows) +[#]: via: (https://opensource.com/article/20/3/emacs-windows) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Install GNU Emacs on Windows +====== +Even if your operating system is closed source, you can still use this +popular open source text editor. +![Tall building with windows][1] + +GNU Emacs is a popular text editor designed for programmers of all sorts. Because it was developed on Unix and is widely used on Linux (and shipped with macOS), people sometimes don't realize that it's also available for Microsoft Windows. You don't need to be an experienced or full-time programmer to make use of Emacs, either. You can download and install Emacs with just a few clicks, and this article shows you how. + +You can install Windows manually or with a package manager, like [Chocolatey][2]. + +### 7-zip + +If you haven't already installed 7-zip for Windows, you should do that first. [7-zip][3] is an open source archive utility with the ability to create and extract ZIP, 7z, TAR, XZ, BZIP2, and GZIP (and more) files. It's an invaluable tool for Windows users. + +After installing 7-zip, you have new 7-zip archive options in your right-click menu when browsing files in Windows Explorer. + +### Powershell and Chocolatey + +To install GNU Emacs on Windows using Chocolatey: + + +``` +`PS> choco install emacs-full` +``` + +Once it has installed, launch Emacs from Powershell: + + +``` +`PS> emacs` +``` + +![Emacs running on Windows][4] + +### Download GNU Emacs for Windows + +To manually install GNU Emacs on Windows, you must [download Emacs][5]. + +![GNU Windows downloader][6] + +This takes you to a server near you, which shows you a list of all available Emacs releases. Find the directory with the highest release number and click into it. There are many different builds of Emacs for Windows, but the most general-purpose version is just named **emacs-VERSION-ARCHITECTURE.zip**. The **VERSION** depends upon which release you're downloading, while the **ARCHITECTURE** depends on whether you have a 32-bit or 64-bit machine. Most modern computers are 64-bit, but if you're in doubt you can download the 32-bit version, which runs on both. + +If you're downloading version 26 of Emacs for a 64-bit machine, you would click the link titled **emacs-26.2-x86_64.zip**. There are smaller downloads available (such as the **no-deps** variety) but you must be familiar with how Emacs is built from source code, knowing which libraries it needs and which of those your computer has on it already. Generally, it's easiest to get the large version of Emacs, because it contains everything it needs to run on your computer. + +### Extract Emacs + +Next, unarchive the ZIP file you downloaded. To extract it, right-click on the Emacs ZIP file and select **Extract to Emacs-VERSION** from the 7-zip sub-menu. It's a big archive, so it may take a while to uncompress, but when it does, you have a new directory containing all the files distributed with Emacs. For example, in this example, the file **emacs-26.2-x86_64.zip** was downloaded, so the unarchived directory is **emacs-26.2-x86_64**. + +### Launch Emacs + +Within the Emacs directory, find the **bin** directory. This folder stores all the binary executable files (EXE files) distributed with Emacs. Double-click the **emacs.exe** file to launch the application. + +![Emacs running on Windows][7] + +You can create a shortcut to **emacs.exe** on your desktop for easier access. + +### Learn Emacs + +Emacs isn't as obtuse as its reputation may indicate. It's got its own traditions and conventions, but when you're typing text into it, you can treat it exactly as you treat Notepad or any given text field on any given website. + +The important differences occur when you _edit_ the text you've typed. + +The only way to learn is to start using it, though, so make Emacs your go-to text editor for simple tasks. When you'd normally open Notepad or Word or Evernote or whatever it is you use for quick notes or as a temporary scratchpad, launch Emacs instead. + +Emacs has the reputation of being a terminal-based application, but obviously it has a GUI, so use the GUI often, just as you would with any application. Copy, cut, and paste (or "yank" in Emacs terminology) from the menu instead of with the keyboard, and open and save files from the menu or toolbar. Start from the beginning and learn the application based on what it is and not how you think it should act based on your experience with other editors. + +### Download our [cheatsheet][8]! + +_Thanks to Matthias Pfuetzner and Stephen Smoogen._ + +These are Jimmy's six favorite open source applications that he immediately installs on a new... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/emacs-windows + +作者:[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/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://github.com/chocolatey/choco +[3]: https://www.7-zip.org/ +[4]: https://opensource.com/sites/default/files/uploads/windows-ps-choco-emacs.jpg (Emacs running on Windows) +[5]: https://www.gnu.org/software/emacs/download.html +[6]: https://opensource.com/sites/default/files/uploads/windows-emacs-download.jpg (GNU Windows downloader) +[7]: https://opensource.com/sites/default/files/uploads/windows-emacs.jpg (Emacs running on Windows) +[8]: https://opensource.com/downloads/emacs-cheat-sheet From ec7255480e6bcac1bde1267401c05181bca9767c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 3 Mar 2020 00:57:27 +0800 Subject: [PATCH 071/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200302=20Using?= =?UTF-8?q?=20LibreOffice=20for=20your=20open=20source=20budgeting=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md --- ...ice for your open source budgeting tool.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md diff --git a/sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md b/sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md new file mode 100644 index 0000000000..9d26ff39c7 --- /dev/null +++ b/sources/tech/20200302 Using LibreOffice for your open source budgeting tool.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using LibreOffice for your open source budgeting tool) +[#]: via: (https://opensource.com/article/20/3/libreoffice-open-source-budget) +[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) + +Using LibreOffice for your open source budgeting tool +====== +Figure out where your money is going with this LibreOffice Calc budget +template. +![scientific calculator][1] + +Budgets can be intimidating for beginners. It can feel overwhelming to think about money, much less about how to keep track of it. But it's important to know where your money is coming and going. + +In this article, I'll step through a sample budget by explaining the logic behind important money decisions as well as the formulas you need to automate the process. Fortunately, LibreOffice makes it easy for anyone to keep their yearly budget in check, even the math-averse. + +### Getting started + +Begin by downloading and installing [LibreOffice][2], if you don't already have it. Next, download my [LibreOffice Calc template][3], which you can use as a starting point to create your own budget to meet your spending and savings goals. + +It's important to interact with your spreadsheet frequently. You can input transactions as they happen, daily, or weekly. You even could save up your receipts to calculate all your expenses at the end of the month, but this can be a hard slog. You want budgeting to be as quick and easy as possible. + +### Categories + +The first step to creating a budget is to decide on the categories you want to track. These categories can be as simple or as complex as you like. Think about what is useful to your personal situation and financial goals. You can easily add or change categories as your needs change. + +The template has a number of example categories you can start with. There is no right or wrong way to choose categories; your budget has to work for you. Look through the list in Column A of the **Budget** tab and decide which ones to keep, which to delete, and any others you want to add. Then edit that list to align with your personal income and expense situation. + +#### Create category drop-down menus + +![Budget categories][4] + +The template uses a drop-down menu to make it easy to assign categories to income and expenses. You can view them on the **Monthly** sheets (accessed with the tabs at the bottom of the LibreOffice window). Click on a cell in Column C, and a drop-down arrow will appear on the right. Click the arrow, and you'll see the example categories. You may need to change some of them so that they will match the categories in your budget (Column A of the **Budget** tab). + +To add or remove categories from the dropdown menu, click on Column C in a Monthly sheet to select all **Category** cells. Then, in the main menu, select **Data** > **Validity**. This opens up a dialog box. + +In **Validity**, select the **Criteria** tab, then click on the arrow to the right of **Allow**, set it to **List**, and type the categories you want to use in the **Entries** box. Type one category per line. Make sure to use the exact same categories you used on the **Budget** sheet in Column A. + +### Estimating your budget + +Once you have defined your categories, it's time to estimate how much you expect to earn and spend. You can calculate these amounts monthly, yearly, or using a mix of the two. + +Your first year of budgeting estimates won't be perfect, and you may be surprised at how much or little you spend on certain categories. But doing this will help you get a realistic idea of where your money is going. You can make adjustments in your second year to create a more accurate budget based upon what you spend in year one. + +In Column B (**Monthly Estimate**) of the **Budget** tab, enter your anticipated _monthly_ income and expenses for each category (an exception is the **Charity** row, which is automatically calculated as a percentage of your income). For _annual_ expenses and income (e.g., taxes, insurance, tuition, etc.), enter them in Column P (**Yearly Estimate**). + +#### Calculating the annual cost of monthly expenses + +Most expenses occur monthly. To find the yearly cost of a monthly expense, multiply your monthly estimate by 12. You could do this manually for each category, but it is much easier to use formulas. + +Formulas are automated calculations that determine the value of a cell. Formulas do all the heavy lifting, so you don't have to do a lot of sums in your head. + +In the template, you can use the **Yearly Estimate** column to make an equation to annualize a monthly expense or income. In a cell in Column P, type this: + + +``` +`=SUM(x*12)` +``` + +but change _x_ to the name of the **Monthly Estimate** cell you want to use. (For example, to calculate the annual cost of your phone service using the template, the formula would read **=SUM(B12*13)**.) + +#### Calculating the monthly cost of yearly expenses + +You may pay some expenses, such as car insurance, only once a year. You can either ignore these expenses in the monthly estimates or put money aside for them in your budget each month. + +If you want to do the latter, you need to divide your **Yearly Estimate** by 12 and put that amount into your monthly budget. To do so, place this equation in the appropriate cell in the **Monthly Estimate** column: + + +``` +`=SUM(x/12)` +``` + +where _x_ is the corresponding **Yearly Estimate** cell on your spreadsheet (from Column P). + +#### Finding percentages + +If you want to donate or save a percentage of your income, there's a function for that, too! + +The common recommendation is to put aside 20% of your take-home pay for savings. While I don't focus on this too much, I do find it helpful to see if I'm meeting my savings goals from month to month. + +For instance, Row 32 of the **Budget** tab template uses this formula to calculate the 20% of your income that you should allocate to savings: + + +``` +`=SUM(B2*0.2)` +``` + +This same method can be used if you give a percentage (e.g., 10%) of your income to charity (Row 21 of the template): + + +``` +`=SUM(B2*-0.1)` +``` + +This formula uses a negative percentage because donating to charity is an expense. + +### Entering monthly income and expenses + +The template pulls data totals from the **Monthly** sheets (the tabs at the bottom of the spreadsheet) to populate Columns C through N on the **Budget** sheet. + +It's useful to place each month's transactions on separate sheets of your budget spreadsheet. By keeping your receipts from purchases and entering them into each month's sheet, you create a digital record of your money. + +Enter income as positive numbers and expenses as negative numbers. Select the appropriate category using the drop-down in the **Category** column. + +In LibreOffice, the **SUMIF** function can look at values in a specific column and extract only the ones that occur next to a specific word. My template uses a **SUMIF** formula to extract values based on the adjacent category in order to enter an amount in the correct cell on the **Budget** tab. For example, to enter January's internet expenses into the **Budget** spreadsheet, enter this formula in cell C12: + + +``` +`=SUMIF(january.$C:$C,A12,january.$D:$D)` +``` + +This looks at January's Column C and, if it sees an entry that contains the word in A12 on the **Budget** tab (Internet), then it extracts the number from Column D on the **January** tab and enters that value into the cell that contains the formula on the **Budget** tab (C12). + +### Analyzing your budget data + +#### Adding a range of numbers to calculate YTD spending + +To see how much you have spent overall this year to date (YTD), select the cell where you want to display that data (in the template, it's cell O29, under the **YTD** column), and enter the following formula to total the range of numbers corresponding to your monthly **Total Expense**: + + +``` +`=SUM(x:y)` +``` + +Instead of _x_ and _y_, enter the first cell and the last cell in the range. You can type them in manually, but it's easier and less error-prone to just click and drag from the first to last cell. LibreOffice does the calculation and enters the appropriate values. + +#### Seeing how you're doing on your budget + +A big part of budgeting is comparing your estimates to your actual income and expenses. In the template, this is the **Budget** tab's Column Q. This column subtracts the contents of each cell in Column O (**YTD**) from Column P (**Yearly Estimate**).  + + +``` +`=SUM(x-y)` +``` + +where _x_ and _y_ equal the corresponding cells from Column P and O. For example, using the template to calculate how much you've spent on Utilities compared to your budget, you would enter **=SUM(P11-O11)**. + +![Budget overview][5] + +### Tracking expenses + +Now that your yearly budget is set up, you are ready to start meeting your financial goals. + +It's important to look at your budget often—and it's equally important to do so without guilt. Think of this process as gathering data so that you can adjust your estimates for the next year. The primary goal of budgeting is to understand your own spending habits and refine either your expectations or your behavior so that you can plan better for how your income is used. + +Which open source tools and apps do you use to budget? Tell us in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/libreoffice-open-source-budget + +作者:[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/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) +[2]: https://www.libreoffice.org/download/download/ +[3]: https://opensource.com/sites/default/files/uploads/budget_template_0.ods +[4]: https://opensource.com/sites/default/files/uploads/imagebudget_cat.png (Budget categories) +[5]: https://opensource.com/sites/default/files/uploads/imagebudget_overview.png (Budget overview) From a5c982d71d5d9547357c898676750677ea3865cb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 3 Mar 2020 00:59:21 +0800 Subject: [PATCH 072/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200302=208=20re?= =?UTF-8?q?asons=20to=20consider=20hyperconverged=20infrastructure=20for?= =?UTF-8?q?=20your=20data=20center?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md --- ...ged infrastructure for your data center.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md diff --git a/sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md b/sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md new file mode 100644 index 0000000000..10b1e0575d --- /dev/null +++ b/sources/talk/20200302 8 reasons to consider hyperconverged infrastructure for your data center.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 reasons to consider hyperconverged infrastructure for your data center) +[#]: via: (https://www.networkworld.com/article/3530072/eight-reasons-to-consider-hyperconverged-infrastructure-for-your-data-center.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +8 reasons to consider hyperconverged infrastructure for your data center +====== + +Thinkstock + +Demand for on-premises data center equipment is shrinking as organizations move workloads to the cloud. But on-prem is far from dead, and one segment that’s thriving is hyperconverged infrastructure ([HCI][1]). + +HCI is a form of scale-out, software-integrated infrastructure that applies a modular approach to compute, network and storage capacity. Rather than silos with specialized hardware, HCI leverages distributed, horizontal blocks of commodity hardware and delivers a single-pane dashboard for reporting and management. Form factors vary: Enterprises can choose to deploy hardware-agnostic [hyperconvergence software][2] from vendors such as Nutanix and VMware, or an integrated HCI appliance from vendors such as HP Enterprise, Dell, Cisco, and Lenovo. + +**Learn more about enterprise infrastructure trends** + + * [Making the right hyperconvergence choice: HCI hardware or software?][3] + * [10 of the world's fastest supercomputers][4] + * [NVMe over Fabrics creates data-center storage disruption][5] + * [For enterprise storage, persistent memory is here to stay][6] + + + +The market is growing fast. By 2023, Gartner projects 70% of enterprises will be running some form of hyperconverged infrastructure, up from less than 30% in 2019. And as HCI grows in popularity, cloud providers such as Amazon, Google and Microsoft are providing connections to on-prem HCI products for hybrid deployment and management. + +So why is it so popular? Here are some of the top reasons. + +### 1) Simplified design + +A traditional data center design is comprised of separate storage silos with individual tiers of servers and specialized networking spanning the compute and storage silos. This worked in the pre-cloud era, but it’s too rigid for the cloud era. “It’s untenable for IT teams to take weeks or months to provision new infrastructure so the dev team can produce new apps and get to market quickly,” says Greg Smith, vice president of product marketing at Nutanix. + +“HCI radically simplifies data center architectures and operations, reducing the time and expense of managing data and delivering apps,” he says. + +### 2) Cloud integration + +HCI software, such as from Nutanix or VMware, is deployed the same way in both a customer’s data center and cloud instances; it runs on bare metal instances in the cloud exactly the same as it does in a data center. HCI “is the best foundation for companies that want to build a hybrid cloud. They can deploy apps in their data center and meld it with a public cloud,” Smith says. + +[][7] + +“Because it’s the same on both ends, I can have one team manage an end-to-end hybrid cloud and with confidence that whatever apps run in my private cloud will also run in that public cloud environment,” he adds. + +### 3) Ability to start small, grow large + +“HCI allows you to consolidate compute, network, and storage into one box, and grow this solution quickly and easily without a lot of downtime,” says Tom Lockhart, IT systems manager with Hastings Prince Edward Public Health in Bellville, Ontario, Canada. + +In a legacy approach, multiple pieces of hardware – a server, Fiber Channel switch, host-based adapters, and a hypervisor – have to be installed and configured separately. With hyperconvergence, everything is software-defined. HCI uses the storage in the server, and the software almost entirely auto-configures and detects the hardware, setting up the connections between compute, storage, and networking. + +“Once we get in on a workload, [customers] typically have a pretty good experience. A few months later, they try another workload, then another, and they start to extend it out of their data center to remote sites,” says Chad Dunn, vice president of product management for HCI at Dell. + +“They can start small and grow incrementally larger but also have a consistent operating model experience, whether they have 1,000 nodes or three nodes per site across 1,000 sites, whether they have 40 terabytes of data or 40 petabytes. They have consistent software updates where they don’t have to retrain their people because it’s the same toolset,” Dunn added. + +### 4) Reduced footprint + +By starting small, customers find they can reduce their hardware stack to just what they need, rather than overprovision excessive capacity. Moving away from the siloed approach also allows users to eliminate certain hardware. + +Josh Goodall, automation engineer with steel fabricator USS-POSCO Industries, says his firm deployed HCI primarily for its ability to do stretched clusters, where the hardware cluster is in two physical locations but linked together. This is primarily for use as a backup, so if one site went down, the other can take over the workload. In the process, though, USS-POSCO got rid of a lot of expensive hardware and software. “We eliminated several CPU [software] licenses, we eliminated the SAN from other site, we didn’t need SRM [site recovery management] software, and we didn’t need Commvault licensing. We saved between $25,000 and $30,000 on annual license renewals,” Goodall says. + +### 5) No special skills needed + +To run a traditional three-tiered environment, companies need specialists in compute, storage, and networking. With HCI, a company can manage its environment with general technology consultants and staff rather than the more expensive specialists. + +“HCI has empowered the storage generalist,” Smith says. “You don’t have to hire a storage expert, a network expert. Everyone has to have infrastructure, but they made the actual maintenance of infrastructure a lot easier than under a typical scenario, where a deep level of expertise is needed to manage under those three skill sets.” + +Lockhart of Hastings Prince Edward Public Health says adding new compute/storage/networking is also much faster when compared to traditional infrastructure. “An upgrade to our server cluster was 20 minutes with no down time, versus hours of downtime with an interruption in service using the traditional method,” he says. + +“Instead of concentrating on infrastructure, you can expand the amount of time and resources you spend on workloads, which adds value to your business. When you don’t have to worry about infrastructure, you can spend more time on things that add value to your clients,” Lockhart adds. + +### 6) Faster disaster recovery + +Key elements of hyperconvergence products are their backup, recovery, data protection, and data deduplication capabilities, plus analytics to examine it all. Disaster recovery components are managed from a single dashboard, and HCI monitors not only the on-premises storage but also cloud storage resources. With deduplication, compression rates as high as 55:1, and backups can be done in minutes. + +USS-POSCO Industries is an HP Enterprise shop and uses HPE’s SimpliVity HCI software, which includes dedupe, backup, and recovery. Goodall says he gets about 12-15:1 compression on mixed workloads, and that has eliminated the need for third-party backup software. + +More importantly, recovery timeframes have dropped. “The best recent example is a Windows update messed up a manufacturing line, and the error wasn’t realized for a few weeks. In about 30 minutes, I rolled through four weeks of backups, updated the system, rebooted and tested a 350GB system. Restoring just one backup would have been a multi-hour process,” Goodall says. + +### 7) Hyperconvergence analytics + +HCI products come with a considerable amount of analytics software to monitor workloads and find resource constraints. The monitoring software is consolidated into a single dashboard view of system performance, including negatively impacted performance. + +Hastings recently had a problem with a Windows 7 migration, but the HCI model made it easy to get performance info. “It showed that workloads, depending on time of day, were running out of memory, and there was excessive CPU queuing and paging,” Lockhart says. “We had the entire [issue] written up in an hour. It was easy to determine where problems lie. It can take a lot longer without that single-pane-of-glass view.” + +### 8) Less time managing network, storage resources + +Goodall says he used to spend up to 50% of his time dealing with storage issues and backup matrixes. Now he spends maybe 20% of his time dealing with it and most of his time tackling and addressing legacy systems. And his apps are better performing under HCI. “We’ve had no issues with our SQL databases; if anything, we’ve seen huge performance gain due to the move to full SSDs [instead of hard disks] and the data dedupe, reducing reads and writes in the environment.” + +Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3530072/eight-reasons-to-consider-hyperconverged-infrastructure-for-your-data-center.html + +作者:[Andy Patrizio][a] +选题:[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/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207567/what-is-hyperconvergence.html?nsdr=true +[2]: https://www.networkworld.com/article/3318683/making-the-right-hyperconvergence-choice-hci-hardware-or-software.html +[3]: https://www.networkworld.com/article/3318683/making-the-right-hyperconvergence-choice-hci-hardware-or-software +[4]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html#slide1 +[5]: https://www.networkworld.com/article/3394296/nvme-over-fabrics-creates-data-center-storage-disruption.html +[6]: https://www.networkworld.com/article/3398988/for-enterprise-storage-persistent-memory-is-here-to-stay.html +[7]: 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) +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world From fbfbece223dc77a960fc97da5741cffd189c4b26 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 3 Mar 2020 08:22:50 +0800 Subject: [PATCH 073/207] translated --- ... PHP Development on Fedora with Eclipse.md | 89 ------------------- ... PHP Development on Fedora with Eclipse.md | 89 +++++++++++++++++++ 2 files changed, 89 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20200214 PHP Development on Fedora with Eclipse.md create mode 100644 translated/tech/20200214 PHP Development on Fedora with Eclipse.md diff --git a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md b/sources/tech/20200214 PHP Development on Fedora with Eclipse.md deleted file mode 100644 index 24ecdcb232..0000000000 --- a/sources/tech/20200214 PHP Development on Fedora with Eclipse.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (PHP Development on Fedora with Eclipse) -[#]: via: (https://fedoramagazine.org/php-development-on-fedora-with-eclipse/) -[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) - -PHP Development on Fedora with Eclipse -====== - -![][1] - -[Eclipse][2] is a full-featured free and open source IDE developed by the Eclipse Foundation. It has been around since 2001. You can write anything from C/C++ and Java to PHP, Python, HTML, JavaScript, Kotlin, and more in this IDE. - -### Installation - -The software is available from Fedora’s official repository. To install it, invoke: - -``` -sudo dnf install eclipse -``` - -This will install the base IDE and Eclipse platform, which enables you to develop Java applications. In order to add PHP development support to the IDE, run this command: - -``` -sudo dnf install eclipse-pdt -``` - -This will install PHP development tools like PHP project wizard, PHP server configurations, composer support, etc. - -### Features - -This IDE has many features that make PHP development easier. For example, it has a comprehensive project wizard (where you can configure many options for your new projects). It also has built-in features like composer support, debugging support, a browser,a terminal, and more. - -### Sample project - -Now that the IDE is installed, let’s create a simple PHP project. Go to _File →New → Project_. From the resulting dialog, select _PHP project_. Enter a name for your project. There are some other options you might want to change, like changing the project’s default location, enabling JavaScript, and changing PHP version. See the following screenshot. - -![Create A New PHP Project in Eclipse][3] - -You can click the _Finish_ button to create the project or press _Next_ to configure other options like adding include and build paths. You don’t need to change those in most cases. - -Once the project is created, right click on the project folder and select _New → PHP File_ to add a new PHP file to the project. For this tutorial I named it _index.php_, the conventionally-recognized default file in every PHP project. - -![][4] - -Then add the your code to the new file. - -![Demo PHP code][5] - -In the example above, I used CSS, JavaScript, and PHP tags on the same page mainly to show that the IDE is capable of supporting all of them together. - -Once your page is ready, you can see the result output by moving the file to your web server document root or by creating a development PHP server in the project directory. - -Thanks to the built-in terminal in Eclipse, we can launch a PHP development server right from within the IDE. Simply click the terminal icon on the toolbar (![Terminal Icon][6]) and click _OK_. In the new terminal, change to the project directory and run the following command: - -``` -php -S localhost:8080 -t . index.php -``` - -![Terminal output][7] - -Now, open a browser and head over to . If everything has been done correctly per instructions and your code is error-free, you will see the output of your PHP script in the browser. - -![PHP output in Fedora][8] - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/php-development-on-fedora-with-eclipse/ - -作者:[Mehdi Haghgoo][a] -选题:[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/powergame/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/php-eclipse-816x346.png -[2]: https://projects.eclipse.org/projects/eclipse -[3]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-01-58-39.png -[4]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-02-02-05-1024x576.png -[5]: https://fedoramagazine.org/wp-content/uploads/2020/02/code-1024x916.png -[6]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-03-50-05.png -[7]: https://fedoramagazine.org/wp-content/uploads/2020/02/terminal-1024x239.png -[8]: https://fedoramagazine.org/wp-content/uploads/2020/02/output.png diff --git a/translated/tech/20200214 PHP Development on Fedora with Eclipse.md b/translated/tech/20200214 PHP Development on Fedora with Eclipse.md new file mode 100644 index 0000000000..a9e0e48a56 --- /dev/null +++ b/translated/tech/20200214 PHP Development on Fedora with Eclipse.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PHP Development on Fedora with Eclipse) +[#]: via: (https://fedoramagazine.org/php-development-on-fedora-with-eclipse/) +[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) + +使用 Eclipse 在 Fedora 上进行 PHP 开发 +====== + +![][1] + +[Eclipse][2] 是由 Eclipse 基金会开发的功能全面的免费开源 IDE。自 2001 年以来一直存在。你可以在此 IDE 中编写从 C/C++ 和 Java 到 PHP、Python、HTML、JavaScript、Kotlin 等。 + +### 安装 + +该软件可从 Fedora 的官方仓库中获得。要安装它,请用: + +``` +sudo dnf install eclipse +``` + +这将安装基本的 IDE 和 Eclipse 平台,能让你开发 Java 应用。为了将 PHP 开发支持添加到 IDE,请运行以下命令: + +``` +sudo dnf install eclipse-pdt +``` + +这将安装 PHP 开发工具,如 PHP 项目向导、PHP 服务器配置,composer 支持等。 + +### 功能 + +该 IDE 有许多使 PHP 开发更加容易的功能。例如,它有全面的项目向导(你可以在其中为新项目配置许多选项)。它还有如 composer 支持、调试支持、浏览器、终端等内置功能。 + +### 示例项目 + +现在已经安装了 IDE,让我们创建一个简单的 PHP 项目。进入 _File →New → Project_。在出现的对话框中,选择 _PHP project_。输入项目的名称。你可能还需要更改其他一些选项,例如更改项目的默认位置,启用 JavaScript 以及更改 PHP 版本。请看以下截图。 + +![Create A New PHP Project in Eclipse][3] + +你可以单击 _Finish_ 按钮创建项目,或按 _Next_ 配置其他选项,例如添加包含和构建路径。在大多数情况下,你无需更改这些设置。 + +创建项目后,右键单击项目文件夹,然后选择 _New→PHP File_ 将新的 PHP 文件添加到项目。在本教程中,我将其命名为 _index.php_,这是每个 PHP 项目中公认的默认文件。 + +![][4] + +接着在新文件中添加代码。 + +![Demo PHP code][5] + +在上面的例子中,我在同一页面上使用了 CSS、JavaScript 和 PHP 标记,主要是为了展示 IDE 能够支持所有这些标记。 + +页面完成后,你可以将文件移至 Web 服务器文档根目录或在项目目录中创建一个开发 PHP 服务器来查看输出。 + +借助 Eclipse 中的内置终端,我们可以直接在 IDE 中启动 PHP 开发服务器。只需单击工具栏上的终端图标(![Terminal Icon][6]),然后单击 _OK_。在新终端中,进入项目目录,然后运行以下命令: + +``` +php -S localhost:8080 -t . index.php +``` + +![Terminal output][7] + +现在,打开浏览器并进入 。如果按照说明正确完成了所有操作,并且代码没有错误,那么你将在浏览器中看到 PHP 脚本的输出。 + +![PHP output in Fedora][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/php-development-on-fedora-with-eclipse/ + +作者:[Mehdi Haghgoo][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/powergame/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/php-eclipse-816x346.png +[2]: https://projects.eclipse.org/projects/eclipse +[3]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-01-58-39.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-02-02-05-1024x576.png +[5]: https://fedoramagazine.org/wp-content/uploads/2020/02/code-1024x916.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/02/Screenshot-from-2020-02-07-03-50-05.png +[7]: https://fedoramagazine.org/wp-content/uploads/2020/02/terminal-1024x239.png +[8]: https://fedoramagazine.org/wp-content/uploads/2020/02/output.png From c2fb406528fd3c1016b4ab1191b2b1fa331e88eb Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 3 Mar 2020 08:26:51 +0800 Subject: [PATCH 074/207] translating --- .../tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md index 6443a00482..6a93204805 100644 --- a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md +++ b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 62bbf6fd7e9a6c67d2ad092ac81bd96fc6541890 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 3 Mar 2020 10:13:04 +0800 Subject: [PATCH 075/207] PRF @wxy --- ...1 Troubleshooting hardware problems in Linux.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20181231 Troubleshooting hardware problems in Linux.md b/translated/tech/20181231 Troubleshooting hardware problems in Linux.md index eee2160639..cffbb8f5b2 100644 --- a/translated/tech/20181231 Troubleshooting hardware problems in Linux.md +++ b/translated/tech/20181231 Troubleshooting hardware problems in Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Troubleshooting hardware problems in Linux) @@ -12,11 +12,11 @@ Linux 硬件故障排除指南 > 了解是什么原因导致你的 Linux 硬件发生故障,以便你可以将其恢复并快速运行。 -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_other11x_cc.png?itok=I_kCDYj0) +![](https://img.linux.net.cn/data/attachment/album/202003/03/101312zcazy02wl2g8uhy1.jpg) -[Linux 服务器][1]在物理机、虚拟化、私有云、公共云和混合云等许多不同种类的基础设施中运行着关键的业务应用程序。对于 Linux 系统管理员来说,了解如何管理 Linux 硬件基础设施(包括与 [网络][2]、存储、Linux 容器相关的软件定义的功能)和 Linux 服务器上的多种工具非常重要。 +[Linux 服务器][1]在物理机、虚拟化、私有云、公共云和混合云等许多不同种类的基础设施中运行着关键的业务应用程序。对于 Linux 系统管理员来说,了解如何管理 Linux 硬件基础设施(包括与 [网络][2]、存储、Linux 容器相关的软件定义功能)和 Linux 服务器上的多种工具非常重要。 -在 Linux 上进行故障排除和解决与硬件相关的问题可能需要一些时间。即使是经验丰富的系统管理员,有时也会花费数小时来解决神秘的硬件和软件差异。 +在 Linux 上进行排除和解决与硬件相关的问题可能需要一些时间。即使是经验丰富的系统管理员,有时也会花费数小时来解决神秘的硬件和软件差异。 以下提示可以使你更快、更轻松地对 Linux 中的硬件进行故障排除。许多不同的事情都可能导致 Linux 硬件出现问题。在开始诊断它们之前,明智的做法是了解最常见的问题以及最有可能找到问题的地方。 @@ -54,7 +54,7 @@ xvdb    202:16   0  20G  0 disk .... ``` -### 深入到多个日志当中 +### 深入到各个日志当中 使用 `dmesg` 可以找出内核最新消息中的错误和警告。例如,这是 `dmesg | more` 命令的输出: @@ -93,7 +93,7 @@ Dec  1 13:21:33 bastion dnsmasq[30201]: using nameserver 127.0.0.1#53 for domai ### 分析网络功能 -你可能有成千上万的云原生应用程序在一个复杂的网络环境中为业务提供服务。其中可能包括虚拟化、多云和混合云。这意味着,作为故障排除的一部分,你应该分析网络连接是否正常工作。弄清 Linux 服务器中网络功能的有用命令包括:`ip addr`、`traceroute`、`nslookup`、`dig` 和 `ping` 等。例如,这是 `ip addr show` 命令的输出: +你可能有成千上万的云原生应用程序在一个复杂的网络环境中为业务提供服务,其中可能包括虚拟化、多云和混合云。这意味着,作为故障排除的一部分,你应该分析网络连接是否正常工作。弄清 Linux 服务器中网络功能的有用命令包括:`ip addr`、`traceroute`、`nslookup`、`dig` 和 `ping` 等。例如,这是 `ip addr show` 命令的输出: ``` # ip addr show @@ -129,7 +129,7 @@ via: https://opensource.com/article/18/12/troubleshooting-hardware-problems-linu 作者:[Daniel Oh][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 55baf904b467ff0b6fef690da266577a0bbbf395 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 3 Mar 2020 10:13:45 +0800 Subject: [PATCH 076/207] PUB @wxy https://linux.cn/article-11953-1.html --- .../20181231 Troubleshooting hardware problems in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181231 Troubleshooting hardware problems in Linux.md (99%) diff --git a/translated/tech/20181231 Troubleshooting hardware problems in Linux.md b/published/20181231 Troubleshooting hardware problems in Linux.md similarity index 99% rename from translated/tech/20181231 Troubleshooting hardware problems in Linux.md rename to published/20181231 Troubleshooting hardware problems in Linux.md index cffbb8f5b2..34dbed5f44 100644 --- a/translated/tech/20181231 Troubleshooting hardware problems in Linux.md +++ b/published/20181231 Troubleshooting hardware problems in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11953-1.html) [#]: subject: (Troubleshooting hardware problems in Linux) [#]: via: (https://opensource.com/article/18/12/troubleshooting-hardware-problems-linux) [#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) From 03cb1976135ed46c877cff013e3bc004872b6067 Mon Sep 17 00:00:00 2001 From: MFG <48886453+MFGJT@users.noreply.github.com> Date: Tue, 3 Mar 2020 13:33:53 +0800 Subject: [PATCH 077/207] Update 20190422 9 ways to save the planet.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2020.03.03申领原文 --- sources/tech/20190422 9 ways to save the planet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190422 9 ways to save the planet.md b/sources/tech/20190422 9 ways to save the planet.md index d3301006cc..a448fa7660 100644 --- a/sources/tech/20190422 9 ways to save the planet.md +++ b/sources/tech/20190422 9 ways to save the planet.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MFGJT) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 67c1663127915b8fc43b632c27866430f200b9c9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 3 Mar 2020 20:59:46 +0800 Subject: [PATCH 078/207] APL --- ...to set up your own fast, private open source mesh network.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md b/sources/tech/20200214 How to set up your own fast, private open source mesh network.md index b68b57da3d..fa8b645527 100644 --- a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md +++ b/sources/tech/20200214 How to set up your own fast, private open source mesh network.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7095936674f53ee70f3ef8325fb05089a608b1d2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 3 Mar 2020 21:34:12 +0800 Subject: [PATCH 079/207] TSL --- ... fast, private open source mesh network.md | 110 ----------------- ... fast, private open source mesh network.md | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20200214 How to set up your own fast, private open source mesh network.md create mode 100644 translated/tech/20200214 How to set up your own fast, private open source mesh network.md diff --git a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md b/sources/tech/20200214 How to set up your own fast, private open source mesh network.md deleted file mode 100644 index fa8b645527..0000000000 --- a/sources/tech/20200214 How to set up your own fast, private open source mesh network.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to set up your own fast, private open source mesh network) -[#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh) -[#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason) - -How to set up your own fast, private open source mesh network -====== -FreeMesh is an affordable, performant, privacy-respecting mesh system -that installs in less than 10 minutes. -![people on top of a connected globe][1] - -The [FreeMesh][2] system promises to bring fully open source mesh networking to the masses. I recently had a chance to test it; it installed quickly, and the performance was great—especially for the price. - -### Why mesh and open source? - -The reason to use open source is simple: privacy. With FreeMesh, your data is your own. It doesn't track or collect data. Don't trust it? You can easily check—it's open source, after all! With some other popular mesh solutions, say those provided by very large tech conglomerates, would you trust them with your data? - -Another important factor: updates. FreeMesh says it is committed to pushing out security and performance updates regularly. What about 10 years from now? With an open source solution, you are free to update the product for as long as you want. - -So why mesh? In a mesh network, multiple wireless routers work together to broadcast a single, very large wireless network. Each router in a mesh network intelligently communicates with the other(s) to provide the best "path" for your data. The following images from FreeMesh's website highlight the difference between using a single wireless router and a mesh network. The red network represents a single wireless router, and the green is a mesh network. - -![Single-router network][3] | ![Mesh network][4] ----|--- - -### Get the equipment - -To get started with FreeMesh, [order a kit][5]. Two kits are available: standard and 4G LTE. - -The 4G LTE kit, as the name suggests, supports cellular data connections. This feature is a rarity in the consumer networking space, and it will be _very_ useful to some folks. You can set up a portable mesh network anywhere with power and cell service with full fast-failover capability. - -The FreeMesh kits come with a primary router and two nodes. The router and nodes use 802.11ac, 802.11r, and 802.11s standards. The included firmware runs a customized version of [OpenWrt][6], a Linux distro for embedded devices. - -The FreeMesh router has some really good specs: - - * **CPU:** Dual-core 880MHz MediaTek MT7621AT (two cores/four threads!) - * **RAM:** DDR3 512MB - * **Interfaces:** 1x GbE WAN, 4x GbE LAN, 1x USB 2.0 ports, 1x microSD card slot, 1x SIM slot - * **Antenna:** 2x 5dBi 2.4GHz, 2x 5dBi 5GHz, 2x 3dBi 3G/4G (built-in) - * **4G LTE modem:** LTE category 4 module, 150Mbps downlink and 50Mbps uplink - - - -### Setup - -Setup is easy, and FreeMesh's [README][7] offers simple instructions and diagrams. Start by setting up the primary router first. Then follow these simple steps: - - 1. Connect the first node (blue WAN port) to the primary router (yellow LAN port). -![FreeMesh setup step 1][8] - 2. Wait about 30 to 60 seconds. The node will flash its LEDs when the setup is complete. -![FreeMesh setup step 2][9] - 3. Move the node to another location. - - - -That's it! There is no manual setup required for the nodes; you simply plug them into the primary router, and it does the rest. You can add more nodes the same way; just repeat the steps above. - -### Features - -Out of the box, FreeMesh runs a combination of OpenWRT and LuCI. It has all the features you'd expect from a router. Want to install new features or packages? SSH in and start hacking! - -![Real-time load on FreeMesh network][10] - -![Overview of FreeMesh network][11] - -![OpenWrt status report][12] - -### Performance - -After setting up the FreeMesh system, I moved the nodes to various places around my house. I used [iPerf][13] to test the bandwidth and was getting around 150Mbps. WiFi can be affected by any number of environmental variables, so your mileage may vary. Distance between the nodes and the primary router also plays a large factor in bandwidth. - -However, the real advantage of a mesh network isn't its top-end speed but much better average speed across a space. Even at the far reaches of my home, I was still able to stream videos and work without interruption. I was even able to work in my backyard. I simply repositioned one of the nodes in front of a window before heading outside. - -### Conclusion - -FreeMesh is really compelling; it offers performance, privacy, and price, all in a simple, open source package. - -In my experience, setup is a breeze, and it is more than fast enough. The range is excellent and far exceeds any single-router setup. You are free to hack and customize your FreeMesh setup, but I didn't feel the need to. It has everything I need out of the box. - -If you are looking for an affordable, performant, privacy-respecting mesh system that installs in less than 10 minutes, you might want to consider FreeMesh. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/mesh-network-freemesh - -作者:[Spencer Thomason][a] -选题:[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/spencerthomason -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-networking.png?itok=fHmulI9p (people on top of a connected globe) -[2]: https://freemeshwireless.com/ -[3]: https://opensource.com/sites/default/files/uploads/singlerouternetwork.png (Single-router network) -[4]: https://opensource.com/sites/default/files/uploads/meshnetwork.png (Mesh network) -[5]: https://freemeshwireless.com/#pricing -[6]: https://openwrt.org/ -[7]: https://gitlab.com/slthomason/freemesh/-/blob/master/README.md -[8]: https://opensource.com/sites/default/files/uploads/connecttorouter.png (FreeMesh setup step 1) -[9]: https://opensource.com/sites/default/files/uploads/setupcomplete.png (FreeMesh setup step 2) -[10]: https://opensource.com/sites/default/files/uploads/freemeshrealtimeload.png (Real-time load on FreeMesh network) -[11]: https://opensource.com/sites/default/files/uploads/freemeshwirelessoverview.png (Overview of FreeMesh network) -[12]: https://opensource.com/sites/default/files/uploads/openwrt.png (OpenWrt status report) -[13]: https://opensource.com/article/20/1/internet-speed-tests diff --git a/translated/tech/20200214 How to set up your own fast, private open source mesh network.md b/translated/tech/20200214 How to set up your own fast, private open source mesh network.md new file mode 100644 index 0000000000..1ce5cdae9d --- /dev/null +++ b/translated/tech/20200214 How to set up your own fast, private open source mesh network.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up your own fast, private open source mesh network) +[#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh) +[#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason) + +如何建立自己的快速、私有的开源网状网络 +====== + +> 只需要不到 10 分钟的安装时间,就可以用 FreeMesh 搭建一个经济实惠、性能卓越、尊重隐私的网格系统。 + +![people on top of a connected globe][1] + +[FreeMesh][2] 系统有望为大众带来完全开源的网格网络mesh network。我最近有机会进行了测试;它安装迅速,性能非常好 —— 特别是相对它的价格而言。 + +### 为什么要网格化和开源? + +使用开源的原因很简单:隐私。有了 FreeMesh,你的数据就是你自己的。它不会跟踪或收集数据。不相信吗?毕竟,你可以轻松检查 —— 它是开源的!而其它大型高科技企业集团提供的一些流行的网格解决方案,你是否相信它们会保护你的数据? + +另一个重要因素:更新。FreeMesh 表示,它将致力于定期发布安全性和性能更新。从现在起到 10 年后呢?使用开放源代码解决方案,你可以根据需要自由地更新产品。 + +那么为什么要用网格呢?在网状网络中,多个无线路由器一起工作以广播单个超大型的无线网络。网状网络中的每个路由器都可与其他路由器智能地通信,以便为你的数据提供最佳的“路径”。FreeMesh 网站上的以下图片突出显示了使用单个无线路由器和网状网络之间的区别。 红色网络表示单个无线路由器,绿色网络是网状网络。 + +![单路由器网络] [3] + +![网状网络] [4] + +### 采购设备 + +要开始使用 FreeMesh,请[订购套件][5]。它提供两种套件:标准套件和 4G LTE。 + +顾名思义,4G LTE 套件支持蜂窝数据连接。此功能在消费级网络领域非常罕见,但对某些人来说非常有用。你可以在提供电源和电池的任何地方建立具有完整的快速故障转移功能的便携式网状网络。 + +FreeMesh 套件带有一个主路由器和两个节点。路由器和节点使用 802.11ac、802.11r 和 802.11s 标准。随附的固件运行定制版本的 [OpenWrt] [6],这是嵌入式设备的 Linux 发行版。 + +FreeMesh 路由器的一些规格非常好: + +* CPU:双核 880MHz MediaTek MT7621AT(双核/四线程!) +* 内存:DDR3 512MB +* 接口:1 个 GbE WAN、4 个 GbE LAN、1 个 USB 2.0 端口、1 个 microSD 卡插槽、1 个 SIM 插槽 +* 天线:2 个 5dBi 2.4GHz、2 个 5dBi 5GHz、2 个 3dBi 3G/4G(内置) +* 4G LTE 调制解调器:LTE 4 类模块,下行 150Mbps/上行 50Mbps + +### 设置 + +设置很容易,FreeMesh 的 [README][7] 提供了简单的说明和图表。首先首先设置主路由器。然后按照以下简单步骤操作: + +1、将第一个节点(蓝色 WAN 端口)连接到主路由器(黄色 LAN 端口)。 + +![FreeMesh 设置步骤 1][8] + +2、等待约 30 至 60 秒。设置完成后,节点将闪烁其 LED。 + +![FreeMesh 设置步骤 2][9] + +3、将节点移到另一个位置。 + +仅此而已!节点不需要手动设置。你只需将它们插入主路由器,其余的工作就完成了。你可以以相同的方式添加更多节点;只需重复上述步骤即可。 + +### 功能 + +FreeMesh 是开箱即用的,它由 OpenWRT 和 LuCI 组合而成。它具有你期望路由器提供的所有功能。是否要安装新功能或软件包?SSH 连入并开始魔改! + +![FreeMesh 网络上的实时负载][10] + +![FreeMesh 网络概览][11] + +![OpenWrt 状态报告][12] + +### 性能如何 + +设置完 FreeMesh 系统后,我将节点移动到了房屋周围的各个地方。我使用 [iPerf][13] 测试带宽,它达到了约 150Mbps。WiFi 可能会受到许多环境变量的影响,因此你的结果可能会有所不同。节点与主路由器之间的距离在带宽中也有很大的影响。 + +但是,网状网络的真正优势不是高峰速度,而是整个空间的平均速度要好得多。即使在我家很远的地方,我仍然能够流媒体播放视频并正常工作。我甚至可以在后院工作。在出门之前,我只是将一个节点重新放在窗口前面而已。 + +### 结论 + +FreeMesh 确实令人信服。它以简单、开源的形式为你提供高性价比和隐私。 + +以我的经验,设置非常容易,而且足够快。覆盖范围非常好,远远超过了任何单路由器环境。你可以随意魔改和定制 FreeMesh 设置,但是我觉得没有必要。它提供了我需要的一切。 + +如果你正在寻找价格可承受、性能良好且尊重隐私的网格系统,且该系统可以在不到 10 分钟的时间内安装完毕,你可以考虑一下 FreeMesh。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/mesh-network-freemesh + +作者:[Spencer Thomason][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/spencerthomason +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-networking.png?itok=fHmulI9p (people on top of a connected globe) +[2]: https://freemeshwireless.com/ +[3]: https://opensource.com/sites/default/files/uploads/singlerouternetwork.png (Single-router network) +[4]: https://opensource.com/sites/default/files/uploads/meshnetwork.png (Mesh network) +[5]: https://freemeshwireless.com/#pricing +[6]: https://openwrt.org/ +[7]: https://gitlab.com/slthomason/freemesh/-/blob/master/README.md +[8]: https://opensource.com/sites/default/files/uploads/connecttorouter.png (FreeMesh setup step 1) +[9]: https://opensource.com/sites/default/files/uploads/setupcomplete.png (FreeMesh setup step 2) +[10]: https://opensource.com/sites/default/files/uploads/freemeshrealtimeload.png (Real-time load on FreeMesh network) +[11]: https://opensource.com/sites/default/files/uploads/freemeshwirelessoverview.png (Overview of FreeMesh network) +[12]: https://opensource.com/sites/default/files/uploads/openwrt.png (OpenWrt status report) +[13]: https://opensource.com/article/20/1/internet-speed-tests From 313bfe0bc3ae2e96975d6f89c04e45c095da1f5b Mon Sep 17 00:00:00 2001 From: wetshoes <43409711+Fisherman110@users.noreply.github.com> Date: Tue, 3 Mar 2020 22:20:13 +0800 Subject: [PATCH 080/207] Update 20180306 Exploring free and open web fonts.md --- sources/tech/20180306 Exploring free and open web fonts.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180306 Exploring free and open web fonts.md b/sources/tech/20180306 Exploring free and open web fonts.md index 533286ca2c..d01accfbce 100644 --- a/sources/tech/20180306 Exploring free and open web fonts.md +++ b/sources/tech/20180306 Exploring free and open web fonts.md @@ -1,3 +1,5 @@ +Fisherman110 translating + Exploring free and open web fonts ====== From 52fbbba1b8db0840303587bb1fe08dad97cceb4f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 00:59:25 +0800 Subject: [PATCH 081/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200304=20Drauge?= =?UTF-8?q?r=20OS=20Linux=20Aims=20to=20Bring=20Console=20Gaming=20Experie?= =?UTF-8?q?nce=20on=20the=20Desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md --- ...onsole Gaming Experience on the Desktop.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md diff --git a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md new file mode 100644 index 0000000000..5cd5c57024 --- /dev/null +++ b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop) +[#]: via: (https://itsfoss.com/drauger-os/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop +====== + +For years (or decades) people complained that one of the reasons to not [use Linux][1] is lack of mainstream games. [Gaming on Linux][2] has improved drastically in last few years specially with the [introduction of Steam Proton][3] project that enables you to [play a lot of Windows-only games on Linux][4]. + +This also has encourages several [Linux distributions centered around gaming][5]. Take [Lakka][6] for example. You can [turn your old computer into a retro gaming console thanks to Lakka Linux][7]. + +Another such gaming focused Linux distribution is [Draguer OS][8] and we are going to take a look at it today. + +### What is Drauger OS? + +Accord to [the project’s website][9], “Drauger OS is a Linux desktop gaming operating system. It aims to provide a platform for gamers to use where they can get great performance without sacrificing their security. Furthermore, it aims to make it easy for anyone to game, whether they use a keyboard and mouse, or some sort of controller.” + +They stress that Drauger OS is not for everyday use. As such, many of the productivity tools that most other distros come with are not in Drauger OS. + +![Drauger OS 7.4.1][10] + +Drauger OS is [based][9] on the Ubuntu. The current version (7.4.1 Jiangshi) uses “[Liquorix][11] low latency Linux kernel, a pre-compiled ZEN kernel designed with a balance between latency and throughput in mind”. However, that will be changing in the next release. They only have one desktop environment choice, a modified version of [Xfce][12]. + +Drauger OS has several applications and tools installed out of the box to improve the gaming experience. These include: + + * [PlayOnLinux][13] + * WINE + * [Lutris][14] + * Steam + * [DXVK][15] + + + +It also has an interesting set of tools that are not gaming related. [Drauger Installer][16] is a .deb installer and alternative to Gdebi. [Multiple Repository App Installer][17] (mrai) is “an AUR-helper-like script for Debian-based Linux Operating Systems”. Mrai is designed to work with apt, snaps, flatpaks, and can install apps from GitHub. + +Interestingly, Drauger OS’ name is an error. Lead dev [Thomas Castleman][18] (aka batcastle) has intended to name his distro Draugr, but had mistyped the name. In [episode 23][19] of the Drauger OS podcast, Castleman said the name will stay misspelled because it would be a lot of work to correct it. According to [Wikipedia][20], a draugr is “an undead creature from Norse mythology”. + +Yes, you read that correctly. Drauger OS is one of only a few distros that have its own [podcast][21]. When asked about it, Castleman told me that “I wanted to ensure that we had the maximum transparency possible with our community, no matter their circumstances.” Most of the time, the podcast is an audio version of the Drauger OS blog, but sometimes they use it to make an announcement when they don’t have time to write a blog post. + +### The Future for Drauger OS + +![Drauger OS][22] + +The developers behind Druager OS are working on their next major release: 7.5.1. This release will be based on Ubuntu 19.10. There will be three major changes. First, the Liquorix kernel will be [replaced][23] with “a kernel we are building in-house.” This kernel will be based on the Linux Kernel GitHub repository, “so it’s about as vanilla as it gets”. + +The second major change in the new release will a new layout for their desktop. Based on user feedback, they have decided to change it to something that looks more GNOME-like. + +Thirdly, they are dropping SystemBack as their backup tool and installer. They have instead written a new [installer][24] from scratch. + +The Dev team is also working on an [ARM version][25] of Drauger OS. They hope to release it sometime in 2022. + +### System requirements for Draguer OS + +The Drauger OS [system requirements][25] are pretty modest. Keep in mind that Drauger OS will only run on 64-bit systems. + +#### Minimum system requirements + + * CPU: Dual-Core, 1.8GHz, 64-bit processor + * RAM: 1 GB + * Storage: 16 GB + * Graphics Processor: Integrated + * Screen Resolution: 1024×768 at 60Hz + * External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 2 USB Ports for Installation USB Drive and Keyboard (Mouse optional, but recommended) + + + +#### Recommended system requirements + + * CPU: Quad-Core, 2.2Ghz, 64-bit processor + * RAM: 4 GB + * Storage: 128 GB + * Graphics Processor: NVIDIA GTX 1050, AMD RX 460, or equivalent card + * Screen Resolution: 1080p at 60Hz + * External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 3 USB Ports for Installation USB Drive, Keyboard, and Mouse, 1 Audio Out Port + + + +### How you can help out Drauger OS + +There are several ways that you can help out the Drauger OS if you are interestedin doing so. They are always looking for [financial support][26] to keep development going. + +If you want yo contribute code, they are looking for people with experience in BASH, C++, and Python. All of their code is up on [GitHub][27]. You can also [contact][28] them on social media. + +### Final Thoughts + +Drauger OS is quite a project. I’ve seen a couple of other [gaming-oriented distributions][29], but Drauger OS is single-minded in its focus on gaming. Since I am more of a casual gamer, this distro doesn’t appeal to me personally. But, I can see how it could lure gaming enthusiasts to Linux. I wish them good luck in their future releases. + +What are your thoughts on this gaming-only distro? What is your favorite Linux gaming solution? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][30]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/drauger-os/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/why-use-linux/ +[2]: https://itsfoss.com/linux-gaming-guide/ +[3]: https://itsfoss.com/steam-play-proton/ +[4]: https://itsfoss.com/steam-play/ +[5]: https://itsfoss.com/linux-gaming-distributions/ +[6]: http://www.lakka.tv/ +[7]: https://itsfoss.com/lakka-retrogaming-linux/ +[8]: https://draugeros.org/go/ +[9]: https://www.draugeros.org/go/about/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1 +[11]: https://liquorix.net/ +[12]: https://www.xfce.org/ +[13]: https://www.playonlinux.com/en/ +[14]: https://lutris.net/ +[15]: https://github.com/doitsujin/dxvk +[16]: https://github.com/drauger-os-development/drauger-installer +[17]: https://github.com/drauger-os-development/mrai +[18]: https://github.com/Batcastle +[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47 +[20]: https://en.wikipedia.org/wiki/Draugr +[21]: https://anchor.fm/drauger-os +[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1 +[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/ +[24]: https://github.com/drauger-os-development/system-installer +[25]: https://www.draugeros.org/go/system-requirements/ +[26]: https://www.draugeros.org/go/contribute/ +[27]: https://github.com/drauger-os-development +[28]: https://www.draugeros.org/go/contact-us/ +[29]: https://itsfoss.com/manjaro-gaming-linux/ +[30]: https://reddit.com/r/linuxusersgroup From 6988bbe4e11d1694c26b65fb6cf8ffc434c41974 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:01:24 +0800 Subject: [PATCH 082/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Most-u?= =?UTF-8?q?sed=20libraries,=20open=20source=20adoption,=20and=20more=20ind?= =?UTF-8?q?ustry=20trends?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md --- ...urce adoption, and more industry trends.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md diff --git a/sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md b/sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md new file mode 100644 index 0000000000..769f4f550e --- /dev/null +++ b/sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Most-used libraries, open source adoption, and more industry trends) +[#]: via: (https://opensource.com/article/20/3/libraries-5G-more-industry-trends) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +Most-used libraries, open source adoption, 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. + +## [Most-used libraries revealed – plus 10 things developers should be doing to keep their code secure][2] + +> “The report begins to give us an inventory of the most important shared software and potential vulnerabilities and is the first step to understand more about these projects so that we can create tools and standards that results in trust and transparency in software," explained Jim Zemlin, executive director at the Linux Foundation, in a statement. + +**The impact**: Importantly, there is also a great list of packages for backdoors here. + +## [Survey: Open source adoption, quality gains][3] + +> Overall, the survey finds there has been [a marked shift away from proprietary software][4]. Only 42% said that more than half of the software they use today is proprietary, down from 55% a year ago. Two years from now only 32% said they expect proprietary software to account for more than half their portfolio. On average, respondents said 36% of their organization’s software is open source, which in two years is expected to increase to 44% in two years. A total of 77% said they would increase usage of open source software over the next 12 months. + +**The impact**: There is a clear virtuous cycle of companies getting more comfortable with open source and more open source software being created. If there isn't already, there will be a rule 34 about open source software. + +## [5G must go cloud-native from edge to core][5] + +> A containerised core will be the heart of cloud-native 5G networks. Managing and scaling networking apps in containers using a modular microservices approach will help service providers to dynamically orchestrate and grow service capacity across a distributed architecture. + +**The impact**: When you're building something complicated and reliable, you really can't look past starting with open source software. Unless you want to be in a foot race against "a Kawasaki" (that's a motorbike, right?). + +## [High-performance object storage, Kubernetes, + why you can't containerize a storage appliance][6] + +> True multi-tenancy isn’t possible unless the storage system is extremely lightweight and able to be packaged with the application stack. If the storage system takes too many resources or contains too many APIs, it won’t be possible to pack many tenants on the same infrastructure. + +**The impact**: The title of this post is a challenge to someone much more skilled and knowledgable than I. + +_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/3/libraries-5G-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.theregister.co.uk/2020/02/20/linux_foundation_report/ +[3]: https://devops.com/surevey-sees-open-source-adoption-quality-gains/ +[4]: https://devops.com/devops-deeper-dive-devops-accelerates-open-source-innovation-pace/ +[5]: https://www.5gradar.com/features/5g-must-go-cloud-native-from-edge-to-core +[6]: https://blog.min.io/high-performance-object-storage-with-kubernetes/ From 3508b38c19610121c0558ee9dd10abae5b4f2320 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:05:06 +0800 Subject: [PATCH 083/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Gettin?= =?UTF-8?q?g=20started=20with=20the=20Rust=20package=20manager,=20Cargo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Getting started with the Rust package manager, Cargo.md --- ...ed with the Rust package manager, Cargo.md | 607 ++++++++++++++++++ 1 file changed, 607 insertions(+) create mode 100644 sources/tech/20200303 Getting started with the Rust package manager, Cargo.md diff --git a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md new file mode 100644 index 0000000000..d77410b904 --- /dev/null +++ b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md @@ -0,0 +1,607 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with the Rust package manager, Cargo) +[#]: via: (https://opensource.com/article/20/3/rust-cargo) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +Getting started with the Rust package manager, Cargo +====== +Get to know Rust's package manager and build tool. +![Shipping containers stacked in a yard][1] + +[Rust][2] is a modern programming language that provides performance, reliability, and productivity. It has consistently been voted as the [most-loved language][3] on StackOverflow surveys for a few years now. + +In addition to being a great programming language, Rust also features a build system and package manager called Cargo. Cargo handles a lot of tasks, like building code, downloading libraries or dependencies, and so on. The two are bundled together, so you get Cargo when you install Rust. + +### Installing Rust and Cargo + +Before getting started, you need to install Rust and Cargo. The Rust project provides a downloadable script to handle the installation. To get the script, open a browser to [https://sh.rustup.rs][4] and save the file. Read the script to make sure you're happy with what it intends to do, and then run it: + + +``` +`$ sh ./rustup.rs` +``` + +You can also refer to the [Install Rust][5] webpage for more information. + +After installing Rust and Cargo, you must source the env file: + + +``` +`$ source $HOME/.cargo/env` +``` + +Better yet, add the required directory to your PATH variable: + + +``` +`$ source $HOME/.cargo/env` +``` + +If you prefer to use your package manager (such as DNF or Apt on Linux), look for Rust and Cargo packages in your distribution's repositories and install accordingly. For example: + + +``` +`$ dnf install rust cargo` +``` + +Once they're installed and set up, verify which versions of Rust and Cargo you have: + + +``` +$ rustc --version +rustc 1.41.0 (5e1a79984 2020-01-27) +$ cargo --version +cargo 1.41.0 (626f0f40e 2019-12-03) +``` + +### Building and running Rust by hand + +Start with a simple program that prints "Hello, world!" on the screen. Open your favorite text editor and type the following program: + + +``` +$ cat hello.rs +fn main() { +    println!("Hello, world!"); +} +``` + +Save the file with an **.rs** extension to identify it as a Rust source code file. + +Compile your program using the Rust compiler, **rustc**: + + +``` +`$ rustc hello.rs` +``` + +After compilation, you will have a binary that has the same name as the source program: + + +``` +$ ls -l +total 2592 +-rwxr-xr-x. 1 user group 2647944 Feb 13 14:14 hello +-rw-r--r--. 1 user group      45 Feb 13 14:14 hello.rs +$ +``` + +Execute your program to verify that it runs as expected: + + +``` +$ ./hello +Hello, world! +``` + +These steps are sufficient for smaller programs or whenever you want to test out something quickly. However, when working on bigger programs involving multiple people, Cargo is the best way forward. + +### Creating a new package using Cargo + +Cargo is a build system and package manager for Rust. It helps developers download and manage dependencies and assists in creating Rust packages. Packages in Rust are often called "crates" in the Rust community, but in this article, the two words are interchangeable. Refer to the Cargo [FAQ][6] provided by the Rust community for clarification. + +If you need any help with Cargo's command-line utility, use the **\--help** or **-h** command-line argument: + + +``` +`$ cargo –help` +``` + +To create a new package, use the **new** keyword, followed by the package name. For this example, use **hello_opensource** as your new package name. After running the command, you will see a message confirming that Cargo has created a binary package with the given name: + + +``` +$ cargo new hello_opensource +     Created binary (application) `hello_opensource` package +``` + +Running a **tree** command to see the directory structure reports that some files and directories were created. First, it creates a directory with the name of the package, and within that directory is an **src** directory for your source code files: + + +``` +$ tree . +. +└── hello_opensource +    ├── Cargo.toml +    └── src +        └── main.rs + +2 directories, 2 files +``` + +Cargo not only creates a package, but it also creates a simple **Hello, world!** program. Open the **main.rs** file and have a look: + + +``` +$ cat hello_opensource/src/main.rs +fn main() { +    println!("Hello, world!"); +} +``` + +The next file to work with is **Cargo.toml**, which is a configuration file for your package. It contains information about the package, such as its name, version, author information, and Rust edition information. + +A program often depends on external libraries or dependencies to run, which enables you to write applications that perform tasks that you don't know how to code or you don't want to spend time coding. All your dependencies will be listed in this file. At this point, you do not have any dependencies for your new program. Open the **Cargo.toml** file and view its contents: + + +``` +$ cat hello_opensource/Cargo.toml +[package] +name = "hello_opensource" +version = "0.1.0" +authors = ["user <[user@mail.com][7]>"] +edition = "2018" + +# See more keys and their definitions at + +[dependencies] +``` + +### Building the program using Cargo + +So far, so good. Now that you have a package in place, build a binary (also called an executable). Before doing that, move into the package directory: + + +``` +`$ cd hello_opensource/` +``` + +You can use Cargo's **build** command to build the package. Notice the messages that say it is **Compiling** your program: + + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.38s +``` + +Check what happens to your project directory after you run the **build** command: + + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +├── src +│   └── main.rs +└── target +    └── debug +        ├── build +        ├── deps +        │   ├── hello_opensource-147b8a0f466515dd +        │   └── hello_opensource-147b8a0f466515dd.d +        ├── examples +        ├── hello_opensource +        ├── hello_opensource.d +        └── incremental +            └── hello_opensource-3pouh4i8ttpvz +                ├── s-fkmhjmt8tj-x962ep-1hivstog8wvf +                │   ├── 1r37g6m45p8rx66m.o +                │   ├── 2469ykny0eqo592v.o +                │   ├── 2g5i2x8ie8zed30i.o +                │   ├── 2yrvd7azhgjog6zy.o +                │   ├── 3g9rrdr4hyk76jtd.o +                │   ├── dep-graph.bin +                │   ├── query-cache.bin +                │   ├── work-products.bin +                │   └── wqif2s56aj0qtct.o +                └── s-fkmhjmt8tj-x962ep.lock + +9 directories, 17 files +``` + +Wow! The compilations process produced a lot of intermediate files. Your binary, though, is saved in the **./target/debug** directory with the same name as your package. + +### Running your application using Cargo + +Now that your binary is built, run it using Cargo's **run** command. As expected, it prints **Hello, world!** on the screen. + + +``` +$ cargo run +    Finished dev [unoptimized + debuginfo] target(s) in 0.01s +     Running `target/debug/hello_opensource` +Hello, world! +``` + +Alternatively, you can run the binary directly, which is located at: + + +``` +$ ls -l ./target/debug/hello_opensource +-rwxr-xr-x. 2 root root 2655552 Feb 13 14:19 ./target/debug/hello_opensource +``` + +As expected, it produces the same results: + + +``` +$ ./target/debug/hello_opensource +Hello, world! +``` + +Say you need to rebuild your package and get rid of all the binaries and the intermediate files created by the earlier compilation process. Cargo provides a handy **clean** option to remove all intermediate files except the source code and other required files: + + +``` +$ cargo clean +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +Make some changes to the program and run it again to see how it works. For example, this minor change adds **Opensource** to the **Hello, world!** string: + + +``` +$ cat src/main.rs +fn main() { +    println!("Hello, Opensource world!"); +} +``` + +Now, build the program and run it again. This time you see **Hello, Opensource world!** displayed on the screen: + + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.39s + +$ cargo run +    Finished dev [unoptimized + debuginfo] target(s) in 0.01s +     Running `target/debug/hello_opensource` +Hello, Opensource world! +``` + +### Adding dependencies using Cargo + +Cargo allows you to add dependencies that your program needs to run. Adding a dependency is extremely easy with Cargo. Every Rust package includes a **Cargo.toml** file, which contains a list (empty by default) of dependencies. Open the file in your favorite text editor, find the **[dependencies]** section, and add the library you want to include in your package. For example, to add the **rand** library as your dependency: + + +``` +$ cat Cargo.toml +[package] +name = "hello_opensource" +version = "0.1.0" +authors = ["test user <[test@mail.com][8]>"] +edition = "2018" + +# See more keys and their definitions at + +[dependencies] +rand = "0.3.14" +``` + +Try building your package to see what happens. + + +``` +$ cargo build +    Updating crates.io index +   Compiling libc v0.2.66 +   Compiling rand v0.4.6 +   Compiling rand v0.3.23 +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 4.48s +``` + +Cargo is now reaching out to [Crates.io][9], which is Rust's central repository for crates (or packages) and downloading and compiling **rand**. But wait—what about the **libc** package? You did not ask for **libc** to be installed. Well, the **rand** package is dependent on the **libc** package; hence, Cargo downloads and compiles **libc** as well. + +New versions of libraries keep coming, and Cargo provides an easy way to update all of their dependencies using the **update** command: + + +``` +`cargo update` +``` + +You can also choose to update specific libraries using the **-p** flag followed by the package name: + + +``` +`cargo update -p rand` +``` + +### Compiling and running with a single command + +So far, you have used **build** followed by **run** whenever you make changes to your program. There is an easier way: you can simply use the **run** command, which internally compiles and runs the program. To see how it works, first clean up your package directory: + + +``` +$ cargo clean +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +Now execute **run**. The output states that it compiled and then ran the program, and this means you don't need to explicitly run **build** each time: + + +``` +$ cargo run +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.41s +     Running `target/debug/hello_opensource` +Hello, world! +``` + +### Checking your code in development + +You often go through multiple iterations when developing a program. You need to ensure that your program has no coding errors and compiles fine. You don't need the overhead of generating the binary on each compilation. Cargo has you covered with a **check** option that compiles your code but skips the final step of generating an executable. + +Start by running **cargo clean** within your package directory: + + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +Now run the **check** command and see what changes were made to the directory: + + +``` +$ cargo check +    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.18s +``` + +The output shows that, even though intermediate files were created as part of the compilation process, the final binary or executable was not created. This saves some time, which matters a lot if the package is huge with thousands of lines of code: + + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +├── src +│   └── main.rs +└── target +    └── debug +        ├── build +        ├── deps +        │   ├── hello_opensource-842d9a06b2b6a19b.d +        │   └── libhello_opensource-842d9a06b2b6a19b.rmeta +        ├── examples +        └── incremental +            └── hello_opensource-1m3f8arxhgo1u +                ├── s-fkmhw18fjk-542o8d-18nukzzq7hpxe +                │   ├── dep-graph.bin +                │   ├── query-cache.bin +                │   └── work-products.bin +                └── s-fkmhw18fjk-542o8d.lock + +9 directories, 9 files +``` + +To see if you are really saving time, time the **build** and **check** commands and compare them. + +First, the **build** command: + + +``` +$ time cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.40s + +real    0m0.416s +user    0m0.251s +sys     0m0.199s +``` + +Clean the directory before running the **check** command: + + +``` +`$ cargo clean` +``` + +The **check** command: + + +``` +$ time cargo check +    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.15s + +real    0m0.166s +user    0m0.086s +sys     0m0.081s +``` + +Clearly, the **check** command is much faster. + +### Building external Rust packages + +Everything you've done so far will apply to any Rust crate you get from the internet. You simply need to download or clone the repository, move to the package folder, and run the **build** command, and you are good to go: + + +``` +git clone <github-like-url> +cd <package-folder> +cargo build +``` + +### Building optimized Rust programs using Cargo + +You've run **build** multiple times so far, but did you notice its output? No worries, build it again and watch closely: + + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.36s +``` + +See the **[unoptimized + debuginfo]** text after each compilation? This means that the binary generated by Cargo includes a lot of debugging information and is not optimized for execution. Developers often go through multiple iterations of development and need this debugging information for analysis. Also, performance is not the immediate goal while developing software. Therefore, this is OK for now. + +However, once the software is ready for release, it doesn't need to have the debugging information anymore. But it does need to be optimized for best performance. In the final stages of development, you can use the **\--release** flag with **build**. Watch closely; you should see the **[optimized]** text after compilation: + + +``` +$ cargo build --release +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished release [optimized] target(s) in 0.29s +``` + +If you want to, you can go through the exercise to find out your time savings when running optimized vs. unoptimized software. + +### Creating a library vs. a binary using Cargo + +Any software program can be roughly categorized as either a standalone binary or a library. A standalone binary can be run as it is, even though it might make use of external libraries. A library, however, is utilized by another standalone binary. All the programs you've built so far in this tutorial are standalone binaries since that is Cargo's default. To create a **library**, add the **\--lib** option: + + +``` +$ cargo new --lib libhello +     Created library `libhello` package +``` + +This time, Cargo does not create a **main.rs** file; instead, it creates a **lib.rs** file. The code for your library should go here: + + +``` +$ tree . +. +└── libhello +    ├── Cargo.toml +    └── src +        └── lib.rs + +2 directories, 2 files +``` + +Knowing Cargo, don't be surprised that it put some code in your new library file. Find out what it added by moving to the package directory and viewing the file. By default, Cargo puts a test function within library files. + +### Running tests using Cargo + +Rust provides first-class support for unit and integration testing, and Cargo allows you to execute any of these tests: + + +``` +$ cd libhello/ + +$ cat src/lib.rs +#[cfg(test)] +mod tests { +    #[test] +    fn it_works() { +        assert_eq!(2 + 2, 4); +    } +} +``` + +Cargo has a handy **test** option to run any test that is present in your code. Try running the tests that Cargo put in the library code by default: + + +``` +$ cargo test +   Compiling libhello v0.1.0 (/opensource/libhello) +    Finished test [unoptimized + debuginfo] target(s) in 0.55s +     Running target/debug/deps/libhello-d52e35bb47939653 + +running 1 test +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out + +   Doc-tests libhello + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +``` + +### Looking under Cargo's hood + +You may be interested in knowing what Cargo does under the hood when you run a command. After all, Cargo is, in many ways, a wrapper. To find out what it's doing, you can use the **-v** option with any Cargo command to output verbose information to the screen. + +Here are a couple of examples that run **build** and **clean** using the **-v** option. + +In the **build** command, you can see that the underlying **rustc** (Rust compiler) fired with the given command-line options: + + +``` +$ cargo build -v +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +     Running `rustc --edition=2018 --crate-name hello_opensource src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=147b8a0f466515dd -C extra-filename=-147b8a0f466515dd --out-dir /opensource/hello_opensource/target/debug/deps -C incremental=/opensource/hello_opensource/target/debug/incremental -L dependency=/opensource/hello_opensource/target/debug/deps` +    Finished dev [unoptimized + debuginfo] target(s) in 0.36s +``` + +Whereas the **clean** command shows that it is simply removing the directory that contains the intermediate files and the binary: + + +``` +$ cargo clean -v +    Removing /opensource/hello_opensource/target +``` + +### Don't let your skills get rusty + +To expand your skills, try writing and running a slightly more complex program using Rust and Cargo. Something simple will do: for instance, try listing all files in the current directory (it can be done in nine lines of code), or try echoing input back out at yourself. Small practice applications help you get comfortable with the syntax and the process of writing and testing code. + +This article offers plenty of information for budding Rust programmers to get started with Cargo. However, as you begin working on larger and more complicated programs, you'll need a more advanced understanding of Cargo. When you're ready for more, download and read the open source [Cargo Book][10] written by the Rust team, and see what you can create! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/rust-cargo + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers2.png?itok=idd8duC_ (Shipping containers stacked in a yard) +[2]: https://www.rust-lang.org/ +[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages +[4]: https://sh.rustup.rs/ +[5]: https://www.rust-lang.org/tools/install +[6]: https://doc.rust-lang.org/cargo/faq.html +[7]: mailto:user@mail.com +[8]: mailto:test@mail.com +[9]: http://crates.io +[10]: https://doc.rust-lang.org/cargo From 396b5d6cb440f3c07b8d7ff564da3db3ede12d25 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:06:15 +0800 Subject: [PATCH 084/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Gettin?= =?UTF-8?q?g=20started=20with=20lightweight=20alternatives=20to=20GNU=20Em?= =?UTF-8?q?acs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md --- ...h lightweight alternatives to GNU Emacs.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md diff --git a/sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md b/sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md new file mode 100644 index 0000000000..5f86c79b84 --- /dev/null +++ b/sources/tech/20200303 Getting started with lightweight alternatives to GNU Emacs.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with lightweight alternatives to GNU Emacs) +[#]: via: (https://opensource.com/article/20/3/lightweight-emacs) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Getting started with lightweight alternatives to GNU Emacs +====== +Slimmed-down (in size and features) alternatives allow you to take your +text editor anywhere you go. +![Text editor on a browser, in blue][1] + +I work on a lot of servers, and sometimes I find a host that hasn't installed [GNU Emacs][2]. There's usually a [GNU Nano][3] installation to keep me from resorting to [Vi][4], but I'm not used to Nano the way I am Emacs, and I inevitably run into complications when I try to save my document (**C-x** in Nano stands for Exit, and **C-s** locks Konsole). + +While it would be nice to have GNU Emacs available everywhere, it's a lot of program for making a simple update to a config file. My need for a small and lightweight emacs is what took me down the path of discovering MicroEmacs, Jove, and Zile—tiny, self-contained [emacsen][5] that you can put on a thumb drive, an SD card, and nearly any server, so you'll never be without an emacs editor. + +### Editing macros + +The term "emacs" is a somewhat generic term in the way that only open source produces, and a portmanteau. Before there was [GNU Emacs][6], there were collections of batch process scripts (called _macros_) that could perform common tasks for a user. For instance, if you often found yourself typing "teh" instead of "the," you could either go in and correct each one manually (no small feat when your editor can't even load the entire document into memory, as was often the case in the early 1980s), or you could invoke a macro to perform a quick swap of the "e" and "h." + +Eventually, these macros were bundled together into a package called editing macros, or EMACS for short. GNU Emacs is the most famous emacsen (yes, the -en suffix is used to describe many emacs, as in the word "oxen"), but it's not the only one. And it's certainly not the smallest. Quite the contrary, GNU Emacs is probably one of the largest. + +Fortunately, GNU Emacs is so popular that other emacs implementations tend to mimic most of the GNU version's basic controls. If you're looking for a basic, fast, and efficient editor that isn't Vim, you'll likely be happy with any of these options. + +### MicroEmacs + +![µemacs][7] + +[MicroEmacs][8], also known as uemacs (as in the Greek letter µ, which denotes "micro" in scientific notation), was written by Dave Conroy, but there's a long list of users who have cloned it and modified it. One user who maintains a personal version of µemacs is a programmer named Linus Torvalds, and his copy is available from his website, [kernel.org][9] (which also, incidentally, includes a small side project of his called [Linux][10]). + +#### Size + +It takes me five seconds to compile µemacs at the slowest setting I can impose on my computer, and the resulting binary is a mere 493KB. Admittedly, that's not literally "micro" compared to the typical size of a GNU Emacs download (1 millionth of 70MB is 70 bytes, by my calculation), but it's respectably small. For instance, it's easy enough to send it to yourself by email or over Signal, and certainly small enough to keep handy on every thumb drive or SD card you own. + +By default, Linus's version expects libcurses, but you can override this setting in the Makefile so that it uses libtermcap instead. The resulting binary is independent enough to run on most Linux boxes: + + +``` +$ ldd em +linux-vdso.so.1 +libtermcap.so.2 => /lib64/libtermcap.so.2 +libc.so.6 => /lib64/libc.so.6 +/lib64/ld-linux-x86-64.so.2 +``` + +#### Features + +The [keyboard shortcuts][11] are just as you'd expect. You can open files and edit them without ever realizing you're not in GNU Emacs. + +Some advanced features are missing. For instance, there's no vertical buffer split, although there is a horizontal split. There's no eval command, so you won't use µemacs for Lisp programming. + +The search function is also a little different from what you may be used to: instead of **C-s**, it's **M-s**, which could make all the difference if your terminal emulator accepts **Ctrl+S** as a freeze command. The help page for µemacs is very complete, so use **M-x help** to get familiar with what it has available. + +#### License + +The license for µemacs is custom to the project with a non-commercial condition. You're free to share, use, and modify µemacs, but you can't do anything commercial with it. +While not as liberal a policy as I typically prefer, it's a good-enough license for personal use; just don't build a business around it. + +### GNU Zile + +![GNU Zile][12] + +[GNU Zile][13] claims to be a development kit for text editors. It's meant as a framework to enable people to quickly develop their own custom text editor without having to reinvent common data structures. It's a great idea and probably very useful, but as I have no interest in making my own editor, I just use the example implementation that ships with its codebase as a pleasant, lightweight emacs. + +The build process for the example editor (supposedly called Zemacs, although the binary it renders is named zile) is the standard [Autotools][14] procedure: + + +``` +$ ./configure +$ make +``` + +#### Size + +Compiling it from source takes me a minute on one core or about 50 seconds on six cores (the configuration process is the long part). The binary produced in the end is 1.2MB, making this the heaviest of the lightweight emacsen I use, but compared to even GNU Emacs without X (which is 14MB on my system), it's relatively trivial. + +Of the lightweight emacsen I use, it's also the most complex. You can exclude some library links by disabling features during configuration, but here are the defaults: + + +``` +$ ldd src/zile +linux-vdso.so.1 +libacl.so.1 => /lib64/libacl.so.1 +libncurses.so.5 => /lib64/libncurses.so.5 +libgc.so.1 => /usr/lib64/libgc.so.1 +libc.so.6 => /lib64/libc.so.6 +libattr.so.1 => /lib64/libattr.so.1 +libdl.so.2 => /lib64/libdl.so.2 +libpthread.so.0 => /lib64/libpthread.so.0 +/lib64/ld-linux-x86-64.so.2 +``` + +#### Features + +Zile acts a little more like GNU Emacs than µemacs or Jove, but it's still a minimal experience. But some little touches are refreshing: Tab completion happens in a buffer, you can run shell commands from the mini-buffer, and you have a good assortment of functions available. It's by no means a GNU Emacs replacement, though, and if you wander too far in search of advanced features, you'll find out why it's only 1.2MB. + +I've been unable to find in-application help files, and the man page bundled with it is minimal. However, if you're comfortable with Emacs, Zile is a good compromise between the full 14MB (or greater, if you're using a GUI) version and the extremely lightweight implementations. + +### Jove + +![Jove][15] + +[Jove][16] was my first tiny emacs and remains the smallest I've found yet. This was an easy discovery for me, as it ships with [Slackware][17] Linux and, with a surreptitious symlink, quickly became my personal replacement for the Vi binary. Jove is based on GNU Emacs, but the man page cautions that feature parity is by no means to be expected. I find Jove surprisingly feature-rich for such a small binary (in fact, this article was written in Jove version 4.17.06-9), but there's no question that renaming .emacs to .joverc does _not_ behave as you might hope. + +#### Size + +It takes me five seconds to compile Jove at the slowest setting (-j1) and about a second using all cores. The resulting binary, confusingly called jjove by default, is just 293KB. + +The Jove binary is independent enough to run on most Linux boxes: + + +``` +$ ldd jjove +linux-vdso.so.1 +libtermcap.so.2 => /lib64/libtermcap.so.2 +libc.so.6 => /lib64/libc.so.6 +/lib64/ld-linux-x86-64.so.2 +``` + +#### Features + +Jove has good documentation in the form of a man page. You can also get a helpful listing of all available commands by typing **M-x ?** and using the Spacebar to scroll. If you're entirely new to emacs, you can run **teachjove** to learn Jove (and emacs, accordingly). + +Most common editing commands and keybindings work as expected. Some oddities exist; for example, there's no vertical split, and Tab completion for paths in the mini-buffer is non-existent. However, it's the smallest emacs I've found and yet has a full GNU Emacs feel to it. + +### Try Emacs + +If you've only ever tried GNU Emacs, then you might find that the world of emacsen is richer than you may have expected. There's a rich tradition behind emacs, and trying some of its variants, spin-offs, and alternate implementations is part of the joy of being comfortable with how emacsen work. Get to know emacs; carry a few builds around everywhere you go, and you'll never have to use a substandard editor again! + +GNU Emacs can be much more than just a text editor. Learn how to get started. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/lightweight-emacs + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://www.gnu.org/software/emacs/ +[3]: https://www.nano-editor.org/ +[4]: https://opensource.com/article/19/3/getting-started-vim +[5]: https://www.emacswiki.org/emacs/Emacsen +[6]: https://opensource.com/article/20/2/who-cares-about-emacs +[7]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-uemacs.jpg (µemacs) +[8]: https://en.wikipedia.org/wiki/MicroEMACS +[9]: https://git.kernel.org/pub/scm/editors/uemacs/uemacs.git +[10]: https://opensource.com/tags/linux +[11]: https://opensource.com/downloads/emacs-cheat-sheet +[12]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-zile.jpg (GNU Zile) +[13]: https://www.gnu.org/software/zile/ +[14]: https://opensource.com/article/19/7/introduction-gnu-autotools +[15]: https://opensource.com/sites/default/files/uploads/lightweight-emacs-jove.jpg (Jove) +[16]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim +[17]: http://slackware.com From 842af9ddb8e9532d7505601d567d34a0f68d7400 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:07:23 +0800 Subject: [PATCH 085/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20How=20?= =?UTF-8?q?to=20assess=20your=20organization's=20technological=20maturity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 How to assess your organization-s technological maturity.md --- ...r organization-s technological maturity.md | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 sources/tech/20200303 How to assess your organization-s technological maturity.md diff --git a/sources/tech/20200303 How to assess your organization-s technological maturity.md b/sources/tech/20200303 How to assess your organization-s technological maturity.md new file mode 100644 index 0000000000..75c3cda6ff --- /dev/null +++ b/sources/tech/20200303 How to assess your organization-s technological maturity.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to assess your organization's technological maturity) +[#]: via: (https://opensource.com/open-organization/20/3/communication-technology-worksheet) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland) + +How to assess your organization's technological maturity +====== +Implementing new communications technologies can make your organization +more open. Use this worksheet to determine whether your organization—and +its people—are prepared. +![Someone wearing a hardhat and carrying code ][1] + +New communication technologies can promote and improve [open organizational principles and practices][2]—both within a company and between customers and strategic partners, leading to greater sales and business opportunities. + +Previously, I've discussed how companies adopting new communication technologies tend to [fall into four basic categories][3] of investment and utilization. In this article, I'll demonstrate how someone might assess an organization's level of preparedness for technological innovations and the cultural changes it requires. + +### Becoming a superstar + +For the purpose of this exercise, imagine you're a salesperson working for a company that provides communication or information technology solutions to companies that need advanced information systems and would benefit by becoming "[communication superstars][3]." You'll likely want to impress upon your customers the benefits of becoming this type of user—benefits such as: + + * Enhanced customer interaction: When _our_ customers' salespeople visit _their_ customers, they'll need to make the best impression they can to build some level of trust. Therefore—before offering any product—a salesperson must get a customer talking about his situation in order to discover his particular needs, concerns, and opportunities for growth. When the customer asks the salesperson questions about what he can do to address these issues, imagine our customer's salespeople being able to answer him in seconds with detailed information, instead of making the customer wait for hours, day, or even weeks for the answers. Such technologies can increase one's capacity to make proposals, lead to faster and wiser purchasing decisions, and maximize salesperson-customer interactions—all extremely important benefits. + * Better operations: In manufacturing especially, production bottlenecks can be a drain on in-process inventory costs, and alleviating those bottlenecks is critical. Knowing _exactly_ the situation (in-process inventory levels and processing speed, for example) of _every_ stage of a production line in real time can greatly [improve productivity][4]. + * Development of new business strategies: With new communication technology expertise, a company could open up new markets and opportunities that would have historically been out of its reach. + + + +### **Let's do some research** + +Armed with knowledge of those benefits, again imagine you're a salesperson at an enterprise communication or information technology company. You meet a potential customer at an exhibition or business summit, and she describes the following situation to you: + +> "I'm the Operations Manager of a small, local transportation company that makes deliveries within and between several of the surrounding cities. We have a fleet of 30 trucks, all of various sizes and makes. I know the company's information system must to be improved; much of our communication is done through email attachments, texting, and mobile phone calls. We have no central information operating system." + +A large, public, national trucking company has set up in her area. She's studied this competitor and read several of its news releases and annual reports. She's learned the company has a centralized communications system, and that all its trucks have tracking technologies that monitor the location of every truck in operation. Trucks also feature sensors that monitor many vehicle operations, including average and specific engine RPM per route by vehicle and driver, and miles travelled in particular conditions (to determine fuel economy and maintenance schedules). An electronic parts delivery system connects this company's service operations with a network of dealers to reduce the time service technicians must wait for parts. + +This is what the small local trucking company must compete against. So its operations manager asks you, the IT company salesperson, what you can do to help. + +You decide that your first step is to conduct a survey to learn more about both the company's current communication technology system and the personnel's attitude toward this system in order to see what _could_ and _should_ be done to improve the situation. While there, you want to learn this trucking company's IT status _before_ making any recommendations. + +I've created a worksheet you might use to facilitate this conversation. + +### Taking the temperature + +The first part of the worksheet can help you develop a baseline assessment of an organization's readiness for technological change. + +#### Part 1: Baseline maturity relative to competitors + +Generally, if the customer scores between 10 and 42, then that customer needs more assistance adopting new communication technology, but this varies by industry. If the score is between 43 and 70, then (when compared to competitors the customer is likely already mature in its use of communication technologies. + +#### Part 2: Leaders' relationship to communication technologies + +Next, you need to assess the company leadership's relationship to technologies, associated processes, and cultural changes. So let's make those calculations in Part 2 of the worksheet. + +Here again, depending on the competitive environment, if the score is between 10 and 42, then the company is generally _not_ completely utilizing the communication technology it has. If the score is between 43 and 70, then generally the company puts the communication technology it has to good, creative use. + +Organizational leaders must lead the conversation about using more advanced communication systems in the organization. Therefore management must establish training programs to teach everyone in the organization the skills required to _use_ that technology (a step often forgotten or poorly implemented). + +#### Part 3: Awareness of challenges and opportunities + +We now need to help the organization think more strategically about its use of communication technologies to implement open processes and open culture. We'll do this with Part 3 of the worksheet. + +If an organization scores higher than 15, the company understands the communication technology landscape fairly well. If the score is between 9 and 15, the organization needs to isolate its weakest areas and remedy them. A score of less than 9 indicates that the organization should consider conducting new awareness exercises and/or communication technology discovery programs. + +#### Part 4: Technological mastery relative to competitors + +Next, we need to better understand the trucking company's current strategic assets and its level of technological mastery relative to competitors. We'll do that with Part 4 of the worksheet. + +An organization that scores above 16 in this section likely knows where it stands and what its innovation trajectory is in comparison to competitors. A score of 7 to 16 means the organization needs to build alignment around a viable renewal path. A score of less than 7 might mean the organization should conduct a communication technology maturity assessment and update its best practices. + +#### Part 5: Ability to articulate technological vision + +Now let's explore how well the organization's senior leaders can articulate a vision for the role communication technology will play in the company's future. That's Part 5 of the worksheet. + +If the organization scores over 24, then its members likely believe its executives are aligned on a technological vision (and are considering competitors). A score of 14 to 24 should prompt us to isolate the root causes of the concerns and work with the team to remedy them. Anything less than 14 should spur a structured senior executive alignment initiative. + +Questions like these can clarify the extent to which employees must be involved in communication technology investment decision-making and utilization. Front-line members typically know what's necessary, what's available, and what the organization should introduce. + +### From vision to action + +I've seen first-hand that in situations like these, purchasing technologies is only half the problem. Getting people to buy into the system and use it to full capacity are far bigger challenges. + +In this section, we'll assess the organization's ability to translate technological vision into action. + +#### Part 6: Ability to translate vision to action + +First, let's see how the company is currently converting its vision into an action plan relative to competitors. We'll return to the worksheet, specifically Part 6. + +A company scoring more than 17 points likely has a robust plan and evaluation system in place, and is focused on engaging people in executing technological adoption efforts relative to competitors. Organizations scoring 7 to 17 should review the action plan and milestone checklist weekly for content and alignment. Those scoring less than 7 should conduct a full review of its milestone checklist and action plan processes. + +#### Part 7: Supervision strategies + +Few plans succeed without proper supervision, so you'll want to assess the organization's plans to oversee change management efforts. We'll use the trusty worksheet—this time, Part 7. + +Did the company score something greater than 15? Then its supervision model is in good shape. Maybe 8 to 15? It should check its governance principles and/or program leadership. Less than 8? Time to rework (or design for the first time) its supervision principles. + +#### Part 8: Funding strategy for implementation + +Of course, organizational initiatives like these require funding. So you'll want to assess the organization's financial commitment to technological change. Once again, let's use our worksheet (Part 8 this time). + +Scoring more than 16 points means the company's funding for new communication technologies is strong. Scoring 8 to 16 means the company should work to ensure that the company portfolio, funding, and business strategy are better aligned. Anything less than 8 means company needs to rework its investment and funding strategy for new technologies. + +#### Part 9: Clarity and promotion of vision + +Organizational leaders should constantly be clarifying and advocating plans to adopt new technologies. How are they doing? Let's review Part 9 of our worksheet. + +If the company scores over 17, then it's likely doing a good job of marketing its ambitions. If it scores somewhere between 7 and 17, it should isolate dimensions of its messaging that need refinement and work with the team to remedy them. If it scores less than 7, it should consider developing a specific program to convey the company's ambition more broadly. + +#### Part 10: Ability to build and sustain engagement + +Changes to technological systems and processes don't happen automatically. People need to invest in them, and leaders need to sustain their engagement in the organizational changes. Not everyone will buy in (as I've [written previously][5]). We can assess how well the organization is doing this with Part 10 of the worksheet. + +A score over 23 indicates that the company is doing a good job building momentum while introducing communication technologies. A score of 12 to 23 means that organization might need to isolate some part of the process that's not proceeding satisfactorily and remedy that component. Less than 12? The company needs to design and conduct a full engagement program. + +### Organizational considerations + +This final section assesses specific _organizational_ capacities—that is, the organization's culture, its structure, and its processes. Becoming more open by adopting new communication technologies is only possible if the organization itself is flexible and willing to change. + +#### Part 11: Organizational culture + +Is the organizational environment amenable to the kinds of changes necessary for effectively adopting new communication activities? We'll assess that in Part 11 of our worksheet. + +An organization scoring more than 16 points is already shifting its organizational behaviors and culture ahead of competitors. One scoring between 7 and 16 points should investigate root causes of concerns about cultural changes and work with the team to remedy problems. An organization scoring less than 7 should begin working to shift its culture around communication practices and expectations. + +#### Part 12: Organizational structure + +Does the organization's current structure allow it to sustain communication technology innovations? Use Part 12 of the worksheet to gather an initial impression. + +Scoring over 16 means the company possesses the basic structural capabilities necessary for sustained, steady, technical changes. Scoring between 8 and 16 means the company has only begun implementing projects aimed at developing necessary structural capabilities, but more effort is needed. And a score of less than 8 indicates that the company needs to consider specific programs for improving basic structural capabilities. + +#### Part 13: Reward and incentive structures + +Are the organization's reward and incentive structures aligned with the organization's goals for introducing and adopting new communication technologies? Let's look at the worksheet one last time. + +A score over 14 indicates that the company's current reward structures are aligned with its communication technology objectives. A score between 6 and 14 tells us that the organization should build stronger consensus around a viable reward strategy aligned to communication technology renewal. And a score of less than 6 should prompt leadership to implement specific reward structures that accomplish its communication technology adoption goals. + +### Post-survey debrief + +After collecting those data, you're now in a position to ask how your information technology company can help your potential customer in four areas: + + 1. Data gathering and company strategy analytics + 2. Social media, internet utilization, and interaction internally + 3. Telecommunication utilization within company (to avoid excess and unnecessary traveling for meetings, etc.) + 4. Automation technology utilization within the company + + + +You're also able to inquire within your company (among solution architects, for example) who we potentially should partner with if need be in order to achieve this transportation company's goals in these four areas." + +In these kinds of strategic partnerships, open organization principles—especially transparency, inclusivity, collaboration, and community—come alive. One person cannot do this kind of work alone. + +I've seen first-hand that in situations like these, purchasing technologies is only _half the problem._ Getting people to _buy into the system_ and _use it to full capacity_ are far bigger challenges. These challenges are cultural, not technological. Being a "communication superstar" means being great in both those areas—both the communication technology itself, as well as the culture and process expertise necesasry for actual utilization. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/20/3/communication-technology-worksheet + +作者:[Ron McFarland][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code ) +[2]: https://opensource.com/open-organization/resources/open-org-definition +[3]: https://opensource.com/open-organization/20/1/communication-technology-superstars +[4]: https://www.slideshare.net/RonMcFarland1/improving-processes-65115172?qid=b0a0fde3-62c6-4538-88c8-1bfd70485cee&v=&b=&from_search=5 +[5]: https://opensource.com/open-organization/17/1/escape-the-cave From d2f3f6dbad41ec895c0b5b33c95ceeac8aba8717 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:09:06 +0800 Subject: [PATCH 086/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Key=20?= =?UTF-8?q?Takeaways=20from=20Cisco=E2=80=99s=20Annual=20Internet=20Report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md --- ...ays from Cisco-s Annual Internet Report.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md diff --git a/sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md b/sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md new file mode 100644 index 0000000000..d450597913 --- /dev/null +++ b/sources/talk/20200303 Key Takeaways from Cisco-s Annual Internet Report.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Key Takeaways from Cisco’s Annual Internet Report) +[#]: via: (https://www.networkworld.com/article/3529989/key-takeaways-from-cisco-s-annual-internet-report.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Key Takeaways from Cisco’s Annual Internet Report +====== +Businesses need to be ready for the massive wave of devices and bandwidth that are coming in the next vide years +Natalya Burova / Getty Images + +By 2023, two-thirds of the world’s population will have Internet access—that’s 5.3 billion total Internet users, compared to 3.9 billion in 2018. The number of devices and connections will also skyrocket. There will be 3.6 networked devices per capita by 2023, whereas in 2018, there were 2.4 networked devices per capita. + +These findings come from Cisco’s _[Annual Internet Report (2018 – 2023) ][1]_(AIR) - previously known as Visual Network Index (VNI), which assesses the digital transformation across different business segments and their adoption of networking technologies, including fixed broadband, Wi-Fi, and mobile (3G, 4G, 5G).  + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +The report described an increased demand for new or enhanced applications that boost workforce productivity or improve customer experiences. In today’s mobile world, users expect their devices (and networks) to deliver on all fronts: quality, ease of use, and seamless connectivity.  + +[Cisco][3] + +The report can be useful as companies plan out their network strategies. One of the aspects of the VNI that Cisco carried over to AIR is an [online tool][4] that lets people slice and dice the information by country, device or other factors. They also included an [“Internet readiness” tool ][5]that explores how prepared different regions are for the coming wave of devices and need for bandwidth.  + +**More network automation is needed** + +To meet growing demand for enhanced apps, enterprises need automated network monitoring and optimization, andt that can be achieved with software-defined wide area networking (SD-WAN). Software-driven networks create more flexible infrastructures that can adapt to changing traffic requirements, which becomes necessary as more enterprises move to hybrid clouds, the report says. + +Policy-based automation and Intent-Based Networking (IBN) are just as important when it comes to building agile, portable, and scalable networks. IBN, as the name implies, captures business intent through analytics and machine learning. One trend Cisco observed in its report is how business WAN traffic flow patterns are becoming more software-based and hybrid in nature, creating a need for IBN solutions, the report says. + +[][6] + +**SD-WAN is core to network success** + +SD-WAN is important to the network edge, which brings computing, storage, and networking resources closer to users and devices. Cisco found many use cases driving the need for greater edge-computing capabilities. One of them is finding ways to control data from the billions of Internet of Things (IoT) endpoints being added to the network edge. + +Out of the 29.3 billion networked devices in use by 2023, about half will support various IoT applications, per Cisco’s report. As for machine-to-machine (M2M) communication, there will be 14.7 billion connections by 2023. Consumers will hold the biggest share (74%) of total devices and connections, with businesses claiming approximately 26%. However, the consumer share will grow at a slower rate than business. + +How will enterprises manage to secure all networked devices and data? Cisco recommends creating a security policy that strikes a balance between data protection and ease of use. In other words, networks will have to be intelligent enough to grant access to the right users without putting them through a difficult authentication process. + +**Network managers still struggle to lower operational costs** + +Network managers continue to struggle with rising operational costs, as the explosion of devices and data outpaces IT resources. Cisco found nearly 95% of network changes are still performed manually, resulting in operational costs that outweigh network costs. That’s where IT automation can help, enabled by SDN, intelligent network-edge enhancements, and unified domain controls. + +In addition to exploring business-specific networking needs, Cisco outlined some trends in consumer and small-to-medium business (SMB) markets. Here are the key takeaways: + + * **Next-generation applications**—built with artificial intelligence (AI) and machine learning—will create complex requirements and new business models. Mobile applications, specifically, will drive future consumer, SMB, and enterprise needs, with 299.1 billion mobile apps downloaded worldwide by 2023. + * **Mixed devices and connections** are enabling myriad M2M apps. Connected-home, video-surveillance, connected appliances, and tracking apps will make up 48% of M2M connections by 2023. Connected-car apps will be the fastest-growing category, with connected cities coming in second. + * **Accelerating broadband speeds** will affect traffic growth and use of high-bandwidth content and applications. Average broadband speeds will more than double globally from 45.9 Mbps (in 2018) to 110.4 Mbps (in 2023). Fiber-to-the-home (FTTH), high-speed DSL, and cable broadband adoption will contribute to the growth. + * **Wi-Fi will gain momentum** as devices and IoT connections increase. By 2023, the number of public Wi-Fi hotspots will grow to 628 million, up from 169 million in 2018. Wi-Fi 6 promises to boost speeds by up to 30%, compared to the current generation. More importantly, next-gen Wi-Fi will significantly improve real-time communications and high-definition video, impacting both consumer and business sectors. + + + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529989/key-takeaways-from-cisco-s-annual-internet-report.html + +作者:[Zeus Kerravala][a] +选题:[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/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: http://www.cisco.com/go/ciscoair +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.cisco.com/c/en/us/solutions/collateral/executive-perspectives/annual-internet-report/white-paper-c11-741490.html +[4]: https://www.cisco.com/c/en/us/solutions/executive-perspectives/annual-internet-report/air-highlights.html +[5]: https://www.cisco.com/c/en/us/solutions/service-provider/cloud-readiness-tool/index.html +[6]: 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) +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 77330e72f751d0dea17086412d79458ed8735ab5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 4 Mar 2020 01:18:38 +0800 Subject: [PATCH 087/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200303=20Watchi?= =?UTF-8?q?ng=20activity=20on=20Linux=20with=20watch=20and=20tail=20comman?= =?UTF-8?q?ds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200303 Watching activity on Linux with watch and tail commands.md --- ...y on Linux with watch and tail commands.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20200303 Watching activity on Linux with watch and tail commands.md diff --git a/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md b/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md new file mode 100644 index 0000000000..15780a5b34 --- /dev/null +++ b/sources/tech/20200303 Watching activity on Linux with watch and tail commands.md @@ -0,0 +1,148 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Watching activity on Linux with watch and tail commands) +[#]: via: (https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Watching activity on Linux with watch and tail commands +====== +The watch and tail commands can help monitor activity on Linux systems. This post looks at some helpful ways to use these commands. +Loops7 / Getty Images + +The **watch** and **tail** commands provide some interesting options for examining activity on a Linux system in an ongoing manner. + +That is, instead of just asking a question and getting an answer (like asking **who** and getting a list of currently logged in users), you can get **watch** to provide you with a display showing who is logged in along with updates as users come and go. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +With **tail**, you can display the bottoms of files and see content as it is added. This kind of monitoring is often very helpful and requires less effort than running commands periodically. + +### Using watch + +One of the simplest examples of using **watch** is to use the command **watch who**. You should see a list showing who is logged in along with when they logged in and where they logged in from. Notice that the default is to update the display every two seconds (top left) and that the date and time (upper right) updates itself at that interval. The list of users will grow and shrink as users log in and out. + +### $ watch who + +This command will dissplay a list of logins like this: + +``` +Every 2.0s: who dragonfly: Thu Feb 27 10:52:00 2020 + +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +You can change the interval to get less frequent updates by adding a **-n** option (e.g., -n 10) to select a different number of seconds between updates. + +### $ watch -n 10 who + +The new interval will be displayed and the time shown will change less frequently, aligning itself with the selected interval. + +[][2] + +``` +Every 10.0s: who dragonfly: Thu Feb 27 11:05:47 2020 + +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +If you prefer to see only the command's output and not the heading (the top 2 lines), you can omit those lines by adding the **-t** (no title) option. + +### $ watch -t who + +Your display will then look like this: + +``` +nemo pts/0 2020-02-27 08:07 (192.168.0.11) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +``` + +If every time the watched command runs, its output is the same, only the title line (if not omitted) will change. The rest of the displayed information will stay the same. + +If you want your **watch** command to exit as soon as the output of the command that it is watching changes, you can use a **-g** (think of this as the "go away") option. You might choose to do this if, for example, you are simply waiting for others to start logging into the system. + +You can also highlight changes in the displayed output using the **-d** (differences) option. The highlighting will only last for one interval (2 seconds by default), but can help to draw your attention to the changes. + +Here's a more complex example of using the **watch** command to display services that are listening for connections and the ports they are using. While the output isn't likely to change, it would alert you to any new service starting up or one going down. + +``` +$ watch 'sudo lsof -i -P -n | grep LISTEN' +``` + +Notice that the command being run needs to be enclosed in quotes to ensure that the **watch** command doesn't send its output to the grep command. + +Using the **watch -h** command will provide you with a list of the command's options. + +``` +$ watch -h + +Usage: + watch [options] command + +Options: + -b, --beep beep if command has a non-zero exit + -c, --color interpret ANSI color and style sequences + -d, --differences[=] + highlight changes between updates + -e, --errexit exit if command has a non-zero exit + -g, --chgexit exit when output from command changes + -n, --interval seconds to wait between updates + -p, --precise attempt run command in precise intervals + -t, --no-title turn off header + -x, --exec pass command to exec instead of "sh -c" + + -h, --help display this help and exit + -v, --version output version information and exit +``` + +### Using tail -f + +The **tail -f** command has something in common with **watch**. It will both display the bottom of a file and additional content as it is added. Instead of having to run a "tail" command again and again, you run one command and get a repeatedly updated view of its output. For example, you could watch a system log with a command like this: + +``` +$ tail -f /var/log/syslog +``` + +Some files, like **/var/log/wtmp**, don't lend themselves to this type of handling because they're not formatted as normal text files, but you could get a similar result by combining **watch** and **tail** like this: + +``` +watch 'who /var/log/wtmp | tail -20' +``` + +This command will display the most recent 5 logins regardless of how many of the users are still logged in. If another login occurs, a line will be added and the top line removed. + +``` +Every 60.0s: who /var/log/wtmp | tail -5 dragonfly: Thu Feb 27 12:46:07 2020 + +shs pts/0 2020-02-27 08:07 (192.168.0.5) +nemo pts/1 2020-02-27 08:26 (192.168.0.5) +shs pts/1 2020-02-27 10:58 (192.168.0.5) +nemo pts/1 2020-02-27 11:34 (192.168.0.5) +dory pts/1 2020-02-27 12:14 (192.168.0.5) +``` + +Both the **watch** and **tail -f** commands can provide auto-updating views of information that you might at times want to monitor, making the task of monitoring quite a bit easier whether you're monitoring processes, logins or system resources. + +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/3529891/watching-activity-on-linux-with-watch-and-tail-commands.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/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) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From 206f0206d03b3c49f013fc44b2ac4ba5da0b8658 Mon Sep 17 00:00:00 2001 From: wenwensnow <963555237@qq.com> Date: Tue, 3 Mar 2020 22:10:19 +0100 Subject: [PATCH 088/207] Update 20200225 3 eBook readers for the Linux desktop.md --- sources/tech/20200225 3 eBook readers for the Linux desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/sources/tech/20200225 3 eBook readers for the Linux desktop.md index 1c057a15ed..0fea0ba883 100644 --- a/sources/tech/20200225 3 eBook readers for the Linux desktop.md +++ b/sources/tech/20200225 3 eBook readers for the Linux desktop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wenwensnow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b08890fe07482b838c8c9cb8bab5b763936598c6 Mon Sep 17 00:00:00 2001 From: wenwensnow <963555237@qq.com> Date: Tue, 3 Mar 2020 22:37:35 +0100 Subject: [PATCH 089/207] Update 20200225 3 eBook readers for the Linux desktop.md --- .../tech/20200225 3 eBook readers for the Linux desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/sources/tech/20200225 3 eBook readers for the Linux desktop.md index 0fea0ba883..700f56aeed 100644 --- a/sources/tech/20200225 3 eBook readers for the Linux desktop.md +++ b/sources/tech/20200225 3 eBook readers for the Linux desktop.md @@ -7,10 +7,10 @@ [#]: via: (https://opensource.com/article/20/2/linux-ebook-readers) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) -3 eBook readers for the Linux desktop +3 eBook readers for the Linux desktop 针对Linux桌面版的3个电子书阅读器 ====== Any of these open source eBook applications will make it easy to read -your books on a larger screen. +your books on a larger screen. 任意一个开源电子书应用都能使你在更大屏幕上的阅读体验得到提升。 ![Computer browser with books on the screen][1] I usually read eBooks on my phone or with my Kobo eReader. I've never been comfortable reading books on larger screens. However, many people regularly read books on their laptops or desktops. If you are one of them (or think you might be), I'd like to introduce you to three eBook readers for the Linux desktop. From 0e966feb51d1ddfa043b7ee320479b4a3b808489 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 4 Mar 2020 08:23:12 +0800 Subject: [PATCH 090/207] translated --- ...se logzero for simple logging in Python.md | 156 ------------------ ...se logzero for simple logging in Python.md | 155 +++++++++++++++++ 2 files changed, 155 insertions(+), 156 deletions(-) delete mode 100644 sources/tech/20200226 Use logzero for simple logging in Python.md create mode 100644 translated/tech/20200226 Use logzero for simple logging in Python.md diff --git a/sources/tech/20200226 Use logzero for simple logging in Python.md b/sources/tech/20200226 Use logzero for simple logging in Python.md deleted file mode 100644 index 467b30d968..0000000000 --- a/sources/tech/20200226 Use logzero for simple logging in Python.md +++ /dev/null @@ -1,156 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use logzero for simple logging in Python) -[#]: via: (https://opensource.com/article/20/2/logzero-python) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -Use logzero for simple logging in Python -====== -A quick primer on the handy log library that can help you master this -important programming concept. -![Snake charmer cartoon with a yellow snake and a blue snake][1] - -The logzero library makes logging as easy as a print statement, which is quite a feat of simplicity. I'm not sure whether logzero took its name to fit in with the series of "zero boilerplate" libraries like pygame-zero, GPIO Zero, and guizero, but it's certainly in that category. It's a Python library that makes logging straightforward. - -You can just use its basic logging to stdout the same way you might use print for information and debugging purposes, and it has a smooth learning curve towards more advanced logging, like logging to a file. - -To start, install logzero with pip: - - -``` -`$ sudo pip3 install logzero` -``` - -Now in a Python file, import logger and try one or all of these logging examples: - - -``` -from logzero import logger - -logger.debug("hello") -logger.info("info") -logger.warning("warning") -logger.error("error") -``` - -The output is automatically colored in an easy-to-read way: - -![Python, Raspberry Pi: import logger][2] - -So now, instead of using **print** to figure out what's going on, use logger instead, with the relevant log level. - -### Writing logs to a file in Python - -If you only read this far and make that one change in the way you write code, that's good enough for me. If you want to go further, read on! - -Writing to **stdout** is fun for testing a new program, but it is only useful if you are logged into the computer where the script is running. Many times when using an application you'll want to execute the code remotely and review errors after the fact. That's when it's helpful to log to a file instead. Let's try it: - - -``` -from logzero import logger, logfile - -logfile('/home/pi/test.log') -``` - -Now your log entries will be logged into the file **test.log**. Remember to make sure that the [script has permission][3] to write to that file and its directory structure. - -You can specify some more options too: - - -``` -`logfile(’/home/pi/test.log’, maxBytes=1e6, backupCount=3)` -``` - -Now when the file provided to **logfile** reaches 1MB (1×106 bytes), it will rotate entries through **test.log.1**, **test.log.2**, and so on. This behavior is nice to avoid generating a massive log file that is I/O intensive for the system to open and close. You might also want to log to **/var/log** like a pro. Assuming you're on Linux, you a directory and make your user the owner so they can write to it: - - -``` -$ sudo mkdir /var/log/test -$ sudo chown pi /var/log/test -``` - -Then in your Python code, change the **logfile** path: - - -``` -`logfile(’/var/log/test/test.log’, maxBytes=1e6, backupCount=3)` -``` - -When it comes to catching exceptions in your **logfile**, you can either use **logging.exception:** - - -``` -try: -    c = a / b -except Exception as e: -    logger.exception(e) -``` - -This will produce the following (in the case that b is zero): - - -``` -[E 190422 23:41:59 test:9] division by zero -     Traceback (most recent call last): -       File "test.py", line 7, in -         c = a / b -     ZeroDivisionError: division by zero -``` - -You get the log entry, followed by the full traceback. Alternatively, you could use **logging.error** and hide the traceback: - - -``` -try: -    c = a / b -except Exception as e: -    logger.error(f"{e.__class__.__name__}: {e}") -``` - -Now this will produce the more succinct: - - -``` -`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero` -``` - -* * * - -* * * - -* * * - -**![Logging output][4]** - -There are plenty more options which you can read in the docs at [logzero.readthedocs.io][5]. - -### logzero shines for education - -Logging can be a challenging concept for a new programmer. Most frameworks depend on flow control and lots of variable manipulation to make a meaningful log, but logzero is different. With its syntax being similar to a print statement, it is a big win for education as it saves from explaining another concept. Give it a try on your next project. - -\-- - -_This article was originally written on [my blog][6] and is republished with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/logzero-python - -作者:[Ben Nuttall][a] -选题:[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/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake) -[2]: https://opensource.com/sites/default/files/uploads/rpi_ben_1.png (Python, Raspberry Pi: import logger) -[3]: https://opensource.com/article/19/6/understanding-linux-permissions -[4]: https://opensource.com/sites/default/files/uploads/rpi_ben_2.png (Logging output) -[5]: https://logzero.readthedocs.io/en/latest/ -[6]: https://tooling.bennuttall.com/logzero/ diff --git a/translated/tech/20200226 Use logzero for simple logging in Python.md b/translated/tech/20200226 Use logzero for simple logging in Python.md new file mode 100644 index 0000000000..f246475da4 --- /dev/null +++ b/translated/tech/20200226 Use logzero for simple logging in Python.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use logzero for simple logging in Python) +[#]: via: (https://opensource.com/article/20/2/logzero-python) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +使用 logzero 在 Python 中进行简单日志记录 +====== +一个方便的日志库快速入门,来帮助你掌握这个重要的编程概念。 +![Snake charmer cartoon with a yellow snake and a blue snake][1] + +logzero 库使日志记录就像打印语句一样容易,是简单性的杰出代表。我不确定 logzero 的名称是否要与 pygame-zero、GPIO Zero 和 guizero 这样的 “zero 样板库”契合,但是肯定属于该类别。它是一个 Python 库,使得日志记录变得简单明了。 + +你可以使用它的基本日志记录到标准输出,就像你可以使用 print 来获得信息和调试一样,它还有学习更高级日志记录(例如记录到文件)的平滑学习曲线。 + +首先,使用 pip 安装 logzero: + + +``` +`$ sudo pip3 install logzero` +``` + +在 Python 文件中,导入 logger 并尝试以下一个或所有日志实例: + + +``` +from logzero import logger + +logger.debug("hello") +logger.info("info") +logger.warning("warning") +logger.error("error") +``` + +输出以易于阅读的方式自动着色: + +![Python, Raspberry Pi: import logger][2] + +因此现在不要再使用 **print** 来了解发生了什么,而应使用有相关日志级别的 logger。 + +### 在 Python 中将日志写入文件 + +如果你阅读至此,并会在你写代码时做一点改变,这对我就足够了。如果你要了解更多,请继续阅读! + +写到**标准输出**对于测试新程序不错,但是仅当你登录到运行脚本的计算机时才有用。在很多时候,你需要远程执行代码并在事后查看错误。这种情况下,记录到文件很有帮助。让我们尝试一下: + + +``` +from logzero import logger, logfile + +logfile('/home/pi/test.log') +``` + +现在,你的日志条目将记录到文件 **test.log** 中。记住确保[脚本有权限] [3]写入该文件及其目录结构。 + +你也可以指定更多选项: + + +``` +`logfile(’/home/pi/test.log’, maxBytes=1e6, backupCount=3)` +``` + +现在,当提供给 **logfile** 文件达到 1MB(10^6 字节)时,它将通过 **test.log.1**、**test.log.2** 等文件轮询写入。这种行为可以避免系统打开和关闭大量 I/O 密集的日志文件,以至于系统无法打开和关闭。你或许还要记录到 **/var/log**。假设你使用的是 Linux,那么创建一个目录并将用户设为所有者,以便可以写入该目录: + + +``` +$ sudo mkdir /var/log/test +$ sudo chown pi /var/log/test +``` + +然后在你的 Python 代码中,更改 **logfile** 路径: + + +``` +`logfile(’/var/log/test/test.log’, maxBytes=1e6, backupCount=3)` +``` + +当要在 **logfile** 中捕获异常时,可以使用 **logging.exception**:。 + + +``` +try: +    c = a / b +except Exception as e: +    logger.exception(e) +``` + +这将输出(在 b 为零的情况下): + + +``` +[E 190422 23:41:59 test:9] division by zero +     Traceback (most recent call last): +       File "test.py", line 7, in +         c = a / b +     ZeroDivisionError: division by zero +``` + +你会得到日志,还有完整回溯。另外,你可以使用 **logging.error** 并隐藏回溯: + + +``` +try: +    c = a / b +except Exception as e: +    logger.error(f"{e.__class__.__name__}: {e}") +``` + +现在,将产生更简洁的结果: + + +``` +`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero` +``` + +* * * + +* * * + +* * * + +**![Logging output][4]** + +你可以在 [logzero.readthedocs.io] [5] 中阅读更多选项。 + +### logzero 为教育而生 + +对于新手程序员来说,日志记录可能是一个具有挑战性的概念。大多数框架依赖于流控制和大量变量操作来生成有意义的日志,但是 logzero不同。由于它的语法类似于 print 语句,因此它在教育上很成功,因为它无需解释其他概念。在你的下个项目中试试它。 + +\-- + +_此文章最初发布在[我的博客] [6]上,经许可重新发布。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/logzero-python + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake) +[2]: https://opensource.com/sites/default/files/uploads/rpi_ben_1.png (Python, Raspberry Pi: import logger) +[3]: https://opensource.com/article/19/6/understanding-linux-permissions +[4]: https://opensource.com/sites/default/files/uploads/rpi_ben_2.png (Logging output) +[5]: https://logzero.readthedocs.io/en/latest/ +[6]: https://tooling.bennuttall.com/logzero/ From cdbbfc8b788a0a5cc3c10c0ce2ee80429c6ba98b Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 4 Mar 2020 08:29:03 +0800 Subject: [PATCH 091/207] translating --- sources/tech/20200302 Install GNU Emacs on Windows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200302 Install GNU Emacs on Windows.md b/sources/tech/20200302 Install GNU Emacs on Windows.md index be429efe50..7ba0e633bb 100644 --- a/sources/tech/20200302 Install GNU Emacs on Windows.md +++ b/sources/tech/20200302 Install GNU Emacs on Windows.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 37a895dd36c454f99aa53ccea3a23711b896acbc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 4 Mar 2020 09:37:37 +0800 Subject: [PATCH 092/207] Rename sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md to sources/talk/20200303 Most-used libraries, open source adoption, and more industry trends.md --- ...d libraries, open source adoption, and more industry trends.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200303 Most-used libraries, open source adoption, and more industry trends.md (100%) diff --git a/sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md b/sources/talk/20200303 Most-used libraries, open source adoption, and more industry trends.md similarity index 100% rename from sources/tech/20200303 Most-used libraries, open source adoption, and more industry trends.md rename to sources/talk/20200303 Most-used libraries, open source adoption, and more industry trends.md From eacc073cf1bd6976e46e6faffe94c6aa3afdf846 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 4 Mar 2020 09:44:16 +0800 Subject: [PATCH 093/207] Rename sources/tech/20200303 How to assess your organization-s technological maturity.md to sources/talk/20200303 How to assess your organization-s technological maturity.md --- ...03 How to assess your organization-s technological maturity.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200303 How to assess your organization-s technological maturity.md (100%) diff --git a/sources/tech/20200303 How to assess your organization-s technological maturity.md b/sources/talk/20200303 How to assess your organization-s technological maturity.md similarity index 100% rename from sources/tech/20200303 How to assess your organization-s technological maturity.md rename to sources/talk/20200303 How to assess your organization-s technological maturity.md From e7c8cdc4e89fc540edc7e80068e76f397660d4c5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 10:09:23 +0800 Subject: [PATCH 094/207] PRF @lujun9972 --- ... to get social and track your todo list.md | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/translated/tech/20200129 Use Emacs to get social and track your todo list.md b/translated/tech/20200129 Use Emacs to get social and track your todo list.md index fff71fcc19..88e21c0f94 100644 --- a/translated/tech/20200129 Use Emacs to get social and track your todo list.md +++ b/translated/tech/20200129 Use Emacs to get social and track your todo list.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use Emacs to get social and track your todo list) @@ -9,19 +9,20 @@ 使用 Emacs 进行社交并跟踪你的待办事项列表 ====== -访问 Twitter、Reddit、 交谈、电子邮件 、RSS 和你的待办事项列表,这是我们关于 2020 年使用开源提高效率的 20 个方法系列的第 19 个。 -![团队沟通、交谈 ][1] -去年,我给你们带来了 2019 年的 19 天新生产力工具。今年,我将采取一种不同的方法:建立一个新的环境,让你使用已用或未用的工具在新的一年里更有效率,。 +> 在 2020 年用开源实现更高生产力的二十种方式的第十九篇文章中,访问 Twitter、Reddit、 交谈、电子邮件 、RSS 和你的待办事项列表。 + +![](https://img.linux.net.cn/data/attachment/album/202003/04/100911lg2vrv92692b422y.jpg) + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 Emacs 做(几乎)所有的事情,第 2 部分 -[昨天 ][2],我谈到了如何在 Emacs 中读取电子邮件、访问电子邮件地址和显示日历。Emacs 功能繁多,你还可以将它用于 Twitter、 交谈、待办事项列表等等! +[昨天][2],我谈到了如何在 Emacs 中读取电子邮件、访问电子邮件地址和显示日历。Emacs 功能繁多,你还可以将它用于 Twitter、交谈、待办事项列表等等! -[在 Emacs 中处理所有事情 ][3] - -要完成所有这些,您需要安装一些 Emacs 包。和昨天一样,用 `Meta+x package-manager` 打开 Emacs 包管理器 (Meta 在大多数键盘上是 **Alt**,在 MacOS 上是 **Option**)。然后通过 **i** 选择以下带有的软件包,然后输入 **x** 进行安装: +![在 Emacs 中处理所有事情][3] +要完成所有这些,你需要安装一些 Emacs 包。和昨天一样,用 `Meta+x package-manager` 打开 Emacs 包管理器(Meta 键在大多数键盘上是 `Alt`,在 MacOS 上是 `Option`)。然后通过 `i` 选择以下带有的软件包,然后输入 `x` 进行安装: ``` nnreddit @@ -31,7 +32,6 @@ twittering-mode 安装之后,按下 `Ctrl+x ctrl+f` 打开 `~/.emacs.d/init.el`,并在 `(custom-set-variables` 行前加上: - ``` ;; Todo.txt (require 'todotxt) @@ -54,11 +54,11 @@ twittering-mode [Twittering-mode][5] 是 Twitter 最好的 Emacs 接口之一。它几乎支持 Twitter 的所有功能,并且键盘快捷键也易于使用。 -首先,输入 `Meta+x twit` 来启动 twitter-mode。它会提供一个 URL 并提示你启动浏览器来访问它,你登录该 URL 后就能获得授权令牌。将令牌复制并粘贴到 Emacs 中,您的 Twitter 时间线就会加载了。您可以使用**箭头**键滚动,使用 **Tab** 从一个项目移动到另一个项目,并按 **Enter** 访问光标所在的 URL。如果光标在用户名上,按 **Enter** 将在 web 浏览器中打开时间轴。如果你在一条 tweet 的文本上,按 **Enter** 将回复该 tweet。你可以用 **u** 创建一个新的 tweet,用 `Ctrl+c+Enter` 转发一些内容,然后用 **d** 发送一条直接消息——它打开的对话框中有关于如何发送、取消和缩短 url 的说明。 +首先,输入 `Meta+x twit` 来启动 twittering-mode。它会提供一个 URL 并提示你启动浏览器来访问它,你登录该 URL 后就能获得授权令牌。将令牌复制并粘贴到 Emacs 中,你的 Twitter 时间线就会加载了。你可以使用箭头键滚动,使用 `Tab` 从一个项目移动到另一个项目,并按回车访问光标所在的 URL。如果光标在用户名上,按回车将在 web 浏览器中打开时间轴。如果你在一条推文的文本上,按回车将回复该推文。你可以用 `u` 创建一个新的推文,用 `Ctrl+c+Enter` 转发一些内容,然后用 `d` 发送一条即时消息——它打开的对话框中有关于如何发送、取消和缩短 URL 的说明。 -按 **V** 会打开一个提示让你跳转到其他时间线。输入 **:mentions** 打开你的提及。输入 **:home** 打开你的主时间线,输入用户名将进入该用户的时间线。最后,按 **q** 会退出 twittering-mode 并关闭窗口。 +按 `V` 会打开一个提示让你跳转到其他时间线。输入 `:mentions` 打开你的提及。输入 `:home` 打开你的主时间线,输入用户名将进入该用户的时间线。最后,按 `q` 会退出 twittering-mode 并关闭窗口。 -twitter-mode 还有更多功能,我鼓励你阅读它 GitHub 页面上的[完整功能列表 ][6]。 +twitter-mode 还有更多功能,我鼓励你阅读它 GitHub 页面上的[完整功能列表][6]。 #### 在 Emacs 上使用 Todotxt.el 追踪你的待办事项 @@ -66,27 +66,27 @@ twitter-mode 还有更多功能,我鼓励你阅读它 GitHub 页面上的[完 [Todotxt.el][8] 是一个很棒的 [todo.txt][9] 待办列表管理器接口。它的快捷键几乎无所不包。 -输入 `Meta+x todotxt` 启动它将加载 **todotxt-file** 变量中指定的 todo.txt 文件(本文的第一部分中设置了该文件)。 -在 todo.txt 的缓冲区(窗口*,您可以按 **a** 添加新任务并和按 **c** 标记它已被完成。你还可以使用 **r** 设置优先级,并使用 **t** 添加项目和上下文。 -完成事项后只需要按下 **A** 即可将任务移如 **done.txt**。你可以使用**/**过滤列表,也可以使用 **l** 刷新完整列表。同样,您可以按 **q** 退出。 +输入 `Meta+x todotxt` 启动它将加载 `todotxt-file` 变量中指定的 `todo.txt` 文件(本文的第一部分中设置了该文件)。在 `todo.txt` 的缓冲区(窗口),你可以按 `a` 添加新任务并和按 `c` 标记它已被完成。你还可以使用 `r` 设置优先级,并使用 `t` 添加项目和上下文。完成事项后只需要按下 `A` 即可将任务移如 `done.txt`。你可以使用 `/` 过滤列表,也可以使用 `l` 刷新完整列表。同样,你可以按 `q` 退出。 #### 在 Emacs 中使用 ERC 进行交谈 ![使用 ERC 与人交谈 ][10] -Vim 的缺点之一是很难用它与人交谈。另一方面,Emacs 则将 [ERC][11] 客户端内置到默认发行版中。使用 `Meta+x ERC` 启动 ERC,系统将提示您输入服务器、用户名和密码。你可以使用几天前介绍设置 [BitlBee][12] 时使用的相同信息:服务器为 **localhost**,端口为 **6667**,相同用户名,无需密码。 -ERC 使用起来与其他 IRC 客户端一样。每个频道单独一个缓冲区(窗口),您可以使用 `Ctrl+x ctrl+b` 进行频道间切换,这也可以在 Emacs 中的其他缓冲区之间进行切换。`/quit` 命令将退出 ERC。 +Vim 的缺点之一是很难用它与人交谈。另一方面,Emacs 则将 [ERC][11] 客户端内置到默认发行版中。使用 `Meta+x ERC` 启动 ERC,系统将提示你输入服务器、用户名和密码。你可以使用几天前介绍设置 [BitlBee][12] 时使用的相同信息:服务器为 `localhost`,端口为 `6667`,相同用户名,无需密码。 + +ERC 使用起来与其他 IRC 客户端一样。每个频道单独一个缓冲区(窗口),你可以使用 `Ctrl+x ctrl+b` 进行频道间切换,这也可以在 Emacs 中的其他缓冲区之间进行切换。`/quit` 命令将退出 ERC。 #### 使用 Gnus 阅读电子邮件,Reddit 和 RSS ![Mail,Reddit,and RSS feeds with Gnus][13] 我相信昨天在我提及在 Emacs 中阅读邮件时,许多 Emacs 的老用户会问,“怎么没有 [Gnus][14] 呢?” -这个疑问很合理。Gnus 是一个内置在 Emacs 中的邮件和新闻阅读器,尽管它这个邮件阅读器不支持以 [Notmuch][15] 作为搜索引擎。但是,如果你将其配置来阅读 Reddit 和 RSS feed( 稍后您将这样做),那么同时使用它来阅读邮件是个聪明的选择。 -Gnus 是为阅读 Usenet 新闻而创建的,并从此发展而来。因此,它的很多外观和感觉(以及术语)看起来很像 Usenet 的新闻阅读器。 +这个疑问很合理。Gnus 是一个内置在 Emacs 中的邮件和新闻阅读器,尽管它这个邮件阅读器不支持以 [Notmuch][15] 作为搜索引擎。但是,如果你将其配置来阅读 Reddit 和 RSS feed(稍后你将这样做),那么同时使用它来阅读邮件是个聪明的选择。 -Gnus 以 `~/.gnus` 作为自己的配置文件。(该配置也可以包含在 `~/.emacs.d/init.el` 中)。使用 `Ctrl+x Ctrl+f` 打开 `~/.gnus`,并添加以下内容: +Gnus 是为阅读 Usenet 新闻而创建的,并从此发展而来。因此,它的很多外观和感觉(以及术语)看起来很像 Usenet 的新闻阅读器。 + +Gnus 以 `~/.gnus` 作为自己的配置文件。(该配置也可以包含在 `~/.emacs.d/init.el` 中)。使用 `Ctrl+x Ctrl+f` 打开 `~/.gnus`,并添加以下内容: ``` @@ -104,19 +104,17 @@ Gnus 以 `~/.gnus` 作为自己的配置文件。(该配置也可以包含在 `~              '(nnreddit "")) ``` -用 `Ctrl+x Ctrl+s` 保存文件。这分配置告诉 Gnus 从 `~/Maildir` 这个本地邮箱中读取邮件作为主源(参见 **gnus-select-method** 变量),并使用 [nnreddit][16] 插件添加辅源 (**gnus-secondary-select-methods** 变量)。你还可以定义多个辅助源,包括 Usenet 新闻 (nntp)、IMAP (nnimap)、mbox (nnmbox) 和虚拟集合 (nnvirtual)。您可以在 [Gnus 手册 ][17] 中了解更多有关所有选项的信息。 +用 `Ctrl+x Ctrl+s` 保存文件。这分配置告诉 Gnus 从 `~/Maildir` 这个本地邮箱中读取邮件作为主源(参见 `gnus-select-method` 变量),并使用 [nnreddit][16] 插件添加辅源(`gnus-secondary-select-methods` 变量)。你还可以定义多个辅助源,包括 Usenet 新闻(nntp)、IMAP (nnimap)、mbox(nnmbox)和虚拟集合(nnvirtual)。你可以在 [Gnus 手册][17] 中了解更多有关所有选项的信息。 -保存文件后,使用 `Meta+x Gnus` 启动 Gnus。第一次运行将在 Python 虚拟环境中安装 [Reddit 终端查看器 ][18],Gnus 通过它获取 Reddit 上的文章。然后它会启动浏览器来登录 Reddit。之后,它会扫描并加载你订阅的 Reddit 群组。你会看到一个有新邮件的邮件夹列表和一个有新内容的看板列表。在任一列表上按 **Enter** 将加载该组中的消息列表。您可以使用**箭头**键导航并按 **Enter** 加载和读取消息。在查看消息列表时,按 **q** 将返回到前一个视图,从主窗口按 **q** 将退出 Gnus。在阅读 Reddit 群组时,**a** 会创建一条新消息;在邮件组中,**m** 创建一个新的电子邮件;并且在任何一个视图中按 **r** 回复邮件。 +保存文件后,使用 `Meta+x Gnus` 启动 Gnus。第一次运行将在 Python 虚拟环境中安装 [Reddit 终端查看器][18],Gnus 通过它获取 Reddit 上的文章。然后它会启动浏览器来登录 Reddit。之后,它会扫描并加载你订阅的 Reddit 群组。你会看到一个有新邮件的邮件夹列表和一个有新内容的看板列表。在任一列表上按回车将加载该组中的消息列表。你可以使用箭头键导航并按回车加载和读取消息。在查看消息列表时,按 `q` 将返回到前一个视图,从主窗口按 `q` 将退出 Gnus。在阅读 Reddit 群组时,`a` 会创建一条新消息;在邮件组中,`m` 创建一个新的电子邮件;并且在任何一个视图中按 `r` 回复邮件。 -您还可以向 Gnus 接口中添加 RSS feed,并像阅读邮件和新闻组一样阅读它们。要添加 RSS feed,输入 `G+R` 并填写 RSS feed 的 URL。会有提示让你输入 feed 的标题和描述,这些信息可以从 feed 中提取出来并填充进去。现在输入 **g** 来检查新消息(这将检查所有组中的新消息)。阅读 feed 就像阅读 Reddit 群组和邮件一样,它们使用相同的快捷键。 +你还可以向 Gnus 接口中添加 RSS 流,并像阅读邮件和新闻组一样阅读它们。要添加 RSS 流,输入 `G+R` 并填写 RSS 流的 URL。会有提示让你输入 RSS 的标题和描述,这些信息可以从流中提取出来并填充进去。现在输入 `g` 来检查新消息(这将检查所有组中的新消息)。阅读 RSS 流 就像阅读 Reddit 群组和邮件一样,它们使用相同的快捷键。 -Gnus 中有_很多_功能,还有大量的键组合。[Gnus 参考卡 ][19] 为每个视图列出了所有这些键组合(以非常小的字体显示在 5 页纸上)。 +Gnus 中有*很多*功能,还有大量的键组合。[Gnus 参考卡][19]为每个视图列出了所有这些键组合(以非常小的字体显示在 5 页纸上)。 #### 使用 nyan-mode 查看位置 -As a final note,you might notice [Nyan cat][20] at the bottom of some of my screenshots。This is [nyan-mode][21],which indicates where you are in a buffer,so it gets longer as you get closer to the bottom of a document or buffer。You can install it with the package manager and set it up with the following code in **~/.emacs.d/init.el**: -最后,你可能会一些截屏底部注意到 [Nyan cat][20]。这是 [nyan-mode][21],它指示了你在缓冲区中的位置,因此当您接近文档或缓冲区的底部时,它会变长。您可以使用包管理器安装它,并在 `~/.emacs.d/init.el` 中使用以下代码进行设置: - +最后,你可能会一些截屏底部注意到 [Nyan cat][20]。这是 [nyan-mode][21],它指示了你在缓冲区中的位置,因此当你接近文档或缓冲区的底部时,它会变长。你可以使用包管理器安装它,并在 `~/.emacs.d/init.el` 中使用以下代码进行设置: ``` ;; Nyan Cat @@ -125,9 +123,9 @@ As a final note,you might notice [Nyan cat][20] at the bottom of some of my sc (nyan-mode) ``` -### Emacs 的皮毛 +### Emacs 的基本功能 -这只是 Emacs 所有功能的皮毛。Emacs_ 非常_强大,是我用来提高工作效率的必要工具之一,无论我是在追踪待办事项、阅读和回复邮件、编辑文本,还是与朋友和同事交流我都用它。这需要一点时间来适应,但是一旦你习惯了,它就会成为你桌面上最有用的工具之一。 +这只是 Emacs 所有功能的皮毛。Emacs *非常*强大,是我用来提高工作效率的必要工具之一,无论我是在追踪待办事项、阅读和回复邮件、编辑文本,还是与朋友和同事交流我都用它。这需要一点时间来适应,但是一旦你习惯了,它就会成为你桌面上最有用的工具之一。 -------------------------------------------------------------------------------- @@ -136,14 +134,14 @@ via: https://opensource.com/article/20/1/emacs-social-track-todo-list 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/ksonney [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) -[2]: https://opensource.com/article/20/1/emacs-mail-calendar +[2]: https://linux.cn/article-11932-1.html [3]: https://opensource.com/sites/default/files/uploads/productivity_19-1.png (All the things with Emacs) [4]: https://opensource.com/sites/default/files/uploads/productivity_19-2.png (Twitter in Emacs) [5]: https://github.com/hayamiz/twittering-mode @@ -153,10 +151,10 @@ via: https://opensource.com/article/20/1/emacs-social-track-todo-list [9]: http://todotxt.org/ [10]: https://opensource.com/sites/default/files/uploads/productivity_19-4.png (Chatting with erc) [11]: https://www.gnu.org/software/emacs/manual/html_mono/erc.html -[12]: https://opensource.com/article/20/1/open-source-chat-tool +[12]: https://linux.cn/article-11856-1.html [13]: https://opensource.com/sites/default/files/uploads/productivity_19-5.png (Mail, Reddit, and RSS feeds with Gnus) [14]: https://www.gnus.org/ -[15]: https://opensource.com/article/20/1/organize-email-notmuch +[15]: https://linux.cn/article-11807-1.html [16]: https://github.com/dickmao/nnreddit [17]: https://www.gnus.org/manual/gnus.html [18]: https://pypi.org/project/rtv/ From 777a63e16c44aa36eec1906520a883323a786c5e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 10:11:26 +0800 Subject: [PATCH 095/207] PUB @lujun9972 https://linux.cn/article-11956-1.html --- ...200129 Use Emacs to get social and track your todo list.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200129 Use Emacs to get social and track your todo list.md (99%) diff --git a/translated/tech/20200129 Use Emacs to get social and track your todo list.md b/published/20200129 Use Emacs to get social and track your todo list.md similarity index 99% rename from translated/tech/20200129 Use Emacs to get social and track your todo list.md rename to published/20200129 Use Emacs to get social and track your todo list.md index 88e21c0f94..0d7bbc42c5 100644 --- a/translated/tech/20200129 Use Emacs to get social and track your todo list.md +++ b/published/20200129 Use Emacs to get social and track your todo list.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lujun9972) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11956-1.html) [#]: subject: (Use Emacs to get social and track your todo list) [#]: via: (https://opensource.com/article/20/1/emacs-social-track-todo-list) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From b51fc20c83fb670333651c6c8ed64f1fe4ad04cb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 11:22:43 +0800 Subject: [PATCH 096/207] PRF @HankChow --- ...to know about domain-specific languages.md | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/translated/tech/20200224 What developers need to know about domain-specific languages.md b/translated/tech/20200224 What developers need to know about domain-specific languages.md index 299ed726fc..f0578a307f 100644 --- a/translated/tech/20200224 What developers need to know about domain-specific languages.md +++ b/translated/tech/20200224 What developers need to know about domain-specific languages.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What developers need to know about domain-specific languages) @@ -8,29 +8,29 @@ [#]: author: (Girish Managoli https://opensource.com/users/gammay) -开发者需要了解的领域特定语言 +开发者需要了解的领域特定语言(DSL) ====== + > 领域特定语言是在特定领域下用于特定上下文的语言。作为开发者,很有必要了解领域特定语言的含义,以及为什么要使用特定领域语言。 -![Various programming languages in use][1] +![](https://img.linux.net.cn/data/attachment/album/202003/04/112240b0os2988kolritlo.jpg) -领域特定语言domain-specific language(DSL)是在特定领域下用于特定上下文的语言。这里的领域是指某种商业上的(例如银行业、保险业等)上下文,也可以指某种应用程序的(例如 Web 应用、数据库等)上下文。与之相比的另一个概念是通用语言general-purpose language(GPL),通用语言则可以广泛应用于各种商业或应用问题当中。 +领域特定语言domain-specific language(DSL)是一种旨在特定领域下的上下文的语言。这里的领域是指某种商业上的(例如银行业、保险业等)上下文,也可以指某种应用程序的(例如 Web 应用、数据库等)上下文。与之相比的另一个概念是通用语言general-purpose language(GPL,LCTT 译注:注意不要和 GPL 许可证混淆),通用语言则可以广泛应用于各种商业或应用问题当中。 DSL 并不具备很强的普适性,它是仅为某个适用的领域而设计的,但它也足以用于表示这个领域中的问题以及构建对应的解决方案。HTML 是 DSL 的一个典型,它是在 Web 应用上使用的语言,尽管 HTML 无法进行数字运算,但也不影响它在这方面的广泛应用。 -而 GPL 则没有特定针对的领域,GPL 的设计者不可能知道这种语言会在什么领域被使用,更不清楚用户打算解决的问题是什么,因此 GPL 会被设计成可用于解决任何一种问题、适合任何一种业务、满足任何一种需求。例如 Java 就属于 GPL,它可以在 PC 或移动设备上运行,嵌入到银行、金融、保险、制造业等各种行业的应用中去。 +而 GPL 则没有特定针对的领域,这种语言的设计者不可能知道这种语言会在什么领域被使用,更不清楚用户打算解决的问题是什么,因此 GPL 会被设计成可用于解决任何一种问题、适合任何一种业务、满足任何一种需求。例如 Java 就属于 GPL,它可以在 PC 或移动设备上运行,嵌入到银行、金融、保险、制造业等各种行业的应用中去。 ### DSL 的类别 从使用方式的角度,语言可以划分出以下两类: - * DSL:使用 DSL 形式编写或表示的语言 - * 宿主语言host language:用于执行或处理 DSL 的语言 +* DSL:使用 DSL 形式编写或表示的语言 +* 宿主语言host language:用于执行或处理 DSL 的语言 -当 DSL 以独有的形式表达,并由另一种宿主语言来处理时,这种 DSL 称为外部external DSL。 - -以下就是可以在宿主语言中处理的 SQL: +由不同的语言编写并由另一种宿主语言处理的 DSL 被称为外部external DSL。 +以下就是可以在宿主语言中处理的 SQL 形式的 DSL: ``` SELECT account @@ -40,22 +40,27 @@ WHERE account = '123' AND branch = 'abc' AND amount >= 1000 因此,只要在规定了词汇和语法的情况下,DSL 也可以直接使用英语来编写,并使用诸如 ANTLR 这样的解析器生成器parser generator以另一种宿主语言来处理 DSL: - ``` -`if smokes then increase premium by 10%` +if smokes then increase premium by 10% ``` -如果 DSL 和宿主语言是同一种语言,这种 DSL 称为内部internal DSL,其中 DSL 由以同一种语义的宿主语言编写和处理,因此又称为嵌入式embedded DSL。以下是两个例子: +如果 DSL 和宿主语言是同一种语言,这种 DSL 称为内部internalDSL,其中 DSL 由以同一种语义的宿主语言编写和处理,因此又称为嵌入式embedded DSL。以下是两个例子: - * Bash 形式的 DSL 可以由 Bash 解释器执行:`if today_is_christmas; then apply_christmas_discount; fi` 同时这也是一段看起来符合英语语法的 Bash。 - * 使用类似 Java 语法编写的 DSL: +* Bash 形式的 DSL 可以由 Bash 解释器执行: + + ``` +if today_is_christmas; then apply_christmas_discount; fi ``` + 同时这也是一段看起来符合英语语法的 Bash。 +* 使用类似 Java 语法编写的 DSL: + + ``` orderValue = orderValue .applyFestivalDiscount() .applyCustomerLoyalityDiscount() .applyCustomerAgeDiscount(); ``` -这一段的可读性也相当强。 + 这一段的可读性也相当强。 实际上,DSL 和 GPL 之间并没有非常明确的界限。 @@ -63,18 +68,16 @@ orderValue = orderValue 以下这些语言都可以作为 DSL 使用: - * Web 应用:HTML - * Shell:用于类 Unix 系统的 sh、Bash、CSH 等;用于 Windows 系统的 MS-DOS、Windows Terminal、PowerShell 等 - * 标记语言:XML - * 建模:UML - * 数据处理:SQL 及其变体 - * 业务规则管理:Drools - * 硬件:Verilog、VHD - * 构建工具:Maven、Gradle - * 数值计算和模拟:MATLAB(商业)、GNU Octave、Scilab - * 解析器和生成器:Lex、YACC、GNU Bison、ANTLR - - +* Web 应用:HTML +* Shell:用于类 Unix 系统的 sh、Bash、CSH 等;用于 Windows 系统的 MS-DOS、Windows Terminal、PowerShell 等 +* 标记语言:XML +* 建模:UML +* 数据处理:SQL 及其变体 +* 业务规则管理:Drools +* 硬件:Verilog、VHD +* 构建工具:Maven、Gradle +* 数值计算和模拟:MATLAB(商业)、GNU Octave、Scilab +* 解析器和生成器:Lex、YACC、GNU Bison、ANTLR ### 为什么要使用 DSL? @@ -92,25 +95,22 @@ DSL 的优点是,它对于领域的特征捕捉得非常好,同时它不像 开源的 DSL 软件包括: - * Xtext:Xtext 可以与 Eclipse 集成,并支持 DSL 开发。它能够实现代码生成,因此一些开源和商业产品都用它来提供特定的功能。用于农业活动建模分析的多用途农业数据系统Multipurpose Agricultural Data System(MADS)就是基于 Xtext 实现的一个项目,可惜的是这个项目现在已经不太活跃了。 - * JetBrains MPS:JetBrains MPS 是一个可供开发 DSL 的集成开发环境Integrated Development Environment,它将文档在底层存储为一个抽象树结构(Microsoft Word 也使用了这一概念),因此它也自称为一个投影编辑器projectional editor。JetBrains MPS 支持 Java、C、JavaScript 和 XML 的代码生成。 +* Xtext:Xtext 可以与 Eclipse 集成,并支持 DSL 开发。它能够实现代码生成,因此一些开源和商业产品都用它来提供特定的功能。用于农业活动建模分析的多用途农业数据系统Multipurpose Agricultural Data System(MADS)就是基于 Xtext 实现的一个项目,可惜的是这个项目现在已经不太活跃了。 +* JetBrains MPS:JetBrains MPS 是一个可供开发 DSL 的集成开发环境Integrated Development Environment,它将文档在底层存储为一个抽象树结构(Microsoft Word 也使用了这一概念),因此它也自称为一个投影编辑器projectional editor。JetBrains MPS 支持 Java、C、JavaScript 和 XML 的代码生成。 ### DSL 的最佳实践 如果你想使用 DSL,记住以下几点: - * DSL 不同于 GPL,DSL 只能用于解决特定领域中有限范围内的问题。 - * 不必动辄建立自己的 DSL,可以首先尝试寻找已有的 DSL。例如 [DSLFIN][4] 这个网站就提供了很多金融方面的 DSL。在实在找不到合适的 DSL 的情况下,才需要建立自己的 DSL。 - * DSL 最好像平常的语言一样具有可读性。 - * 尽管代码生成不是一项必需的工作,但它确实会大大提高工作效率。 - * 虽然 DSL 被称为语言,但 DSL 不需要像 GPL 一样可以被执行,可执行性并不是 DSL 需要达到的目的。 - * DSL 可以使用文本编辑器编写,但专门的 DSL 编辑器可以更轻松地完成 DSL 的语法和语义检查。 - - +* DSL 不同于 GPL,DSL 只能用于解决特定领域中有限范围内的问题。 +* 不必动辄建立自己的 DSL,可以首先尝试寻找已有的 DSL。例如 [DSLFIN][4] 这个网站就提供了很多金融方面的 DSL。在实在找不到合适的 DSL 的情况下,才需要建立自己的 DSL。 +* DSL 最好像平常的语言一样具有可读性。 +* 尽管代码生成不是一项必需的工作,但它确实会大大提高工作效率。 +* 虽然 DSL 被称为语言,但 DSL 不需要像 GPL 一样可以被执行,可执行性并不是 DSL 需要达到的目的。 +* DSL 可以使用文本编辑器编写,但专门的 DSL 编辑器可以更轻松地完成 DSL 的语法和语义检查。 如果你正在使用或将要使用 DSL,欢迎在评论区留言。 - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/2/domain-specific-languages @@ -118,7 +118,7 @@ via: https://opensource.com/article/20/2/domain-specific-languages 作者:[Girish Managoli][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7a14c7909813c0b5936ed89f9b0c7d88c8055bae Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 11:23:43 +0800 Subject: [PATCH 097/207] PUB @HankChow https://linux.cn/article-11957-1.html --- ...developers need to know about domain-specific languages.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200224 What developers need to know about domain-specific languages.md (99%) diff --git a/translated/tech/20200224 What developers need to know about domain-specific languages.md b/published/20200224 What developers need to know about domain-specific languages.md similarity index 99% rename from translated/tech/20200224 What developers need to know about domain-specific languages.md rename to published/20200224 What developers need to know about domain-specific languages.md index f0578a307f..c0e01b7923 100644 --- a/translated/tech/20200224 What developers need to know about domain-specific languages.md +++ b/published/20200224 What developers need to know about domain-specific languages.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11957-1.html) [#]: subject: (What developers need to know about domain-specific languages) [#]: via: (https://opensource.com/article/20/2/domain-specific-languages) [#]: author: (Girish Managoli https://opensource.com/users/gammay) From c8eadb41681baeea182c8a3da5fc1d6b0437442f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 12:16:14 +0800 Subject: [PATCH 098/207] PRF @wxy --- ...d the life of your SSD drive with fstrim.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md b/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md index 24ed876272..439c9524a7 100644 --- a/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md +++ b/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Extend the life of your SSD drive with fstrim) @@ -12,9 +12,9 @@ > 这个新的系统服务可以使你的生活更轻松。 -![Linux keys on the keyboard for a desktop computer][1] +![](https://img.linux.net.cn/data/attachment/album/202003/04/121625sl380ga10g56d33h.jpg) -在过去的十年中,固态驱动器(SSD)带来了一种管理存储的新方法。与上一代的转盘产品相比,SSD 具有无声、更冷却的操作和更快的接口规格等优点。当然,新技术带来了新的维护和管理方法。SSD 具有称为 TRIM 的功能。从本质上讲,这是一种用于回收设备上未使用的块的方法,该块可能先前已被写入,但不再包含有效数据,因此可以返回到通用存储池以供重用。Opensource.com 的 Don Watkins 在首先其 2017 年的文章《[Linux 固态驱动器:为 SSD 启用 TRIM][2]》中介绍了 TRIM 的内容。 +在过去的十年中,固态驱动器(SSD)带来了一种管理存储的新方法。与上一代的转盘产品相比,SSD 具有无声、更冷却的操作和更快的接口规格等优点。当然,新技术带来了新的维护和管理方法。SSD 具有一种称为 TRIM 的功能。从本质上讲,这是一种用于回收设备上未使用的块的方法,该块可能先前已被写入,但不再包含有效数据,因此可以返回到通用存储池以供重用。Opensource.com 的 Don Watkins 首先在其 2017 年的文章《[Linux 固态驱动器:为 SSD 启用 TRIM][2]》中介绍过 TRIM 的内容。 如果你一直在 Linux 系统上使用此功能,则你可能熟悉下面描述的两种方法。 @@ -29,7 +29,7 @@ UUID=3453g54-6628-2346-8123435f  /home  xfs  defaults,discard   0 0 ``` -丢弃选项可启用自动的在线 TRIM。由于可能会对性能造成负面影响,最近关于这是否是最佳方法一直存在争议。使用此选项会在每次将新数据写入驱动器时启动 TRIM。这可能会引入其他活动,从而影响存储性能。 +丢弃选项可启用自动的在线 TRIM。由于可能会对性能造成负面影响,最近关于这是否是最佳方法一直存在争议。使用此选项会在每次将新数据写入驱动器时启动 TRIM。这可能会引入其他磁盘活动,从而影响存储性能。 #### Cron 作业 @@ -44,7 +44,7 @@ UUID=3453g54-6628-2346-8123435f  /home  xfs  defaults,discard   0 0 ### 一个新的 TRIM 服务 -我最近发现有一个用于 TRIM 的 systemd 服务。Fedora 在版本 30 中将其[引入][3],尽管默认情况下在版本 30 和 31 中未启用它,但计划在版本 32 中使用它。如果你使用的是 Fedora 工作站 31,并且你想要开始使用此功能,可以非常轻松地启用它。我还将在下面向你展示如何对其进行测试。该服务并非 Fedora 独有的服务。它是否存在和地位将因发行版而异。 +我最近发现有一个用于 TRIM 的 systemd 服务。Fedora 在版本 30 中将其[引入][3],尽管默认情况下在版本 30 和 31 中未启用它,但计划在版本 32 中使用它。如果你使用的是 Fedora 工作站 31,并且你想要开始使用此功能,可以非常轻松地启用它。我还将在下面向你展示如何对其进行测试。该服务并非 Fedora 独有的服务。它是否存在及其地位将因发行版而异。 #### 测试 @@ -78,7 +78,7 @@ Options: -V, --version display version ``` -因此,现在我可以看到这个 systemd 服务已配置为在我的 `/etc/fstab` 文件中的所有受支持的挂载文件系统上运行该修剪操作( `-fstab`),并打印出丢弃的字节数(`-verbose`),但是抑制了任何可能会发生的错误消息(`–quiet`)。了解这些选项对测试很有帮助。例如,我可以从最安全的方法开始,即空运行。 我还将去掉 `-quiet` 参数,以便确定驱动器设置是否发生任何错误。 +因此,现在我可以看到这个 systemd 服务已配置为在我的 `/etc/fstab` 文件中的所有受支持的挂载文件系统上运行该修剪操作(`-fstab`),并打印出所丢弃的字节数(`-verbose`),但是抑制了任何可能会发生的错误消息(`–quiet`)。了解这些选项对测试很有帮助。例如,我可以从最安全的方法开始,即空运行。我还将去掉 `-quiet` 参数,以便确定驱动器设置是否发生任何错误。 ``` $ sudo /usr/sbin/fstrim --fstab --verbose --dry-run @@ -101,7 +101,7 @@ $ sudo /usr/sbin/fstrim --fstab --verbose #### 启用 -Fedora Linux 实现了一个计划每周运行它的 systemd 计时器服务。要检查其是否存在和当前状态,请运行 `systemctl status`。 +Fedora Linux 实现了一个计划每周运行它的 systemd 计时器服务。要检查其是否存在及当前状态,请运行 `systemctl status`。 ``` $ sudo systemctl status fstrim.timer @@ -121,7 +121,7 @@ $ sudo systemctl enable fstrim.timer $ sudo systemctl list-timers --all ``` -会显示出下列表明 `fstrim.timer` 存在的行。注意,该计时器实际上激活了 `fstrim.service`。这是 `fstrim` 实际调用的地方。与时间相关的字段显示为 `n/a`,因为该服务已启用且尚未运行。 +会显示出下列行,表明 `fstrim.timer` 存在。注意,该计时器实际上激活了 `fstrim.service` 服务。这是实际调用 `fstrim` 的地方。与时间相关的字段显示为 `n/a`,因为该服务已启用且尚未运行。 ``` NEXT   LEFT    LAST   PASSED   UNIT           ACTIVATES @@ -141,7 +141,7 @@ via: https://opensource.com/article/20/2/trim-solid-state-storage-linux 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9f238d0eeee284460edc7e5ba069949b0b1dde2f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 12:17:35 +0800 Subject: [PATCH 099/207] PUB @wxy https://linux.cn/article-11959-1.html --- .../20200212 Extend the life of your SSD drive with fstrim.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200212 Extend the life of your SSD drive with fstrim.md (98%) diff --git a/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md b/published/20200212 Extend the life of your SSD drive with fstrim.md similarity index 98% rename from translated/tech/20200212 Extend the life of your SSD drive with fstrim.md rename to published/20200212 Extend the life of your SSD drive with fstrim.md index 439c9524a7..dfb2969cf9 100644 --- a/translated/tech/20200212 Extend the life of your SSD drive with fstrim.md +++ b/published/20200212 Extend the life of your SSD drive with fstrim.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11959-1.html) [#]: subject: (Extend the life of your SSD drive with fstrim) [#]: via: (https://opensource.com/article/20/2/trim-solid-state-storage-linux) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From 5ea37b69d253a13e65cf2217aa52fa5cf00db6de Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Wed, 4 Mar 2020 15:32:42 +0800 Subject: [PATCH 100/207] Transtlated --- ...t you-re looking for on Linux with find.md | 240 ----------------- ...t you-re looking for on Linux with find.md | 241 ++++++++++++++++++ 2 files changed, 241 insertions(+), 240 deletions(-) delete mode 100644 sources/tech/20200219 How to find what you-re looking for on Linux with find.md create mode 100644 translated/tech/20200219 How to find what you-re looking for on Linux with find.md diff --git a/sources/tech/20200219 How to find what you-re looking for on Linux with find.md b/sources/tech/20200219 How to find what you-re looking for on Linux with find.md deleted file mode 100644 index 9bcb73d4e5..0000000000 --- a/sources/tech/20200219 How to find what you-re looking for on Linux with find.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (heguangzhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to find what you’re looking for on Linux with find) -[#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -How to find what you’re looking for on Linux with find -====== -The find command has a huge array of options to help you locate exactly the files you're looking for on a Linux system. This post explores a series of extremely useful commands. -CSA Images / Getty Images - -There are a number of commands for finding files on Linux systems, but there are also a huge number of options that you can deploy when looking for them. - -For example, you can find files not just by their names, but by their owners and/or groups, their age, their size, the assigned permissions, the last time they were accessed, the associated inodes and even whether the files belong to an account or group that no longer exists on the system and so on. - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] - -You can also specify where a search should start, how deeply into the file system the search should reach and how much the search result will tell you about the files it finds. - -And all these criteria can be handled by the **find** command. - -Examples of finding files by these criteria are provided below. In some commands, errors (such as trying to list files that you don’t have read access to), error output will be sent to **/dev/null** so that we don’t have to look at it. In others, we’ll simply run as root to avoid this problem. - -Keep in mind that additional options exist. This post covers a lot of ground, but not all of the ways that the **find** command can help locate files for you. - -### Picking a starting point - -With **find**, you can either select a point or start where you are. To select a starting spot, enter it following the word “find”. For example, “find /usr” or “find ./bin” would search starting the **/usr** directory or the **bin** directory in the current location while “find ~” would start in your home directory even if you’re currently located in some other location in the file system. - -[][2] - -### Picking what you want to see - -One of the most commonly used search strategies is to search for files by name. This requires using the **-name** option. - -By default, **find** will show you the full path to the files it finds. This is the same thing you would see if you add **-print** to your command. If you want to see the details associated with a file – its length, permissions, etc., you would need to add **-ls** to the end of your **find** command. - -``` -$ find ~/bin -name tryme -/home/shs/bin/tryme -$ find ~/bin -name tryme -print -/home/shs/bin/tryme -$ find ~/bin -name tryme -ls - 917528 4 -rwx------ 1 shs shs 139 Apr 8 2019 /home/shs/bin/tryme -``` - -You can also find files using substrings. For example, if you replace "tryme" in the example above with "try*", you'll find all the files with names that begin with "try". - -Finding files by name is probably the most typical use of the **find** command, but there are so many other ways to look for files and good reasons to want to. The sections below show how to use many of the other criteria available. - -In addition, when searching for files by size, group, inode etc., you probably will want some confirmation that the files found match what you were looking for. Using the **-ls** option to display the details is often very helpful. - -### Finding files by size - -Finding files by size requires use of the **-size** option and a little finesse with the specifications. If you specify **-size 189b**, for you example, you’re going to find files that are 189 blocks long, not 189 bytes. For bytes, you would need to use **-size 189c** (characters). And, if you specify **-size 200w**, you’re going to find files that are 200 words – words as in "two-byte increments", not words as in "those things we all say to each other". You can also look for file by providing sizes in kilobytes (k), megabytes (M) and gigabytes (G). - -Most of the time, Linux users will be searching for files that are larger than some selected size. For example, to find files that are larger than a gigabyte, you might use a command like this where the +1G means "larger than a gigabyte": - -``` -$ find -size +1G -ls 2>/dev/null - 787715 1053976 -rw-rw-r-- 1 shs shs 1079263432 Dec 21 2018 ./backup.zip - 801834 1052556 -rw-rw-r-- 1 shs shs 1077809525 Dec 21 2018 ./2019/hold.zip -``` - -### Finding files by inode # - -You can find files by the inode that is used to maintain the file’s metadata (i.e., everything but the file content and file name). - -``` -$ find -inum 919674 -ls 2>/dev/null - 919674 4 -rw-rw-r-- 1 shs shs 512 Dec 27 15:25 ./bin/my.log -``` - -### Finding files with a specific file owner or group - -Finding files by owner or group is also very straightforward. Here we use sudo to overcome permission issues. - -``` -$ sudo find /home -user nemo -name "*.png"-ls - 1705219 4 drwxr-xr-x 2 nemo nemo 4096 Jan 28 08:50 /home/nemo/Pictures/me.png -``` - -In this command, we look for a file that is owned by a multi-user group called “admins”. - -``` -# find /tmp -group admins -ls - 262199 4 -rwxr-x--- 1 dory admins 27 Feb 16 18:57 /tmp/testscript -``` - -### Finding files with no owners or groups - -You can look for files that don't belong to any users currently set up on the system by using the **-nouser** option as shown in the command below. - -``` -# find /tmp -nouser -ls -262204 4 -rwx------ 1 1016 1016 17 Feb 17 16:42 /tmp/hello -``` - -Notice that the listing shows the old user's UID and GID – a clear indication that this user is not defined on the system. This kind of command will find files that were likely created in other-than-home directories by users whose accounts have since been removed from the system or in home directories that were not removed after the user account was removed. Similarly, the **-nogroup** option would find such files – especially when these users were the only members of the associated groups. - -### Finding files by last update time - -In this command, we look for files that have been updated in the last 24 hours in a particular user's home directory. The **sudo** is being used to allow searching another user’s home directory. - -``` -$ sudo find /home/nemo -mtime -1 -/home/nemo -/home/nemo/snap/cheat -/home/nemo/tryme -``` - -### Finding files by when permissions were last changed - -The **-ctime** option can help you find files that have had their status (e.g., permissions) changed within some referenced time frame. Here’s an example of looking for files that had permission changes within the last day: - -``` -$ find . -ctime -1 -ls - 787987 4 -rwxr-xr-x 1 shs shs 189 Feb 11 07:31 ./tryme -``` - -Keep in mind that the date and time displayed reflect the last updates to the file contents. You will have to use a command like **stat** to see all three times associated with a file (file creation, modification and status changes) . - -### Finding files based on last access times - -In this command, we look for local pdf files that were accessed within the last two days using the **-atime** option. - -``` -$ find -name "*.pdf" -atime -2 -./Wingding_Invites.pdf -``` - -### Finding files based on their age relative to another file - -You can use the -newer option to find files that are newer than some other file. - -``` -$ find . -newer dig1 -ls - 786434 68 drwxr-xr-x 67 shs shs 69632 Feb 16 19:05 . - 1064442 4 drwxr-xr-x 5 shs shs 4096 Feb 16 11:06 ./snap/cheat - 791846 4 -rw-rw-r-- 1 shs shs 649 Feb 13 14:26 ./dig -``` - -There is no corresponding **-older** option, but you can get a similar result with **! -newer** (i.e., not newer), which means almost the same thing. - -### Finding files by type - -Finding a file by file type, you get a lot of choices – regular files, directories, block and character files, etc. Here’s a list of the file type options: - -``` -b block (buffered) special -c character (unbuffered) special -d directory -p named pipe (FIFO) -f regular file -l symbolic link -s socket -``` - -Here’s an example looking for symbolic links: - -``` -$ find . -type l -ls - 805717 0 lrwxrwxrwx 1 shs shs 11 Apr 10 2019 ./volcano -> volcano.pdf - 918552 0 lrwxrwxrwx 1 shs shs 1 Jun 16 2018 ./letter -> pers/letter2mom -``` - -### Limiting how deeply find should look - -The **-mindepth** and **-maxdepth** options control how deeply into the file system (from the current location or starting point) your searches will look. - -``` -$ find -maxdepth 3 -name "*loop" -./bin/save/oldloop -./bin/long-loop -./private/loop -``` - -### Finding files only if empty - -In this command, we look for empty files, but no further than directories and their subdirectories. - -``` -$ find . -maxdepth 2 -empty -type f -ls - 917517 0 -rw-rw-r-- 1 shs shs 0 Sep 23 11:00 ./complaints/newfile - 792050 0 -rw-rw-r-- 1 shs shs 0 Oct 4 19:02 ./junk -``` - -### Finding files by permissions - -You can find files that have specific permissions set using the **-perm** option. In the example below, we are looking only for regular files (**-type f**) to avoid seeing symbolic links that are given these permissions by default even if the file they refer to is restricted. - -``` -$ find -perm 777 -type f -ls -find: ‘./.dbus’: Permission denied - 798748 4 -rwxrwxrwx 1 shs shs 15 Mar 28 2019 ./runme -``` - -### Using find to help you get rid of files - -You can use the find command to both locate and then remove files if you use a command like this one: - -``` -$ find . -name runme -exec rm {} \; -``` - -The {} represents the name of each of the files located by the search criteria. - -One very useful option is to replace **-exec** with **-ok**. When you do this, **find** will ask for a confirmation before it removes any file. - -``` -$ find . -name runme -ok rm -rf {} \; -< rm ... ./bin/runme > ? -``` - -Removing a file isn't the only thing that **-ok** and **-rm** can do for you. For example, you could copy, rename or move files. - -There are really a lot of options for using the find command effectively and undoubtedly some that haven’t been covered in this post. I hope you’ve found some that are new and especially promising. - -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/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者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/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) -[3]: https://www.facebook.com/NetworkWorld/ -[4]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md b/translated/tech/20200219 How to find what you-re looking for on Linux with find.md new file mode 100644 index 0000000000..f54e9a3924 --- /dev/null +++ b/translated/tech/20200219 How to find what you-re looking for on Linux with find.md @@ -0,0 +1,241 @@ +[#]: collector: (lujun9972) +[#]: translator: (heguangzhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to find what you’re looking for on Linux with find) +[#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何在 Linux上通过 find 命令找到你要找的东西 +====== +find 命令有大量选项可以帮助你准确定位你在 Linux 系统上需要寻找的文件。这篇文章讨论了一系列非常有用的选项。 + +CSA 图片/ Getty 图片 + +在 Linux 系统上有许多用于查找文件的命令,但是在查找文件时也有大量的选项可以选择。 + +例如,你不仅可以通过文件的名称来查找文件,还可以通过文件的所有者或者组、它们的创建时间、大小、分配的权限、最后一次访问它们的时间、关联的信息节点,甚至是文件是否属于系统上不再存在的帐户或组等等来查找文件。 + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] +你还可以指定搜索从哪里开始,搜索应该深入到文件系统的什么位置,以及搜索结果将告诉你它所找到的文件的数量。 + +而所有这些要求都可以通过 **find** 命令来处理。 + +下面提供了根据这些标准查找文件的示例。在某些命令中,错误(例如试图列出你没有读取权限的文件),错误输出将被发送到 **/dev/null**,以便我们不必查看它。在其他情况下,我们将简单地以 root 身份运行以避免这个问题。 + +请记住,还其他选项存在。这篇文章涵盖了很多内容,但并不是 **find** 命令帮助你定位查找文件的所有方式。 + +### 选择起点 + +使用 **find**,您可以选择一个起点或从你所在的位置开始。请在单词“find”后输入要选择起点。例如,“find /usr” 或 “find ./bin "将在 **/usr** 目录或 **bin** 目录开始搜索,而" find ~ " 将在你的主目录中开始,即使你位于当前文件系统中的其他位置。 + +[][2] + +### 选择你想看的 + +最常用的搜索策略之一是按名称搜索文件。这需要使用 **-name** 选项。 + +默认情况下,**查找** 会显示找到的文件的完整路径。如果你在命令中添加 **-print**,你会看到同样的情况。如果你想查看与文件相关的详细信息—-例如:文件的长度、权限等,您需要在你的 **查找** 命令的末尾添加 **-ls** 命令。 + +``` +$ find ~/bin -name tryme +/home/shs/bin/tryme +$ find ~/bin -name tryme -print +/home/shs/bin/tryme +$ find ~/bin -name tryme -ls + 917528 4 -rwx------ 1 shs shs 139 Apr 8 2019 /home/shs/bin/tryme +``` + +你也可以使用子字符串来查找文件。例如,如果你将上面示例中的“tryme”替换为“try*”,你将会找到所有名称以“try”开头的文件。 + +按名称查找文件可能是 **find** 命令最典型的用法,但是有很多其他的方式来查找文件,并且有很好的理由这样做。下面的部分展示了如何使用其他可用的方式。 + +此外,当按大小、组、索引节点等条件来搜索文件时,你需要确认找到的文件与你要查找的文件是否相匹配。使用 **-ls** 选项来显示细节是非常有用。 + +### 通过大小查找文件 + +按大小查找文件需要使用 **-size** 选项并且对相应规范使用一点技巧。如果你指定 **-size 189b**,例如,你将找到189个块长的文件,而不是189个字节。对于字节,你需要使用 **--size 189c**(字符)。而且,如果你指定 **--size 200w** ,你将会找到200个单词的文件——以“双字节增量”为单位的单词,而不是“我们彼此都在说的那些事情”中的单词。你还可以通过以千字节(k)、兆字节(M)和千兆字节(G)为单位提供大小来查找文件。 + + +大多数情况下,Linux用户会搜索比所选文件大的文件。例如,要查找大于1千兆字节的文件,你可以使用这样的命令,其中 +1G 表示“大于1千兆字节”: + +``` +$ find -size +1G -ls 2>/dev/null + 787715 1053976 -rw-rw-r-- 1 shs shs 1079263432 Dec 21 2018 ./backup.zip + 801834 1052556 -rw-rw-r-- 1 shs shs 1077809525 Dec 21 2018 ./2019/hold.zip +``` + +### 通过索引节点查找文件 # + +你可以通过用于维护文件元数据(即除文件内容和文件名之外的所有内容)的索引节点来查找文件。 + +``` +$ find -inum 919674 -ls 2>/dev/null + 919674 4 -rw-rw-r-- 1 shs shs 512 Dec 27 15:25 ./bin/my.log +``` + +### 查找具有特定文件所有者或组的文件 + +按所有者或组查找文件也非常简单。这里我们使用 sudo 来解决权限问题。 + +``` +$ sudo find /home -user nemo -name "*.png"-ls + 1705219 4 drwxr-xr-x 2 nemo nemo 4096 Jan 28 08:50 /home/nemo/Pictures/me.png +``` + +在这个命令中,我们寻找一个被称为 “admins” 的多用户组拥有的文件。 + +``` +# find /tmp -group admins -ls + 262199 4 -rwxr-x--- 1 dory admins 27 Feb 16 18:57 /tmp/testscript +``` + +### 查找没有所有者或组的文件 + +你可以使用如下命令所示的 **-nouser** 选项来查找系统上没有任何现存用户属性的文件。 + +``` +# find /tmp -nouser -ls +262204 4 -rwx------ 1 1016 1016 17 Feb 17 16:42 /tmp/hello +``` + +请注意,该列表显示了旧用户的 UID 和 GID,这清楚地表明该用户未在系统上定义。这种命令将查找由于帐户已从系统中删除的用户在非主目录中创建的文件,或者在用户帐户被删除后未被删除的主目录中创建的文件。类似地,**-nogroup** 选项会找到这样的文件,尤其是当这些用户是相关组的唯一成员时。 + +### 按上次更新时间查找文件 + +在此命令中,我们在特定用户的主目录中查找过去24小时内更新过的文件。**sudo** 用于搜索另一个用户的主目录。 + +``` +$ sudo find /home/nemo -mtime -1 +/home/nemo +/home/nemo/snap/cheat +/home/nemo/tryme +``` + +### 按上次更改权限的时间查找文件 + +**-ctime** 选项可以帮助你查找在某个参考时间范围内状态(如权限)发生更改的文件。以下是查找在最后一天内权限发生更改的文件的示例: + +``` +$ find . -ctime -1 -ls + 787987 4 -rwxr-xr-x 1 shs shs 189 Feb 11 07:31 ./tryme +``` + +请记住,显示的日期和时间反映了文件内容的最后更新。你需要使用像 **stat** 这样的命令来查看与文件相关联的三个状态(文件创建、修改和状态更改)。 + +### Finding files based on last access times + +在这个命令中,我们使用 **-atime** 选项查找在过去两天内访问过的本地 pdf 文件。 + +``` +$ find -name "*.pdf" -atime -2 +./Wingding_Invites.pdf +``` + +### 根据文件相对于另一个文件的时间来查找文件 + +你可以使用 -newer 选项来查找比其他文件更新的文件。 + +``` +$ find . -newer dig1 -ls + 786434 68 drwxr-xr-x 67 shs shs 69632 Feb 16 19:05 . + 1064442 4 drwxr-xr-x 5 shs shs 4096 Feb 16 11:06 ./snap/cheat + 791846 4 -rw-rw-r-- 1 shs shs 649 Feb 13 14:26 ./dig +``` + +没有相应的 **-older** 选项,但是你可以用**,得到类似的结果 **! -newer**(即更旧),这意味着几乎相同的事情。 + +### 按类型查找文件 + +通过文件类型找到一个文件,你有很多选项——常规文件、目录、块和字符文件等等。以下是文件类型选项列表: + +``` +b block (buffered) special +c character (unbuffered) special +d directory +p named pipe (FIFO) +f regular file +l symbolic link +s socket +``` + +这里有一个寻找符号链接的例子: + +``` +$ find . -type l -ls + 805717 0 lrwxrwxrwx 1 shs shs 11 Apr 10 2019 ./volcano -> volcano.pdf + 918552 0 lrwxrwxrwx 1 shs shs 1 Jun 16 2018 ./letter -> pers/letter2mom +``` + +### 限制查找的深度 + +**-mindepth** 和 **-maxdepth** 选项控制在文件系统中搜索的深度(从当前位置或起始点开始)。 + +``` +$ find -maxdepth 3 -name "*loop" +./bin/save/oldloop +./bin/long-loop +./private/loop +``` + +### 查找空文件 + +在这个命令中,我们寻找空文件,但不超过目录及其子目录。 + +``` +$ find . -maxdepth 2 -empty -type f -ls + 917517 0 -rw-rw-r-- 1 shs shs 0 Sep 23 11:00 ./complaints/newfile + 792050 0 -rw-rw-r-- 1 shs shs 0 Oct 4 19:02 ./junk +``` + +### 按权限查找文件 + +你可以使用 **-perm** 选项查找具有特定权限集的文件。在下面的示例中,我们只查找常规文件(**-type f**),以避免看到默认情况下被赋予这些权限的符号链接,即使它们引用的文件是受限的。 + +``` +$ find -perm 777 -type f -ls +find: ‘./.dbus’: Permission denied + 798748 4 -rwxrwxrwx 1 shs shs 15 Mar 28 2019 ./runme +``` + +### 使用查找来帮助你删除文件 + +如果使用如下命令,你可以使用 find 命令定位并删除文件: + +``` +$ find . -name runme -exec rm {} \; +``` + +{} 代表根据搜索条件找到的每个文件的名称。 + +一个非常有用的选项是将 **-exec** 替换为 **-ok**。当您这样做时,**find** 会在删除任何文件之前要求确认。 + +``` +$ find . -name runme -ok rm -rf {} \; +< rm ... ./bin/runme > ? +``` + +删除文件并不是 **-ok** 和 **-rm** 能为你做的唯一事情。例如,你可以复制、重命名或移动文件。 + +确实有很多选择可以有效地使用 find 命令,毫无疑问还有一些在本文中没有涉及到。我希望你已经找到一些新的,特别有帮助的。 + +加入[Facebook][3]和[LinkedIn][4]上的网络世界社区,评论最热门的话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[校对者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/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) +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world From ed2ab44e7c059405853af1f2bb78e17d23bd2bc3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 19:36:46 +0800 Subject: [PATCH 101/207] APL --- ...ux Aims to Bring Console Gaming Experience on the Desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md index 5cd5c57024..95566050a5 100644 --- a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md +++ b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 17c0d8fac6bcc18dc2b64d3edf8beece18a273ab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 4 Mar 2020 20:56:42 +0800 Subject: [PATCH 102/207] TSL --- ...onsole Gaming Experience on the Desktop.md | 139 ------------------ ...onsole Gaming Experience on the Desktop.md | 131 +++++++++++++++++ 2 files changed, 131 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md create mode 100644 translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md diff --git a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md deleted file mode 100644 index 95566050a5..0000000000 --- a/sources/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop) -[#]: via: (https://itsfoss.com/drauger-os/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop -====== - -For years (or decades) people complained that one of the reasons to not [use Linux][1] is lack of mainstream games. [Gaming on Linux][2] has improved drastically in last few years specially with the [introduction of Steam Proton][3] project that enables you to [play a lot of Windows-only games on Linux][4]. - -This also has encourages several [Linux distributions centered around gaming][5]. Take [Lakka][6] for example. You can [turn your old computer into a retro gaming console thanks to Lakka Linux][7]. - -Another such gaming focused Linux distribution is [Draguer OS][8] and we are going to take a look at it today. - -### What is Drauger OS? - -Accord to [the project’s website][9], “Drauger OS is a Linux desktop gaming operating system. It aims to provide a platform for gamers to use where they can get great performance without sacrificing their security. Furthermore, it aims to make it easy for anyone to game, whether they use a keyboard and mouse, or some sort of controller.” - -They stress that Drauger OS is not for everyday use. As such, many of the productivity tools that most other distros come with are not in Drauger OS. - -![Drauger OS 7.4.1][10] - -Drauger OS is [based][9] on the Ubuntu. The current version (7.4.1 Jiangshi) uses “[Liquorix][11] low latency Linux kernel, a pre-compiled ZEN kernel designed with a balance between latency and throughput in mind”. However, that will be changing in the next release. They only have one desktop environment choice, a modified version of [Xfce][12]. - -Drauger OS has several applications and tools installed out of the box to improve the gaming experience. These include: - - * [PlayOnLinux][13] - * WINE - * [Lutris][14] - * Steam - * [DXVK][15] - - - -It also has an interesting set of tools that are not gaming related. [Drauger Installer][16] is a .deb installer and alternative to Gdebi. [Multiple Repository App Installer][17] (mrai) is “an AUR-helper-like script for Debian-based Linux Operating Systems”. Mrai is designed to work with apt, snaps, flatpaks, and can install apps from GitHub. - -Interestingly, Drauger OS’ name is an error. Lead dev [Thomas Castleman][18] (aka batcastle) has intended to name his distro Draugr, but had mistyped the name. In [episode 23][19] of the Drauger OS podcast, Castleman said the name will stay misspelled because it would be a lot of work to correct it. According to [Wikipedia][20], a draugr is “an undead creature from Norse mythology”. - -Yes, you read that correctly. Drauger OS is one of only a few distros that have its own [podcast][21]. When asked about it, Castleman told me that “I wanted to ensure that we had the maximum transparency possible with our community, no matter their circumstances.” Most of the time, the podcast is an audio version of the Drauger OS blog, but sometimes they use it to make an announcement when they don’t have time to write a blog post. - -### The Future for Drauger OS - -![Drauger OS][22] - -The developers behind Druager OS are working on their next major release: 7.5.1. This release will be based on Ubuntu 19.10. There will be three major changes. First, the Liquorix kernel will be [replaced][23] with “a kernel we are building in-house.” This kernel will be based on the Linux Kernel GitHub repository, “so it’s about as vanilla as it gets”. - -The second major change in the new release will a new layout for their desktop. Based on user feedback, they have decided to change it to something that looks more GNOME-like. - -Thirdly, they are dropping SystemBack as their backup tool and installer. They have instead written a new [installer][24] from scratch. - -The Dev team is also working on an [ARM version][25] of Drauger OS. They hope to release it sometime in 2022. - -### System requirements for Draguer OS - -The Drauger OS [system requirements][25] are pretty modest. Keep in mind that Drauger OS will only run on 64-bit systems. - -#### Minimum system requirements - - * CPU: Dual-Core, 1.8GHz, 64-bit processor - * RAM: 1 GB - * Storage: 16 GB - * Graphics Processor: Integrated - * Screen Resolution: 1024×768 at 60Hz - * External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 2 USB Ports for Installation USB Drive and Keyboard (Mouse optional, but recommended) - - - -#### Recommended system requirements - - * CPU: Quad-Core, 2.2Ghz, 64-bit processor - * RAM: 4 GB - * Storage: 128 GB - * Graphics Processor: NVIDIA GTX 1050, AMD RX 460, or equivalent card - * Screen Resolution: 1080p at 60Hz - * External Ports: 1 Port for Display (HDMI / DisplayPort / VGA / DVI), 3 USB Ports for Installation USB Drive, Keyboard, and Mouse, 1 Audio Out Port - - - -### How you can help out Drauger OS - -There are several ways that you can help out the Drauger OS if you are interestedin doing so. They are always looking for [financial support][26] to keep development going. - -If you want yo contribute code, they are looking for people with experience in BASH, C++, and Python. All of their code is up on [GitHub][27]. You can also [contact][28] them on social media. - -### Final Thoughts - -Drauger OS is quite a project. I’ve seen a couple of other [gaming-oriented distributions][29], but Drauger OS is single-minded in its focus on gaming. Since I am more of a casual gamer, this distro doesn’t appeal to me personally. But, I can see how it could lure gaming enthusiasts to Linux. I wish them good luck in their future releases. - -What are your thoughts on this gaming-only distro? What is your favorite Linux gaming solution? Please let us know in the comments below. - -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][30]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/drauger-os/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/why-use-linux/ -[2]: https://itsfoss.com/linux-gaming-guide/ -[3]: https://itsfoss.com/steam-play-proton/ -[4]: https://itsfoss.com/steam-play/ -[5]: https://itsfoss.com/linux-gaming-distributions/ -[6]: http://www.lakka.tv/ -[7]: https://itsfoss.com/lakka-retrogaming-linux/ -[8]: https://draugeros.org/go/ -[9]: https://www.draugeros.org/go/about/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1 -[11]: https://liquorix.net/ -[12]: https://www.xfce.org/ -[13]: https://www.playonlinux.com/en/ -[14]: https://lutris.net/ -[15]: https://github.com/doitsujin/dxvk -[16]: https://github.com/drauger-os-development/drauger-installer -[17]: https://github.com/drauger-os-development/mrai -[18]: https://github.com/Batcastle -[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47 -[20]: https://en.wikipedia.org/wiki/Draugr -[21]: https://anchor.fm/drauger-os -[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1 -[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/ -[24]: https://github.com/drauger-os-development/system-installer -[25]: https://www.draugeros.org/go/system-requirements/ -[26]: https://www.draugeros.org/go/contribute/ -[27]: https://github.com/drauger-os-development -[28]: https://www.draugeros.org/go/contact-us/ -[29]: https://itsfoss.com/manjaro-gaming-linux/ -[30]: https://reddit.com/r/linuxusersgroup diff --git a/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md new file mode 100644 index 0000000000..c8d6710e02 --- /dev/null +++ b/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md @@ -0,0 +1,131 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop) +[#]: via: (https://itsfoss.com/drauger-os/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Drauger OS Linux 旨在为台式机带来主机游戏体验 +====== + +多年来(或数十年),人们抱怨不[使用Linux][1] 的原因之一是缺乏主流游戏。[Linux 上的游戏][2]在最近几年有了显著改进,特别是 [Steam Proton][3] 项目的引入使你可以[在 Linux 上玩很多 Windows 专用的游戏][4]。 + +这也鼓励了一些[以游戏为中心的 Linux发行版][5]。以 [Lakka][6] 为例,你可以[借助 Lakka Linux 将旧计算机变成复古的街机游戏机][7]。 + +另一个以游戏为中心的 Linux 发行版是 [Draguer OS][8],我们今天将对其进行研究。 + +### Drauger OS + +根据[该项目的网站][9],“Drauger OS 是 Linux 桌面游戏操作系统。它旨在为游戏玩家提供一个平台,使他们可以在不牺牲安全性的情况下获得出色的性能。此外,它旨在使任何人都可以轻松玩游戏,无论他们使用键盘和鼠标还是某种控制器。” + +他们强调 Drauger OS 并非供日常使用。因此,大多数其他发行版附带的许多生产力工具都不在 Drauger OS 中。 + +![Drauger OS 7.4.1][10] + +Drauger OS [基于][9] Ubuntu 之上。当前版本(7.4.1 Jiangshi)使用 “[Liquorix][11] 低延迟Linux 内核,这是一种预编译的 ZEN 内核,设计时考虑了延迟和吞吐量之间的平衡”。但是,这将在下一版本中更改。他们只有一个桌面环境可供选择,即一个修改版本的 [Xfce][12]。 + +Drauger OS 开箱即用地安装了多个应用程序和工具,以改善游戏体验。这些包括: + +* [PlayOnLinux][13] +* WINE +* [Lutris][14] +* Steam +* [DXVK][15] + +它还具有一组与游戏无关的有趣工具。[Drauger Installer][16] 是 .deb 安装程序,是 Gdebi 的替代品。[多软件库应用安装器][17](mrai)是“用于基于 Debian 的 Linux 操作系统的类似于 AUR-helper 的脚本”。Mrai 旨在与 apt、snap、flatpaks 配合使用,并且可以从 GitHub 安装应用程序。 + +有趣的是,Drauger OS 的名称是一个错误。首席开发者 [Thomas Castleman][18](即 batcastle)曾打算为其发行版命名为 Draugr,但是却打错了名字。在 Drauger OS 播客的[第 23 集][19]中,Castleman 说保持这个拼写错误的名称,因为要对其进行更正需要大量工作。根据 [Wikipedia][20] 的描述,Draugr 是“来自北欧神话中的不死生物”。 + +是的,你没看错。Drauger OS 是仅有的几个具有自己的[播客][21]的发行版之一。当被问到这个问题时,Castleman 告诉我:“无论他们的情况如何,我都希望确保我们的社区拥有最大的透明度。”多数情况下,播客是 Drauger OS 博客的音频版本,但有时他们会在没有时间撰写博客文章时使用它来发布公告。 + +### Drauger OS 的未来 + +![Drauger OS][22] + +Druager OS 背后的开发人员正在开发其下一个主要版本:7.5.1。此版本将基于 Ubuntu 19.10。将有三个主要变化。首先,将使用“我们内部构建的内核” [替换][23] Liquorix 内核。该内核将基于 Linux Kernel GitHub 存储库,“因此,它变得越来越原汁原味”。 + +新版本的第二个主要变化将是为其桌面提供新布局。根据用户的反馈,他们决定将其更改为看起来更类似于 GNOME 的样子。 + +第三,他们放弃了 SystemBack 作为其备份工具和安装程序。相反,他们从头开始编写了新的[安装程序][24]。 + +开发团队也正在研究 Drauger OS 的 [ARM 版本][25]。他们希望在 2022 年的某个时候发布它。 + +### 系统要求 + +Drauger OS [系统要求][25]非常适中。请记住,Drauger OS 仅在 64 位系统上运行。 + +#### 最低系统要求 + +* CPU:双核、1.8GHz、64 位处理器 +* RAM:1 GB +* 储存空间:16 GB +* 图形处理器:集成 +* 屏幕分辨率:60Hz 时为 1024×768 +* 外部端口:1 个用于显示的端口(HDMI/DisplayPort/VGA/DVI),2 个用于安装 USB 驱动器和键盘的 USB 端口(鼠标可选,但建议使用) +   +#### 推荐系统要求 + +* CPU:四核、2.2Ghz、64 位处理器 +* RAM:4 GB +* 储存空间:128 GB +* 图形处理器:NVIDIA GTX 1050、AMD RX 460 或同等显卡 +* 屏幕分辨率:60Hz 时为 1080p +* 外部端口:1 个用于显示的端口(HDMI/DisplayPort/VGA/DVI),3 个用于安装 USB 驱动器、键盘和鼠标的 USB 端口,1 个音频输出端口 + +### 如何为Drauger OS提供帮助 + +如果你有兴趣,可以通过多种方法来帮助 Drauger OS。他们一直在寻找[财政支持][26]以保持发展。 + +如果你想贡献代码,他们正在寻找具有 BASH、C++ 和 Python 经验的人员。他们所有的代码都在 [GitHub][27] 上。你也可以在社交媒体上[联系][28]他们。 + +### 结语 + +Drauger OS 只是这类项目之一。我还见过其他[面向游戏的发行版][29],但 Drauger OS 在专注于游戏方面一心一意。由于我更喜欢休闲游戏,因此该发行版对我个人而言并不具有吸引力。但是,我可以看到它如何吸引游戏爱好者使用 Linux。祝他们在以后的发行中好运。 + +你对这个仅限于游戏的发行版有何想法?你最喜欢的 Linux 游戏解决方案是什么?请在下面的评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/drauger-os/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/why-use-linux/ +[2]: https://itsfoss.com/linux-gaming-guide/ +[3]: https://itsfoss.com/steam-play-proton/ +[4]: https://itsfoss.com/steam-play/ +[5]: https://itsfoss.com/linux-gaming-distributions/ +[6]: http://www.lakka.tv/ +[7]: https://itsfoss.com/lakka-retrogaming-linux/ +[8]: https://draugeros.org/go/ +[9]: https://www.draugeros.org/go/about/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.4.1.jpg?ssl=1 +[11]: https://liquorix.net/ +[12]: https://www.xfce.org/ +[13]: https://www.playonlinux.com/en/ +[14]: https://lutris.net/ +[15]: https://github.com/doitsujin/dxvk +[16]: https://github.com/drauger-os-development/drauger-installer +[17]: https://github.com/drauger-os-development/mrai +[18]: https://github.com/Batcastle +[19]: https://anchor.fm/drauger-os/episodes/Episode-23-eapu47 +[20]: https://en.wikipedia.org/wiki/Draugr +[21]: https://anchor.fm/drauger-os +[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/drauger-os-7.5.1.png?ssl=1 +[23]: https://www.draugeros.org/go/2020/01/20/major-changes-in-drauger-os-7-5-1/ +[24]: https://github.com/drauger-os-development/system-installer +[25]: https://www.draugeros.org/go/system-requirements/ +[26]: https://www.draugeros.org/go/contribute/ +[27]: https://github.com/drauger-os-development +[28]: https://www.draugeros.org/go/contact-us/ +[29]: https://itsfoss.com/manjaro-gaming-linux/ +[30]: https://reddit.com/r/linuxusersgroup From aee1eebca76a0f90aa16ce7565eece098e2b2c2f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 5 Mar 2020 01:05:14 +0800 Subject: [PATCH 103/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200305=20Instal?= =?UTF-8?q?l=20and=20Use=20Wireshark=20on=20Ubuntu=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md --- ...stall and Use Wireshark on Ubuntu Linux.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md diff --git a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md new file mode 100644 index 0000000000..3b0a4f6468 --- /dev/null +++ b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Install and Use Wireshark on Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-wireshark-ubuntu/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +Install and Use Wireshark on Ubuntu Linux +====== + +_**Brief: You’ll learn to install the latest Wireshark on Ubuntu and other Ubuntu-based distribution in this tutorial. You’ll also learn how to run Wireshark without sudo and how to set it up for packet sniffing.**_ + +[Wireshark][1] is a free and open-source network protocol analyzer widely used around the globe. + +With Wireshark, you can capture incoming and outgoing packets of a network in real-time and use it for network troubleshooting, packet analysis, software and communication protocol development, and many more. + +It is available on all major desktop operating systems like Windows, Linux, macOS, BSD and more. + +In this tutorial, I will guide you to install Wireshark on Ubuntu and other Ubuntu-based distributions. I’ll also show a little about setting up and configuring Wireshark to capture packets. + +### Installing Wireshark on Ubuntu based Linux distributions + +![][2] + +Wireshark is available on all major Linux distributions. You should check out the [official installation instructions][3]. because in this tutorial, I’ll focus on installing the latest Wireshark version on Ubuntu-based distributions only. + +Wireshark is available in the Universe repository of Ubuntu. You can [enable universe repository][4] and then install it like this: + +``` +sudo add-apt-repository universe +sudo apt install wireshark +``` + +One slight problem in this approach is that you might not always get the latest version of Wireshark. + +For example, in Ubuntu 18.04, if you [use the apt command][5] to check the available version of Wireshark, it is 2.6. + +``` +[email protected]:~$ apt show wireshark +Package: wireshark +Version: 2.6.10-1~ubuntu18.04.0 +Priority: optional +Section: universe/net +Origin: Ubuntu +Maintainer: Balint Reczey <[email protected]> +``` + +However, [Wireshark 3.2 stable version][6] has been released months ago. New release brings new features, of course. + +So, what do you do in such case? Thankfully, Wiresshark developers provide an official PPA that you can use to install the latest stable version of Wireshark on Ubuntu and other Ubuntu-based distributions. + +I hope you are acquainted with PPA. If not, please [read our excellent guide on PPA to understand it completely][7]. + +Open a terminal and use the following commands one by one: + +``` +sudo add-apt-repository ppa:wireshark-dev/stable +sudo apt update +sudo apt install wireshark +``` + +Even if you have an older version of Wireshark installed, it will be updated to the newer version. + +While installing, you will be asked whether to allow non-superusers to capture packets. Select Yes to allow and No to restrict non-superusers to capture packets & finish the installation. + +### Running Wireshark without sudo + +If you have selected **No** in the previous installation, then run the following command as root: + +``` +sudo dpkg-reconfigure wireshark-common +``` + +And select **Yes** by pressing the tab key and then using enter key: + +![][8] + +Since you have allowed the non-superuser to capture packets, you have to add the user to wireshark group. Use the [usermod command][9] to add yourself to the wireshark group. + +``` +sudo usermod -aG wireshark $(whoami) +``` + +Finally, [restart your Ubuntu system][10] to make the necessary changes to your system. + +Trivia + +First released in 1998, Wireshark was initially known as Ethereal. Developers had to change its name to Wireshark in 2006 due to trademark issues. + +### Starting Wireshark + +Launching Wireshark application can be done from the application launcher or the CLI. + +To start from CLI, just type **wireshark** on your console: + +``` +wireshark +``` + +From **GUI**, search for Wireshark application on the search bar and hit enter. + +![][11] + +Now let’s play with Wireshark. + +### Capturing packets using Wireshark + +When you start Wireshark, you will see a list of interfaces that you can use to capture packets to and from. + +There are many types of interfaces available which you can monitor using Wireshark such as, Wired, External devices, etc. According to your preference, you can choose to show specific types of interfaces in the welcome screen from the marked area in the given image below. + +![Select interface][12] + +For instance, I listed only the **Wired** network interfaces. + +![][13] + +Next, to start capturing packets, you have to select the interface (which in my case is ens33) and click on the **Start capturing packets** icon as marked in the image below. + +![Start capturing packets with Wireshark][14] + +You can also capture packets to and from multiple interfaces at the same time. Just press and hold the **CTRL** button while clicking on the interfaces that you want to capture to and from and then hit the **Start capturing packets** icon as marked in the image below. + +![][15] + +Next, I tried using **ping google.com** command in the terminal and as you can see, many packets were captured. + +![Captured packets][16] + +Now you can select on any packet to check that particular packet. After clicking on a particular packet you can see the information about different layers of TCP/IP Protocol associated with it. + +![Packet info][17] + +You can also see the RAW data of that particular packet at the bottom as shown in the image below. + +![Check RAW data in the captured packets][18] + +This is why end-to-end encryption is important + +Imagine you are logging into a website that doesn’t use HTTPS. Anyone on the same network as you can sniff the packets and see the user name and password in the RAW data. +This is why most chat applications use end to end encryption and most websites these days use https (instead of http). + +#### Stopping packet capture in Wireshark + +You can click on the red icon as marked in the given image to stop capturing Wireshark packets. + +![Stop packet capture in Wireshark][19] + +#### Save captured packets to a file + +You can click on the marked icon in the image below to save captured packets to a file for future use. + +![Save captured packets by Wireshark][20] + +**Note**: _Output can be exported to XML, PostScript®, CSV, or plain text._ + +Next, select a destination folder, and type the file name and click on **Save**. +Then select the file and click on **Open**. + +![][21] + +Now you can open and analyze the saved packets anytime. To open the file, press **\ + o** +or go to **File > Open** from Wireshark. + +The captured packets should be loaded from the file. + +![][22] + +### Conclusion + +Wireshark supports many different communication protocols. There are many options and features that provide you the power to capture and analyze the network packets in a unique way. You can learn more about Wireshark from their [official documentation][23]. + +I hope this detailed helped you to install Wireshark on Ubuntu. Please let me know your questions and suggestions. + +![][24] + +### Kushal Rai + +A computer science student & Linux and open source lover. He likes sharing knowledge for he believes technology shapes the perception of modern world. Kushal also loves music and photography. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-wireshark-ubuntu/ + +作者:[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://www.wireshark.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/wireshark_ubuntu.png?ssl=1 +[3]: https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallUnixInstallBins.html +[4]: https://itsfoss.com/ubuntu-repositories/ +[5]: https://itsfoss.com/apt-command-guide/ +[6]: https://www.wireshark.org/news/20191218.html +[7]: https://itsfoss.com/ppa-guide/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/yes.png?ssl=1 +[9]: https://linuxhandbook.com/usermod-command/ +[10]: https://itsfoss.com/schedule-shutdown-ubuntu/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/wire.png?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/interfaces.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/intoption.jpg?ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/singleinterface.jpg?ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/selint.jpg?ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/capture.jpg?ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/packetinfo.png?ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/raw.png?ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/stopcapture.png?ssl=1 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/savepackets.jpg?ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/savename.jpg?ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/openpacket.png?ssl=1 +[23]: https://www.wireshark.org/docs/https://www.wireshark.org/docs/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/kushal_rai.jpg?ssl=1 From 8a284e908dae7d6a92202233a65bd00d86e323b9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 5 Mar 2020 01:07:52 +0800 Subject: [PATCH 104/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200304=20How=20?= =?UTF-8?q?service=20virtualization=20relates=20to=20test-driven=20develop?= =?UTF-8?q?ment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200304 How service virtualization relates to test-driven development.md --- ...tion relates to test-driven development.md | 428 ++++++++++++++++++ 1 file changed, 428 insertions(+) create mode 100644 sources/tech/20200304 How service virtualization relates to test-driven development.md diff --git a/sources/tech/20200304 How service virtualization relates to test-driven development.md b/sources/tech/20200304 How service virtualization relates to test-driven development.md new file mode 100644 index 0000000000..4ff4243603 --- /dev/null +++ b/sources/tech/20200304 How service virtualization relates to test-driven development.md @@ -0,0 +1,428 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How service virtualization relates to test-driven development) +[#]: via: (https://opensource.com/article/20/3/service-virtualization-test-driven-development) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) + +How service virtualization relates to test-driven development +====== +Mountebank simulates services you're dependent on so autonomous teams +can continue development activities without having to wait on anyone. +![Person using a laptop][1] + +The agile approach to software development relies on service virtualization to give each IT team autonomy. This approach removes blockages and allows autonomous teams to continue development activities without having to wait on anyone. That way, integration testing can commence as soon as teams start iterating/sprinting. + +### How automated services work + +Any automated service is available to consumers via a published endpoint. This means services can be automated only if they're made available online. + +Any consumer wishing to leverage available automated services must be capable of sending requests to that service's endpoint via an HTTP protocol. Some of those services will, upon receiving the request via the HTTP protocol, respond by simply sending back some data. Other services may respond to receiving a request via HTTP protocol by actually performing some work. For example, a service may create a resource (for example, create an order), update a resource (update an order), or delete a resource (cancel an order). + +All those activities get triggered via the HTTP protocol. In the simplest of cases, the action instigated by the service consumer is GET (e.g., HTTP GET). That request may arrive with some query values; those values will get used by the service to narrow down the search (such as "search for order number 12345 and return the data"). + +In more elaborate cases, a request may arrive with the instruction to POST some values; a service will accept that request and expect some values to be associated with it. Those values are usually called the payload. When the service accepts an HTTP POST request containing the payload, it will attempt to process it. It may or may not succeed in processing it, but either way, it will respond to the service consumer with a status code and an optional status message. That way, service consumers will be notified of the success/failure of their request so that they can decide what the next step should be. + +### What is service virtualization? + +Now that we understand how automated services work, it should be easier to understand how to virtualize them. In a nutshell, it is possible to simulate any service that is published on a hosting site. Instead of sending HTTP requests directly to the service provider's endpoint, you can interject a fake, pretend service that simulates the behavior of the real service. + +From the service consumer's standpoint, it makes absolutely no difference whether it is interacting with a real or a fake service. The interaction remains identical. + +### Virtualize one service + +OK, enough talking, I'll roll up my sleeves and show how to do it in practical terms. Suppose your team is starting a new project and receives requirements in the form of a fully fleshed user story: + +#### Authenticate user + +_As a new app_ +_I want to authenticate the user_ +_Because we want to ensure proper security for the app_ + +#### Acceptance criteria + +**Scenario #1:** _New app successfully authenticates the user_ +Given that the user has navigated to the login page +And the user has submitted credentials +When new app receives login request +Then new app successfully authenticates the user +And new app displays response message "User successfully logged in." + +**Scenario #2:** _New app cannot authenticate the user on the first attempt_ +Given that the user has navigated to the login page +And the user has submitted credentials +When new app receives login request +Then new app fails to successfully authenticate the user +And new app displays response message "Incorrect login. You have 2 more attempts left." + +**Scenario #3:** _New app cannot authenticate the user on the second attempt_ +Given that the user has navigated to the login page +And the user has submitted credentials +When new app receives login request +Then new app fails to successfully authenticate the user +And new app displays response message "Incorrect login. You have 1 more attempt left." + +**Scenario #4:** _New app cannot authenticate the user on the third attempt_ +Given that the user has navigated to the login page +And the user has submitted credentials +When new app receives login request +Then new app fails to successfully authenticate the user +And new app displays response message "Incorrect login. You have no more attempts left." + +The first thing to do when starting the work on this user story is to create the so-called "walking skeleton" (for this exercise, I will be using the standard **.Net Core** platform plus **xUnit.net** I discussed in my previous articles ([starting with this one][2] with [another example here][3]). Please refer to them for technical details on how to install, configure, and run the required tools. + +Create the walking skeleton infrastructure by opening the command line and typing: + + +``` +`mkdir AuthenticateUser` +``` + +Then move inside the **AuthenticateUser** folder: + + +``` +`cd AuthenticateUser` +``` + +And create a separate folder for tests: + + +``` +`mkdir tests` +``` + +Move into the **tests** folder (**cd tests**) and initiate the **xUnit** framework: + + +``` +`dotnet new xunit` +``` + +Now move one folder up (back to **AuthenticateUser**) and create the app folder: + + +``` +mkdir app +cd app +``` + +Create the scaffold necessary for C# code: + + +``` +`dotnet new classlib` +``` + +The walking skeleton is now ready! Open the editor of your choice and start coding. + +### Write a failing test first + +In the spirit of TDD, start by writing the failing test (refer to the [previous article][4] to learn why is it important to see your test fail before attempting to make it pass): + + +``` +using System; +using Xunit; +using app; + +namespace tests { +    public class UnitTest1 { +        Authenticate auth = [new][5] Authenticate(); + +        [Fact] +        public void SuccessLogin(){ +            var given = "credentials"; +            var expected = "Successful login."; +            var actual = auth.Login(given); +            Assert.Equal(expected, actual); +        } +    } +} +``` + +This test states that if someone supplies some credentials (i.e., a secret username and password) to the **Login** method of the **Authenticate** component when it processes the request, it is expected to return the message "Successful login." + +Of course, this is functionality that does not exist yet—the instantiated **Authenticate** module in the **SuccessLogin()** module hasn't been written yet. So you might as well go ahead and take the first stab at writing the desired functionality. Create a new file (**Authenticate.cs**) in the **app** folder and add the following code: + + +``` +using System; + +namespace app { +    public class Authenticate { +        public string Login(string credentials) { +            return "Not implemented"; +        } +    } +} +``` + +Now, navigate to the **tests** folder and run: + + +``` +`dotnet test` +``` + +![Output of dotnet.test][6] + +The test fails because it was expecting a "Successful login" output but instead got the "Not implemented" output. + +### Increasing complexity for day two operations + +Now that you have created the "happy path" expectation and made it fail, it is time to work on implementing the functionality that will make the failing test pass. The following day, you attend the standup and report that you have started on the "Authenticate user" story. You let the team know that you have created the first failing test for the "happy path," and today, the plan is to implement the code to make the failing test pass. + +You explain your intention to first create a **User** table containing the **username**, **password**, and other pertinent attributes. But the scrum master interrupts and explains that the **User** module is being handled by another team. It would be bad practice to duplicate the maintenance of users, as the information will quickly get out of sync. So instead of building the **User** module (which would include the authentication logic), you are to leverage the authentication services that the **User** team is working on. + +That's great news because it saves you the trouble of having to write a lot of code to implement the **User** processing. Emboldened, you enthusiastically announce that you will quickly cobble up a function that will take user credentials and send them to the service that the **User** team has built. + +Alas, your intentions get squashed again as you learn that the **User** team hasn't started building the **User authentication** service yet. They're still in the process of assigning user stories to the backlog. Disheartened, you resign to the fact that it will be at least a few days (if not weeks?) before you can start working on the **User authentication** story. + +The scrum master then says that there is no reason to wait for the **User authentication** service to be built and deployed to testing. You could start developing the authentication functionality right away. But how can you do that? + +The scrum master offers a simple suggestion: leverage service virtualization. Since all specifications for the **User** module have been solidified and signed off, you have a solid, non-volatile contract to build your solution against. The contract published by the **User** services team states that in order to authenticate a user, specific expectations must be fulfilled: + + 1. A client wishing to authenticate a user should send an **HTTP POST** request to the endpoint . + 2. The **HTTP POST** sent to the above endpoint must have a **JSON** payload that contains the user credentials (i.e., username and password). + 3. Upon receiving the request, the service will attempt to log the user in. If the username and password match the information on record, the service will return an **HTTP** response containing status code 200 with the body of the response containing the message "User successfully logged in." + + + +So, now that you know the contract details, you can start building the solution. Here's the code that connects to the endpoint, sends the **HTTP POST** request, and receives the **HTTP** response: + + +``` +using System; +using System.Net.Http; +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace app { +    public class Authenticate { +        HttpClient client = [new][5] HttpClient(); +        string endPoint = ""; + +        public string Login(string credentials) { +            Task<string> response = CheckLogin(credentials); +            return response.Result; +        } + +        private async Task<string> CheckLogin(string credentials) { +            var values = [new][5] Dictionary<string, string>{{"credentials", credentials}}; +            var content = [new][5] FormUrlEncodedContent(values); +            var response = await client.PostAsync(endPoint, content); +            return await response.Content.ReadAsStringAsync(); +        } +    } +} +``` + +This code won't work because does not exist (yet). Are you stuck now, waiting for the other team to eventually build and deploy that service? + +Not really. Service virtualization to rescue! Let's pretend that the service is already there and continue the development. + +### How to virtualize a service + +One way to virtualize the **User authentication** service would be to write a new app (the new API) and run it locally. This API will mirror the contract specified by the real **User authentication** API and will only return hard-coded stubbed data (it will be a fake service). + +Sounds like a good plan. Again, the team pushes back during the standup, questioning the need for writing, building, testing, and deploying a brand new app just to accomplish this fake functionality. It kind of wouldn't be worth the trouble because, by the time you deliver that new fake app, the other team would probably be ready with the real service. + +So you've reached an impasse. It looks like you are forced to wait on your dependency to materialize. You've failed to control your dependencies; you now have no recourse but to work in a sequential fashion. + +Not so fast! There is a great new tool called [mountebank][7] that is ideal for virtualizing any service. Using this tool, you can quickly stand up a local server that listens on a port you specify and takes orders. To make it simulate a service, you only have to tell it which port to listen to and which protocol to handle. The choice of protocols is: + + * HTTP + * HTTPS + * SMTP + * TCP + + + +In this case, you need the HTTP protocol. First, install mountebank—if you have **npm** on your computer, you can simply type on the command line: + + +``` +`npm install -g mountebank` +``` + +After it's installed, run mountebank by typing: + + +``` +`mb` +``` + +At startup, mountebank will show: + +![mountebank startup][8] + +Now you're ready to virtualize an HTTP service. In this case, the **User authentication** service expects to receive an HTTP POST request; here is how the implemented code sends an HTTP POST request: + + +``` +`var response = await client.PostAsync(endPoint, content);` +``` + +You now have to establish that **endPoint**. Ideally, all virtualized services should be propped in the **localhost** server to ensure quick execution of integration tests. + +To do that, you need to configure the **imposter**. In its bare-bones form, the **imposter** is a simple JSON collection of key-value pairs containing the definition of a port and a protocol: + + +``` +{ +    "port": 3001, +    "protocol": "http" +} +``` + +This imposter is configured to handle the HTTP protocol and to listen to incoming requests on port 3001. + +Just listening to incoming HTTP requests on port 3001 is not going to do much. Once the request arrives at that port, mountebank needs to be told what to do with that request. In other words, you are virtualizing not only the availability of a service on a specific port but also the way that virtualized service is going to respond to the request. + +To accomplish that level of service virtualization, you need to tell mountebank how to configure stubs. Each stub consists of two components: + + 1. A collection of predicates + 2. A collection of expected responses + + + +A predicate (sometimes called a matcher) narrows down the scope of the incoming request. For example, using the HTTP protocol, you can expect more than one type of method (e.g., GET, POST, PUT, DELETE, PATCH, etc.). In most service-virtualization scenarios, we are interested in simulating the behavior that is specific to a particular HTTP method. This scenario is about responding to the HTTP POST request, so you need to configure your stub to match on HTTP POST requests only: + + +``` +{ +    "port": 3001, +    "protocol": "http", +    "stubs": [ +        { +            "predicates": [ +                { +                    "equals": { +                        "method": "post" +                    } +                } +            ] +        } +    ] +} +``` + +This imposter defines one predicate that matches (using the keyword **equals**) on the HTTP POST request only. + +Now take a closer look at the **endPoint** value, as defined in the implemented code: + + +``` +`string endPoint = "http://localhost:3001/api/v1/users/login";` +``` + +In addition to listening to port 3001 (as defined in ), the **endPoint** is more specific, in that it expects the incoming HTTP POST request to go to the /api/v1/users/login path. How do you tell mountebank to only match exactly on the /api/v1/users/login path? By adding the path key-value pair to the stub's predicate: + + +``` +{ +    "port": 3001, +    "protocol": "http", +    "stubs": [ +        { +            "predicates": [ +                { +                    "equals": { +                        "method": "post", +                        "path": "/api/v1/users/login" +                    } +                } +            ] +        } +    ] +} +``` + +This imposter now knows that HTTP requests arriving at port 3001 must be a POST method and must point at the /api/v1/users/login path. The only thing left to simulate is the expected HTTP response. + +Add the response to the JSON imposter: + + +``` +{ +    "port": 3001, +    "protocol": "http", +    "stubs": [ +        { +            "predicates": [ +                { +                    "equals": { +                        "method": "post", +                        "path": "/api/v1/users/login" +                    } +                } +            ], +            "responses": [ +                { +                    "is": { +                        "statusCode": 200, +                        "body": "Successful login." +                    } +                } +            ] +        } +    ] +} +``` + +With mountebank imposters, you define responses as a collection of JSON key-value pairs. In most cases, it is sufficient to simply state that a response is a **statusCode** and a **body**. This case is simulating the "happy path" response that has the status code **OK (200)** and the body containing a simple message **Successful login** (as specified in the acceptance criteria). + +### How to run virtualized services? + +OK, now that you have virtualized the **User authentication** service (at least its "happy path"), how do you run it? + +Remember that you have already started mountebank, and it reported that it is running in memory as the domain. Mountebank is listening on port 2525 and taking orders. + +Great, now you have to tell mountebank that you have the imposter ready. How do you do that? Send an HTTP POST request to . The requests body must contain the JSON you created above. There are a few techniques available to send that request. If you're versed in [curl][9], using it to send HTTP POST requests would be the simplest, quickest way to stand up the imposter. But many people prefer a more user-friendly way to send the HTTP POST to mountebank. + +The easy way to do that is to use [Postman][10]. If you download and install Postman, you can point it at , select the POST method from the pulldown menu, and copy and paste the imposter JSON into the raw body. + +When you click Send, the imposter will be created, and you should get Status 201 (Created). + +![Postman output][11] + +Your virtualized service is now running! You can verify it by navigating to the **tests** folder and running the **dotnet test** command: + +![dotnet test output][12] + +### Conclusion + +This demo shows how easy it is to remove blockages and control dependencies by simulating services you're dependent on. Mountebank is a fantastic tool that easily and cheaply simulates all kinds of very elaborate, sophisticated services. + +In this installment, I just had time to illustrate how to virtualize a simple "happy path" service. If you go back to the actual user story, you will notice that its acceptance criteria contain several "less happy" paths (cases when someone is repeatedly trying to log in using invalid credentials). It's a bit trickier to properly virtualize and test those use cases, so I've left that exercise for the next installment in this series. + +How will you use service virtualization to solve your testing needs? I would love to hear about it in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/service-virtualization-test-driven-development + +作者:[Alex Bunardzic][a] +选题:[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/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/article/19/8/mutation-testing-evolution-tdd +[3]: https://opensource.com/article/19/9/mutation-testing-example-tdd +[4]: https://opensource.com/article/20/2/automate-unit-tests +[5]: http://www.google.com/search?q=new+msdn.microsoft.com +[6]: https://opensource.com/sites/default/files/uploads/dotnet-test.png (Output of dotnet.test) +[7]: http://www.mbtest.org/ +[8]: https://opensource.com/sites/default/files/uploads/mountebank-startup.png (mountebank startup) +[9]: https://curl.haxx.se/ +[10]: https://www.postman.com/ +[11]: https://opensource.com/sites/default/files/uploads/status-201.png (Postman output) +[12]: https://opensource.com/sites/default/files/uploads/dotnet-test2.png (dotnet test output) From 398dd2ab5afdae764c9c5e30eb42cfc55c2613c4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 5 Mar 2020 01:09:29 +0800 Subject: [PATCH 105/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200304=20Gettin?= =?UTF-8?q?g=20started=20with=20the=20Gutenberg=20editor=20in=20Drupal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md --- ...ted with the Gutenberg editor in Drupal.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md diff --git a/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md b/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md new file mode 100644 index 0000000000..6050adebfa --- /dev/null +++ b/sources/tech/20200304 Getting started with the Gutenberg editor in Drupal.md @@ -0,0 +1,122 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with the Gutenberg editor in Drupal) +[#]: via: (https://opensource.com/article/20/3/gutenberg-editor-drupal) +[#]: author: (MaciejLukianski https://opensource.com/users/maciejlukianski) + +Getting started with the Gutenberg editor in Drupal +====== +Learn how to use the WYSIWYG editor, made popular in WordPress, with +Drupal. +![Text editor on a browser, in blue][1] + +Since 2017, WordPress has had a really great WYSIWYG editor in the [Gutenberg][2] plugin. But the Drupal community hasn't yet reached consensus on the best approach to the content management system's (CMS) editorial experience. But a strong new option appeared when, with a lot of community effort, [Gutenberg was integrated with Drupal][3]. + +Previously, there were two main approaches to content creation in Drupal 8: + + * In the [**Paragraph-based approach**][4], content is assembled out of entities called paragraphs. Currently, approximately 100,000 websites use the Paragraphs module (according to Drupal). + * The [**Layout-Builder approach**][5] uses an editorial tool shipped with Drupal 8.5. It is still undergoing improvements, but it is the next strong contender because it is really well integrated with the Drupal core. Stats on usage are not available since Layout Builder is part of Drupal. + + + +At the end of 2018, the Drupal community, lead by Fronkom (a Norwegian digital agency strongly focused on open source solutions), ported the WordPress Gutenberg project as a contributed module into Drupal. Let's take a look at how Gutenberg works in Drupal (including some cool Drupal-specific integrations). + +### Installation + +Installing the [Gutenberg module][6] is as straightforward as installing any Drupal module, and it has good [installation documentation][7]. + +### Configuration + +Gutenberg is integrated into Drupal's default content-entity creation workflow. You can use it on any of the content types you choose, provided that the content type has at least one text area field, which is where the Gutenberg editor's output will be saved. + +To enable the Gutenberg project on a content type in Drupal, you have to navigate to its settings: **Structure > Content types** and, from the dropdown next to the content type where you want to use Gutenberg, click **Edit**. + +![Drupal settings][8] + +In the form that appears, scroll down and select the **Gutenberg experience** tab on the left, where you can find the settings described below. Select the **Enable Gutenberg experience** box. + +![Drupal Gutenberg settings][9] + +#### Template + +This is one of the cool features that is not available in WordPress out of the box. It enables you to define a template for a new page in a JSON structure. This will pre-populate all newly created articles with dummy placeholder content, which will help editors structure content correctly. In the screenshot above, I added a heading and a paragraph. Note that any double-quotes have to be escaped. + +#### Template lock + +This setting allows you to define whether users are allowed to delete the placeholder content, add new blocks, or just edit the existing, pre-populated content. + +#### Allowed Gutenberg and Drupal blocks + +This is another super-cool feature on the Drupal side of Gutenberg. Drupal allows users to create various types of blocks to design a page. For example, you could create a block with a list of the five latest blog posts, the most recent comments, or a form to collect users' emails. + +Gutenberg's deep integration with Drupal allows users to select which Drupal blocks are available to users while they are editing (e.g., limit embeds to YouTube) and use blocks as inline content. This is a very handy feature that allows granular control of the user experience. + +There's not much to choose from in a blank Drupal installation, but a live site usually has many blocks that provide various functionalities. In the screenshot below, the **Search form** Drupal block is selected. + +![Drupal Gutenberg blocks][10] + +After you finish the configuration, hit **Save content type**. + +### Publishing content with Drupal Gutenberg + +When Gutenberg is enabled for a content type, it takes over most of the editorial experience. + +![Drupal Gutenberg content screen][11] + +In the main window, you can see the dummy placeholder content I added in the Template configuration above. + +#### Drupal-specific options + +On the right-hand side, there are a few fields and settings that Drupal provides. For example, the **Title** field is a required separate field in Drupal, and therefore it is not on the main Gutenberg screen. + +Underneath the **Title**, there are additional settings that can vary, depending on the modules installed and options set up in Drupal. You can see **Revision log messages**, **Menu settings**, **Comment settings**, and a place to add a **URL alias**. + +Typically, Drupal content types are composed of several text fields, such as tags, categories, checkboxes, image fields for teasers, etc. When you enable Gutenberg for a content type, these additional fields are available in the **More settings** tab. + +You can now add your content—it works the same as it does in WordPress Gutenberg, with the additional option to add Drupal blocks. + +In the screenshot below, you can see what happens when I add some text to replace the placeholder text, a search block from Drupal, a title, tags, and a custom URL alias. + +![Drupal Gutenberg entering text][12] + +After you hit **Save**, your content will be published. + +![Drupal Gutenberg output][13] + +And that is it. It works like a charm! + +### Working together for better software experiences + +Gutenberg in Drupal works well. It is an alternative option that allows editors to control the look and feel of their websites down to the tiniest details. Adoption is growing well, with over 1,000 installations as of this writing and 50 new ones every month. The Drupal integration adds other cool features like fine-grained permissions, placeholder content, and the ability to include Drupal blocks inline, which aren't available in the WordPress plugin. + +It is great to see the communities of two separate projects working together to achieve the common goal of giving people better software. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/gutenberg-editor-drupal + +作者:[MaciejLukianski][a] +选题:[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/maciejlukianski +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://wordpress.org/plugins/gutenberg/ +[3]: https://drupalgutenberg.org/ +[4]: https://www.droptica.com/blog/flexible-and-easy-content-creation-drupal-paragraphs-module/ +[5]: https://www.droptica.com/blog/layout-builder-building-drupal-8-layouts/ +[6]: https://www.drupal.org/project/gutenberg +[7]: https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-modules +[8]: https://opensource.com/sites/default/files/uploads/gutenberg_edit.png (Drupal settings) +[9]: https://opensource.com/sites/default/files/uploads/gutenberg_settings.png (Drupal Gutenberg settings) +[10]: https://opensource.com/sites/default/files/uploads/gutenberg_blocks.png (Drupal Gutenberg blocks) +[11]: https://opensource.com/sites/default/files/uploads/gutenberg_contentwindow.png (Drupal Gutenberg content screen) +[12]: https://opensource.com/sites/default/files/uploads/gutenberg_entry.png (Drupal Gutenberg entering text) +[13]: https://opensource.com/sites/default/files/uploads/gutenberg-demo.png (Drupal Gutenberg output) From c813eb3c075a18e26bb944fc3e031d3d4620141e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 5 Mar 2020 01:19:05 +0800 Subject: [PATCH 106/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200304=20Seawat?= =?UTF-8?q?er,=20humidity=20inspire=20new=20ways=20to=20generate=20power?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md --- ...dity inspire new ways to generate power.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md diff --git a/sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md b/sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md new file mode 100644 index 0000000000..7e2dc5927f --- /dev/null +++ b/sources/talk/20200304 Seawater, humidity inspire new ways to generate power.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Seawater, humidity inspire new ways to generate power) +[#]: via: (https://www.networkworld.com/article/3529893/seawater-humidity-inspire-new-ways-to-generate-power.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Seawater, humidity inspire new ways to generate power +====== +Researchers around the globe are working on new ways to generate huge amounts of power that will be needed for the shift to a data-driven society. +Getty Imags + +The possiblity of a future power-availability crunch – spurred in part by a global increase in data usage – is driving researchers to get creative with a slew of new and modified ways to generate and store energy. + +Ongoing projects include the use of seawater for batteries; grabbing ambient humidity; massive water storage systems for hydropower; and solar panels that work at night. Here are some details: + +### Batteries based on seawater + +Seawater will provide "super-batteries," says the University of Southern Denmark. Researchers there have been studying how to use sodium, which is abundant in seawater, as an alternative to lithium in batteries. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] + +"Sodium is a very readily available resource," the school says in a [press release][2], and it can be easily extracted from seawater. Lithium, on the other hand, is a limited resource that's mined only in a few places in the world, says research leader Dorthe Bomholdt Ravnsbæk of the department of physics, chemistry and pharmacy at the university. Batteries based on seawater would also alleviate the need for cobalt, which is used in lithium cells. The team in Denmark (working with Massachusetts Institute of Technology) believes it has come up with a new electrode material, based on manganese, that will make the seawater battery ultimately viable. + +### Using ambient moisture to generate power + +Humidity captured with bio-electronics could end up being a viable power source for sensors, say some scientists. + +"Harvesting energy from the environment offers the promise of clean power for self-sustained systems," notes University of Massachusetts researchers [in an article published in Nature][3]. However, known technologies often have restrictive environmental requirements – solar panels that must be mounted outside, for example – that limit their energy-producing potential. + +Moisture harvesting with thin-film, protein nanowires doesn't have restrictive environmental requirements. Sustained voltages of about half a volt can be obtained from moisture present in normal, ambient air. "Connecting several devices linearly scales up the voltage and current to power electronics," the Amherst group claims. "Our results demonstrate the feasibility of a continuous energy-harvesting strategy that is less restricted by location or environmental conditions than other sustainable approaches." + +[][4] + +### Seasonally pumped hydropower storage  + +On a larger scale, inland water storage could solve renewable power issues, say scientists at the International Institute for Applied Systems Analysis. + +One big problem collecting power from the environment, as opposed to using fossil fuels, is where to store the on-the-fly electricity being generated. The Austrian organization believes that hydropower systems should be used to contain renewable energy. It's cheap, for starters. In addition, seasonal pumped hydropower storage (SPHS) is better than wind or solar, the group claims, because it not only generates the power in real time as it’s needed, but also isn't affected by variations— a windy day isn't required, for example. + +SPHS operates by pumping water into dammed, river-adjacent reservoirs when water flow is high but power demand is low. Water is then allowed to flow out of the reservoir, through turbines—similar to hydroelectric—when energy demand increases. Electricity is thus created. The group, in a [press release][5] related to a study just released, says the technique is highly economical, even including required land purchases, excavation and tunneling. + +### Nighttime, anti-solar cells + +Contrary to popular belief, photovoltaic solar panels don't actually need full sun to function. Cloud cover allows some to work just fine, just not as well. Nighttime photovoltaic, however, is something more radical: + +The earth should be used as a heat source, and the night sky a heat sink, say Jeremy Munday and Tristan Deppe of the department of electrical and computer engineering at University of California, Davis. They shared their idea for nighttime photovoltaic cells in an [abstract of a paper][6] published by American Chemical Society's ACS Photonics. + +What they are suggesting is using thermoradiative photovoltaics, where deep space radiative cooling ([which I’ve written about before][7]) is combined with photovoltaics. Current is created as infrared light – or heat, in other words – is radiated into extremely cold, deep space. + +"Similar to the way a normal solar cell works, but in reverse," Munday says of their anti-solar panel concept, quoted in a [UC Davis news article][8].  + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529893/seawater-humidity-inspire-new-ways-to-generate-power.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://www.networkworld.com/newsletters/signup.html +[2]: https://www.sdu.dk/en/nyheder/Forskningsnyheder/skal_fremtidens_superbatterier_laves_af_havvand +[3]: https://www.nature.com/articles/s41586-020-2010-9 +[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://iiasa.ac.at/web/home/about/news/200219-seasonal-pumped-storage.html +[6]: https://pubs.acs.org/toc/apchd5/7/1 +[7]: https://www.networkworld.com/article/3222850/space-radiated-cooling-cuts-power-use-21.html +[8]: https://www.ucdavis.edu/news/anti-solar-cells-photovoltaic-cell-works-night +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 2be87fcfdcca73633cc7878507786f3fed6043c8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 5 Mar 2020 08:26:00 +0800 Subject: [PATCH 107/207] translated --- ...w to Add New Brushes in GIMP -Quick Tip.md | 105 ------------------ ...w to Add New Brushes in GIMP -Quick Tip.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md create mode 100644 translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md diff --git a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md deleted file mode 100644 index 6a93204805..0000000000 --- a/sources/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Add New Brushes in GIMP [Quick Tip]) -[#]: via: (https://itsfoss.com/add-brushes-gimp/) -[#]: author: (Community https://itsfoss.com/author/itsfoss/) - -How to Add New Brushes in GIMP [Quick Tip] -====== - -[GIMP][1], is the most popular free and open-source image editor and perhaps the best [Adobe Photoshop alternative][2] on Linux. - -When you [install GIMP on Ubuntu][3] or any other operating system, you’ll find a few brushes already installed for basic image editing. If you need something more specific, you can always add new brushes in GIMP. - -How? Let me show you that in this quick tutorial. - -### How to add brushes in GIMP - -![][4] - -There are three steps involved in installing new brushes in GIMP: - - * Get new brush - * Put it in the designated folder - * Refresh the brushes in GIMP - - - -#### Step 1: Download new GIMP brushes - -The first step is to get new brushes for GIMP. Where do you get it from? From the internet, of course. - -You can search on Google or [alternative private search engines like Duck Duck Go][5] for ‘GIMP brushes’ and download the ones you like from a reputed website. - -GIMP brushes are usually available in .gbr and .gih file formats. The .gbr file is for regular brushes while .gih is used for animated brushes. - -Did you know? - -For the versions 2.4 and above, GIMP makes installing and using Photoshop brushes (.abr file) quite straightforward. All you need to do is place the Photoshop brush files in the proper folder. -Do keep in mind that the latest Photoshop brushes might not work with GIMP flawlessly. - -#### Step 2: Copy the new brushes into its location - -After you get your brush file, the next step is to copy and paste it to the right folder in GIMP configuration directory. - -On **Windows**, you’ll have to go to a folder like “**C:\Documents and Settings\myusername.gimp-2.10\brushes**“. - -I’ll show detailed steps for **Linux** because It’s FOSS is a Linux-focused website. - -After selecting the brush files press **Ctrl+h** in your **Home** folder to [see hidden files in Linux][6]. - -![Press Ctrl+H to see hidden files in the home directory][7] - -You should go to **.config/GIMP/2.10/brushes** folder (if you are using GIMP version 2.10). If you are using some other version, you should see an equivalent folder under .config/GIMP. - -![Adding New Brushes in GIMP][8] - -Paste the brush files in this folder. Optionally, you can hide the hidden files by pressing **Ctrl+h** again. - -#### Step 3: Refresh the brushes (to avoid restarting GIMP) - -GIMP will automatically load brushes when it’s launched. If you are already running it and don’t want to close it, you can refresh the brushes. - -In GIMP go to **Windows**->**Dockable Dialogues**->**Brushes** in the main menu. - -![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9] - -Locate the **refresh** icon in the **Brushes** dialog on the right side bar. - -![Refresh GIMP Brushes][10] - -If your brushes are not present, you can always try to restart GIMP. - -Bonus Tip! - -Adding new brushes in [GIMP also allows you easily watermark images][11]. Just use your logo as a brush and add it to the images in a single click. - -I hope you enjoyed this quick GIMP tip. Stay tuned for more. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/add-brushes-gimp/ - -作者:[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://www.gimp.org/ -[2]: https://itsfoss.com/open-source-photoshop-alternatives/ -[3]: https://itsfoss.com/gimp-2-10-release/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install-New-Brushes-in-GIMP.jpg?ssl=1 -[5]: https://itsfoss.com/privacy-search-engines/ -[6]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP-1.jpg?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP.png?ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes.jpg?ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes-2.jpg?ssl=1 -[11]: https://itsfoss.com/add-watermark-gimp-linux/ diff --git a/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md new file mode 100644 index 0000000000..1e43b2bc71 --- /dev/null +++ b/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add New Brushes in GIMP [Quick Tip]) +[#]: via: (https://itsfoss.com/add-brushes-gimp/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +如何在 GIMP 中添加新画笔(快速技巧) +====== + +[GIMP][1] 是最流行的免费和开源图像编辑器,它也许是 Linux 上最好的 [Adobe Photoshop 替代品][2]。 + +当你[在 Ubuntu 或其他任何操作系统上安装了 GIMP 后][3],你会发现已经安装了一些用于基本图像编辑的画笔。如果你需要更具体的画笔,你可以随时在 GIMP 中添加新画笔。 + +怎么样?让我在这个快速教程中向你展示。 + +### 如何在 GIMP 中添加画笔 + +![][4] + +在 GIMP 中安装新画笔需要三个步骤: + + * 获取新画笔 + * 将其放入指定的文件夹中 + * 刷新 GIMP 中的画笔 + + + +#### 步骤 1:下载新的 GIMP 画笔 + +第一步是获取新的 GIMP 画笔。你从哪里获取?当然是从互联网上。 + +你可以在 Google 或[隐私搜索引擎,如 Duck Duck Go][5] 种搜索 “GIMP画笔”,并从网站下载一个你喜欢的。 + +GIMP 画笔通常以 .gbr 和 .gih 文件格式提供。.gbr 文件用于常规画笔,而 .gih 用于动画画笔。 + +你知道吗? + +从 2.4 版本起,GIMP 使安装和使用 Photoshop 画笔(.abr 文件)非常简单。你只需将 Photoshop 画笔文件放在正确的文件夹中。 +请记住,最新的 Photoshop 画笔可能无法完美地在 GIMP 中使用。 + +#### 步骤 2:将新画笔复制到它的位置 + +获取画笔文件后,下一步是复制该文件并将其粘贴到 GIMP 配置目录中所在的文件夹。 + +在 **Windows** 上,你必须进入类似 “**C:\Documents and Settings\myusername.gimp-2.10\brushes**” 这样的文件夹。 + +我将展示 **Linux** 上的详细步骤,因为 It’s FOSS 是一个专注于 Linux 的网站。 + +选择画笔文件后,在 **Home** 目录中按下 **Ctrl+h** [查看 Linux 中的隐藏文件][6]。 + +![Press Ctrl+H to see hidden files in the home directory][7] + +你应该进入 **.config/GIMP/2.10/brushes** 文件夹(如果你使用的是 GIMP 2.10)。如果使用其他版本,那么应在 .config/GIMP 下看到相应文件夹。 + +![Adding New Brushes in GIMP][8] + +将画笔文件粘贴到此文件夹中。可选地,你可以通过再次按 **Ctrl+h** 来隐藏隐藏的文件。 + +#### 步骤 3:刷新画笔(避免重启 GIMP) + +GIMP 将在启动时自动加载画笔。如果已在运行,并且不想关闭它,你可以刷新画笔。 + +在 GIMP 的主菜单中找到 **Windows**->**Dockable Dialogues**->**Brushes**。 + +![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9] + +在右侧栏的 **Brushes** 对话框中找到**刷新**图标。 + +![Refresh GIMP Brushes][10] + +如果你的画笔没有出现,那么你可以试试重启 GIMP。 + +额外的技巧! + +在 [GIMP 中添加新画笔还能让你轻松给图片添加水印][11]。只需将 logo 用作画笔,并点击一下就可添加到图片中。 + +我希望你喜欢这个快速 GIMP 技巧。敬请期待更多。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/add-brushes-gimp/ + +作者:[Community][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/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://www.gimp.org/ +[2]: https://itsfoss.com/open-source-photoshop-alternatives/ +[3]: https://itsfoss.com/gimp-2-10-release/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Install-New-Brushes-in-GIMP.jpg?ssl=1 +[5]: https://itsfoss.com/privacy-search-engines/ +[6]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP-1.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/adding-brushes-GIMP.png?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/Refresh-GIMP-Brushes-2.jpg?ssl=1 +[11]: https://itsfoss.com/add-watermark-gimp-linux/ From 785572ee1b12fe309ffd4bbc969989fe83cde4a8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 5 Mar 2020 08:37:11 +0800 Subject: [PATCH 108/207] translating --- ... an open source scientific calculator for your smartphone.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md index 32d467465a..b69120beaa 100644 --- a/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md +++ b/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fdbde56c54955e14cee2b608135200a577d6e7da Mon Sep 17 00:00:00 2001 From: qianmingtian <40565099+qianmingtian@users.noreply.github.com> Date: Thu, 5 Mar 2020 09:15:05 +0800 Subject: [PATCH 109/207] Translating by qianmingtian --- .../tech/20200305 Install and Use Wireshark on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md index 3b0a4f6468..b1f3b76e2b 100644 --- a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md +++ b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qianmingtian) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 167fc66be563afadc2e3998cdc67ea579104be1c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 09:42:08 +0800 Subject: [PATCH 110/207] PRF @geekpi --- ...hing- Open Source P2P File Syncing Tool.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md index 013a3569a4..0905f1aa3f 100644 --- a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md +++ b/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Syncthing: Open Source P2P File Syncing Tool) @@ -10,11 +10,11 @@ Syncthing:开源 P2P 文件同步工具 ====== -_ **简介:Syncthing 是一个开源的 P2P 文件同步工具,可用于在多个设备(包括 Android 手机)之间同步文件。** _ +> Syncthing 是一个开源的 P2P 文件同步工具,可用于在多个设备(包括 Android 手机)之间同步文件。 -通常,我们有 [MEGA][1] 或 Dropbox 之类的云同步解决方案,以便在云上备份我们的文件,同时更易于共享。 +![](https://img.linux.net.cn/data/attachment/album/202003/05/094211oy2dosttvoaseovk.jpg) -但是,如果要跨多个设备同步文件而不将其存储在云中怎么办? +通常,我们有 [MEGA][1] 或 Dropbox 之类的云同步解决方案,以便在云上备份我们的文件,同时更易于共享。但是,如果要跨多个设备同步文件而不将其存储在云中怎么办? 这就是 [Syncthing][2] 派上用场的地方了。 @@ -22,7 +22,7 @@ _ **简介:Syncthing 是一个开源的 P2P 文件同步工具,可用于在 ![][3] -Syncthing 可让你跨多个设备同步文件(包括对 Android 智能手机的支持)。它主要通过 Linux上 的 Web UI 进行工作,但也提供了 GUI(需要单独安装)。 +Syncthing 可让你跨多个设备同步文件(包括对 Android 智能手机的支持)。它主要通过 Linux 上的 Web UI 进行工作,但也提供了 GUI(需要单独安装)。 然而,Syncthing 完全没有利用云,它是 [P2P][4] 文件同步工具。你的数据不会被发送到中央服务器。而是会在所有设备之间同步。因此,它并不能真正取代 [Linux 上的典型云存储服务][5]。 @@ -36,7 +36,7 @@ Syncthing 可让你跨多个设备同步文件(包括对 Android 智能手机 例如,你可能不想在云上存储一些敏感文件,因此你可以添加其他受信任的设备来同步并保留这些文件的副本。 -即使我简单描述了它,但它并不像看到的那么简单。如果你感兴趣的话,我建议你阅读[官方 FAQ][7] 来了解它如何工作的。 +即使我对它的描述很简单,但它并不像看到的那么简单。如果你感兴趣的话,我建议你阅读[官方 FAQ][7] 来了解它如何工作的。 ### Syncthing 的特性 @@ -90,15 +90,15 @@ Syncthing 确实非常简单且易于理解。即使这样,如果你想使用 你可能无法在软件中心找到它(如果你找到了,那它可能不是最新版本)。 -**注意:**_如果你需要一个 GUI 而不是浏览器来管理它,它还有一个 [Syncthing-GTK][16]。_ +**注意:**如果你需要一个 GUI 应用而不是浏览器来管理它,它还有一个 [Syncthing-GTK][16]。 -[Syncthing][2] +- [Syncthing][2] -如果你有基于 Debian 的发行版,你也可以利用终端来安装它,这些说明位于[官方下载页面][17] 上。 +如果你有基于 Debian 的发行版,你也可以利用终端来安装它,这些说明位于[官方下载页面][17]上。 ### 我在 Syncthing 方面的体验 -就个人而言,我把它安装在 Pop!\_OS 19.10 上,并在写这篇文章之前用了一会儿。 +就个人而言,我把它安装在 Pop!_OS 19.10 上,并在写这篇文章之前用了一会儿。 我尝试同步文件夹、删除它们、添加重复文件以查看文件版本控制是否工作,等等。它工作良好。 @@ -108,7 +108,7 @@ Syncthing 确实非常简单且易于理解。即使这样,如果你想使用 总体而言,它工作良好,但我必须说,你不应该依赖它作为唯一的数据备份方案。 -**总结** +### 总结 你试过 Syncthing 了吗?如果有的话,你的体验如何?欢迎在下面的评论中分享。 @@ -121,7 +121,7 @@ via: https://itsfoss.com/syncthing/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 06e8186da15eb1d33a2020f08855d0cc5542299c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 09:44:51 +0800 Subject: [PATCH 111/207] PUB @geekpi https://linux.cn/article-11960-1.html --- .../20200121 Syncthing- Open Source P2P File Syncing Tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200121 Syncthing- Open Source P2P File Syncing Tool.md (98%) diff --git a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md b/published/20200121 Syncthing- Open Source P2P File Syncing Tool.md similarity index 98% rename from translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md rename to published/20200121 Syncthing- Open Source P2P File Syncing Tool.md index 0905f1aa3f..383fc2f351 100644 --- a/translated/tech/20200121 Syncthing- Open Source P2P File Syncing Tool.md +++ b/published/20200121 Syncthing- Open Source P2P File Syncing Tool.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11960-1.html) [#]: subject: (Syncthing: Open Source P2P File Syncing Tool) [#]: via: (https://itsfoss.com/syncthing/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 6a3c2a7534b5754cca8c90b74e46a7df0c6ae5e6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 10:18:15 +0800 Subject: [PATCH 112/207] PRF @wxy --- ...ource productivity tools on my wishlist.md | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200130 4 open source productivity tools on my wishlist.md b/translated/tech/20200130 4 open source productivity tools on my wishlist.md index eaebf35f1d..7570c78433 100644 --- a/translated/tech/20200130 4 open source productivity tools on my wishlist.md +++ b/translated/tech/20200130 4 open source productivity tools on my wishlist.md @@ -1,30 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 open source productivity tools on my wishlist) [#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) -我的愿望清单上的 4 个开源生产力工具 +我的愿望清单上的 4 种开源生产力工具 ====== -> 在 2020 年用开源实现更高生产力的二十种方式的最后一篇文章中,了解开源世界需要做什么。 +> 在 2020 年用开源实现更高生产力的二十种方式的最后一篇文章中,了解开源世界还需要什么。 -![Two diverse hands holding a globe][1] +![](https://img.linux.net.cn/data/attachment/album/202003/05/100642k52u7oydcwnc1c2w.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 -### 不过… +### 然而… -在搜索生产力应用程序时,我找不到想要的一切应用,而且几乎总是会丢失一些读者与我分享的精彩内容。 因此,当我结束本系列文章时,是时候[再次][2]谈论我在本年度系列文章中未能涵盖的一些主题。 +在搜索生产力应用程序时,我找不到想要的所有应用,而且几乎总是会丢失一些读者与我分享的精彩内容。 因此,当我结束本系列文章时,是时候[再次][2]谈论我在本年度系列文章中未能涵盖的一些主题。 ![Desktop with Joplin, Emacs, and Firefox][3] #### 在 Vim 中聊天 -我试过了。我真的非常非常想能够在 Vim 中聊天,但我做不到。我找到的一个软件包 [VimIRC.vim][4] 一直就工作不起来,我试了几天也没用。我探索的另一个选项是 [Irc it][5],这需要我付出更多的[努力去设置][6],超过了我正常可以付出的耐心或时间。我尝试过了,也确实做到了,但对于同处于相同境地的 Vim 用户,对不起,我无法帮到你。 +我试过了。我真的非常、非常想能够在 Vim 中聊天,但我做不到。我找到的一个软件包 [VimIRC.vim][4] 一直就工作不起来,我试了几天也没用。我探索的另一个选项是 [Irc it][5],这需要我付出更多的[努力去设置][6],超过了我正常可以付出的耐心或时间。我尝试过了,也确实做到了,但对于同处于相同境地的 Vim 用户,对不起,我无法帮到你。 #### Org 模式 @@ -36,15 +36,38 @@ #### 图形用户界面程序 -在 2019 年的生产力系列中,我共享了很多图形用户界面程序,而今年几乎都是命令行应用程序。有一些很棒的图形程序可以帮助解决我今年谈论的一些问题,例如可以使用 Maildir 邮箱的[邮件][12]程序、用于读取本地日历文件的日历程序、[天气][13]应用程序等等。我甚至尝试了几项对我而言新奇的事物,看它们是否适合这个主题。除了 [twin][14] 之外,我没有感觉到有什么图形用户界面程序是新颖的(对我而言)或值得注意的(同样对我而言)今年要写的。至于…… +在 2019 年的生产力系列中,我共享了很多图形用户界面程序,而今年几乎都是命令行应用程序。有一些很棒的图形程序可以帮助解决我今年谈论的一些问题,例如可以使用 Maildir 邮箱的[邮件][12]程序、用于读取本地日历文件的日历程序、[天气][13]应用程序等等。我甚至尝试了几项对我而言新奇的事物,看它们是否适合这个主题。除了 [twin][14] 之外,我没有感觉到有什么图形用户界面程序是新颖的(对我而言)或值得注意的(同样对我而言)是今年要写的。至于…… #### 移动应用程序 -越来越多的人将平板电脑(有时与笔记本电脑结合使用)作为主要设备。我将手机用于大多数社交媒体和即时消息传递,并且经常使用平板电脑(好的,老实说,好几个平板电脑)来阅读或浏览网络。可以肯定的是,并不是开源移动应用程序不存在,但是它们与我今年的主题不符。开源和移动应用程序正在发生很多变化,我正在仔细地寻找可以帮助我在手机和平板电脑上提高工作效率的事物。 +越来越多的人将平板电脑(有时与笔记本电脑结合使用)作为主要设备。我将手机用于大多数社交媒体和即时消息传递,并且经常使用平板电脑(好的,老实说,好几个平板电脑)来阅读或浏览网络。可以肯定的是,并不是没有开源移动应用程序,但是它们与我今年的主题不符。开源和移动应用程序正在发生很多变化,我正在仔细地寻找可以帮助我在手机和平板电脑上提高工作效率的事物。 ### 该你了 -非常感谢你阅读今年的系列文章。请你发表评论,告诉我错过的或需要在 2021 年看到的内容。正如我在 [Productivity Alchemy] [15] 播客上所说:“哥们,记着:保持生产力!” +非常感谢你阅读今年的系列文章。请你发表评论,告诉我错过的或需要在 2021 年看到的内容。正如我在 [Productivity Alchemy][15] 播客上所说:“哥们,记着:要保持生产力!” + +### 本系列汇总 + +1. [使用 Syncthing 在多个设备间同步文件](https://linux.cn/article-11793-1.html) +2. [使用 Stow 管理多台机器配置](https://linux.cn/article-11796-1.html) +3. [使用 OfflineIMAP 同步邮件](https://linux.cn/article-11804-1.html) +4. [使用 Notmuch 组织你的邮件](https://linux.cn/article-11807-1.html) +5. [使用 khal 和 vdirsyncer 组织和同步你的日历](https://linux.cn/article-11812-1.html) +6. [用于联系人管理的三个开源工具](https://linux.cn/article-11834-1.html) +7. [开始使用开源待办事项清单管理器](https://linux.cn/article-11835-1.html) +8. [使用这个 Python 程序记录你的活动](https://linux.cn/article-11846-1.html) +9. [一个通过 IRC 管理所有聊天的开源聊天工具](https://linux.cn/article-11856-1.html) +10. [使用这个 Twitter 客户端在 Linux 终端中发推特](https://linux.cn/article-11858-1.html) +11. [在 Linux 终端中阅读 Reddit](https://linux.cn/article-11869-1.html) +12. [使用此开源工具在一起收取你的 RSS 订阅源和播客](https://linux.cn/article-11876-1.html) +13. [使用这个开源工具获取本地天气预报](https://linux.cn/article-11879-1.html) +14. [使用此开源窗口环境一次运行多个控制台](https://linux.cn/article-11892-1.html) +15. [使用 tmux 创建你的梦想主控台](https://linux.cn/article-11900-1.html) +16. [使用 Vim 发送邮件和检查日历](https://linux.cn/article-11908-1.html) +17. [使用 Vim 管理任务列表和访问 Reddit 和 Twitter](https://linux.cn/article-11912-1.html) +18. [使用 Emacs 发送电子邮件和检查日历](https://linux.cn/article-11932-1.html) +19. [使用 Emacs 进行社交并跟踪你的待办事项列表](https://linux.cn/article-11956-1.html) +20. [我的愿望清单上的 4 种开源生产力工具](https://linux.cn/article-11961-1.html) -------------------------------------------------------------------------------- @@ -53,7 +76,7 @@ via: https://opensource.com/article/20/1/open-source-productivity-tools 作者:[Kevin Sonney][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 48849f6708f7dd121d1ad26ad5438a879d31a027 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 10:18:44 +0800 Subject: [PATCH 113/207] PUB @wxy https://linux.cn/article-11961-1.html --- ...0200130 4 open source productivity tools on my wishlist.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200130 4 open source productivity tools on my wishlist.md (98%) diff --git a/translated/tech/20200130 4 open source productivity tools on my wishlist.md b/published/20200130 4 open source productivity tools on my wishlist.md similarity index 98% rename from translated/tech/20200130 4 open source productivity tools on my wishlist.md rename to published/20200130 4 open source productivity tools on my wishlist.md index 7570c78433..533247844b 100644 --- a/translated/tech/20200130 4 open source productivity tools on my wishlist.md +++ b/published/20200130 4 open source productivity tools on my wishlist.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11961-1.html) [#]: subject: (4 open source productivity tools on my wishlist) [#]: via: (https://opensource.com/article/20/1/open-source-productivity-tools) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 22ec776fbb6af45f69863ef820b4cf96230584ed Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 16:37:46 +0800 Subject: [PATCH 114/207] APL --- ...0303 Getting started with the Rust package manager, Cargo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md index d77410b904..9d3429f1bd 100644 --- a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md +++ b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 792460af0e4bd1846de1970d8cf85b046f43c74f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 5 Mar 2020 18:23:10 +0800 Subject: [PATCH 115/207] TSL --- ...ed with the Rust package manager, Cargo.md | 607 ------------------ ...ed with the Rust package manager, Cargo.md | 561 ++++++++++++++++ 2 files changed, 561 insertions(+), 607 deletions(-) delete mode 100644 sources/tech/20200303 Getting started with the Rust package manager, Cargo.md create mode 100644 translated/tech/20200303 Getting started with the Rust package manager, Cargo.md diff --git a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md b/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md deleted file mode 100644 index 9d3429f1bd..0000000000 --- a/sources/tech/20200303 Getting started with the Rust package manager, Cargo.md +++ /dev/null @@ -1,607 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with the Rust package manager, Cargo) -[#]: via: (https://opensource.com/article/20/3/rust-cargo) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) - -Getting started with the Rust package manager, Cargo -====== -Get to know Rust's package manager and build tool. -![Shipping containers stacked in a yard][1] - -[Rust][2] is a modern programming language that provides performance, reliability, and productivity. It has consistently been voted as the [most-loved language][3] on StackOverflow surveys for a few years now. - -In addition to being a great programming language, Rust also features a build system and package manager called Cargo. Cargo handles a lot of tasks, like building code, downloading libraries or dependencies, and so on. The two are bundled together, so you get Cargo when you install Rust. - -### Installing Rust and Cargo - -Before getting started, you need to install Rust and Cargo. The Rust project provides a downloadable script to handle the installation. To get the script, open a browser to [https://sh.rustup.rs][4] and save the file. Read the script to make sure you're happy with what it intends to do, and then run it: - - -``` -`$ sh ./rustup.rs` -``` - -You can also refer to the [Install Rust][5] webpage for more information. - -After installing Rust and Cargo, you must source the env file: - - -``` -`$ source $HOME/.cargo/env` -``` - -Better yet, add the required directory to your PATH variable: - - -``` -`$ source $HOME/.cargo/env` -``` - -If you prefer to use your package manager (such as DNF or Apt on Linux), look for Rust and Cargo packages in your distribution's repositories and install accordingly. For example: - - -``` -`$ dnf install rust cargo` -``` - -Once they're installed and set up, verify which versions of Rust and Cargo you have: - - -``` -$ rustc --version -rustc 1.41.0 (5e1a79984 2020-01-27) -$ cargo --version -cargo 1.41.0 (626f0f40e 2019-12-03) -``` - -### Building and running Rust by hand - -Start with a simple program that prints "Hello, world!" on the screen. Open your favorite text editor and type the following program: - - -``` -$ cat hello.rs -fn main() { -    println!("Hello, world!"); -} -``` - -Save the file with an **.rs** extension to identify it as a Rust source code file. - -Compile your program using the Rust compiler, **rustc**: - - -``` -`$ rustc hello.rs` -``` - -After compilation, you will have a binary that has the same name as the source program: - - -``` -$ ls -l -total 2592 --rwxr-xr-x. 1 user group 2647944 Feb 13 14:14 hello --rw-r--r--. 1 user group      45 Feb 13 14:14 hello.rs -$ -``` - -Execute your program to verify that it runs as expected: - - -``` -$ ./hello -Hello, world! -``` - -These steps are sufficient for smaller programs or whenever you want to test out something quickly. However, when working on bigger programs involving multiple people, Cargo is the best way forward. - -### Creating a new package using Cargo - -Cargo is a build system and package manager for Rust. It helps developers download and manage dependencies and assists in creating Rust packages. Packages in Rust are often called "crates" in the Rust community, but in this article, the two words are interchangeable. Refer to the Cargo [FAQ][6] provided by the Rust community for clarification. - -If you need any help with Cargo's command-line utility, use the **\--help** or **-h** command-line argument: - - -``` -`$ cargo –help` -``` - -To create a new package, use the **new** keyword, followed by the package name. For this example, use **hello_opensource** as your new package name. After running the command, you will see a message confirming that Cargo has created a binary package with the given name: - - -``` -$ cargo new hello_opensource -     Created binary (application) `hello_opensource` package -``` - -Running a **tree** command to see the directory structure reports that some files and directories were created. First, it creates a directory with the name of the package, and within that directory is an **src** directory for your source code files: - - -``` -$ tree . -. -└── hello_opensource -    ├── Cargo.toml -    └── src -        └── main.rs - -2 directories, 2 files -``` - -Cargo not only creates a package, but it also creates a simple **Hello, world!** program. Open the **main.rs** file and have a look: - - -``` -$ cat hello_opensource/src/main.rs -fn main() { -    println!("Hello, world!"); -} -``` - -The next file to work with is **Cargo.toml**, which is a configuration file for your package. It contains information about the package, such as its name, version, author information, and Rust edition information. - -A program often depends on external libraries or dependencies to run, which enables you to write applications that perform tasks that you don't know how to code or you don't want to spend time coding. All your dependencies will be listed in this file. At this point, you do not have any dependencies for your new program. Open the **Cargo.toml** file and view its contents: - - -``` -$ cat hello_opensource/Cargo.toml -[package] -name = "hello_opensource" -version = "0.1.0" -authors = ["user <[user@mail.com][7]>"] -edition = "2018" - -# See more keys and their definitions at - -[dependencies] -``` - -### Building the program using Cargo - -So far, so good. Now that you have a package in place, build a binary (also called an executable). Before doing that, move into the package directory: - - -``` -`$ cd hello_opensource/` -``` - -You can use Cargo's **build** command to build the package. Notice the messages that say it is **Compiling** your program: - - -``` -$ cargo build -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.38s -``` - -Check what happens to your project directory after you run the **build** command: - - -``` -$ tree . -. -├── Cargo.lock -├── Cargo.toml -├── src -│   └── main.rs -└── target -    └── debug -        ├── build -        ├── deps -        │   ├── hello_opensource-147b8a0f466515dd -        │   └── hello_opensource-147b8a0f466515dd.d -        ├── examples -        ├── hello_opensource -        ├── hello_opensource.d -        └── incremental -            └── hello_opensource-3pouh4i8ttpvz -                ├── s-fkmhjmt8tj-x962ep-1hivstog8wvf -                │   ├── 1r37g6m45p8rx66m.o -                │   ├── 2469ykny0eqo592v.o -                │   ├── 2g5i2x8ie8zed30i.o -                │   ├── 2yrvd7azhgjog6zy.o -                │   ├── 3g9rrdr4hyk76jtd.o -                │   ├── dep-graph.bin -                │   ├── query-cache.bin -                │   ├── work-products.bin -                │   └── wqif2s56aj0qtct.o -                └── s-fkmhjmt8tj-x962ep.lock - -9 directories, 17 files -``` - -Wow! The compilations process produced a lot of intermediate files. Your binary, though, is saved in the **./target/debug** directory with the same name as your package. - -### Running your application using Cargo - -Now that your binary is built, run it using Cargo's **run** command. As expected, it prints **Hello, world!** on the screen. - - -``` -$ cargo run -    Finished dev [unoptimized + debuginfo] target(s) in 0.01s -     Running `target/debug/hello_opensource` -Hello, world! -``` - -Alternatively, you can run the binary directly, which is located at: - - -``` -$ ls -l ./target/debug/hello_opensource --rwxr-xr-x. 2 root root 2655552 Feb 13 14:19 ./target/debug/hello_opensource -``` - -As expected, it produces the same results: - - -``` -$ ./target/debug/hello_opensource -Hello, world! -``` - -Say you need to rebuild your package and get rid of all the binaries and the intermediate files created by the earlier compilation process. Cargo provides a handy **clean** option to remove all intermediate files except the source code and other required files: - - -``` -$ cargo clean -$ tree . -. -├── Cargo.lock -├── Cargo.toml -└── src -    └── main.rs - -1 directory, 3 files -``` - -Make some changes to the program and run it again to see how it works. For example, this minor change adds **Opensource** to the **Hello, world!** string: - - -``` -$ cat src/main.rs -fn main() { -    println!("Hello, Opensource world!"); -} -``` - -Now, build the program and run it again. This time you see **Hello, Opensource world!** displayed on the screen: - - -``` -$ cargo build -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.39s - -$ cargo run -    Finished dev [unoptimized + debuginfo] target(s) in 0.01s -     Running `target/debug/hello_opensource` -Hello, Opensource world! -``` - -### Adding dependencies using Cargo - -Cargo allows you to add dependencies that your program needs to run. Adding a dependency is extremely easy with Cargo. Every Rust package includes a **Cargo.toml** file, which contains a list (empty by default) of dependencies. Open the file in your favorite text editor, find the **[dependencies]** section, and add the library you want to include in your package. For example, to add the **rand** library as your dependency: - - -``` -$ cat Cargo.toml -[package] -name = "hello_opensource" -version = "0.1.0" -authors = ["test user <[test@mail.com][8]>"] -edition = "2018" - -# See more keys and their definitions at - -[dependencies] -rand = "0.3.14" -``` - -Try building your package to see what happens. - - -``` -$ cargo build -    Updating crates.io index -   Compiling libc v0.2.66 -   Compiling rand v0.4.6 -   Compiling rand v0.3.23 -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 4.48s -``` - -Cargo is now reaching out to [Crates.io][9], which is Rust's central repository for crates (or packages) and downloading and compiling **rand**. But wait—what about the **libc** package? You did not ask for **libc** to be installed. Well, the **rand** package is dependent on the **libc** package; hence, Cargo downloads and compiles **libc** as well. - -New versions of libraries keep coming, and Cargo provides an easy way to update all of their dependencies using the **update** command: - - -``` -`cargo update` -``` - -You can also choose to update specific libraries using the **-p** flag followed by the package name: - - -``` -`cargo update -p rand` -``` - -### Compiling and running with a single command - -So far, you have used **build** followed by **run** whenever you make changes to your program. There is an easier way: you can simply use the **run** command, which internally compiles and runs the program. To see how it works, first clean up your package directory: - - -``` -$ cargo clean -$ tree . -. -├── Cargo.lock -├── Cargo.toml -└── src -    └── main.rs - -1 directory, 3 files -``` - -Now execute **run**. The output states that it compiled and then ran the program, and this means you don't need to explicitly run **build** each time: - - -``` -$ cargo run -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.41s -     Running `target/debug/hello_opensource` -Hello, world! -``` - -### Checking your code in development - -You often go through multiple iterations when developing a program. You need to ensure that your program has no coding errors and compiles fine. You don't need the overhead of generating the binary on each compilation. Cargo has you covered with a **check** option that compiles your code but skips the final step of generating an executable. - -Start by running **cargo clean** within your package directory: - - -``` -$ tree . -. -├── Cargo.lock -├── Cargo.toml -└── src -    └── main.rs - -1 directory, 3 files -``` - -Now run the **check** command and see what changes were made to the directory: - - -``` -$ cargo check -    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.18s -``` - -The output shows that, even though intermediate files were created as part of the compilation process, the final binary or executable was not created. This saves some time, which matters a lot if the package is huge with thousands of lines of code: - - -``` -$ tree . -. -├── Cargo.lock -├── Cargo.toml -├── src -│   └── main.rs -└── target -    └── debug -        ├── build -        ├── deps -        │   ├── hello_opensource-842d9a06b2b6a19b.d -        │   └── libhello_opensource-842d9a06b2b6a19b.rmeta -        ├── examples -        └── incremental -            └── hello_opensource-1m3f8arxhgo1u -                ├── s-fkmhw18fjk-542o8d-18nukzzq7hpxe -                │   ├── dep-graph.bin -                │   ├── query-cache.bin -                │   └── work-products.bin -                └── s-fkmhw18fjk-542o8d.lock - -9 directories, 9 files -``` - -To see if you are really saving time, time the **build** and **check** commands and compare them. - -First, the **build** command: - - -``` -$ time cargo build -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.40s - -real    0m0.416s -user    0m0.251s -sys     0m0.199s -``` - -Clean the directory before running the **check** command: - - -``` -`$ cargo clean` -``` - -The **check** command: - - -``` -$ time cargo check -    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.15s - -real    0m0.166s -user    0m0.086s -sys     0m0.081s -``` - -Clearly, the **check** command is much faster. - -### Building external Rust packages - -Everything you've done so far will apply to any Rust crate you get from the internet. You simply need to download or clone the repository, move to the package folder, and run the **build** command, and you are good to go: - - -``` -git clone <github-like-url> -cd <package-folder> -cargo build -``` - -### Building optimized Rust programs using Cargo - -You've run **build** multiple times so far, but did you notice its output? No worries, build it again and watch closely: - - -``` -$ cargo build -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished dev [unoptimized + debuginfo] target(s) in 0.36s -``` - -See the **[unoptimized + debuginfo]** text after each compilation? This means that the binary generated by Cargo includes a lot of debugging information and is not optimized for execution. Developers often go through multiple iterations of development and need this debugging information for analysis. Also, performance is not the immediate goal while developing software. Therefore, this is OK for now. - -However, once the software is ready for release, it doesn't need to have the debugging information anymore. But it does need to be optimized for best performance. In the final stages of development, you can use the **\--release** flag with **build**. Watch closely; you should see the **[optimized]** text after compilation: - - -``` -$ cargo build --release -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -    Finished release [optimized] target(s) in 0.29s -``` - -If you want to, you can go through the exercise to find out your time savings when running optimized vs. unoptimized software. - -### Creating a library vs. a binary using Cargo - -Any software program can be roughly categorized as either a standalone binary or a library. A standalone binary can be run as it is, even though it might make use of external libraries. A library, however, is utilized by another standalone binary. All the programs you've built so far in this tutorial are standalone binaries since that is Cargo's default. To create a **library**, add the **\--lib** option: - - -``` -$ cargo new --lib libhello -     Created library `libhello` package -``` - -This time, Cargo does not create a **main.rs** file; instead, it creates a **lib.rs** file. The code for your library should go here: - - -``` -$ tree . -. -└── libhello -    ├── Cargo.toml -    └── src -        └── lib.rs - -2 directories, 2 files -``` - -Knowing Cargo, don't be surprised that it put some code in your new library file. Find out what it added by moving to the package directory and viewing the file. By default, Cargo puts a test function within library files. - -### Running tests using Cargo - -Rust provides first-class support for unit and integration testing, and Cargo allows you to execute any of these tests: - - -``` -$ cd libhello/ - -$ cat src/lib.rs -#[cfg(test)] -mod tests { -    #[test] -    fn it_works() { -        assert_eq!(2 + 2, 4); -    } -} -``` - -Cargo has a handy **test** option to run any test that is present in your code. Try running the tests that Cargo put in the library code by default: - - -``` -$ cargo test -   Compiling libhello v0.1.0 (/opensource/libhello) -    Finished test [unoptimized + debuginfo] target(s) in 0.55s -     Running target/debug/deps/libhello-d52e35bb47939653 - -running 1 test -test tests::it_works ... ok - -test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - -   Doc-tests libhello - -running 0 tests - -test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out -``` - -### Looking under Cargo's hood - -You may be interested in knowing what Cargo does under the hood when you run a command. After all, Cargo is, in many ways, a wrapper. To find out what it's doing, you can use the **-v** option with any Cargo command to output verbose information to the screen. - -Here are a couple of examples that run **build** and **clean** using the **-v** option. - -In the **build** command, you can see that the underlying **rustc** (Rust compiler) fired with the given command-line options: - - -``` -$ cargo build -v -   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) -     Running `rustc --edition=2018 --crate-name hello_opensource src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=147b8a0f466515dd -C extra-filename=-147b8a0f466515dd --out-dir /opensource/hello_opensource/target/debug/deps -C incremental=/opensource/hello_opensource/target/debug/incremental -L dependency=/opensource/hello_opensource/target/debug/deps` -    Finished dev [unoptimized + debuginfo] target(s) in 0.36s -``` - -Whereas the **clean** command shows that it is simply removing the directory that contains the intermediate files and the binary: - - -``` -$ cargo clean -v -    Removing /opensource/hello_opensource/target -``` - -### Don't let your skills get rusty - -To expand your skills, try writing and running a slightly more complex program using Rust and Cargo. Something simple will do: for instance, try listing all files in the current directory (it can be done in nine lines of code), or try echoing input back out at yourself. Small practice applications help you get comfortable with the syntax and the process of writing and testing code. - -This article offers plenty of information for budding Rust programmers to get started with Cargo. However, as you begin working on larger and more complicated programs, you'll need a more advanced understanding of Cargo. When you're ready for more, download and read the open source [Cargo Book][10] written by the Rust team, and see what you can create! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/rust-cargo - -作者:[Gaurav Kamathe][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/gkamathe -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers2.png?itok=idd8duC_ (Shipping containers stacked in a yard) -[2]: https://www.rust-lang.org/ -[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages -[4]: https://sh.rustup.rs/ -[5]: https://www.rust-lang.org/tools/install -[6]: https://doc.rust-lang.org/cargo/faq.html -[7]: mailto:user@mail.com -[8]: mailto:test@mail.com -[9]: http://crates.io -[10]: https://doc.rust-lang.org/cargo diff --git a/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md b/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md new file mode 100644 index 0000000000..b289dd6f00 --- /dev/null +++ b/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md @@ -0,0 +1,561 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with the Rust package manager, Cargo) +[#]: via: (https://opensource.com/article/20/3/rust-cargo) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +Rust 包管理器 Cargo 入门 +====== + +> 了解 Rust 的软件包管理器和构建工具。 + +![Shipping containers stacked in a yard][1] + +[Rust][2] 是一种现代编程语言,可提供高性能、可靠性和生产力。几年来,它一直被 StackOverflow 调查评为[最受欢迎的语言][3]。 + +除了是一种出色的编程语言之外,Rust 还具有一个称为 Cargo 的构建系统和软件包管理器。Cargo 处理许多任务,例如构建代码、下载库或依赖项等等。这两者捆绑在一起,因此在安装 Rust 时会得到 Cargo。 + +### 安装 Rust 和 Cargo + +在开始之前,你需要安装 Rust 和 Cargo。Rust 项目提供了一个可下载的脚本来处理安装。要获取该脚本,请打开浏览器以访问 [https://sh.rustup.rs][4] 并保存该文件。阅读脚本以确保你对它的具体行为有所了解,然后运行它: + +``` +$ sh ./rustup.rs +``` + +你也可以参考这个[安装 Rust][5]网页以获取更多信息。 + +安装 Rust 和 Cargo 之后,你必须获取source `env` 文件: + +``` +$ source $HOME/.cargo/env +``` + +更好的是,将所需目录添加到 `PATH` 环境变量中: + +``` +export PATH=$PATH:~/.cargo/bin +``` + +如果你更喜欢使用软件包管理器(例如 Linux 上的 DNF 或 Apt),请在发行版本的存储库中查找 Rust 和 Cargo 软件包,并进行相应的安装。 例如: + +``` +$ dnf install rust cargo +``` + +安装并设置它们后,请验证你拥有的 Rust 和 Cargo 版本: + +``` +$ rustc --version +rustc 1.41.0 (5e1a79984 2020-01-27) +$ cargo --version +cargo 1.41.0 (626f0f40e 2019-12-03) +``` + +### 手动构建和运行 Rust + +从在屏幕上打印“Hello, world!”的简单程序开始。打开你喜欢的文本编辑器,然后键入以下程序: + +``` +$ cat hello.rs +fn main() { +    println!("Hello, world!"); +} +``` + +以扩展名 `.rs` 保存文件,以将其标识为 Rust 源代码文件。 + +使用 Rust 编译器 `rustc` 编译程序: + +``` +$ rustc hello.rs +``` + +编译后,你将拥有一个与源程序同名的二进制文件: + +``` +$ ls -l +total 2592 +-rwxr-xr-x. 1 user group 2647944 Feb 13 14:14 hello +-rw-r--r--. 1 user group      45 Feb 13 14:14 hello.rs +$ +``` + +执行程序以验证其是否按预期运行: + +``` +$ ./hello +Hello, world! +``` + +这些步骤对于较小的程序或任何你想快速测试的东西就足够了。但是,在进行涉及多人的大型计划时,Cargo 是前进的最佳之路。 + +### 使用 Cargo 创建新包 + +Cargo 是 Rust 的构建系统和包管理器。它可以帮助开发人员下载和管理依赖项,并帮助创建 Rust 包。在Rust 社区中,Rust 中的“包”通常被称为“crate”(板条箱),但是在本文中,这两个词是可以互换的。请参阅 Rust 社区提供的 Cargo [FAQ][6] 来区分。 + +如果你需要有关 Cargo 命令行实用程序的任何帮助,请使用 `--help` 或 `-h` 命令行参数: + +``` +$ cargo –help +``` + +要创建一个新的包,请使用关键字 `new`,跟上包名称。在这个例子中,使用 `hello_opensource` 作为新的包名称。运行该命令后,你将看到一条消息,确认 Cargo 已创建具有给定名称的二进制包: + +``` +$ cargo new hello_opensource +     Created binary (application) `hello_opensource` package +``` + +运行 `tree` 命令以查看目录结构,它会报告已创建了一些文件和目录。首先,它创建一个带有包名称的目录,并且在该目录内有一个存放你的源代码文件的 `src` 目录: + +``` +$ tree . +. +└── hello_opensource +    ├── Cargo.toml +    └── src +        └── main.rs + +2 directories, 2 files +``` + +Cargo 不仅可以创建包,它也创建了一个简单的 “Hello, world” 程序。打开 `main.rs` 文件看看: + +``` +$ cat hello_opensource/src/main.rs +fn main() { +    println!("Hello, world!"); +} +``` + +下一个要处理的文件是 `Cargo.toml`,这是你的包的配置文件。它包含有关包的信息,例如其名称、版本、作者信息和 Rust 版本信息。 + +程序通常依赖于外部库或依赖项来运行,这使你可以编写应用程序来执行不知道如何编码或不想花时间编码的任务。你所有的依赖项都将在此文件中列出。此时,对你的新程序你没有任何依赖关系。打开 `Cargo.toml` 文件并查看其内容: + +``` +$ cat hello_opensource/Cargo.toml +[package] +name = "hello_opensource" +version = "0.1.0" +authors = ["user "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +``` + +### 使用 Cargo 构建程序 + +到目前为止,一切都很顺利。现在你已经有了一个包,可构建一个二进制文件(也称为可执行文件)。在此之前,进入包目录: + +``` +$ cd hello_opensource/ +``` + +你可以使用 Cargo 的 `build` 命令来构建包。注意消息说它正在“编译”你的程序: + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.38s +``` + +运行 `build` 命令后,检查项目目录发生了什么: + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +├── src +│   └── main.rs +└── target +    └── debug +        ├── build +        ├── deps +        │   ├── hello_opensource-147b8a0f466515dd +        │   └── hello_opensource-147b8a0f466515dd.d +        ├── examples +        ├── hello_opensource +        ├── hello_opensource.d +        └── incremental +            └── hello_opensource-3pouh4i8ttpvz +                ├── s-fkmhjmt8tj-x962ep-1hivstog8wvf +                │   ├── 1r37g6m45p8rx66m.o +                │   ├── 2469ykny0eqo592v.o +                │   ├── 2g5i2x8ie8zed30i.o +                │   ├── 2yrvd7azhgjog6zy.o +                │   ├── 3g9rrdr4hyk76jtd.o +                │   ├── dep-graph.bin +                │   ├── query-cache.bin +                │   ├── work-products.bin +                │   └── wqif2s56aj0qtct.o +                └── s-fkmhjmt8tj-x962ep.lock + +9 directories, 17 files +``` + +哇!编译过程产生了许多中间文件。另外,你的二进制文件将以与软件包相同的名称保存在 `./target/debug` 目录中。 + +### 使用 Cargo 运行你的应用程序 + +现在你的二进制文件已经构建好了,使用 Cargo 的 `run` 命令运行它。如预期的那样,它将在屏幕上打印 `Hello, world!`。 + +``` +$ cargo run +    Finished dev [unoptimized + debuginfo] target(s) in 0.01s +     Running `target/debug/hello_opensource` +Hello, world! +``` + +或者,你可以直接运行二进制文件,该文件位于: + +``` +$ ls -l ./target/debug/hello_opensource +-rwxr-xr-x. 2 root root 2655552 Feb 13 14:19 ./target/debug/hello_opensource +``` + +如预期的那样,它产生相同的结果: + +``` +$ ./target/debug/hello_opensource +Hello, world! +``` + +假设你需要重建包,并丢弃早期编译过程创建的所有二进制文件和中间文件。Cargo 提供了一个方便的`clean` 选项来删除所有中间文件,但源代码和其他必需文件除外: + +``` +$ cargo clean +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +对程序进行一些更改,然后再次运行以查看其工作方式。例如,下面这个较小的更改将 `Opensource` 添加到 `Hello, world!` 字符串中: + +``` +$ cat src/main.rs +fn main() { +    println!("Hello, Opensource world!"); +} +``` + +现在,构建程序并再次运行它。这次,你会在屏幕上看到 `Hello, Opensource world!`: + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.39s + +$ cargo run +    Finished dev [unoptimized + debuginfo] target(s) in 0.01s +     Running `target/debug/hello_opensource` +Hello, Opensource world! +``` + +### 使用 Cargo 添加依赖项 + +Cargo 允许你添加程序需要运行的依赖项。使用 Cargo 添加依赖项非常容易。每个 Rust 包都包含一个 `Cargo.toml` 文件,其中包含一个依赖关系列表(默认为空)。用你喜欢的文本编辑器打开该文件,找到 `[dependencies]` 部分,然后添加要包含在包中的库。例如,将 `rand` 库添加为依赖项: + +``` +$ cat Cargo.toml +[package] +name = "hello_opensource" +version = "0.1.0" +authors = ["test user "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +rand = "0.3.14" +``` + +试试构建你的包,看看会发生什么。 + +``` +$ cargo build +    Updating crates.io index +   Compiling libc v0.2.66 +   Compiling rand v0.4.6 +   Compiling rand v0.3.23 +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 4.48s +``` + +现在,Cargo 会联系 [Crates.io][9],这是 Rust 用于存储 crate(或包)的中央仓库,并下载和编译 `rand`。但是,等等 —— `libc` 包是怎么回事?你没有要要安装 libc 啊。是的,`rand` 包依赖于 `libc` 包;因此,Cargo 也会下载并编译 `libc`。 + +库的新版本不断涌现,而 Cargo 提供了一种使用 `update` 命令更新其所有依赖关系的简便方法: + +``` +cargo update +``` + +你还可以选择使用 `-p` 标志跟上包名称来更新特定的库: + +``` +cargo update -p rand +``` + +### 使用单个命令进行编译和运行 + +到目前为止,每当对程序进行更改时,都先使用了 `build` 之后是 `run`。有一个更简单的方法:你可以直接使用 `run` 命令,该命令会在内部进行编译并运行该程序。要查看其工作原理,请首先清理你的软件包目录: + +``` +$ cargo clean +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +现在执行 `run`。输出信息表明它已进行编译,然后运行了该程序,这意味着你不需要每次都显式地运行 `build`: + +``` +$ cargo run +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.41s +     Running `target/debug/hello_opensource` +Hello, world! +``` + +### 在开发过程中检查代码 + +在开发程序时,你经常会经历多次迭代。你需要确保你的程序没有编码错误并且可以正常编译。你不需要负担在每次编译时生成二进制文件的开销。Cargo 为你提供了一个 `check` 选项,该选项可以编译代码,但跳过了生成可执行文件的最后一步。首先在包目录中运行 `cargo clean`: + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +└── src +    └── main.rs + +1 directory, 3 files +``` + +现在运行 `check` 命令,查看对目录进行了哪些更改: + +``` +$ cargo check +    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.18s +``` + +该输出显示,即使在编译过程中创建了中间文件,但没有创建最终的二进制文件或可执行文件。这样可以节省一些时间,如果该包包含了数千行代码,这非常重要: + +``` +$ tree . +. +├── Cargo.lock +├── Cargo.toml +├── src +│   └── main.rs +└── target +    └── debug +        ├── build +        ├── deps +        │   ├── hello_opensource-842d9a06b2b6a19b.d +        │   └── libhello_opensource-842d9a06b2b6a19b.rmeta +        ├── examples +        └── incremental +            └── hello_opensource-1m3f8arxhgo1u +                ├── s-fkmhw18fjk-542o8d-18nukzzq7hpxe +                │   ├── dep-graph.bin +                │   ├── query-cache.bin +                │   └── work-products.bin +                └── s-fkmhw18fjk-542o8d.lock + +9 directories, 9 files +``` + +要查看你是否真的节省了时间,请对 `build` 和 `check` 命令进行计时并进行比较。首先,计时 `build` 命令: + +``` +$ time cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.40s + +real    0m0.416s +user    0m0.251s +sys     0m0.199s +``` + +在运行 `check` 命令之前清理目录: + +``` +$ cargo clean +``` + +计时 `check` 命令: + +``` +$ time cargo check +    Checking hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.15s + +real    0m0.166s +user    0m0.086s +sys     0m0.081s +``` + +显然,`check` 命令要快得多。 + +### 建立外部 Rust 包 + +到目前为止,你所做的这些都可以应用于你从互联网上获得的任何 Rust crate。你只需要下载或克隆存储库,移至包文件夹,然后运行 `build` 命令,就可以了: + +``` +git clone +cd +cargo build +``` + +### 使用 Cargo 构建优化的 Rust 程序 + +到目前为止,你已经多次运行 `build`,但是你注意到它的输出了吗?不用担心,再次构建它并密切注意: + +``` +$ cargo build +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished dev [unoptimized + debuginfo] target(s) in 0.36s +``` + +看到了每次编译后的 `[unoptimized + debuginfo]` 文本了吗?这意味着 Cargo 生成的二进制文件包含大量调试信息,并且未针对执行进行优化。开发人员经常经历开发的多次迭代,并且需要此调试信息进行分析。同样,性能并不是开发软件时的近期目标。因此,对于现在而言是没问题的。 + +但是,一旦准备好发布软件,就不再需要这些调试信息。而是需要对其进行优化以获得最佳性能。在开发的最后阶段,可以将 `--release` 标志与 `build` 一起使用。仔细看,编译后,你应该会看到 `[optimized]` 文本: + +``` +$ cargo build --release +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +    Finished release [optimized] target(s) in 0.29s +``` + +如果愿意,你可以通过这种练习来了解运行优化软件与未优化软件时节省的时间。 + +### 使用 Cargo 创建库还是二进制文件 + +任何软件程序都可以粗略地分类为独立二进制文件或库。一个独立二进制文件也许即使是当中外部库使用的,自身也是可以运行的。但是,作为一个库,是可以被另一个独立二进制文件所利用的。到目前为止,你在本教程中构建的所有程序都是独立二进制文件,因为这是 Cargo 的默认设置。 要创建一个**库**,请添加 `--lib` 选项: + +``` +$ cargo new --lib libhello +     Created library `libhello` package +``` + +这次,Cargo 不会创建 `main.rs` 文件,而是创建一个 `lib.rs` 文件。 你的库的代码应该是这样的: + +``` +$ tree . +. +└── libhello +    ├── Cargo.toml +    └── src +        └── lib.rs + +2 directories, 2 files +``` + +Cargo 就是这样的,不要奇怪,它在你的新库文件中添加了一些代码。通过移至包目录并查看文件来查找添加的内容。默认情况下,Cargo 在库文件中放置一个测试函数。 + +### 使用 Cargo 运行测试 + +Rust 为单元测试和集成测试提供了一流的支持,而 Cargo 允许你执行以下任何测试: + +``` +$ cd libhello/ + +$ cat src/lib.rs +#[cfg(test)] +mod tests { +    #[test] +    fn it_works() { +        assert_eq!(2 + 2, 4); +    } +} +``` + +Cargo 有一个方便的 `test` 命令,可以运行代码中存在的任何测试。尝试默认运行 Cargo 在库代码中放入的测试: + +``` +$ cargo test +   Compiling libhello v0.1.0 (/opensource/libhello) +    Finished test [unoptimized + debuginfo] target(s) in 0.55s +     Running target/debug/deps/libhello-d52e35bb47939653 + +running 1 test +test tests::it_works ... ok + +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out + +   Doc-tests libhello + +running 0 tests + +test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out +``` + +### 深入了解 Cargo 内部 + +你可能有兴趣了解在运行一个 Cargo 命令时它底下发生了什么。毕竟,在许多方面,Cargo 只是个封装器。要了解它在做什么,你可以将 `-v` 选项与任何 Cargo 命令一起使用,以将详细信息输出到屏幕。 + +这是使用 `-v` 选项运行 `build` 和 `clean` 的几个例子。 + +在 `build` 命令中,你可以看到这些给定的命令行选项触发了底层的 `rustc`(Rust编译器): + +``` +$ cargo build -v +   Compiling hello_opensource v0.1.0 (/opensource/hello_opensource) +     Running `rustc --edition=2018 --crate-name hello_opensource src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=147b8a0f466515dd -C extra-filename=-147b8a0f466515dd --out-dir /opensource/hello_opensource/target/debug/deps -C incremental=/opensource/hello_opensource/target/debug/incremental -L dependency=/opensource/hello_opensource/target/debug/deps` +    Finished dev [unoptimized + debuginfo] target(s) in 0.36s +``` + +而 `clean` 命令表明它只是删除包含中间文件和二进制文件的目录: + +``` +$ cargo clean -v +    Removing /opensource/hello_opensource/target +``` + +### 不要让你的技能生锈 + +要扩展你的技能,请尝试使用 Rust 和 Cargo 编写并运行一个稍微复杂的程序。很简单就可以做到:例如,尝试列出当前目录中的所有文件(可以用 9 行代码完成),或者尝试自己回显输入。小型的实践应用程序可帮助你熟悉语法以及编写和测试代码的过程。 + +本文为刚起步的 Rust 程序员提供了大量信息,以使他们可以开始入门 Cargo。但是,当你开始处理更大、更复杂的程序时,你需要对 Cargo 有更深入的了解。当你准备好迎接更多内容时,请下载并阅读 Rust 团队编写的开源《[Cargo 手册][10]》,看看你可以创造什么! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/rust-cargo + +作者:[Gaurav Kamathe][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/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers2.png?itok=idd8duC_ (Shipping containers stacked in a yard) +[2]: https://www.rust-lang.org/ +[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages +[4]: https://sh.rustup.rs/ +[5]: https://www.rust-lang.org/tools/install +[6]: https://doc.rust-lang.org/cargo/faq.html +[7]: mailto:user@mail.com +[8]: mailto:test@mail.com +[9]: http://crates.io +[10]: https://doc.rust-lang.org/cargo From 93c91e2a44ba0545b2eef72e4d30f13c83abdbfc Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Thu, 5 Mar 2020 22:15:55 +0800 Subject: [PATCH 116/207] hankchow translating --- ...rce Private Messenger That Doesn-t Need Your Phone Number.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md index bc4dece67e..15529537a0 100644 --- a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md +++ b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d4e1dd002f90e8a196c5689ed339dd9f343f436f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 00:52:25 +0800 Subject: [PATCH 117/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200306=20Three?= =?UTF-8?q?=20Ways=20to=20Exclude/Hold/Prevent=20a=20Specific=20Package=20?= =?UTF-8?q?from=20an=20apt=20Upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md --- ... a Specific Package from an apt Upgrade.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md diff --git a/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md b/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md new file mode 100644 index 0000000000..b4e47fcc36 --- /dev/null +++ b/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md @@ -0,0 +1,190 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade) +[#]: via: (https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade +====== + +Sometimes you may accidentally update packages that are not updated due to some application dependency. + +This is always the case during the entire system update or automatic package upgrade process. + +If this happens, it may break the application function. + +This creates a serious problem and you need to spend a lot of time fixing the problem. + +See the following article if you want to **[Exclude Specific Packages from Yum Update][1]** + +How to avoid this kind of situation? + +How do I exclude packages from apt-get update? + +Yes, it can be done using the following three methods on Debian and Ubuntu systems. + + * **[apt-mark Command][2]** + * **[dpkg Command][3]** + * aptitude Command + + + +We will show in detail each. + +### Method-1: How to Exclude Packages Update on Debian/Ubuntu System Using the apt-mark Command + +The apt-mark is used to mark/unmark a package as being automatically installed. + +The Hold option is used to mark a package as blocked, which prevents the package from being automatically installed, upgraded, or removed. + +The unhold option is used to cancel a previously set hold on a package to allow all actions to be repeated. + +Run the following command to hold the given package using the **apt-mark** command. + +``` +$ sudo apt-mark hold nano +nano set on hold. +``` + +Once you have hold some packages, run the following apt-mark command to view them. + +``` +$ sudo apt-mark showhold +nano +``` + +This will show that the **“nano”** package will not be upgraded when you perform a full system update. + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + nano +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +Run the following command to unhold the “nano” package using the apt-mark command. + +``` +$ sudo apt-mark unhold nano +Canceled hold on nano. +``` + +### Method-2: How to Exclude Packages Update on Debian/Ubuntu System Using the dpkg Command + +The dpkg command is a CLI tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg is aptitude. + +Run the following command to block a given package using the dpkg command. + +**Syntax:** + +``` +$ echo "package_name hold" | sudo dpkg --set-selections +``` + +Run the below dpkg command to hold the **“apache2”** package. + +``` +$ echo "apache2 hold" | sudo dpkg --set-selections +``` + +Once you have hold some packages, run the following command to view them. + +``` +$ sudo dpkg --get-selections | grep "hold" +apache2 hold +``` + +It will show that the **“apache2”** package will not be upgraded when you perform a full system update. + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + apache2 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +Run the following command to unhold the given package using the dpkg command. + +**Syntax:** + +``` +$ echo "package_name install" | sudo dpkg --set-selections +``` + +Run the following command to unhold the “apache2” package using the dpkg command. + +``` +$ echo "apache2 install" | sudo dpkg --set-selections +``` + +### Method-3: How to Exclude Packages Update on Debian/Ubuntu System Using the aptitude Command + +The aptitude command is a text-based package management interface to the Debian and it’s derivative. + +It allows the user to view a list of packages and to perform package management tasks such as installing, upgrading, and removing packages. Actions may be performed from a visual interface or from the command-line. + +Run the following command to hold the given package using the aptitude command. + +``` +$ sudo aptitude hold python3 +``` + +Once you have hold some packages, run the following aptitude command to view them. + +``` +$ sudo dpkg --get-selections | grep "hold" +or +$ sudo apt-mark showhold + +python3 +``` + +This will show that the **“python3”** package will not be upgraded when you perform a full system update. + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + python3 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +Run the following command to unhold the **“python3”** package using the apt-mark command. + +``` +$ sudo aptitude unhold python3 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/ + +作者:[Magesh Maruthamuthu][a] +选题:[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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/redhat-centos-yum-update-exclude-specific-packages/ +[2]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ From a81e47864ae9aadd7e554f4ffa6ac0cf10e29c10 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 00:54:20 +0800 Subject: [PATCH 118/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200306=20What?= =?UTF-8?q?=20is=20Linux=20and=20Why=20There=20are=20100=E2=80=99s=20of=20?= =?UTF-8?q?Linux=20Distributions=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md --- ... There are 100-s of Linux Distributions.md | 193 ++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md diff --git a/sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md b/sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md new file mode 100644 index 0000000000..be6a45e211 --- /dev/null +++ b/sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md @@ -0,0 +1,193 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is Linux and Why There are 100’s of Linux Distributions?) +[#]: via: (https://itsfoss.com/what-is-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +What is Linux and Why There are 100’s of Linux Distributions? +====== + +When you are just starting with Linux, it’s easy to get overwhelmed. + +You probably know only Windows and now you want to use Linux because you read that [Linux is better than Windows][1] as it is more secure and you don’t have to buy a license to use Linux. + +But then when you go about downloading and installing Linux, you learn that Linux is not a single entity. There are [Ubuntu][2], [Fedora][3], [Linux Mint][4], elementary and hundreds of such ‘Linux variants’. The trouble is that some of them look just like the other. + +If that’s the case, why are there multiple of those Linux operating systems? And then you also learn that Linux is just a kernel not an operating system. + +![Too Many Linux!][5] + +It gets messy. And you may feel like pulling out your hair. For a person who has a receding hairline, I would like you to keep your hair intact by explaining things in a way you could easily understand. + +I am going to take an analogy and explain why Linux is just a kernel, why there are hundreds of Linux and why, despite looking similar, they are different. + +The explanation here may not be considered good enough for an answer in an exam or interview but it should give you a better understanding of the topic. + +Apology in advance! + +My analogy may not be entirely correct from mechanical point of view as well. I am not knowledgeable about engines, cars and other related mechanical stuff. +But in my experience, I have noticed that this analogy helps people clearly understand the concept of Linux and operating system. +Also, I have used the term Linux OS instead of Linux distribution deliberately so that newcomers don’t start wondering about distribution. + +### Linux is just a kernel + +_**Linux is not an operating system, it’s just a kernel.**_ + +The statement is entirely true. But how do you understand it. If you look into books, you’ll find Linux kernel structure described like this: + +![Linux Kernel Structure][6] + +There is absolutely correct, however, let’s take a different approach. Think of operating systems as vehicles, any kind of vehicle be it motorbikes, cars or trucks. + +What is at the core of a vehicle? An engine. + +Think of kernel as the engine. It’s an essential part of the vehicle and you cannot use a vehicle without the engine. + +![The Operating System Analogy][7] + +But you cannot drive an engine, can you? You need a lot of other stuff to interact with the engine and drive the vehicle. You need wheels, steering, gears, clutch, brakes and more to drive a vehicle on top of that engine. + +Similarly, you cannot use a kernel on its own. You need lots of tool to interact with the kernel and use the operating system. These stuff could be shell, commands, graphical interface (also called desktop environments) etc. + +This makes sense, right? Now that you understand this analogy, let’s take it further so that you understand the rest of it. + +Windows and other operating systems have kernel too + +Kernel is not something exclusive to Linux. You may not have realized but Windows, macOS and other operating systems have a kernel underneath as well. +Microsoft Windows operating systems are based on [Windows NT kernel][8]. Apple’s macOS is based on the [XNU kernel][9]. + +### Think of operating systems as vehicles + +Think of Microsoft as an automobile company that makes a general purpose car (Windows operating system) that is hugely popular and dominates the car market. They use their own patented engine that no one else can use. But these ‘Microsoft cars’ do not offer scope of customization. You cannot modify the engine on your own. + +Now come to ‘Apple automobile’. They offer shiny looking, luxury cars at an expensive price. If you got a problem, they have a premium support system where they might just replace the car. + +Now comes Linux. Remember, Linux is just an engine (kernel). But this ‘Linux engine’ is not patented and thus anyone is free to modify and build cars (desktop operating system), bikes (small embed system in your toys, tvs etc), trucks (servers) or jet-planes ([supercomputers][10]) on top of it. In real world, no such engine exists but accept it for the sake of this analogy. + +![][11] + + * kernel = engine + * Linux kernel = specific type of engine + * desktop operating systems = cars + * server operating systems = heavy trucks + * embed systems = motor-bikes + * desktop environment = body of the vehicle along with interiors (dashboard and all) + * themes and icons = paint job, rim job and other customization + * applications = accessories you put for specific purpose (like music system) + + + +### Why there are so many Linux OS/distributions? Why some look similar? + +Why there are so many cars? Because there are several vehicle manufacturers using the ‘Linux engine’ and each of them have so many cars of different type and for different purposes. + +Since ‘Linux engine’ is free to use and modify, anyone can use it to build a vehicle on top of it. + +This is why Ubuntu, Debian, Fedora, SUSE, [Manjaro][12] and many other **Linux-based operating systems (also called Linux distributions or Linux distros)** exist. + +You might also have noticed that these Linux operating systems offer different variants but they look similar. I mean look at Fedora’s default GNOME version and Debian’s GNOME version. They do look the same, don’t they? + +![Fedora GNOME vs Debian GNOME: Virtually No Visual Difference][13] + +The component that gives the look and feel in a Linux OS is called [desktop environment][14]. In our analogy here, you can think of it as a combination of outer body and matching interiors. This is what provides the look and feel to your vehicle, does it not? + +It’s from the exterior that you can identify the cars into category of sedan, SUV, hatchback, station wagon, convertible, minivan, van, compact car, 4×4 etc. + +But these ‘type of cars’ are not exclusive to a single automobile company. Ford offers SUV, compact cars, vans etc and so do other companies like General Motors, Toyota. + +![Vehicles of same type look similar even if they are from different automobile companies][15] + +Similarly, distributions (Linux OSes) like Fedora, Ubuntu, Debian, Manjaro etc also offer different variants in the form of GNOME, KDE, Cinnamon, MATE and other [desktop environments][16]. + +Ford’s SUV may look similar to Toyota’s or Renault’s SUV. Fedora’s GNOME version may look similar to Manjaro or Debian’s GNOME version. + +#### Some type of cars consume more fuel, some desktop environments need more RAM + +You probably understand the ‘usefulness’ of different types of cars. Compact cars are good for driving in the cities, vans are good for long trip with family, 4×4 are good for adventures in jungles and other rough terrain. A SUV may look good and feel comfortable for sitting but it consumes more fuel than a compact car that might not be comfortable to sit in. + +Similarly, desktop environments (GNOME, MATE, KDE, Xfce etc) also serve some purpose other than just providing the looks to your Linux operating system. + +GNOME gives a modern looking desktop but it consumes more RAM and thus require that your computer has more than 4 GB of RAM. Xfce on the other hand may look old/vintage but it can run on systems with 1 GB of RAM. + +#### Difference between getting desktop environment from distribution and installing on your own + +As you start using Linux, you’ll also come across suggestions that you can easily install other desktop environments on your current system. + +Remember that Linux is a free world. You are free to modify the engine, customize the looks on your own, if you have the knowledge/experience or if you are an enthusiastic learner. + +Think of it as customizing cars. You may modify a Hundai i20 to look like Suzuki Swift Dzire. But it might not be the same as using a Swift Dzire. + +When you are inside the i20 modified to look like Swiftz Dzire, you’ll find that it may not have the same experience from the inside. Dashboard is different, seats are different. You may also notice that the exterior doesn’t fit the same on i20’s body. + +The same goes for switching desktop environments. You will find that you don’t have the same set of apps in Ubuntu that you should be getting in Mint Cinnamon. Few apps will look out of place. Not to mention that you may find a few things broken, such as network manager indicator missing etc. + +Of course, you can put time, effort and skills to make Hundai i20 look as much like Swift Dzire as possible but you may feel like getting Suzuki Swift Dzire is a better idea in the first place. + +This is the reason why installing Ubuntu MATE is better than installing Ubuntu (GNOME version) and then [installing MATE desktop][17] on it. + +### Linux operating systems also differ in the way they handle applications + +Another major criteria on which the Linux operating systems differ from each other is the package management. + +Package management is basically how you get new software and updates in your systems. It’s up to your Linux distribution/OS to provide the security and maintenance updates. Your Linux OS also provides the means of installing new software on your system. + +Some Linux OS provides all the new software version immediately after their release while some take time to test them for your own good. Some Linux OS (like Ubuntu) provides easier way of installing a new software while you may find it complicated in some other Linux OS (like [Gentoo][18]). + +Keeping the line of our analogy, consider installing software as adding accessories to your vehicle. + +Suppose you have to install a music system in your car. You may have two options here. Your car is designed in such a way that you just insert the music player, you hear the click sound and you know it’s installed. The second option could be to get a screwdriver and then fix the music player on screws. + +Most people would prefer the hassle-free click lock installing system. Some people might take matter (and screwdriver) into their own hands. + +If an automobile company provides scope for installing lots of accessories in click-lock fashion in their cars, they will be preferred, won’t they? + +This is why Linux distributions like Ubuntu have a more users because they have a huge collection of software that can be easily installed in matter of clicks. + +### Conclusion + +Before I conclude this article, I’ll also like to talk about support that plays a significant role in choosing a Linux OS. For your car, you would like to have its official service center or other garages that service the automobile brand you own, don’t you? If the automobile company is popular, naturally, it will have more and more garages providing services. + +The same goes for Linux as well. For a popular Linux OS like Ubuntu, you have some official forums to seek support and a good number of websites and forums providing troubleshooting tips to fix your problem. + +Again, I know this is not a perfect analogy but this helps understand the things slightly better. + +If you are absolutely new to Linux, did this article made things clear for you or you are more confused than before? + +If you already know Linux, how would you explain Linux to someone from non-technical background? + +Your suggestions and feedback is welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/what-is-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-better-than-windows/ +[2]: https://ubuntu.com/ +[3]: https://getfedora.org/ +[4]: https://linuxmint.com/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/too-many-linux-choices.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Linux_Kernel_structure.png?ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/operating_system_analogy.png?ssl=1 +[8]: https://en.wikipedia.org/wiki/Architecture_of_Windows_NT +[9]: https://en.wikipedia.org/wiki/XNU +[10]: https://itsfoss.com/linux-runs-top-supercomputers/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/linux-kernel-as-engine.png?ssl=1 +[12]: https://manjaro.org/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/fedora-gnome-vs-debian-gnome.jpg?ssl=1 +[14]: https://itsfoss.com/glossary/desktop-environment/ +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/linux_suv_analogy.jpg?ssl=1 +[16]: https://itsfoss.com/best-linux-desktop-environments/ +[17]: https://itsfoss.com/install-mate-desktop-ubuntu/ +[18]: https://www.gentoo.org/ From 8b898f553e50b5f67e627f6a127c0dc7aeb8d334 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 00:56:58 +0800 Subject: [PATCH 119/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200305=205=20pr?= =?UTF-8?q?oductivity=20apps=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200305 5 productivity apps for Linux.md --- .../20200305 5 productivity apps for Linux.md | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 sources/tech/20200305 5 productivity apps for Linux.md diff --git a/sources/tech/20200305 5 productivity apps for Linux.md b/sources/tech/20200305 5 productivity apps for Linux.md new file mode 100644 index 0000000000..3e7423dc59 --- /dev/null +++ b/sources/tech/20200305 5 productivity apps for Linux.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 productivity apps for Linux) +[#]: via: (https://opensource.com/article/20/3/productivity-apps-linux-elementary) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +5 productivity apps for Linux +====== +Get organized and accomplish more with these five productivity apps for +the Elementary Linux desktop. +![Person drinking a hat drink at the computer][1] + +I've had a soft spot for [Elementary OS][2] since I first encountered it in 2013. A lot of that has to do with the distribution being very clean and simple. + +Since 2013, I've recommended Elementary to people who I've helped [transition to Linux][3] from other operating systems. Some have stuck with it. Some who moved on to other Linux distributions told me that Elementary helped smooth the transition and gave them more confidence using Linux. + +Like the distribution itself, many of the applications created specifically for Elementary OS are simple, clean, and useful. They can help boost your day-to-day productivity, too. + +### About "pay-what-you-want" apps + +Some apps in the Elementary AppCenter ask you to pay what you can. You're not obliged to pay to the full amount a developer asks for (or pay anything, for that matter). However, any money that changes hands goes to support the development of those apps. + +Three of the applications in this article—Quilter, Notes-up, and Envelope—are pay-what-you-want. If you find an app useful, I encourage you to send some money the developer's way. + +### Envelope + +Managing your budget should be simple. More than a few people, though, struggle with the task. That's where [Envelope][4] can help. While Envelope doesn't pack the features of something like [GnuCash][5], it's good enough for most of us. + +The app is built around the [envelope system][6] of personal and household budgeting. The first time you launch Envelope, you need to set up an account. You can do that manually, or you can import a [QIF][7] file containing financial information from another program. + +![Adding an account in Envelope][8] + +Either way, Envelope offers a set of categories (your envelopes). Add or delete categories as you see fit—for example, I don't own a car, so I deleted the Fuel category. + +From there, add transactions. Those can be your expenses or your income. Or both. + +![Entering a transaction in Envelope][9] + +Envelope gives you an overview of your spending and income. To get a more focused view of your budget, you can report on the current or previous month or a specific range of dates. + +### Notes-Up + +[Notes-Up][10]'s look and feel are reminiscent of note-taking tools like [Standard Notes][11], Simplenote, and the macOS Notes app. If you use any of them, switching to Notes-Up will be smooth and painless. Regardless, Notes-Up is easy to learn and use. + +![Notes-Up][12] + +Create a note and start typing. Notes-Up supports Markdown, making it easy to add formatting to your notes. + +![Taking notes in Notes-Up][13] + +If your Markdown is rusty, you can click the buttons on the toolbar to add formatting like lists; bold, italics, and strikethrough; code blocks; images; and more. You can also export your notes as PDF or Markdown files. + +Use Notes-Up for a while, and you'll wind up with a long list of notes. Organize them using _notebooks_. You can, for example, create personal, school, and work notebooks. On top of that, Notes-Up enables you to create sub-notebooks. Under my notebook for Opensource.com, for example, I have sub-notebooks for articles and the news roundups I curate. + +Notebooks not your thing? Then use tags to add keywords to your notes to make them easier to sort. + +### Yishu + +I do as much of my work as I can in [plain text][14]. That includes my task list. For that, I turn to a handy command-line application called [Todo.txt][15]. + +If you aren't comfortable working at the command line, then [Yishu][16] is for you. It has Todo.txt's key features but graphically on the desktop. + +![Yishu][17] + +When you first fire up Yishu, it asks you to open an existing Todo.txt file. If you have one, open it. Otherwise, create a task. That also creates a new file for your tasks. + +![Adding a task in Yishu][18] + +Your options are limited: a description of the task and a priority. You can also add a due date in the format _YYYY-MM-DD_—for example, _2020-02-17_. + +When you click **OK**, Yishu saves the file Todo.txt to your **/home** folder. That might not be where you want to store your tasks. You can tell Yishu to use another folder in its preferences. + +### Reminduck + +Chances are, your notifications and reminders are jarring. A piercing buzz, an annoying beep, a text box that appears when you least expect it. Why not add a bit of [calm][19] and a bit of whimsy to your reminders—with a duck? + +That's the idea behind [Reminduck][20]. It's a simple and fun way to tell yourself it's time to do, well, anything. + +Fire up the app and create a reminder. You can add a description, date, and time for the reminder to appear, and you can set it to repeat. Reminders can repeat after a number of minutes that you set or at specific times every day, week, or month. + +![Reminduck][21] + +You can set up more than one reminder. Reminduck organizes your reminders, and you can edit or delete them. + +![Reminduck reminders][22] + +When the reminder is triggered, a little message pops out of the notification area on the desktop along with a soft alert and an icon of a smiling duck. + +![Reminduck notification][23] + +### Quilter + +It's easy enough to write with [Markdown][24] in a plain old text editor. Some folks, though, prefer to work with a dedicated Markdown editor. On the Elementary OS desktop, one option is [Quilter][25]. + +![Quilter][26] + +Quilter is pretty basic. There's no toolbar to insert formatting; you have to add Markdown by hand. On the other hand, Quilter displays a running word count and an estimate of how long it will take to read what you're writing. + +![Quilter][27] + +The editor's options are few. There's a preview mode, and you can export your documents to PDF or HTML. The result of an export has the same look as a preview. That's not a bad thing. + +Quilter's other options include the ability to change the line spacing and margins, set the editor's font, as well as enable syntax highlighting and spell checking. It also has a mode that you can use to focus on a single line or a single paragraph while you're writing. + +### Final thoughts + +Sometimes, the best tools to boost your productivity are simple ones. Applications like the five above focus on doing one thing and doing it well. + +Envelope, Notes-Up, Yishu, Reminduck, and Quilter won't appeal to everyone. But if you use Elementary OS, give them a try. They can help you keep on track and do what you need to do. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/productivity-apps-linux-elementary + +作者:[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/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://elementary.io +[3]: https://opensource.com/article/18/12/help-non-techies +[4]: https://nlaplante.github.io/envelope/ +[5]: https://opensource.com/article/20/2/gnucash +[6]: https://en.wikipedia.org/wiki/Envelope_system +[7]: https://en.wikipedia.org/wiki/Quicken_Interchange_Format +[8]: https://opensource.com/sites/default/files/uploads/envelope-add-account.png (Adding an account in Envelope) +[9]: https://opensource.com/sites/default/files/uploads/envelope-entering-transaction.png (Entering a transaction in Envelope) +[10]: https://appcenter.elementary.io/com.github.philip-scott.notes-up/ +[11]: https://opensource.com/article/18/12/taking-notes-standard-notes +[12]: https://opensource.com/sites/default/files/uploads/notes-up-main-window.png (Notes-Up) +[13]: https://opensource.com/sites/default/files/uploads/notes-up-taking-note.png (Taking notes in Notes-Up) +[14]: https://plaintextproject.online +[15]: https://opensource.com/article/20/1/open-source-to-do-list +[16]: https://appcenter.elementary.io/com.github.lainsce.yishu/ +[17]: https://opensource.com/sites/default/files/uploads/yishu-task-list.png (Yishu) +[18]: https://opensource.com/sites/default/files/uploads/yishu-add-task.png (Adding a task in Yishu) +[19]: https://weeklymusings.net/weekly-musings-025 +[20]: https://appcenter.elementary.io/com.github.matfantinel.reminduck/ +[21]: https://opensource.com/sites/default/files/uploads/reminduck.png (Reminduck) +[22]: https://opensource.com/sites/default/files/uploads/remiunduck-reminders-list.png (Reminduck reminders) +[23]: https://opensource.com/sites/default/files/uploads/reminduck-notification.png (Reminduck notification) +[24]: https://opensource.com/article/19/8/markdown-beginners-cheat-sheet +[25]: https://appcenter.elementary.io/com.github.lainsce.quilter/ +[26]: https://opensource.com/sites/default/files/uploads/quilter.png (Quilter) +[27]: https://opensource.com/sites/default/files/uploads/quilter-editing.png (Quilter) From 3fd33c8ec7b9fca4b13f160daa6b00415a8e7960 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 01:03:53 +0800 Subject: [PATCH 120/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200305=20Report?= =?UTF-8?q?:=20Most=20IoT=20transactions=20are=20not=20secure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200305 Report- Most IoT transactions are not secure.md --- ...t- Most IoT transactions are not secure.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20200305 Report- Most IoT transactions are not secure.md diff --git a/sources/talk/20200305 Report- Most IoT transactions are not secure.md b/sources/talk/20200305 Report- Most IoT transactions are not secure.md new file mode 100644 index 0000000000..96a2add2d7 --- /dev/null +++ b/sources/talk/20200305 Report- Most IoT transactions are not secure.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Report: Most IoT transactions are not secure) +[#]: via: (https://www.networkworld.com/article/3530476/report-most-iot-transactions-are-not-secure.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Report: Most IoT transactions are not secure +====== +Data gathered by security provider Zscaler shows that not only are most internet-of-things transactions unsecured, they are also unauthorized as IoT creeps in as shadow-IT devices. +Iot + +The majority of [Internet of Things (IoT)][1] transactions don’t use even basic security, and there is a great deal of unauthorized IoT taking place inside the perimeter of enterprise firewalls thanks to shadow IT, a new study finds. + +Security vendor Zscaler analyzed nearly 500 million IoT transactions from more than 2,000 organizations over a two-week period. [The survey][2] found 553 different IoT devices from more than 200 different manufacturers, many of which had their security turned off. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +The study was done on Zscaler’s own Internet Access security service. It found the rate of IoT growth to be explosive: When it first started monitoring IoT traffic in May 2019, IoT traffic generated by its enterprise customer base was 56 million IoT transactions per month. By February 2020, that number had soared to 33 million transactions _per day_, or one billion IoT transactions per month, a 1,500% increase. + +Zscaler is a bit generous in what it defines as enterprise IoT devices, from devices such as data-collection terminals, digital signage media players, industrial control devices, medical devices, to decidedly non-business devices like digital home assistants, TV set-top boxes, IP cameras, smart home devices, smart TVs, smart watches and even automotive multimedia systems. + +“What this tells us is that employees inside the office might be checking their nanny cam over the corporate network. Or using their Apple Watch to look at email. Or working from home, connected to the enterprise network, and periodically checking the home security system or accessing media devices,” the company said in its report. + +Which is typical, to be honest, and let (s)he who is without sin cast the first stone in that regard. What’s troubling is that roughly 83% of IoT-based transactions are happening over plaintext channels, while only 17% are using [SSL][4]. The use of plaintext is risky, opening traffic to packet sniffing, eavesdropping, man-in-the-middle attacks and other exploits. + +And there are a lot of exploits. Zscaler said it detects about 14,000 IoT-based malware exploits per month, a seven-fold increase over the previous year. + +“Folks can keep their smart watches, smart closets, and whatever else they think is making them smart. Banning devices is not going to be the answer here. The answer is changing up the narrative on how we think about IoT devices from a security and risk standpoint, and what expectations we put on manufacturers to increase the security posture of these devices,” wrote Deepen Desai, Zscaler’s vice president of security research in a [blog post][5]. + +Desai said the solution is “taking a [zero-trust][6] mentality.” It may be a buzzword but, “it’s about security people not trusting any person or device to touch the network—that is, until you know who the user is, what the device is, and whether that user and device are allowed to access the applications they’re trying to reach.” + +Naturally Zscaler sells such a solution, but he makes a valid point. This is an ages-old problem I have seen time and again; a hot new technology comes along, everyone rushes to embrace it, then they think about securing it later. IoT is no different. + +Whatever your device, at least go into the settings and turn on SSL. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3530476/report-most-iot-transactions-are-not-secure.html + +作者:[Andy Patrizio][a] +选题:[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/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[2]: https://info.zscaler.com/resources-industry-iot-in-the-enterprise +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/2303073/lan-wan-what-is-transport-layer-security-protocol.html +[5]: https://www.zscaler.com/blogs/corporate/shining-light-shadow-iot-protect-your-organization +[6]: https://www.networkworld.com/article/3487720/the-vpn-is-dying-long-live-zero-trust.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 4e8e207047dbf849e8af9952a0f77823c91cbffc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 6 Mar 2020 01:09:48 +0800 Subject: [PATCH 121/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200305=20Chines?= =?UTF-8?q?e=20auto=20giant=20Geely=20plans=20a=20private=20satellite=20ne?= =?UTF-8?q?twork=20to=20support=20autonomous=20vehicles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md --- ... network to support autonomous vehicles.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md diff --git a/sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md b/sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md new file mode 100644 index 0000000000..8bf990573e --- /dev/null +++ b/sources/talk/20200305 Chinese auto giant Geely plans a private satellite network to support autonomous vehicles.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Chinese auto giant Geely plans a private satellite network to support autonomous vehicles) +[#]: via: (https://www.networkworld.com/article/3530336/chinese-auto-giant-geely-plans-a-private-satellite-network-to-support-autonomous-vehicles.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Chinese auto giant Geely plans a private satellite network to support autonomous vehicles +====== +Geely is developing a satellite network to provide high-bandwidth wireless needed by on-board applications in self-driving vehicles. +Olivier Le Moal / Getty Images + +What does a large automaker that’s morphing into a mobile-technology company and heavily investing in autonomous vehicles need to add to its ecosystem? Probably connectivity, and that’s likely why Chinese car giant Geely says it will be building its own satellite data network. + +A need for “highly accurate, autonomous driving solutions,” is part of what’s driving the strategy, the company says in a [press release][1]. Geely – the largest car maker in China and whose assets include Volvo and a stake in Lotus – has begun building a test facility in Taizhou City where it will develop satellite models, the company says. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +“The creation of a truly smart, three-dimensional mobility ecosystem,” as the company describes its Geespace project, will include precise navigation, cloud computing and high-speed Internet functions. Geely is investing $326 million in the project [according to Reuters][3], citing a statement from the company. + +Over-the-air updating of vehicle software is a principal reason data networks will become prevalent in automobile technology. Historically, car companies haven’t worried much about the speedy updating of end-user’s systems, in part because they’ve liked getting customers back into the dealership to upsell service options and pitch new cars. A leisurely software patch while the customer hangs around drinking warm coffee and watching daytime soaps suits that purpose. However, autonomous cars are a different story: The safety of self-driving cars can’t tolerate software vulnerabilities. + +Control over vehicle positioning also comes into play. Knowing where the car is and where obstacles are is more important than in traditional vehicles. Lane-change and accident avoidance, for example, are autonomous-vehicle features that require high levels of accuracy. + +“The Geespace low-orbit satellite network will offer much higher centimeter-accurate precision,” Geely says, comparing its proposed constellation with the U.S. government-owned Global Positioning System. + +Data processing, artificial intelligence and infotainment onboard the vehicles all need fat networks, too. Former Intel CEO Brian Krzanich [said at a talk I attended a few years ago][4] that he thought cars would soon create 4,000 GB of data per hour of driving because of the number of sensors, such as cameras, that they’ll be equipped with. + +[][5] + +The Geely private satellite network is the first of its kind for an industrial use and joins [a trend in private wireless networking][6]. Private, terrestrial 5G networks and private LTE networks allow companies to control their own data and uptime, rather than relying on service providers. Mercedes-Benz is reportedly working on a private 5G network for privacy and security. + +“As vehicles become more connected and integrated into the Internet of Things ecosystem, the demand for data has grown exponentially,” Geely says. + +Geely will begin launching the Geespace satellites by the end of 2020. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3530336/chinese-auto-giant-geely-plans-a-private-satellite-network-to-support-autonomous-vehicles.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]: http://zgh.com/media-center/news/2020-03-03-1/?lang=en +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.reuters.com/article/geely-china-satellite-autonomous/chinas-geely-invests-326-mln-to-build-satellites-for-autonomous-cars-idUSL4N2AV45H +[4]: https://www.networkworld.com/article/3147892/one-autonomous-car-will-use-4000-gb-of-dataday.html +[5]: 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) +[6]: https://www.networkworld.com/article/3319176/private-5g-networks-are-coming.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 3dbcc83a451c69459181255ad043942a3ac4c43e Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 6 Mar 2020 08:03:03 +0800 Subject: [PATCH 122/207] translating --- ...between uppercase and lowercase on the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md index a2819e3ff7..b830a88c9d 100644 --- a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md +++ b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From be4d9c35dd6f1be786bdbfecadf6f342a6bec1ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 09:32:59 +0800 Subject: [PATCH 123/207] PRF @geekpi --- ...oud with Fedora 31 and Nextcloud Server.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md index c5cd454f7d..7c7db7b186 100644 --- a/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md +++ b/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Build your own cloud with Fedora 31 and Nextcloud Server) @@ -38,7 +38,7 @@ # systemctl enable --now httpd ``` -接下来,允许 _HTTP_ 流量穿过防火墙: +接下来,允许 HTTP 流量穿过防火墙: ``` # firewall-cmd --permanent --add-service=http @@ -57,7 +57,7 @@ # systemctl enable --now mariadb ``` -现在,MariaDB 正在运行,你可以运行 _mysql_secure_installation_ 命令来保护它: +现在,MariaDB 正在运行,你可以运行 `mysql_secure_installation` 命令来保护它: ``` # mysql_secure_installation @@ -148,14 +148,14 @@ Thanks for using MariaDB! # unzip nextcloud-17.0.2.zip -d /var/www/html/ ``` -接下来,创建一个数据文件夹,并授予 Apache 对 _nextcloud_ 目录树的读写访问权限: +接下来,创建一个数据文件夹,并授予 Apache 对 `nextcloud` 目录树的读写访问权限: ``` # mkdir /var/www/html/nextcloud/data # chown -R apache:apache /var/www/html/nextcloud ``` -SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示,但在 nexcloud 安装中还有很多其他的命令,发布在这里:[Nextcloud SELinux 配置][6] +SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示,但在 nexcloud 安装中还有很多其他的命令,发布在这里:[Nextcloud SELinux 配置][6]。 ``` # semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?' @@ -172,7 +172,7 @@ SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示 #### 使用 Web 界面 -在你喜欢的浏览器中,访问 __ 并输入字段: +在你喜欢的浏览器中,访问 并输入字段: ![][7] @@ -186,14 +186,12 @@ SELinux 必须配置为可与 Nextcloud 一起使用。基本命令如下所示 ### 最后几点 - * 我使用的是 _http_ 协议,但是 Nextcloud 也可以在 _https_ 上运行。我可能会在以后的文章中写一篇有关保护 Nextcloud 的文章。 -  * 我禁用了 SELinux,但是如果配置它,你的服务器将更加安全。 -  * Nextcloud 的建议 PHP 内存限制为 512M。要更改它,请编辑 _/etc/php.ini_ 配置文件中的 _memory_limit_ 变量,然后重新启动 _httpd_ 服务。 -  * 默认情况下,只能使用 __ URL 访问 Web 界面。如果要允许使用其他域名访问,[你可编辑 _/var/www/html/nextcloud/config/config.php_ 来进行此操作][8]。\* 字符可用于绕过域名限制,并允许任何解析为服务器 IP 的 URL 访问。 +* 我使用的是 http 协议,但是 Nextcloud 也可以在 https 上运行。我可能会在以后的文章中写一篇有关保护 Nextcloud 的文章。 +* 我禁用了 SELinux,但是如果配置它,你的服务器将更加安全。 +* Nextcloud 的建议 PHP 内存限制为 512M。要更改它,请编辑 `/etc/php.ini` 配置文件中的 `memory_limit` 变量,然后重新启动 httpd 服务。 +* 默认情况下,只能使用 URL 访问 Web 界面。如果要允许使用其他域名访问,[你可编辑 /var/www/html/nextcloud/config/config.php 来进行此操作][8]。`*` 字符可用于绕过域名限制,并允许任何解析为服务器 IP 的 URL 访问。 - - -``` + ``` 'trusted_domains' => array ( 0 => 'localhost', @@ -208,7 +206,7 @@ via: https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextclou 作者:[storyteller][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bd5d2583e0098ca744e4ef5d160515cc1e46d998 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 09:33:38 +0800 Subject: [PATCH 124/207] PUB @geekpi https://linux.cn/article-11964-1.html --- ...uild your own cloud with Fedora 31 and Nextcloud Server.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md (99%) diff --git a/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md b/published/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md similarity index 99% rename from translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md rename to published/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md index 7c7db7b186..295e111690 100644 --- a/translated/tech/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md +++ b/published/20200127 Build your own cloud with Fedora 31 and Nextcloud Server.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11964-1.html) [#]: subject: (Build your own cloud with Fedora 31 and Nextcloud Server) [#]: via: (https://fedoramagazine.org/build-your-own-cloud-with-fedora-31-and-nextcloud-server/) [#]: author: (storyteller https://fedoramagazine.org/author/storyteller/) From 4bc2d382657d6716756c220b52d4f40e06f7e015 Mon Sep 17 00:00:00 2001 From: messon007 <306809057@qq.com> Date: Fri, 6 Mar 2020 10:26:06 +0800 Subject: [PATCH 125/207] Update 20200204 DevOps vs Agile- What-s the difference.md Translating by messon007 --- sources/tech/20200204 DevOps vs Agile- What-s the difference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200204 DevOps vs Agile- What-s the difference.md b/sources/tech/20200204 DevOps vs Agile- What-s the difference.md index ec49c22c92..d83e9c17f7 100644 --- a/sources/tech/20200204 DevOps vs Agile- What-s the difference.md +++ b/sources/tech/20200204 DevOps vs Agile- What-s the difference.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (messon007) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eb44cdacedfb210887e2e4395945f399761da29c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 6 Mar 2020 10:47:38 +0800 Subject: [PATCH 126/207] Rename sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md to sources/talk/20200306 What is Linux and Why There are 100-s of Linux Distributions.md --- ...hat is Linux and Why There are 100-s of Linux Distributions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200306 What is Linux and Why There are 100-s of Linux Distributions.md (100%) diff --git a/sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md b/sources/talk/20200306 What is Linux and Why There are 100-s of Linux Distributions.md similarity index 100% rename from sources/tech/20200306 What is Linux and Why There are 100-s of Linux Distributions.md rename to sources/talk/20200306 What is Linux and Why There are 100-s of Linux Distributions.md From 64b6658edee78c40545a7da5be45aeb5531950a9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 6 Mar 2020 11:38:08 +0800 Subject: [PATCH 127/207] translated --- .../20200302 Install GNU Emacs on Windows.md | 102 ------------------ .../20200302 Install GNU Emacs on Windows.md | 99 +++++++++++++++++ 2 files changed, 99 insertions(+), 102 deletions(-) delete mode 100644 sources/tech/20200302 Install GNU Emacs on Windows.md create mode 100644 translated/tech/20200302 Install GNU Emacs on Windows.md diff --git a/sources/tech/20200302 Install GNU Emacs on Windows.md b/sources/tech/20200302 Install GNU Emacs on Windows.md deleted file mode 100644 index 7ba0e633bb..0000000000 --- a/sources/tech/20200302 Install GNU Emacs on Windows.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Install GNU Emacs on Windows) -[#]: via: (https://opensource.com/article/20/3/emacs-windows) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Install GNU Emacs on Windows -====== -Even if your operating system is closed source, you can still use this -popular open source text editor. -![Tall building with windows][1] - -GNU Emacs is a popular text editor designed for programmers of all sorts. Because it was developed on Unix and is widely used on Linux (and shipped with macOS), people sometimes don't realize that it's also available for Microsoft Windows. You don't need to be an experienced or full-time programmer to make use of Emacs, either. You can download and install Emacs with just a few clicks, and this article shows you how. - -You can install Windows manually or with a package manager, like [Chocolatey][2]. - -### 7-zip - -If you haven't already installed 7-zip for Windows, you should do that first. [7-zip][3] is an open source archive utility with the ability to create and extract ZIP, 7z, TAR, XZ, BZIP2, and GZIP (and more) files. It's an invaluable tool for Windows users. - -After installing 7-zip, you have new 7-zip archive options in your right-click menu when browsing files in Windows Explorer. - -### Powershell and Chocolatey - -To install GNU Emacs on Windows using Chocolatey: - - -``` -`PS> choco install emacs-full` -``` - -Once it has installed, launch Emacs from Powershell: - - -``` -`PS> emacs` -``` - -![Emacs running on Windows][4] - -### Download GNU Emacs for Windows - -To manually install GNU Emacs on Windows, you must [download Emacs][5]. - -![GNU Windows downloader][6] - -This takes you to a server near you, which shows you a list of all available Emacs releases. Find the directory with the highest release number and click into it. There are many different builds of Emacs for Windows, but the most general-purpose version is just named **emacs-VERSION-ARCHITECTURE.zip**. The **VERSION** depends upon which release you're downloading, while the **ARCHITECTURE** depends on whether you have a 32-bit or 64-bit machine. Most modern computers are 64-bit, but if you're in doubt you can download the 32-bit version, which runs on both. - -If you're downloading version 26 of Emacs for a 64-bit machine, you would click the link titled **emacs-26.2-x86_64.zip**. There are smaller downloads available (such as the **no-deps** variety) but you must be familiar with how Emacs is built from source code, knowing which libraries it needs and which of those your computer has on it already. Generally, it's easiest to get the large version of Emacs, because it contains everything it needs to run on your computer. - -### Extract Emacs - -Next, unarchive the ZIP file you downloaded. To extract it, right-click on the Emacs ZIP file and select **Extract to Emacs-VERSION** from the 7-zip sub-menu. It's a big archive, so it may take a while to uncompress, but when it does, you have a new directory containing all the files distributed with Emacs. For example, in this example, the file **emacs-26.2-x86_64.zip** was downloaded, so the unarchived directory is **emacs-26.2-x86_64**. - -### Launch Emacs - -Within the Emacs directory, find the **bin** directory. This folder stores all the binary executable files (EXE files) distributed with Emacs. Double-click the **emacs.exe** file to launch the application. - -![Emacs running on Windows][7] - -You can create a shortcut to **emacs.exe** on your desktop for easier access. - -### Learn Emacs - -Emacs isn't as obtuse as its reputation may indicate. It's got its own traditions and conventions, but when you're typing text into it, you can treat it exactly as you treat Notepad or any given text field on any given website. - -The important differences occur when you _edit_ the text you've typed. - -The only way to learn is to start using it, though, so make Emacs your go-to text editor for simple tasks. When you'd normally open Notepad or Word or Evernote or whatever it is you use for quick notes or as a temporary scratchpad, launch Emacs instead. - -Emacs has the reputation of being a terminal-based application, but obviously it has a GUI, so use the GUI often, just as you would with any application. Copy, cut, and paste (or "yank" in Emacs terminology) from the menu instead of with the keyboard, and open and save files from the menu or toolbar. Start from the beginning and learn the application based on what it is and not how you think it should act based on your experience with other editors. - -### Download our [cheatsheet][8]! - -_Thanks to Matthias Pfuetzner and Stephen Smoogen._ - -These are Jimmy's six favorite open source applications that he immediately installs on a new... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/3/emacs-windows - -作者:[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/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) -[2]: https://github.com/chocolatey/choco -[3]: https://www.7-zip.org/ -[4]: https://opensource.com/sites/default/files/uploads/windows-ps-choco-emacs.jpg (Emacs running on Windows) -[5]: https://www.gnu.org/software/emacs/download.html -[6]: https://opensource.com/sites/default/files/uploads/windows-emacs-download.jpg (GNU Windows downloader) -[7]: https://opensource.com/sites/default/files/uploads/windows-emacs.jpg (Emacs running on Windows) -[8]: https://opensource.com/downloads/emacs-cheat-sheet diff --git a/translated/tech/20200302 Install GNU Emacs on Windows.md b/translated/tech/20200302 Install GNU Emacs on Windows.md new file mode 100644 index 0000000000..3ef9810f0c --- /dev/null +++ b/translated/tech/20200302 Install GNU Emacs on Windows.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Install GNU Emacs on Windows) +[#]: via: (https://opensource.com/article/20/3/emacs-windows) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +在 Windows 上安装 GNU Emacs +====== +即使你的操作系统是闭源的,你仍然可以使用这个流行的开源文本编辑器。 +![Tall building with windows][1] + +GNU Emacs 是一个专为各种程序员设计的流行的文本编辑器。因为它是在 Unix 上开发的,并在 Linux(macOS 中也有)上得到了广泛使用,所以人们有时没有意识到它也可用于 Microsoft Windows 上。你也无需成为有经验的或专职的程序员即可使用 Emacs。只需单击几下就可以下载并安装 Emacs,本文向你展示了如何进行。 + +你可以手动安装 Windows,也可以使用包管理器安装,例如 [Chocolatey][2]。 + +### 7-zip + +如果还没在 Windows 中安装 7-zip,那么就先安装它。[7-zip][3] 是一个开源的存档程序,能够创建和解压 ZIP、7z、TAR、XZ、BZIP2 和 GZIP(以及更多)文件。对于 Windows 用户来说,这是一个宝贵的工具。 + +安装 7-zip 后,在 Windows 资源管理器中浏览文件时,右键单击菜单中就有新的 7-zip 存档选项。 + +### Powershell 和 Chocolatey + +要在 Windows 上使用 Chocolatey 安装 GNU Emacs : + + +``` +`PS> choco install emacs-full` +``` + +安装后,在 Powershell 中启动 Emacs: + + +``` +`PS> emacs` +``` + +![Emacs running on Windows][4] + +### 下载适用于 Windows 的 GNU Emacs + +要在 Windows 上手动安装 GNU Emacs,你必须[下载 Emacs][5]。 + +![GNU Windows downloader][6] + +它会打开连接到离你最近的服务器,并展示所有可用的 Emacs 版本。找到发行版本号最高的目录,然后单击进入。Windows 有许多不同的 Emacs 构建,但是最通用的版本只是被命名为 emacs-VERSION-ARCHITECTURE.zip。**VERSION** 取决于你要下载的版本,而 **ARCHITECTURE** 取决于你使用的是 32 位还是 64 位计算机。大多数现代计算机都是 64 位的,但是如果你有疑问,可以下载 32 位版本,它可在两者上运行。 + +如果要下载 64 位计算机的 Emacs v26,你应该点击 emacs-26.2-x86_64.zip 的链接。有较小的下载包(例如 “no-deps” 等),但是你必须熟悉如何从源码构建 Emacs,知道它需要哪些库以及你的计算机上已经拥有哪些库。通常,获取较大版本的 Emacs 最容易,因为它包含了在计算机上运行所需的一切。 + +### 解压 Emacs + +接下来,解压下载的 ZIP 文件。要解压缩,请右键单击 Emacs ZIP 文件,然后从 7-zip 子菜单中选择 **Extract to Emacs-VERSION**。这是一个很大的压缩包,因此解压可能需要一段时间,但是完成后,你将拥有一个新目录,其中包含与 Emacs 一起分发的所有文件。例如,在此例中,下载了 emacs-26.2-x86_64.zip,因此解压后的目录为 emacs-26.2-x86_64。 + +### 启动 Emacs + +在 Emacs 目录中,找到 **bin** 目录。此文件夹存储随 Emacs 一起分发的所有二进制可执行文件(EXE 文件)。双击 emacs.exe 文件启动应用。 + +![Emacs running on Windows][7] + +你可以在桌面上创建 **emacs.exe** 的快捷方式,以便于访问。 + +### 学习 Emacs + +Emacs 并不像传闻那样难用。它具有自己的传统和惯例,但是当你其中输入文本时,你可以像在记事本或者网站的文本框中那样使用它。 + +重要的区别是在你_编辑_输入的文本时。 + +但是,学习的唯一方法是开始使用它,因此,使 Emacs 成为完成简单任务的首选文本编辑器。当你通常打开记事本、Word 或 Evernote 或其他工具来做快速笔记或临时记录时,请启动 Emacs。 + +Emacs 以基于终端的应用而闻名,但它显然有 GUI,因此请像使用其他程序一样经常使用它的 GUI。从菜单而不是使用键盘复制、剪切和粘贴(paste)(或用 Emacs 的术语 “yank”),然后从菜单或工具栏打开和保存文件。从头开始,并根据应用本身来学习它,而不是根据你以往对其他编辑器的经验就认为它应该是怎样。 + +### 下载[速查表][8]! + +_感谢 Matthias Pfuetzner 和 Stephen Smoogen。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/emacs-windows + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://github.com/chocolatey/choco +[3]: https://www.7-zip.org/ +[4]: https://opensource.com/sites/default/files/uploads/windows-ps-choco-emacs.jpg (Emacs running on Windows) +[5]: https://www.gnu.org/software/emacs/download.html +[6]: https://opensource.com/sites/default/files/uploads/windows-emacs-download.jpg (GNU Windows downloader) +[7]: https://opensource.com/sites/default/files/uploads/windows-emacs.jpg (Emacs running on Windows) +[8]: https://opensource.com/downloads/emacs-cheat-sheet From 2c12683835505475605f02f6c8d0161bdc3b35e6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 11:39:16 +0800 Subject: [PATCH 128/207] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @heguangzhi 翻译完再检查一遍会更好 --- ...t you-re looking for on Linux with find.md | 103 +++++++++--------- 1 file changed, 49 insertions(+), 54 deletions(-) diff --git a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md b/translated/tech/20200219 How to find what you-re looking for on Linux with find.md index f54e9a3924..a6d515943e 100644 --- a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md +++ b/translated/tech/20200219 How to find what you-re looking for on Linux with find.md @@ -1,42 +1,40 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to find what you’re looking for on Linux with find) [#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) -如何在 Linux上通过 find 命令找到你要找的东西 +通过 find 命令找到你要找的东西 ====== -find 命令有大量选项可以帮助你准确定位你在 Linux 系统上需要寻找的文件。这篇文章讨论了一系列非常有用的选项。 -CSA 图片/ Getty 图片 +> find 命令有巨多的选项可以帮助你准确定位你在 Linux 系统上需要寻找的文件。这篇文章讨论了一系列非常有用的选项。 -在 Linux 系统上有许多用于查找文件的命令,但是在查找文件时也有大量的选项可以选择。 +![](https://img.linux.net.cn/data/attachment/album/202003/06/113842txki5llopb5aagbt.jpg) + +在 Linux 系统上有许多用于查找文件的命令,而你在使用它们时也有巨多的选项可以使用。 例如,你不仅可以通过文件的名称来查找文件,还可以通过文件的所有者或者组、它们的创建时间、大小、分配的权限、最后一次访问它们的时间、关联的信息节点,甚至是文件是否属于系统上不再存在的帐户或组等等来查找文件。 -[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] 你还可以指定搜索从哪里开始,搜索应该深入到文件系统的什么位置,以及搜索结果将告诉你它所找到的文件的数量。 -而所有这些要求都可以通过 **find** 命令来处理。 +而所有这些要求都可以通过 `find` 命令来处理。 -下面提供了根据这些标准查找文件的示例。在某些命令中,错误(例如试图列出你没有读取权限的文件),错误输出将被发送到 **/dev/null**,以便我们不必查看它。在其他情况下,我们将简单地以 root 身份运行以避免这个问题。 +下面提供了根据这些要求查找文件的示例。在某些命令中,错误(例如试图列出你没有读取权限的文件)输出将被发送到 `/dev/null`,以便我们不必查看它。或者,我们可以简单地以 root 身份运行以避免这个问题。 -请记住,还其他选项存在。这篇文章涵盖了很多内容,但并不是 **find** 命令帮助你定位查找文件的所有方式。 +请记住,还有更多的其他选项。这篇文章涵盖了很多内容,但并不是 `find` 命令帮助你定位查找文件的所有方式。 ### 选择起点 -使用 **find**,您可以选择一个起点或从你所在的位置开始。请在单词“find”后输入要选择起点。例如,“find /usr” 或 “find ./bin "将在 **/usr** 目录或 **bin** 目录开始搜索,而" find ~ " 将在你的主目录中开始,即使你位于当前文件系统中的其他位置。 +使用 `find`,你可以选择一个起点或从你所在的位置开始。要选择的搜索的起点,请在单词 `find` 后输入它。例如,`find /usr` 或 `find ./bin` 将在 `/usr` 目录或当前位置下的 `bin` 目录开始搜索,而 `find ~` 将在你的主目录中开始搜索,即使你当前位于当前文件系统中的其他位置。 -[][2] +### 选择你要找的 -### 选择你想看的 +最常用的搜索策略之一是按名称搜索文件。这需要使用 `-name` 选项。 -最常用的搜索策略之一是按名称搜索文件。这需要使用 **-name** 选项。 - -默认情况下,**查找** 会显示找到的文件的完整路径。如果你在命令中添加 **-print**,你会看到同样的情况。如果你想查看与文件相关的详细信息—-例如:文件的长度、权限等,您需要在你的 **查找** 命令的末尾添加 **-ls** 命令。 +默认情况下,`find` 会显示找到的文件的完整路径。如果你在命令中添加 `-print`,你会看到同样的结果。如果你想查看与文件相关的详细信息—-例如:文件的长度、权限等,你需要在你的 `find` 命令的末尾添加 `-ls` 参数。 ``` $ find ~/bin -name tryme @@ -47,18 +45,17 @@ $ find ~/bin -name tryme -ls 917528 4 -rwx------ 1 shs shs 139 Apr 8 2019 /home/shs/bin/tryme ``` -你也可以使用子字符串来查找文件。例如,如果你将上面示例中的“tryme”替换为“try*”,你将会找到所有名称以“try”开头的文件。 +你也可以使用子字符串来查找文件。例如,如果你将上面示例中的 `tryme` 替换为 `try*`,你将会找到所有名称以 `try` 开头的文件。(LCTT 译注:如果要使用通配符 `*` ,请将搜索字符串放到单引号或双引号内,以避免通配符被 shell 所解释) -按名称查找文件可能是 **find** 命令最典型的用法,但是有很多其他的方式来查找文件,并且有很好的理由这样做。下面的部分展示了如何使用其他可用的方式。 +按名称查找文件可能是 `find` 命令最典型的用法,不过还有很多其他的方式来查找文件,并且有这样做的需要。下面的部分展示了如何使用其他可用的方式。 -此外,当按大小、组、索引节点等条件来搜索文件时,你需要确认找到的文件与你要查找的文件是否相匹配。使用 **-ls** 选项来显示细节是非常有用。 +此外,当按文件大小、组、索引节点等条件来搜索文件时,你需要确认找到的文件与你要查找的文件是否相匹配。使用 `-ls` 选项来显示细节是非常有用。 ### 通过大小查找文件 -按大小查找文件需要使用 **-size** 选项并且对相应规范使用一点技巧。如果你指定 **-size 189b**,例如,你将找到189个块长的文件,而不是189个字节。对于字节,你需要使用 **--size 189c**(字符)。而且,如果你指定 **--size 200w** ,你将会找到200个单词的文件——以“双字节增量”为单位的单词,而不是“我们彼此都在说的那些事情”中的单词。你还可以通过以千字节(k)、兆字节(M)和千兆字节(G)为单位提供大小来查找文件。 +按大小查找文件需要使用 `-size` 选项并且对相应规范使用一点技巧。例如,如果你指定 `-size 189b`,你将找到 189 个块大小的文件,而不是 189 个字节。(LCTT 译注:如果不跟上单位,默认单位是 `b`。一个块是 512 个字节大小,不足或正好 512 个字节将占据一个块。)对于字节,你需要使用 `--size 189c`(字符)。而且,如果你指定 `--size 200w` ,你将会找到 200 个“word”的文件——以“双字节增量”为单位的字,而不是“我们互相谈论的那些事情”中的单词。你还可以通过以千字节(`k`)、兆字节(`M`)和千兆字节(`G`)为单位提供大小来查找文件。(LCTT 译注:乃至还有 `T`、`P`) - -大多数情况下,Linux用户会搜索比所选文件大的文件。例如,要查找大于1千兆字节的文件,你可以使用这样的命令,其中 +1G 表示“大于1千兆字节”: +大多数情况下,Linux 用户会搜索比选定大小要大的文件。例如,要查找大于 1 千兆字节的文件,你可以使用这样的命令,其中 `+1G` 表示“大于 1 千兆字节”: ``` $ find -size +1G -ls 2>/dev/null @@ -66,9 +63,9 @@ $ find -size +1G -ls 2>/dev/null 801834 1052556 -rw-rw-r-- 1 shs shs 1077809525 Dec 21 2018 ./2019/hold.zip ``` -### 通过索引节点查找文件 # +### 通过索引节点号查找文件 -你可以通过用于维护文件元数据(即除文件内容和文件名之外的所有内容)的索引节点来查找文件。 +你可以通过用于维护文件元数据(即除文件内容和文件名之外的所有内容)的索引节点来查找文件。 ``` $ find -inum 919674 -ls 2>/dev/null @@ -77,14 +74,14 @@ $ find -inum 919674 -ls 2>/dev/null ### 查找具有特定文件所有者或组的文件 -按所有者或组查找文件也非常简单。这里我们使用 sudo 来解决权限问题。 +按所有者或组查找文件也非常简单。这里我们使用 `sudo` 来解决权限问题。 ``` -$ sudo find /home -user nemo -name "*.png"-ls +$ sudo find /home -user nemo -name "*.png" -ls 1705219 4 drwxr-xr-x 2 nemo nemo 4096 Jan 28 08:50 /home/nemo/Pictures/me.png ``` -在这个命令中,我们寻找一个被称为 “admins” 的多用户组拥有的文件。 +在下面这个命令中,我们寻找一个被称为 `admins` 的多用户组拥有的文件。 ``` # find /tmp -group admins -ls @@ -93,18 +90,18 @@ $ sudo find /home -user nemo -name "*.png"-ls ### 查找没有所有者或组的文件 -你可以使用如下命令所示的 **-nouser** 选项来查找系统上没有任何现存用户属性的文件。 +你可以使用如下命令所示的 `-nouser` 选项来查找不属于当前系统上的任何用户的文件。 ``` # find /tmp -nouser -ls 262204 4 -rwx------ 1 1016 1016 17 Feb 17 16:42 /tmp/hello ``` -请注意,该列表显示了旧用户的 UID 和 GID,这清楚地表明该用户未在系统上定义。这种命令将查找由于帐户已从系统中删除的用户在非主目录中创建的文件,或者在用户帐户被删除后未被删除的主目录中创建的文件。类似地,**-nogroup** 选项会找到这样的文件,尤其是当这些用户是相关组的唯一成员时。 +请注意,该列表显示了旧用户的 UID 和 GID,这清楚地表明该用户未在系统上定义。这种命令将查找帐户已从系统中删除的用户创建在主目录之外的文件,或者在用户帐户被删除后而未被删除的主目录中创建的文件。类似地,`-nogroup` 选项也会找到这样的文件,尤其是当这些用户是相关组的唯一成员时。 ### 按上次更新时间查找文件 -在此命令中,我们在特定用户的主目录中查找过去24小时内更新过的文件。**sudo** 用于搜索另一个用户的主目录。 +在此命令中,我们在特定用户的主目录中查找过去 24 小时内更新过的文件。`sudo` 用于搜索另一个用户的主目录。 ``` $ sudo find /home/nemo -mtime -1 @@ -115,18 +112,18 @@ $ sudo find /home/nemo -mtime -1 ### 按上次更改权限的时间查找文件 -**-ctime** 选项可以帮助你查找在某个参考时间范围内状态(如权限)发生更改的文件。以下是查找在最后一天内权限发生更改的文件的示例: +`-ctime` 选项可以帮助你查找在某个参考时间范围内状态(如权限)发生更改的文件。以下是查找在最后一天内权限发生更改的文件的示例: ``` $ find . -ctime -1 -ls 787987 4 -rwxr-xr-x 1 shs shs 189 Feb 11 07:31 ./tryme ``` -请记住,显示的日期和时间反映了文件内容的最后更新。你需要使用像 **stat** 这样的命令来查看与文件相关联的三个状态(文件创建、修改和状态更改)。 +请记住,显示的日期和时间只反映了对文件内容进行的最后更新。你需要使用像 `stat` 这样的命令来查看与文件相关联的三个状态(文件创建、修改和状态更改)。 -### Finding files based on last access times +### 按上次访问的时间查找文件 -在这个命令中,我们使用 **-atime** 选项查找在过去两天内访问过的本地 pdf 文件。 +在这个命令中,我们使用 `-atime` 选项查找在过去两天内访问过的本地 pdf 文件。 ``` $ find -name "*.pdf" -atime -2 @@ -135,7 +132,7 @@ $ find -name "*.pdf" -atime -2 ### 根据文件相对于另一个文件的时间来查找文件 -你可以使用 -newer 选项来查找比其他文件更新的文件。 +你可以使用 `-newer` 选项来查找比其他文件更新的文件。 ``` $ find . -newer dig1 -ls @@ -144,23 +141,23 @@ $ find . -newer dig1 -ls 791846 4 -rw-rw-r-- 1 shs shs 649 Feb 13 14:26 ./dig ``` -没有相应的 **-older** 选项,但是你可以用**,得到类似的结果 **! -newer**(即更旧),这意味着几乎相同的事情。 +没有相应的 `-older` 选项,但是你可以用 `! -newer` (即更旧)得到类似的结果,它们基本上一样。 ### 按类型查找文件 通过文件类型找到一个文件,你有很多选项——常规文件、目录、块和字符文件等等。以下是文件类型选项列表: ``` -b block (buffered) special -c character (unbuffered) special -d directory -p named pipe (FIFO) -f regular file -l symbolic link -s socket +b 块特殊文件(缓冲的) +c 字符特殊文件(无缓冲的) +d 目录 +p 命名管道(FIFO) +f 常规文件 +l 符号链接 +s 套接字 ``` -这里有一个寻找符号链接的例子: +这里有一个寻找符号链接的例子: ``` $ find . -type l -ls @@ -170,7 +167,7 @@ $ find . -type l -ls ### 限制查找的深度 -**-mindepth** 和 **-maxdepth** 选项控制在文件系统中搜索的深度(从当前位置或起始点开始)。 +`-mindepth` 和 `-maxdepth` 选项控制在文件系统中搜索的深度(从当前位置或起始点开始)。 ``` $ find -maxdepth 3 -name "*loop" @@ -181,7 +178,7 @@ $ find -maxdepth 3 -name "*loop" ### 查找空文件 -在这个命令中,我们寻找空文件,但不超过目录及其子目录。 +在这个命令中,我们寻找空文件,但不进入目录及其子目录。 ``` $ find . -maxdepth 2 -empty -type f -ls @@ -191,7 +188,7 @@ $ find . -maxdepth 2 -empty -type f -ls ### 按权限查找文件 -你可以使用 **-perm** 选项查找具有特定权限集的文件。在下面的示例中,我们只查找常规文件(**-type f**),以避免看到默认情况下被赋予这些权限的符号链接,即使它们引用的文件是受限的。 +你可以使用 `-perm` 选项查找具有特定权限集的文件。在下面的示例中,我们只查找常规文件(`-type f`),以避免看到符号链接,默认情况下符号链接被赋予了这种权限,即使它们所引用的文件是受限的。 ``` $ find -perm 777 -type f -ls @@ -201,26 +198,24 @@ find: ‘./.dbus’: Permission denied ### 使用查找来帮助你删除文件 -如果使用如下命令,你可以使用 find 命令定位并删除文件: +如果使用如下命令,你可以使用 `find` 命令定位并删除文件: ``` $ find . -name runme -exec rm {} \; ``` -{} 代表根据搜索条件找到的每个文件的名称。 +`{}` 代表根据搜索条件找到的每个文件的名称。 -一个非常有用的选项是将 **-exec** 替换为 **-ok**。当您这样做时,**find** 会在删除任何文件之前要求确认。 +一个非常有用的选项是将 `-exec` 替换为 `-ok`。当你这样做时,`find` 会在删除任何文件之前要求确认。 ``` $ find . -name runme -ok rm -rf {} \; < rm ... ./bin/runme > ? ``` -删除文件并不是 **-ok** 和 **-rm** 能为你做的唯一事情。例如,你可以复制、重命名或移动文件。 +删除文件并不是 `-ok` 和 `-exec` 能为你做的唯一事情。例如,你可以复制、重命名或移动文件。 -确实有很多选择可以有效地使用 find 命令,毫无疑问还有一些在本文中没有涉及到。我希望你已经找到一些新的,特别有帮助的。 - -加入[Facebook][3]和[LinkedIn][4]上的网络世界社区,评论最热门的话题。 +确实有很多选择可以有效地使用 `find` 命令,毫无疑问还有一些在本文中没有涉及到。我希望你已经找到一些新的,特别有帮助的。 -------------------------------------------------------------------------------- @@ -229,7 +224,7 @@ via: https://www.networkworld.com/article/3527420/how-to-find-what-you-re-lookin 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b555e5b49fb433f61b3cc767efbb078fe031e740 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 11:39:57 +0800 Subject: [PATCH 129/207] PUB @heguangzhi https://linux.cn/article-11966-1.html --- ... How to find what you-re looking for on Linux with find.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200219 How to find what you-re looking for on Linux with find.md (99%) diff --git a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md b/published/20200219 How to find what you-re looking for on Linux with find.md similarity index 99% rename from translated/tech/20200219 How to find what you-re looking for on Linux with find.md rename to published/20200219 How to find what you-re looking for on Linux with find.md index a6d515943e..4b2ca325ef 100644 --- a/translated/tech/20200219 How to find what you-re looking for on Linux with find.md +++ b/published/20200219 How to find what you-re looking for on Linux with find.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11966-1.html) [#]: subject: (How to find what you’re looking for on Linux with find) [#]: via: (https://www.networkworld.com/article/3527420/how-to-find-what-you-re-looking-for-on-linux-with-find.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 443afcf48aa2b8604169a5ef139574c5ca2518fc Mon Sep 17 00:00:00 2001 From: wetshoes <43409711+Fisherman110@users.noreply.github.com> Date: Fri, 6 Mar 2020 11:54:30 +0800 Subject: [PATCH 130/207] Fisherman110 translating (#17652) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md 2020.3.4 * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md first version * Update 20180306 Exploring free and open web fonts.md * Update 20180306 Exploring free and open web fonts.md * Update and rename sources/tech/20180306 Exploring free and open web fonts.md to translated/tech/ Exploring free and open web fonts.md 这是我第一次在LCTT翻译文章,可能会有比较多不足,请校对的朋友不吝指正! * Rename Exploring free and open web fonts.md to 20180306 Exploring free and open web fonts.md Co-authored-by: Xingyu.Wang --- ...80306 Exploring free and open web fonts.md | 72 ------------------ ...80306 Exploring free and open web fonts.md | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 72 deletions(-) delete mode 100644 sources/tech/20180306 Exploring free and open web fonts.md create mode 100644 translated/tech/20180306 Exploring free and open web fonts.md diff --git a/sources/tech/20180306 Exploring free and open web fonts.md b/sources/tech/20180306 Exploring free and open web fonts.md deleted file mode 100644 index d01accfbce..0000000000 --- a/sources/tech/20180306 Exploring free and open web fonts.md +++ /dev/null @@ -1,72 +0,0 @@ -Fisherman110 translating - -Exploring free and open web fonts -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-docdish-yellow-typewriter-keys.png?itok=0sPgIdMG) - -There is no question that the face of the web has been transformed in recent years by open source fonts. Prior to 2010, the only typefaces you were likely to see in a web browser were the generic "web safe" [core fonts][1] from Microsoft. But that year saw the start of several revolutions: the introduction of the Web Open Font Format ([WOFF][2]), which offered an open standard for efficiently delivering font files over HTTP, and the launch of web-font services like [Google Fonts][3] and the [Open Font Library][4]—both of which offered web publishers access to a large collection of fonts, for free, available under open licenses. - -It is hard to overstate the positive impact of these events on web typography. But it can be all too easy to equate the successes of open web fonts with open source typography as a whole and conclude that the challenges are behind us, the puzzles solved. That is not the case, so if you care about type, the good news is there are a lot of opportunities to get involved in improvement. - -For starters, it's critical to understand that Google Fonts and Open Font Library offer a specialized service—delivering fonts in web pages—and they don't implement solutions for other use cases. That is not a shortcoming on the services' side; it simply means that we have to develop other solutions. - -There are a number of problems to solve. Probably the most obvious example is the awkwardness of installing fonts on a desktop Linux machine for use in other applications. You can download any of the web fonts offered by either service, but all you will get is a generic ZIP file with some TTF or OTF binaries inside and a plaintext license file. What happens next is up to you to guess. - -Most users learn quickly that the "right" step is to manually copy those font binaries into any one of a handful of special directories on their hard drive. But that just makes the files visible to the operating system; it doesn't offer much in the way of a user experience. Again, this is not a flaw with the web-font service; rather it's evidence of the point where the service stops and more work needs to be done on the other side. - -A big improvement from the user's perspective would be for the OS or the desktop environment to be smarter at this "just downloaded" stage. Not only would it install the font files to the right location but, more importantly, it could add important metadata that the user will want to access when selecting a font to use in a project. - -What this additional information consists of and how it is presented to the user is tied to another challenge: Managing a font collection on Linux is noticeably less pleasant than on other operating systems. Periodically, font manager applications appear (see [GTK+ Font Manager][5] for one of the most recent examples), but they rarely catch on. I've been thinking a lot about where I think they come up short; one core factor is they have limited themselves to displaying only the information embedded in the font binary: basic character-set coverage, weight/width/slope settings, embedded license and copyright statements, etc. - -But a lot of decisions go into the process of selecting a font for a job besides what's in this embedded data. Serious font users—like information designers, journal article authors, or book designers—make their font-selection decisions in the context of each document's requirements and needs. That includes license information, naturally, but it includes much more, like information about the designer and the foundry, stylistic trends, or details about how the font works in use. - -For example, if your document includes both English and Arabic text, you probably want a font where the Latin and Arabic glyphs were designed together by someone experienced with the two scripts. Otherwise, you'll waste a ton of time making tiny adjustments to the font sizes and line spacing trying to get the two languages to mix well. You may have learned from experience that certain designers or vendors are better at multi-script design than others. Or it might be relevant to your project that today's fashion magazines almost exclusively use "[Didone][6]"-style typefaces, a name that refers to super-high-contrast styles pioneered by [Firmin Didot][7] and [Giambattista Bodoni][8] around 200 years ago. It just happens to be the trend. - -But none of those terms (Didone, Didot, or Bodoni) are likely to show up in the binary's embedded data, nor is easy to tell whether the Latin and Arabic fit together or anything else about the typeface's back history. That information might appear in supplementary material like a type specimen or font documentation—if any exists. - -A specimen is a designed document (often a PDF) that shows the font in use and includes background information; it frequently serves a dual role as a marketing piece and a sample to look at when choosing a font. The considered design of a specimen showcases how the font functions in practice and in a manner that an automatically generated character table simply cannot. Documentation may include some other vital information, like how to activate the font's OpenType features, what mathematical or archaic forms it provides, or how it varies stylistically across supported languages. Making this sort of material available to the user in the font-management application would go a long way towards helping users find the fonts that fit their projects' needs. - -Of course, if we're going to consider a font manager that can handle documentation and specimens, we also have to take a hard look at what comes with the font packages provided by distributions. Linux users start with a few fonts automatically installed, and repository-provided packages are the only font source most users have besides downloading the generic ZIP archive. Those packages tend to be pretty bare-bones. Commercial fonts generally include specimens, documentation, and other support items, whereas open source fonts usually do not. - -There are some excellent examples of open fonts that do provide quality specimens and documentation (see [SIL Gentium][9] and [Bungee][10] for two distinctly different but valid approaches), but they rarely (if ever) make their way into the downstream packaging chain. We plainly can do better. - -There are some technical obstacles to offering a richer user experience for interacting with the fonts on your system. For one thing, the [AppStream][11] metadata standard defines a few [parameters][12] specific to font files, but so far includes nothing that would cover specimens, designer and foundry information, and other relevant details. For another, the [SPDX][13] (Software Package Data Exchange) format does not cover many of the software licenses (and license variants) used to distribute fonts. - -Finally, as any audiophile will tell you, a music player that does not let you edit and augment the ID3 tags in your MP3 collection is going to get frustrating quickly. You want to fix errors in the tags, you want to add things like notes and album art—essentially, you want to polish your library. You would want to do the same to keep your local font library in a pleasant-to-use state. - -But editing the embedded data in a font file has been taboo because fonts tend to get embedded and attached to other documents. If you monkey with the fields in a font binary, then redistribute it with your presentation slides, anyone who downloads those slides can end up with bad metadata through no fault of their own. So anyone making improvements to the font-management experience will have to figure out how to strategically wrangle repeated changes to the embedded and external font metadata. - -In addition to the technical angle, enriching the font-management experience is also a design challenge. As I said above, good specimens and well-written documentation exist for several open fonts. But there are many more packages missing both, and there are a lot of older font packages that are no longer being maintained. That probably means the only way that most open font packages are going to get specimens or documentation is for the community to create them. - -Perhaps that's a tall order. But the open source design community is bigger than it has ever been, and it is a highly motivated segment of the overall free and open source software movement. So who knows; maybe this time next year finding, downloading, and using fonts on a desktop Linux system will be an entirely different experience. - -One train of thought on the typography challenges of modern Linux users includes packaging, document design, and maybe even a few new software components for desktop environments. There are other trains to consider, too. The commonality is that where the web-font service ends, matters get more difficult. - -The best news, from my perspective, is that there are more people interested in this topic than ever before. For that, I think we have the higher profile that open fonts have received from big web-font services like Google Fonts and Open Font Library to thank. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/3/webfonts - -作者:[Nathan Willis][a] -译者:[译者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/n8willis -[1]:https://en.wikipedia.org/wiki/Core_fonts_for_the_Web -[2]:https://en.wikipedia.org/wiki/Web_Open_Font_Format -[3]:https://fonts.google.com/ -[4]:https://fontlibrary.org/ -[5]:https://fontmanager.github.io/ -[6]:https://en.wikipedia.org/wiki/Didone_(typography) -[7]:https://en.wikipedia.org/wiki/Firmin_Didot -[8]:https://en.wikipedia.org/wiki/Giambattista_Bodoni -[9]:https://software.sil.org/gentium/ -[10]:https://djr.com/bungee/ -[11]:https://www.freedesktop.org/wiki/Distributions/AppStream/ -[12]:https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Fonts.html -[13]:https://spdx.org/ diff --git a/translated/tech/20180306 Exploring free and open web fonts.md b/translated/tech/20180306 Exploring free and open web fonts.md new file mode 100644 index 0000000000..605f7514e7 --- /dev/null +++ b/translated/tech/20180306 Exploring free and open web fonts.md @@ -0,0 +1,73 @@ + +探索免费而开放的网络字体 +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-docdish-yellow-typewriter-keys.png?itok=0sPgIdMG) + +毫无疑问,近些年来互联网的面貌已经被开放免费的字体所改变。在早些的2010年,你在网络浏览器上几乎只能看到微软制作的最普通的“网络安全字体”[core fonts] +[1]。但这一年(2010)正好是好几轮技术革新开始的见证之年:Web开放字体格式的应用给网络高效传输字体文件提供了一个开放的标准,像[Google Fonts]和 +[Open Font Library]这样的网络字体服务使网络内容发布者在开放证书证书下可以免费使用海量的字体库。 + +要夸大这些网络排印领域大事件的积极影响是很难的。但是要将网络开放字体的成功与开源的网络排印划上等号作为一个整体却非常容易,而且得到的结论是挑战已经远离了我们,困难悉数被解决了。然而事实并非如此,如果你很关注网络字体,好消息是你会有非常多的机会参与到对这些字体的改进工作当中去。 + +对新手来说,必须要意识到谷歌字体和开源字体库为网页提供了特殊的”服务提供“(service—delivering)字体但是他们给其他使用情况制定字体解决方案。这不是服务方的短视,这是是意味这我们必须去建立其他的解决方案。 + +需要解决的问题还非常多。可能最明显的例子就是给linux桌面机器的其他软件安装字体使用所遇到的尴尬情况。你可以通过任何一种服务下载任何一种网络字体,但是你能得到的是一个最普通的压缩包文件,里面有一些TTF或OTF二进制文件和一个普通文本文件的证书。接下来会发生什么完完全全需要你去猜。 + +大部分用户很快学会了”正确“的步骤就是手动地复制这些字体二进制文件到他们硬件驱动里一大把的文件夹里的某个文件夹里。但是这样做只能使这个文件被操作系统检索到。它并不能为用户体验带来什么。再强调一遍,这不是网络字体服务的缺陷,然而它是对于关于服务到哪里停止和更多工作需要在其他方面做这个观点的证据。 + +在用户视角来说,一个巨大的提升可能就是直接在“下载“这个阶段系统或者桌面环境变得更智能。它(系统或桌面环境)不仅会把字体文件安装到正确的位置上,更重要的是,当用户选择在一个工程使用的字体时,它会自己添加用户所需要得到的重要的元数据。 + +附加信息的组成与它如何展示给用户连接着另一个挑战:在linux环境管理一个字体库明显不如任何其他操作系统愉快。字体管理软件总是时不时的出现一下(例如[GTK+ Font Manager][5] 这是最近的一个例子),但是他们(字体管理软件)很少能正确的时候出现。我一直在思考一大堆这些软件让人失望的方面。一个核心的原因是他们把自己限制只展示自己在二进制字体文件内嵌的信息:基本字符集的覆盖,粗细,宽度,和斜度的设定,内置的证书和版权说明等等。 + +但是在选择字体的过程中为了工作的选择(字体)都不能在内置数据中找到。正经的字体用户像信息设计者,杂志文章作者,或者书籍美工设计者,他们的字体选择是在每一份文件的需求上做出的。这些需求包含了证书信息,很自然的,它还包含了更多,像关于设计师和厂商的信息,潮流风格的趋势,或者字体在使用当中的细节。 + +举个例子,如果你的文档包含了英语和阿拉伯文,你多半想要一种某个很熟悉拉丁文和阿拉伯文设计师设计同时设计两种语言的字体。否则,你将浪费一大堆时间来微调字体大小和行间距来使两种语言良好地结合在一起。你可能从经验中学到,特定的设计师或服务商(字体)比其他人更善于多语言设计。或许和你职业相关的是今天的时尚杂志几乎无一例外的采用"[Didone][6]"风格的字体,"[Didone][6]"是指一种两百多年前最先被[Firmin Didot][7] 和 [Giambattista Bodoni][8]设计出来的反差超级大的字体风格。这种字体恰好就是现在的潮流。 + +但是这些字体(Didone, Didot, or Bodoni)中没有一种有可能会出现在内置的二进制文件中,你也不容易发现拉丁文和阿拉伯文是否相得益彰或其他关于字体的背后故事。这些信息有可能出现在补充的材料中,类似某种样本或字体文件中,如果这些东西存在的话。 + +字体样本是一份设计好的文档(一般是PDF),它展示了这种字体在使用的情况而且包括了背景信息。字体样本经常起到两重作用,作为市场样本和在挑选字体时的样本。一份样品精心的设计展示了字体在实际应用中的情况和一种自动生产字符表所不能形成的风格。字体样本文件也有可能包含了一些其他重要信息,比如怎样激活字体的开放特色,它提供了什么样的数学表达式和古体字,或者它怎么在跨支持的语言上风格多样。要使这些资源能够被字体管理软件上的用户使用还要走过帮助用户找到合适他们工程的字体的漫长之路。 + +当然,如果我们要去考虑一个字体管理软件能够解决文件和样本问题,我们也必须仔细观察各种发行版提供的字体包伴随着什么。linux的用户刚开始只有自动安装的那几种字体,并且提供仓库的包是大部分用户除了下载最普通的压缩包档案之外的唯一字体来源。这些资源包往往非常的“骨感”。商业字体总的来说都包含了样本,文档,还有其他的支持项目,然而开源字体往往没有(这些配套文件)。 + +也有一些很棒的开源字体提供了高质量的样本和文档的例子(例如 [SIL Gentium][9] 和 [Bungee][10] 是两种极度不一样但是有效的方案),但是他们几乎不涉足下端的整合包链条。我们肯定能做的(比他们)更好。 + +在和系统的字体交互方面提供更丰富的用户体验上面还有一些技术问题。比如说,[AppStream][11]的元数据标准定义了几项针对字体文件的参数,但是现在为止这些参数没有包含样本,设计师和厂商,和其他相关细节的任何信息。另外一个例子,[SPDX][13] (软件包信息交换)格式也没有包含很多软件证书(和证书参数),这些软件证书是用来分配指定字体的。 + +最后,就像任何一个唱片爱好者都会告诉你,一个不允许你编辑和完善你的mp3库的ID3信息(mp3头部的一个字节,记录歌手信息)的音乐播放器很快就会变得让人失望。你想要处理标志里的错误,你想要添加比如笔记和乐队,艺术家这样的基本信息,你想要提升你的音乐库。你可能想要做一样的事情来使你的本地字体仓库保持在一个方便使用的状态。 + +但是改动字体文件的内置数据已经被禁止了,因为字体往往是被内置或附加到其他文件里的。如果你拿字体二进制文件来胡闹的话,那么你需要重新为你的展示幻灯片分配字体,任何一个人下载这些幻灯片最终都会面对错误的元数据但他们自己并没有过失。所以任何一个要提升字体管理体验的人都要弄清楚如何来战略的讨论内置或外置的字体元数据里反反复复的变化。 + +除了技术角度之外,丰富字体管理的体验也是一个设计的挑战。就像我前面说的一样,有几种开放的字体也带了良好的样本和精心写好的证明文件。但是有更多的字体包两者都没有,还有大量的更老的字体包已经没有人维护了。这很可能意味着大部分开放字体包想要获得样本和证明文件的唯一办法就是让(字体)社区去为它们创造。 + +可能那(前面说的)是一个很高的要求。但是开源设计社区现在比它以前任何时候都要庞大,并且它(社区)是全面免费开源软件运动中的一个高度活跃的组成部分。所以谁知道呢。可能明年这个时候会发现,在linux桌面系统下载和使用字体会变成一种完全不同的体验。 + +在关于现代Linux用户的文字设计上的挑战的一连串思考中包含了打包文件,证明文件设计,甚至有可能需要在桌面环境加入不少新的软件成分。还有其他一连串的东西也需要考虑。共通性就是在网络字体服务不及的地方,事情就变得更加困难。 + +最好的消息是,从我的视角来看,就是现在比起以前有更多的人对这个议题感兴趣。我认为我们要感谢像谷歌字体和开放字体库这样的网络字体服务巨头让开放字体得到了更高的关注。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/3/webfonts + +作者:[Nathan Willis][a] +译者:https://github.com/Fisherman110 +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/n8willis +[1]:https://en.wikipedia.org/wiki/Core_fonts_for_the_Web +[2]:https://en.wikipedia.org/wiki/Web_Open_Font_Format +[3]:https://fonts.google.com/ +[4]:https://fontlibrary.org/ +[5]:https://fontmanager.github.io/ +[6]:https://en.wikipedia.org/wiki/Didone_(typography) +[7]:https://en.wikipedia.org/wiki/Firmin_Didot +[8]:https://en.wikipedia.org/wiki/Giambattista_Bodoni +[9]:https://software.sil.org/gentium/ +[10]:https://djr.com/bungee/ +[11]:https://www.freedesktop.org/wiki/Distributions/AppStream/ +[12]:https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Fonts.html +[13]:https://spdx.org/ From 53ffe89b6b1498bb3e1fccf63480544e0000d30d Mon Sep 17 00:00:00 2001 From: Hank Chow <280630620@qq.com> Date: Fri, 6 Mar 2020 12:16:45 +0800 Subject: [PATCH 131/207] hankchow translated --- ...ger That Doesn-t Need Your Phone Number.md | 143 ------------------ ...ger That Doesn-t Need Your Phone Number.md | 142 +++++++++++++++++ 2 files changed, 142 insertions(+), 143 deletions(-) delete mode 100644 sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md create mode 100644 translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md diff --git a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md deleted file mode 100644 index 15529537a0..0000000000 --- a/sources/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) -[#]: via: (https://itsfoss.com/session-messenger/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number -====== - -_**Brief: Our open source software highlight of the week is Session. It is a fork of another increasingly popular private messenger Signal. Session doesn’t even need your phone number to operate.**_ - -### Session: A private messenger in true sense - -![][1] - -Privacy concerned people are always in the search of an ultimate service that lets you communicate securely while respecting our privacy across multiple platforms. - -Recently, I came across an interesting open-source messaging app “[Session][2]” by [Loki Foundation][3], which is technically a fork of another [open source encrypted messenger Signal][4]. - -In this article, I’ll be sharing my experience with the Session app while highlighting the features it offers. - -Session is fairly new to the scene – I’ve mentioned some of the bugs that I encountered at the bottom of the article. - -### Features of Session Messenger - -I’ll highlight the key features of Session that will help you decide if it’s good enough for you to try. - -#### Session does not require a phone number - -![][5] - -For privacy-enthusiasts, registering the phone number with Signal or other such applications is a potential risk. - -But, with Session, you do not need a phone number, simply click on “**Create Account**” after you install it on your desktop or phone and it will simply generate a random (unique) **Session ID**. - -It’ll look something like this: **05652245af9a8bfee4f5a8138fd5c……..** - -So, you just have to share your Session ID with the contact you want to add. Or, you can also opt to get the **QR Code** after account creation which you can share with your friends to add you back. - -#### Session uses blockchain (and other crypto tech) - -![Session ID][6] - -For the users who’re aware of what a [blockchain][7] is – they’ve been waiting for real-world applications that an average user can utilize. Session is one such example that utilizes blockchain at its core and you don’t need to know it’s there. - -If you’re curious about how it works, you can take a look at their [official blog post][8] explaining it. - -#### Cross-Platform Support - -![][9] - -For something strictly privacy-focused, you’d also want it to be available across multiple platforms. - -Of course, primarily, I’d focus on the Linux and Android support but it also supports Windows/Mac/iOS. So, you can easily sync between multiple devices cross-platform. - -#### Includes Essential Privacy Options - -![][10] - -Undoubtedly, it offers some essential privacy-focused features that will help make the experience more secure. - -For starters, you have the following options: - - * **Message TTL**: This lets you control how long the message exists before the recipient sees the message. - * **Read Receipts**: Let others know that you’ve seen the message or if your message has been read. - - - -#### Session uses a decentralized network and protects your metadata - -Even though Session isn’t a peer-to-peer technology, it does not have a central server for the network. - -It takes a decentralized approach to how the messages are transmitted (or routed). If you’ve no idea what I’m talking about, you can follow Session’s official blog post to know the [difference between centralization and decentralization][11] and explore how it potentially works. - -And, this approach of network helps them to protect the metadata (the information associated with a message like IP address). - -#### Other Features - -Not just limited to the latest/greatest privacy-friendly features, but it also supports group chats, voice messages, and also allows you to send attachments. - -### Installing Session on Linux - -If you head to the [official download page][12], you will be able to download an .**AppImage** file. In case you have no clue how it works, you should take a look at our article on [how to use AppImage][13]. - -In either case, you can also head to their [GitHub releases page][14] and grab the **.deb** file. - -[Download Session][12] - -### My Experience On Using Session App - -I’ve managed to try it on multiple platforms. For the desktop, I utilized the .AppImage file on **Pop!_OS 19.10** to run Session. - -Overall, the user experience was impressive and had no UI glitches. - -It’s also easy to recover your account once you’ve backed up your secret code (which is known as **seed**) from the settings. - -![][15] - -But, I also noticed a couple of issues- which can be fixed/improved: - - * Delay in accepting a friend request - * The way of linking devices is not intuitive - * Sometimes when you reply from two separate devices (using the same ID), the receiver gets two different conversations. - - - -**Conclusion** - -Of course, nothing’s ever perfect. For now, I’m thinking of keeping it installed and considering Session’s features, it is definitely something a privacy-focused user should try. - -What do you think about it? Feel free to let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/session-messenger/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-app.jpg?ssl=1 -[2]: https://getsession.org/ -[3]: https://loki.foundation/ -[4]: https://itsfoss.com/signal-messaging-app/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-create.jpg?ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/session-application-id.jpg?ssl=1 -[7]: https://en.wikipedia.org/wiki/Blockchain -[8]: https://getsession.org/how-session-protects-your-anonymity-with-blockchain-and-crypto/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-cross-platform.jpg?ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-settings.jpg?fit=800%2C512&ssl=1 -[11]: https://getsession.org/centralisation-vs-decentralisation-in-private-messaging/ -[12]: https://getsession.org/download/ -[13]: https://itsfoss.com/use-appimage-linux/ -[14]: https://github.com/loki-project/session-desktop/releases -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-seed.jpg?ssl=1 diff --git a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md new file mode 100644 index 0000000000..3cb2f915c4 --- /dev/null +++ b/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) +[#]: via: (https://itsfoss.com/session-messenger/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Session:一款不需要电话号码的开源通信应用 +====== + +Signal 作为一款私人通信应用,正在变得愈发流行。而我们下面要介绍开源应用 Session 则是 Signal 的一个复刻fork,它的一大亮点是并不需要提供手机号码即可以开始使用。 + +### Session:一款真正意义上的私人通信应用 + +![][1] + +对于私人通信服务来说,有没有既能保护通信安全性,又尊重用户跨平台隐私的集大成者呢?很多注重个人隐私的用户似乎都在寻找这个问题的答案。 + +最近,我留意到 [Loki Foundation][3] 开发的一款叫做 [Session][2] 的开源通信应用。从技术上来说,Session 是另一款[开源、加密的通信应用 Signal][4] 的一个复刻。 + +在本文中,我会讲述我自己使用 Session 的体验,以及 Session 的一些主要功能。 + +Session 在这个领域中算是一款比较新的应用了,因此我还会在文章的最后提到它的一些不足之处。 + +### Session 的一些主要功能 + +接下来我会重点介绍 Session 的主要功能,可以供你参考这款应用是否值得使用。 + +#### Session 的使用过程中不需要提供手机号码 + +![][5] + +在 Signal 或者其它类似的通信应用中,用户都需要提供手机号码才得以成功注册。注重隐私的用户们都认为这样的做法会潜藏着巨大的安全隐患。 + +而使用 Session 则简单得多。在 PC 或手机上安装应用之后,只需要点击“创建账号Create Account”,无须提供手机号码,它就会生成一个类似 **05652245af9a8bfee4f5a8138fd5c……..** 这样的随机且唯一的 Session ID。 + +此后,把 Session ID 分享给想要添加的联系人就可以了。Session 还支持二维码,其他人可以通过扫描二维码添加你的 Session ID 为好友。 + +#### Session 使用了区块链等加密技术 + +![Session ID][6] + +对[区块链][7]有所了解的用户都很期待区块链能为普罗大众做出什么有实际意义的应用,而 Session 可以算得上其中一个。尽管 Session 的核心是基于区块链的,但普通用户在使用时并不需要真正弄懂区块链。 + +如果你好奇它的工作原理,可以参考这篇[官方的博客文章][8],里面有相关的解释。 + +#### 跨平台支持 + +![][9] + +这样严格保护隐私的应用,是否能在不同平台上使用? + +答案是肯定的。首先,它支持 Linux 和 Android 平台,同时也支持 Windows/Mac/iOS 平台。因此跨平台、跨设备的消息同步是没有问题的。 + +#### 包含基本隐私选项 + +![][10] + +毫无疑问,基本的隐私功能是必须有的,这是作为一个以安全为卖点的应用所必备的体验。 + +最基本的选项包括: + + * **消息有效期**:你可以控制一条消息在接收者阅读前的保留时长 + * **已读回执**:消息发送者可以知晓你已经阅读该消息 + + + +#### Session 使用去中心化网络保护你的元数据 + +尽管 Session 不使用端对端peer-to-peer技术,但它也不适用中心化的服务器。 + +Session 采用了去中心化的架构实现消息的传输和路由。如果你不熟悉这方面的内容,可以关注 Session 的官方博客,尝试了解[中心化网络和去中心化网络的区别][11],以及它的实际工作原理。 + +同时,这样的网络架构还有助于保护诸如与 IP 地址相关的信息等元数据。 + +#### 其它功能 + +除了专注于隐私之外,Session 也支持群聊、语音消息、发送附件等通信应用的基本功能。 + +### 在 Linux 上安装 Session + +在[官方下载页面][12]中可以下载到对应的 .AppImage 文件。如果你不了解这个文件的使用方法,可以查阅我们的[相关文章][13]。 + +另外,你也可以在它的 [Github 发布页面][14] 获取到对应的 .deb 安装文件。 + +[下载 Session][12] + +### 我使用 Session 的体验 + +我在各种平台上都试用过 Session,其中在 PC 上我使用了 Pop!_OS 19.10 的 .AppImage 文件运行这个应用。 + +总的来说,使用的体验很不错,用户界面也没有出现问题。 + +在设置中备份了密码(也称为种子seed)后,可以很方便地恢复账号。 + +![][15] + +当然,我也发现了一些需要改进的地方: + + * 在接受好友请求时会出现延迟 + * 设备间连接的方式不太直观 + * 当你在不同的设备上使用同一个 Session ID 向同一个人回复消息时,对方会收到两个不同的对话 + + + +### 总结 + +当然,最完美的事物是不存在的。我也会一直使用 Session 并考虑它发展的方向,这是一个注重引得的用户应该做的事情。 + +欢迎在评论区发表你的看法。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/session-messenger/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-app.jpg?ssl=1 +[2]: https://getsession.org/ +[3]: https://loki.foundation/ +[4]: https://itsfoss.com/signal-messaging-app/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-create.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/session-application-id.jpg?ssl=1 +[7]: https://en.wikipedia.org/wiki/Blockchain +[8]: https://getsession.org/how-session-protects-your-anonymity-with-blockchain-and-crypto/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-cross-platform.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-settings.jpg?fit=800%2C512&ssl=1 +[11]: https://getsession.org/centralisation-vs-decentralisation-in-private-messaging/ +[12]: https://getsession.org/download/ +[13]: https://itsfoss.com/use-appimage-linux/ +[14]: https://github.com/loki-project/session-desktop/releases +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-seed.jpg?ssl=1 From 208d0be3e87a6c21988974aabc79c47c9ad4921c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Fri, 6 Mar 2020 04:26:44 -0800 Subject: [PATCH 132/207] Translated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit File name:20190731 How to structure a multi-file C program- Part 2.md Translator:mengxinayan - 萌新阿岩 --- ...tructure a multi-file C program- Part 2.md | 229 ------------------ ...tructure a multi-file C program- Part 2.md | 226 +++++++++++++++++ 2 files changed, 226 insertions(+), 229 deletions(-) delete mode 100644 sources/tech/20190731 How to structure a multi-file C program- Part 2.md create mode 100644 translated/tech/20190731 How to structure a multi-file C program- Part 2.md diff --git a/sources/tech/20190731 How to structure a multi-file C program- Part 2.md b/sources/tech/20190731 How to structure a multi-file C program- Part 2.md deleted file mode 100644 index 3f050b053b..0000000000 --- a/sources/tech/20190731 How to structure a multi-file C program- Part 2.md +++ /dev/null @@ -1,229 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to structure a multi-file C program: Part 2) -[#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-2) -[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) - -How to structure a multi-file C program: Part 2 -====== -Dive deeper into the structure of a C program composed of multiple files -in the second part of this article. -![4 manilla folders, yellow, green, purple, blue][1] - -In [Part 1][2], I laid out the structure for a multi-file C program called [MeowMeow][3] that implements a toy [codec][4]. I also talked about the Unix philosophy of program design, laying out a number of empty files to start with a good structure from the very beginning. Lastly, I touched on what a Makefile is and what it can do for you. This article picks up where the other one left off and now I'll get to the actual implementation of our silly (but instructional) MeowMeow codec. - -The structure of the **main.c** file for **meow**/**unmeow** should be familiar to anyone who's read my article "[How to write a good C main function][5]." It has the following general outline: - - -``` -/* main.c - MeowMeow, a stream encoder/decoder */ - -/* 00 system includes */ -/* 01 project includes */ -/* 02 externs */ -/* 03 defines */ -/* 04 typedefs */ -/* 05 globals (but don't)*/ -/* 06 ancillary function prototypes if any */ -    -int main(int argc, char *argv[]) -{ -  /* 07 variable declarations */ -  /* 08 check argv[0] to see how the program was invoked */ -  /* 09 process the command line options from the user */ -  /* 10 do the needful */ -} -    -/* 11 ancillary functions if any */ -``` - -### Including project header files - -The second section, **/* 01 project includes /***, reads like this from the source: - - -``` -/* main.c - MeowMeow, a stream encoder/decoder */ -... -/* 01 project includes */ -#include "main.h" -#include "mmecode.h" -#include "mmdecode.h" -``` - -The **#include** directive is a C preprocessor command that causes the contents of the named file to be "included" at this point in the file. If the programmer uses double-quotes around the name of the header file, the compiler will look for that file in the current directory. If the file is enclosed in <>, it will look for the file in a set of predefined directories. - -The file [**main.h**][6] contains the definitions and typedefs used in [**main.c**][7]. I like to collect these things here in case I want to use those definitions elsewhere in my program. - -The files [**mmencode.h**][8] and [**mmdecode.h**][9] are nearly identical, so I'll break down **mmencode.h**. - - -``` - /* mmencode.h - MeowMeow, a stream encoder/decoder */ -    - #ifndef _MMENCODE_H - #define _MMENCODE_H -    - #include <stdio.h> -    - int mm_encode(FILE *src, FILE *dst); -    - #endif /* _MMENCODE_H */ -``` - -The **#ifdef, #define, #endif** construction is collectively known as a "guard." This keeps the C compiler from including this file more than once per file. The compiler will complain if it finds multiple definitions/prototypes/declarations, so the guard is a _must-have_ for header files. - -Inside the guard, there are only two things: an **#include** directive and a function prototype declaration. I include **stdio.h** here to bring in the definition of **FILE** that is used in the function prototype. The function prototype can be included by other C files to establish that function in the file's namespace. You can think of each file as a separate _namespace_, which means variables and functions in one file are not usable by functions or variables in another file. - -Writing header files is complex, and it is tough to manage in larger projects. Use guards. - -### MeowMeow encoding, finally - -The meat and potatoes of this program—encoding and decoding bytes into/out of **MeowMeow** strings—is actually the easy part of this project. All of our activities until now have been putting the scaffolding in place to support calling this function: parsing the command line, determining which operation to use, and opening the files that we'll operate on. Here is the encoding loop: - - -``` - /* mmencode.c - MeowMeow, a stream encoder/decoder */ - ... -     while (![feof][10](src)) { -    -       if (![fgets][11](buf, sizeof(buf), src)) -         break; -              -       for(i=0; i<[strlen][12](buf); i++) { -         lo = (buf[i] & 0x000f); -         hi = (buf[i] & 0x00f0) >> 4; -         [fputs][13](tbl[hi], dst); -         [fputs][13](tbl[lo], dst); -       } -            } -``` - -In plain English, this loop reads in a chunk of the file while there are chunks left to read (**feof(3)** and **fgets(3)**). Then it splits each byte in the chunk into **hi** and **lo** nibbles. Remember, a nibble is half of a byte, or 4 bits. The real magic here is realizing that 4 bits can encode 16 values. I use **hi** and **lo** as indices into a 16-string lookup table, **tbl**, that contains the **MeowMeow** strings that encode each nibble. Those strings are written to the destination **FILE** stream using **fputs(3)**, then we move on to the next byte in the buffer. - -The table is initialized with a macro defined in [**table.h**][14] for no particular reason except to demonstrate including another project local header file, and I like initialization macros. We will go further into why a future article. - -### MeowMeow decoding - -Alright, I'll admit it took me a couple of runs at this before I got it working. The decode loop is similar: read a buffer full of **MeowMeow** strings and reverse the encoding from strings to bytes. - - -``` - /* mmdecode.c - MeowMeow, a stream decoder/decoder */ - ... - int mm_decode(FILE *src, FILE *dst) - { -   if (!src || !dst) { -     errno = EINVAL; -     return -1; -   } -   return stupid_decode(src, dst); - } -``` - -Not what you were expecting? - -Here, I'm exposing the function **stupid_decode()** via the externally visible **mm_decode()** function. When I say "externally," I mean outside this file. Since **stupid_decode()** isn't in the header file, it isn't available to be called in other files. - -Sometimes we do this when we want to publish a solid public interface, but we aren't quite done noodling around with functions to solve a problem. In my case, I've written an I/O-intensive function that reads 8 bytes at a time from the source stream to decode 1 byte to write to the destination stream. A better implementation would work on a buffer bigger than 8 bytes at a time. A _much_ better implementation would also buffer the output bytes to reduce the number of single-byte writes to the destination stream. - - -``` - /* mmdecode.c - MeowMeow, a stream decoder/decoder */ - ... - int stupid_decode(FILE *src, FILE *dst) - { -   char           buf[9]; -   decoded_byte_t byte; -   int            i; -      -   while (![feof][10](src)) { -     if (![fgets][11](buf, sizeof(buf), src)) -       break; -     byte.field.f0 = [isupper][15](buf[0]); -     byte.field.f1 = [isupper][15](buf[1]); -     byte.field.f2 = [isupper][15](buf[2]); -     byte.field.f3 = [isupper][15](buf[3]); -     byte.field.f4 = [isupper][15](buf[4]); -     byte.field.f5 = [isupper][15](buf[5]); -     byte.field.f6 = [isupper][15](buf[6]); -     byte.field.f7 = [isupper][15](buf[7]); -        -     [fputc][16](byte.value, dst); -   } -   return 0; - } -``` - -Instead of using the bit-shifting technique I used in the encoder, I elected to create a custom data structure called **decoded_byte_t**. - - -``` - /* mmdecode.c - MeowMeow, a stream decoder/decoder */ - ... - - typedef struct { -   unsigned char f7:1; -   unsigned char f6:1; -   unsigned char f5:1; -   unsigned char f4:1; -   unsigned char f3:1; -   unsigned char f2:1; -   unsigned char f1:1; -   unsigned char f0:1; - } fields_t; -    - typedef union { -   fields_t      field; -   unsigned char value; - } decoded_byte_t; -``` - -It's a little complex when viewed all at once, but hang tight. The **decoded_byte_t** is defined as a **union** of a **fields_t** and an **unsigned char**. The named members of a union can be thought of as aliases for the same region of memory. In this case, **value** and **field** refer to the same 8-bit region of memory. Setting **field.f0** to 1 would also set the least significant bit in **value**. - -While **unsigned char** shouldn't be a mystery, the **typedef** for **fields_t** might look a little unfamiliar. Modern C compilers allow programmers to specify "bit fields" in a **struct**. The field type needs to be an unsigned integral type, and the member identifier is followed by a colon and an integer that specifies the length of the bit field. - -This data structure makes it simple to access each bit in the byte by field name and then access the assembled value via the **value** field of the union. We depend on the compiler to generate the correct bit-shifting instructions to access the fields, which can save you a lot of heartburn when you are debugging. - -Lastly, **stupid_decode()** is _stupid_ because it only reads 8 bytes at a time from the source **FILE** stream. Usually, we try to minimize the number of reads and writes to improve performance and reduce our cost of system calls. Remember that reading or writing a bigger chunk less often is much better than reading/writing a lot of smaller chunks more frequently. - -### The wrap-up - -Writing a multi-file program in C requires a little more planning on behalf of the programmer than just a single **main.c**. But just a little effort up front can save a lot of time and headache when you refactor as you add functionality. - -To recap, I like to have a lot of files with a few short functions in them. I like to expose a small subset of the functions in those files via header files. I like to keep my constants in header files, both numeric and string constants. I _love_ Makefiles and use them instead of Bash scripts to automate all sorts of things. I like my **main()** function to handle command-line argument parsing and act as a scaffold for the primary functionality of the program. - -I know I've only touched the surface of what's going on in this simple program, and I'm excited to learn what things were helpful to you and which topics need better explanations. Share your thoughts in the comments to let me know. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/7/structure-multi-file-c-part-2 - -作者:[Erik O'Shaughnessy][a] -选题:[lujun9972][b] -译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jnyjny -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/file_system.jpg?itok=pzCrX1Kc (4 manilla folders, yellow, green, purple, blue) -[2]: https://opensource.com/article/19/7/how-structure-multi-file-c-program-part-1 -[3]: https://github.com/jnyjny/MeowMeow.git -[4]: https://en.wikipedia.org/wiki/Codec -[5]: https://opensource.com/article/19/5/how-write-good-c-main-function -[6]: https://github.com/JnyJny/meowmeow/blob/master/main.h -[7]: https://github.com/JnyJny/meowmeow/blob/master/main.c -[8]: https://github.com/JnyJny/meowmeow/blob/master/mmencode.h -[9]: https://github.com/JnyJny/meowmeow/blob/master/mmdecode.h -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html -[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgets.html -[12]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html -[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fputs.html -[14]: https://github.com/JnyJny/meowmeow/blob/master/table.h -[15]: http://www.opengroup.org/onlinepubs/009695399/functions/isupper.html -[16]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html diff --git a/translated/tech/20190731 How to structure a multi-file C program- Part 2.md b/translated/tech/20190731 How to structure a multi-file C program- Part 2.md new file mode 100644 index 0000000000..85499e4362 --- /dev/null +++ b/translated/tech/20190731 How to structure a multi-file C program- Part 2.md @@ -0,0 +1,226 @@ +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to structure a multi-file C program: Part 2) +[#]: via: (https://opensource.com/article/19/7/structure-multi-file-c-part-2) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) + +如何组织构建多文件 C 语言程序(二) +====== +我将在本系列的第二篇中深入研究由多个文件组成的C程序的结构。 +![4 个 manilla 文件,黄色,绿色,紫色,蓝色][1] + +在 [(第一篇)][2] 中,我设计了一个名为 [MeowMeow][3] 的多文件 C 程序,该程序实现了一个玩具——[codec][4]。我提到了程序设计中的 Unix 哲学,即在一开始创建多个空文件,并建立一个好的结构。最后,我创建了一个 Makefile 文件夹并阐述了它的作用。在本文中将另一个方向展开:现在我将介绍简单但具有指导性的 MeowMeow 编/解码器的实现。 + +当读过我的 "[如何写一个好的 C 语言 main 函数][5]." 后,你便会知道 `main.c` 文件中 `meow` 和 `unmeow` 的结构,其主体结构如下: + +``` +/* main.c - MeowMeow 流编码器和解码器 */ + +/* 00 system includes */ +/* 01 project includes */ +/* 02 externs */ +/* 03 defines */ +/* 04 typedefs */ +/* 05 globals (but don't)*/ +/* 06 ancillary function prototypes if any */ +    +int main(int argc, char *argv[]) +{ +  /* 07 variable declarations */ +  /* 08 check argv[0] to see how the program was invoked */ +  /* 09 process the command line options from the user */ +  /* 10 do the needful */ +} +    +/* 11 ancillary functions if any */ +``` + +### 包含项目头文件 + +位于第二部分中的 `/* 01 project includes */` 的源代码如下: + + +``` +/* main.c - MeowMeow 流编码器和解码器 */ +... +/* 01 project includes */ +#include "main.h" +#include "mmecode.h" +#include "mmdecode.h" +``` + +`#include` 是 C 语言的预处理命令,它会将其后面的文件内容拷贝到当前文件中。如果程序员在头文件名称周围使用双引号,编译器将会在当前目录寻找该文件。如果文件被尖括号包围,编译器将在一组预定义的目录中查找该文件。 + +[main.h][6] 文件中包含了 [main.c][7] 文件中用到的定义和别名。我喜欢在头文件里尽可能多的声明,以便我想在我的程序的其他位置使用这些定义。 + +头文件 [mmencode.h][8] 和 [mmdecode.h][9] 几乎相同,因此我以 `mmencode.h` 为例来分析。 + + +``` + /* mmencode.h - MeowMeow 流编码器和解码器 */ +    + #ifndef _MMENCODE_H + #define _MMENCODE_H +    + #include <stdio.h> +    + int mm_encode(FILE *src, FILE *dst); +    + #endif /* _MMENCODE_H */ +``` + +`#ifdef`,`#define`,`#endif` 指令统称为 “防护” 指令。其可以防止 C 编译器在一个文件中多次包含同一文件。如果编译器在一个文件中发现多个定义/原型/声明,它将会产生警告。因此这些防护措施是必要的。 + +在防护内部,它只做两件事:`#include` 指令和函数原型声明。我将包含 `stdio.h` 头文件,以便于能在函数原型中使用 `FILE` 流。函数原型也可以被包含在其他 C 文件中,以便于在文件的命名空间中创建它。你可以将每个文件视为一个命名空间,其中的变量和函数不能被另一个文件中的函数或者变量使用。 + +编写头文件很复杂,并且在大型项目中很难管理它。不要忘记使用防护。 + +### MeowMeow 编码的实现 + +该程序的功能是按照字节进行 `MeowMeow` 字符串的编解码,事实上这是该项目中最简单的部分。截止目前我所做的工作便是支持允许在适当的位置调用此函数:解析命令行,确定要使用的操作,并打开将要操作的文件。下面的循环是编码的过程: + + +``` + /* mmencode.c - MeowMeow 流编码器 */ + ... +     while (![feof][10](src)) { +    +       if (![fgets][11](buf, sizeof(buf), src)) +         break; +              +       for(i=0; i<[strlen][12](buf); i++) { +         lo = (buf[i] & 0x000f); +         hi = (buf[i] & 0x00f0) >> 4; +         [fputs][13](tbl[hi], dst); +         [fputs][13](tbl[lo], dst); +       } +            } +``` + +简单的说,上面代码循环读取文件的一部分,剩下的内容通过 `feof(3)` 函数和 `fgets(3)` 函数读取。然后将读入的内容的每个字节分成 `hi` 和 `lo` 半个字节。半个字节是 4 个比特。这里的奥妙之处在于可以用 4 个比特来编码16个值。我将字符串 `hi` 和 `lo` 用作 16 字符串查找表 `tbl` 的索引,表中包含了对每半个字节编码后的 `MeowMeow` 字符串。这些字符串使用 `fputs(3)` 函数写入目标 `FILE` 流,然后移动到缓存区的下一个字节。 + +该表使用 [table.h][14] 中的宏定义进行初始化,在没有特殊原因(比如:要展示包含了另一个项目的本地头文件)时,我喜欢使用宏来进行初始化。我将在未来的文章中进一步探讨原因。 + +### MeowMeow 解码的实现 + +我承认在开始工作前花了一些时间。解码的循环与编码类似:读取 `MeowMeow` 字符串到缓冲区,将编码从字符串转换为字节 + + +``` + /* mmdecode.c - MeowMeow 流解码器 */ + ... + int mm_decode(FILE *src, FILE *dst) + { +   if (!src || !dst) { +     errno = EINVAL; +     return -1; +   } +   return stupid_decode(src, dst); + } +``` + +这不是所期望的吗? + +在这里,我通过外部公开的 `mm_decode()` 函数公开了 `stupid_decode()` 函数细节。我上面所说的“外部”是指在这个文件之外。因为 `stupid_decode()` 函数不在头文件中,因此无法在其他文件中调用它。 + +当我们想发布一个可靠的公共接口时,有时候会这样做,但是我们还没有完全使用函数解决问题。在本例中,我编写了一个 I/O 密集型函数,该函数每次从源中读取 8 个字节,然后解码获得 1 个字节写入目标流中。较好的实现是一次处理多于 8 个字节的缓冲区。更好的实现还可以通过缓冲区输出字节,进而减少目标流中单字节的写入次数。 + + +``` + /* mmdecode.c - MeowMeow 流解码器 */ + ... + int stupid_decode(FILE *src, FILE *dst) + { +   char           buf[9]; +   decoded_byte_t byte; +   int            i; +      +   while (![feof][10](src)) { +     if (![fgets][11](buf, sizeof(buf), src)) +       break; +     byte.field.f0 = [isupper][15](buf[0]); +     byte.field.f1 = [isupper][15](buf[1]); +     byte.field.f2 = [isupper][15](buf[2]); +     byte.field.f3 = [isupper][15](buf[3]); +     byte.field.f4 = [isupper][15](buf[4]); +     byte.field.f5 = [isupper][15](buf[5]); +     byte.field.f6 = [isupper][15](buf[6]); +     byte.field.f7 = [isupper][15](buf[7]); +        +     [fputc][16](byte.value, dst); +   } +   return 0; + } +``` + +我并没有使用编码器中使用的位移方法,而是创建了一个名为 `decoded_byte_t` 的自定义数据结构。 + +``` + /* mmdecode.c - MeowMeow 流解码器 */ + ... + + typedef struct { +   unsigned char f7:1; +   unsigned char f6:1; +   unsigned char f5:1; +   unsigned char f4:1; +   unsigned char f3:1; +   unsigned char f2:1; +   unsigned char f1:1; +   unsigned char f0:1; + } fields_t; +    + typedef union { +   fields_t      field; +   unsigned char value; + } decoded_byte_t; +``` + +初次看到代码时可能会感到有点儿复杂,但不要放弃。`decoded_byte_t` 被定义为 `fields_t` 和 `unsigned char` 的 **联合体** 。可以将联合中的命名成员看作同一内存区域的别名。在这种情况下,`value` 和 `field` 指向相同的 8 比特内存区域。将 `field.f0` 设置为 1 也将设置 `value` 中的最低有效位。 + +虽然 `unsigned char` 并不神秘,但是对 `fields_t` 的 别名(`typedef`) 也许看起来有些陌生。现代 C 编译器允许程序员在结构体中指定单个 bit 的值。`field` 成员是一个无符号整数类型,可以在成员标识符后紧跟一个冒号和一个整数,该整数指定了比特字段的长度。 + +这种数据结构使得按 `field` 名称访问每个比特变得简单。我们依赖编译器生成正确的移位指令来访问 `field`,这可以在调试时为你节省不少时间。 + +最后,因为`stupid_decode()` 函数一次仅从源 `FILE` 流中读取 8 个字节,所以它效率并不高。通常我们尝试最小化读写次数,以提高性能和降低调用系统调用的开销。请记住:少次数的读取/写入大的块比多次数的读取/写入小的块好得多。 + +### 总结 + +用 C 语言编写一个多文件程序需要程序员做更多计划,而不仅仅是一个 `main.c`。但是当你添加功能或者重构时,只需要多花费一点儿努力便可以节省大量时间以及避免让你头痛的问题。 + +回顾一下,我更喜欢这样做:多个文件,每个文件仅有简单功能;通过头文件公开那些文件中的小部分功能;把数字常量和字符串常量保存在头文件中;使用 `Makefile` 而不是 Bash 脚本来自动化处理事务;使用 `main()` 函数来处理和解析命令行参数并作为程序主要功能的框架。 + +我知道我只是涉及了这个简单程序中发生的事情,并且我很高兴知道哪些事情对您有所帮助以及哪些主题需要详细的解释。在评论中分享您的想法,让我知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/7/structure-multi-file-c-part-2 + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[萌新阿岩](https://github.com/mengxinayan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/file_system.jpg?itok=pzCrX1Kc (4 manilla folders, yellow, green, purple, blue) +[2]: https://opensource.com/article/19/7/how-structure-multi-file-c-program-part-1 +[3]: https://github.com/jnyjny/MeowMeow.git +[4]: https://en.wikipedia.org/wiki/Codec +[5]: https://opensource.com/article/19/5/how-write-good-c-main-function +[6]: https://github.com/JnyJny/meowmeow/blob/master/main.h +[7]: https://github.com/JnyJny/meowmeow/blob/master/main.c +[8]: https://github.com/JnyJny/meowmeow/blob/master/mmencode.h +[9]: https://github.com/JnyJny/meowmeow/blob/master/mmdecode.h +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgets.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fputs.html +[14]: https://github.com/JnyJny/meowmeow/blob/master/table.h +[15]: http://www.opengroup.org/onlinepubs/009695399/functions/isupper.html +[16]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html From f058cb8df986784640b6b97c19bb9495fe38f1e9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 23:24:47 +0800 Subject: [PATCH 133/207] PRF @geekpi --- ...4 PHP Development on Fedora with Eclipse.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20200214 PHP Development on Fedora with Eclipse.md b/translated/tech/20200214 PHP Development on Fedora with Eclipse.md index a9e0e48a56..ad2bc7927e 100644 --- a/translated/tech/20200214 PHP Development on Fedora with Eclipse.md +++ b/translated/tech/20200214 PHP Development on Fedora with Eclipse.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (PHP Development on Fedora with Eclipse) @@ -12,7 +12,7 @@ ![][1] -[Eclipse][2] 是由 Eclipse 基金会开发的功能全面的免费开源 IDE。自 2001 年以来一直存在。你可以在此 IDE 中编写从 C/C++ 和 Java 到 PHP、Python、HTML、JavaScript、Kotlin 等。 +[Eclipse][2] 是由 Eclipse 基金会开发的功能全面的自由开源 IDE。它诞生于 2001 年。你可以在此 IDE 中编写各种程序,从 C/C++ 和 Java 到 PHP,乃至于 Python、HTML、JavaScript、Kotlin 等等。 ### 安装 @@ -36,15 +36,15 @@ sudo dnf install eclipse-pdt ### 示例项目 -现在已经安装了 IDE,让我们创建一个简单的 PHP 项目。进入 _File →New → Project_。在出现的对话框中,选择 _PHP project_。输入项目的名称。你可能还需要更改其他一些选项,例如更改项目的默认位置,启用 JavaScript 以及更改 PHP 版本。请看以下截图。 +现在已经安装了 IDE,让我们创建一个简单的 PHP 项目。进入 “File →New → Project”。在出现的对话框中,选择 “PHP project”。输入项目的名称。你可能还需要更改其他一些选项,例如更改项目的默认位置,启用 JavaScript 以及更改 PHP 版本。请看以下截图。 ![Create A New PHP Project in Eclipse][3] -你可以单击 _Finish_ 按钮创建项目,或按 _Next_ 配置其他选项,例如添加包含和构建路径。在大多数情况下,你无需更改这些设置。 +你可以单击 “Finish” 按钮创建项目,或按 “Next” 配置其他选项,例如添加包含和构建路径。在大多数情况下,你无需更改这些设置。 -创建项目后,右键单击项目文件夹,然后选择 _New→PHP File_ 将新的 PHP 文件添加到项目。在本教程中,我将其命名为 _index.php_,这是每个 PHP 项目中公认的默认文件。 +创建项目后,右键单击项目文件夹,然后选择 “New→PHP File” 将新的 PHP 文件添加到项目。在本教程中,我将其命名为 `index.php`,这是每个 PHP 项目中公认的默认文件。 -![][4] +![add a new PHP file][4] 接着在新文件中添加代码。 @@ -52,9 +52,9 @@ sudo dnf install eclipse-pdt 在上面的例子中,我在同一页面上使用了 CSS、JavaScript 和 PHP 标记,主要是为了展示 IDE 能够支持所有这些标记。 -页面完成后,你可以将文件移至 Web 服务器文档根目录或在项目目录中创建一个开发 PHP 服务器来查看输出。 +页面完成后,你可以将文件移至 Web 服务器文档根目录或在项目目录中创建一个 PHP 开发服务器来查看输出。 -借助 Eclipse 中的内置终端,我们可以直接在 IDE 中启动 PHP 开发服务器。只需单击工具栏上的终端图标(![Terminal Icon][6]),然后单击 _OK_。在新终端中,进入项目目录,然后运行以下命令: +借助 Eclipse 中的内置终端,我们可以直接在 IDE 中启动 PHP 开发服务器。只需单击工具栏上的终端图标(![Terminal Icon][6]),然后单击 “OK”。在新终端中,进入项目目录,然后运行以下命令: ``` php -S localhost:8080 -t . index.php @@ -73,7 +73,7 @@ via: https://fedoramagazine.org/php-development-on-fedora-with-eclipse/ 作者:[Mehdi Haghgoo][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e914684a46546d8c4e549cc3e65fcba9a2e36fa0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 23:25:25 +0800 Subject: [PATCH 134/207] PUB @geekpi https://linux.cn/article-11967-1.html --- .../20200214 PHP Development on Fedora with Eclipse.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200214 PHP Development on Fedora with Eclipse.md (98%) diff --git a/translated/tech/20200214 PHP Development on Fedora with Eclipse.md b/published/20200214 PHP Development on Fedora with Eclipse.md similarity index 98% rename from translated/tech/20200214 PHP Development on Fedora with Eclipse.md rename to published/20200214 PHP Development on Fedora with Eclipse.md index ad2bc7927e..d373722c0e 100644 --- a/translated/tech/20200214 PHP Development on Fedora with Eclipse.md +++ b/published/20200214 PHP Development on Fedora with Eclipse.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11967-1.html) [#]: subject: (PHP Development on Fedora with Eclipse) [#]: via: (https://fedoramagazine.org/php-development-on-fedora-with-eclipse/) [#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) From f8531192dda8f9e5489b9c33c1765840f6439bc9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 23:49:38 +0800 Subject: [PATCH 135/207] PRF @wxy --- ... fast, private open source mesh network.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200214 How to set up your own fast, private open source mesh network.md b/translated/tech/20200214 How to set up your own fast, private open source mesh network.md index 1ce5cdae9d..f23480ebc6 100644 --- a/translated/tech/20200214 How to set up your own fast, private open source mesh network.md +++ b/translated/tech/20200214 How to set up your own fast, private open source mesh network.md @@ -1,28 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to set up your own fast, private open source mesh network) [#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh) [#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason) -如何建立自己的快速、私有的开源网状网络 +如何建立自己的快速、私有的开源网状网络(mesh) ====== > 只需要不到 10 分钟的安装时间,就可以用 FreeMesh 搭建一个经济实惠、性能卓越、尊重隐私的网格系统。 -![people on top of a connected globe][1] +![](https://img.linux.net.cn/data/attachment/album/202003/06/234848jaga52a0wx05w0f0.jpg) -[FreeMesh][2] 系统有望为大众带来完全开源的网格网络mesh network。我最近有机会进行了测试;它安装迅速,性能非常好 —— 特别是相对它的价格而言。 +[FreeMesh][2] 系统有望为大众带来完全开源的网状网络mesh network(LCTT 译注:也称之为“多跳网络”)。我最近有机会对它进行了测试;它安装迅速,性能非常好 —— 特别是相对它的价格而言。 ### 为什么要网格化和开源? -使用开源的原因很简单:隐私。有了 FreeMesh,你的数据就是你自己的。它不会跟踪或收集数据。不相信吗?毕竟,你可以轻松检查 —— 它是开源的!而其它大型高科技企业集团提供的一些流行的网格解决方案,你是否相信它们会保护你的数据? +使用开源的原因很简单:隐私。有了 FreeMesh,你的数据就是你自己的。它不会跟踪或收集数据。不相信吗?毕竟,你可以轻松检查 —— 它是开源的!而其它大型高科技企业集团提供的一些流行的网状网络解决方案,你是否相信它们会保护你的数据? -另一个重要因素:更新。FreeMesh 表示,它将致力于定期发布安全性和性能更新。从现在起到 10 年后呢?使用开放源代码解决方案,你可以根据需要自由地更新产品。 +另一个重要因素:更新。FreeMesh 表示,它将致力于定期发布安全性和性能更新。从现在起到 10 年后呢?使用开源解决方案,你可以根据需要自由地更新产品。 -那么为什么要用网格呢?在网状网络中,多个无线路由器一起工作以广播单个超大型的无线网络。网状网络中的每个路由器都可与其他路由器智能地通信,以便为你的数据提供最佳的“路径”。FreeMesh 网站上的以下图片突出显示了使用单个无线路由器和网状网络之间的区别。 红色网络表示单个无线路由器,绿色网络是网状网络。 +那么为什么要用网状网络呢?在网状网络中,多个无线路由器一起工作以广播单个超大型的无线网络。网状网络中的每个路由器都可与其他路由器智能地通信,以便为你的数据提供最佳的“路径”。FreeMesh 网站上的以下图片突出显示了使用单个无线路由器和网状网络之间的区别。红色网络表示单个无线路由器,绿色网络是网状网络。 ![单路由器网络] [3] @@ -52,7 +52,7 @@ FreeMesh 路由器的一些规格非常好: ![FreeMesh 设置步骤 1][8] -2、等待约 30 至 60 秒。设置完成后,节点将闪烁其 LED。 +2、等待约 30 至 60 秒。设置完成后,节点的 LED 将会闪烁。 ![FreeMesh 设置步骤 2][9] @@ -74,7 +74,7 @@ FreeMesh 是开箱即用的,它由 OpenWRT 和 LuCI 组合而成。它具有 设置完 FreeMesh 系统后,我将节点移动到了房屋周围的各个地方。我使用 [iPerf][13] 测试带宽,它达到了约 150Mbps。WiFi 可能会受到许多环境变量的影响,因此你的结果可能会有所不同。节点与主路由器之间的距离在带宽中也有很大的影响。 -但是,网状网络的真正优势不是高峰速度,而是整个空间的平均速度要好得多。即使在我家很远的地方,我仍然能够流媒体播放视频并正常工作。我甚至可以在后院工作。在出门之前,我只是将一个节点重新放在窗口前面而已。 +但是,网状网络的真正优势不是高峰速度,而是整个空间的平均速度要好得多。即使在我家很远的地方,我仍然能够用流媒体播放视频并正常工作。我甚至可以在后院工作。在出门之前,我只是将一个节点重新放在窗口前面而已。 ### 结论 @@ -91,7 +91,7 @@ via: https://opensource.com/article/20/2/mesh-network-freemesh 作者:[Spencer Thomason][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ef01bb94f3a2382c6bcdcd2bf6505dc786a878ee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 6 Mar 2020 23:52:50 +0800 Subject: [PATCH 136/207] PUB @wxy https://linux.cn/article-11968-1.html --- ... set up your own fast, private open source mesh network.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200214 How to set up your own fast, private open source mesh network.md (98%) diff --git a/translated/tech/20200214 How to set up your own fast, private open source mesh network.md b/published/20200214 How to set up your own fast, private open source mesh network.md similarity index 98% rename from translated/tech/20200214 How to set up your own fast, private open source mesh network.md rename to published/20200214 How to set up your own fast, private open source mesh network.md index f23480ebc6..dbf4bfc481 100644 --- a/translated/tech/20200214 How to set up your own fast, private open source mesh network.md +++ b/published/20200214 How to set up your own fast, private open source mesh network.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11968-1.html) [#]: subject: (How to set up your own fast, private open source mesh network) [#]: via: (https://opensource.com/article/20/2/mesh-network-freemesh) [#]: author: (Spencer Thomason https://opensource.com/users/spencerthomason) From 59288fa92b615ccf78e699aa0e95b1f32a90df88 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 7 Mar 2020 01:01:58 +0800 Subject: [PATCH 137/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200306=20How=20?= =?UTF-8?q?I=20learned=20about=20burnout=20the=20hard=20way?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200306 How I learned about burnout the hard way.md --- ...ow I learned about burnout the hard way.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20200306 How I learned about burnout the hard way.md diff --git a/sources/tech/20200306 How I learned about burnout the hard way.md b/sources/tech/20200306 How I learned about burnout the hard way.md new file mode 100644 index 0000000000..ce9af6fb52 --- /dev/null +++ b/sources/tech/20200306 How I learned about burnout the hard way.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I learned about burnout the hard way) +[#]: via: (https://opensource.com/article/20/3/burnout) +[#]: author: (Jason Hibbets https://opensource.com/users/jhibbets) + +How I learned about burnout the hard way +====== +Burnout can happen to anyone. Here are the 3 things I wish I knew before +I burned out. +![Light bulb][1] + +In early 2017, I was mentally in a bad spot. It was the perfect storm of stress, the kind that no one asks for, but you deal with the hand you're dealt. Work was piling up to a point where I couldn't process all the things that were expected of me. I was training for spring half-marathons, which should have been stress relief, but I was putting too much pressure on myself to perform at a high level. And then on top of the everyday family obligations, a surgery in our household turned us into a one-car family and seriously added to the mounting pressure on me to provide and take care of the family. + +Then I broke. + +It wasn't one thing. It was the culmination of things. And it hit me from the blind side, unexpected. I never thought I would be a victim of burnout. I was aware of it and thoughtful about the community I was managing. But "not me," I thought to myself, "I've got this under control." I remember thinking that something was wrong; something was off. But I couldn't quite put my finger on the source. + +I distinctly remember the day where I cried at work, crumbling under the pressure that I was putting on myself. I consider myself a high performer in the office environment. I push myself to exceed the goals that my team co-creates because I want that success. I want the feeling that comes with it. But this experience was different. This wasn't a healthy win for my team or me. I felt like I let everyone down, including myself. + +I was attending South by Southwest in Austin, Texas, where I was [presenting my first Ignite Talk][2] on applying open source principles to government—a talk that was well received by the audience. I remember practicing, and practicing, and practicing more the day before and the morning of my talk. I got that high that comes after delivering a great talk. I had a book signing at the City of Raleigh's Economic Development booth during the event, which was another emotional boost. Life was good. Upon reflection, that's when I started noticing signs of my burnout. + +I didn't have much of an appetite. I was tired all the time. I was sleeping in, and not because of jet lag. I was exercising but wasn't getting the endorphins I was used to. And I wasn't motivated to do the work that I normally love to do. I was very blah and meh about getting work done or hanging out with people I love. These are all signs of depression and burnout. + +After the trip, I scheduled my annual physical and talked to my doctor about my situation, who recommended I see a psychologist. I sat on the couch and talked things out. I was diagnosed with severe anxiety, which was enough for me to know that I didn't want to know what true depression felt like. + +I learned my lesson the hard way. I'd like to share my experience so that you can recognize the signs and avoid going down this path. And before we move on, I must say that it's perfectly fine to ask for help. Ask a trusted co-worker or friend for help or guidance. We're human, and we need to help each other through the ups and the downs. + +### Three things to know about burnout + +Work burnout is a form of depression where you are not motivated to do the things that are expected of you at your job. It's not the occasional slacking off or spring fever because the weather is nice. It's a buildup of emotional stress where you don't want to do what is asked of you at work. There are numerous factors that can lead to burnout. + +#### Know the signs of burnout + +Lesson number one about burnout is to know the signs. I mentioned some of the things I was experiencing, but there are many others. I remember one thing that was extremely abnormal for me (because I'm so social) is that I started to separate myself from my usual team activities and people. + + * Hey Jason, want to grab lunch with us? Nope, I'm too busy. + * Hey Jason, Matt's in town, want to join us for happy hour? No. I've got work to do. + + + +This is totally unlike me. I would normally have said yes to both those opportunities. According to the [Mayo Clinic][3], here are a few things to ask yourself if you think you are experiencing burnout: + + * Do you drag yourself to work? + * Do you have trouble getting started with work? + * Are you cynical or critical at work? + * Have you become irritable or impatient with co-workers or customers? + * Do you lack the energy to be productive? + * Do you find it hard to concentrate? + * Do you lack satisfaction from your achievements? + * Do you feel disillusioned about your work? + * Are you using food, drugs, or alcohol to feel better or to simply not feel? + * Have your sleep habits changed? + * Are you troubled by unexplained headaches, stomach or bowel problems, or other physical complaints? + + + +You can check your own burnout risk at [BurnoutIndex.org][4], an anonymous online questionnaire created in response to the [high level of burnout][5] in the tech industry. + +#### Prevent burnout + +The second lesson is to identify ways [to prevent burnout][6]. First, take time away from your job and plan time to unplug and unwind. This means planning vacations, staycations, or other time away from work. It's sometimes hard to unplug like this with the pressures and obligations we put on ourselves. + +There are three different levels of paid time off (PTO): + + 1. **Best way to unplug:** I'm totally cut-off, not logging in, not checking email. + 2. **Decent way to unplug:** I'm kind of checking in, but not as responsive as normal. + 3. **Meh way to unplug:** I'm available if you need me, I'll monitor email, but I'm away from normal office life. + + + +Your situation will dictate which of these levels of time off will work for you. In my experience, you need at least two total check-outs a year. I typically have a blend of all three throughout the year, but since 2017, I have taken at least three week-long vacations each year to completely escape. It's working so far! + +#### Manage stress + +The third and final lesson is to manage stress effectively. My first go-to for stress management is exercise. I'm addicted to it. I work out pretty much every single day. And I like to mix it up: Cardio, weight lifting, swimming, running, cycling, surfing, and high-intensity interval training (HIIT) are staples in my exercise routine. I used to focus solely on running four to six half marathons a year, but I recently switched to triathlons. The multidisciplinary aspect of the activity has brought more joy and different challenges to my life. + +Another way to reduce stress is to manage your time better. Time is our most precious resource. You've got to choose how you want to spend your time. Family, work, self, social? It's up to you. Find ways to work more efficiently, more effectively, and make sure that you put yourself first. It may sound selfish, but as I've learned from the airplane preflight safety videos, "you need to put your mask on first before helping others." + +### Conclusion + +Burnout can lead to fatigue, excessive stress, sadness, anger, irritability, insomnia, alcohol or substance misuse, heart disease, and other medical conditions—all things that are not good for humans or for your team at work. I hope you can use these tips to put yourself first, reduce stress, and prevent burnout. + +* * * + +_Jason Hibbets will present "[10 things I wish I knew before experiencing burnout][7]" at [SCaLE 18x][8], March 5–8, 2020, in Pasadena, Calif. This article is a preview for the talk and a way to share a bit of his experience._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/burnout + +作者:[Jason Hibbets][a] +选题:[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/jhibbets +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bulb-light-energy-power-idea.png?itok=zTEEmTZB (Light bulb) +[2]: https://schedule.sxsw.com/2017/events/PP96070 +[3]: https://www.mayoclinic.org/healthy-lifestyle/adult-health/in-depth/burnout/art-20046642 +[4]: https://burnoutindex.org/ +[5]: https://opensource.com/article/19/11/burnout-open-source-communities +[6]: https://www.redhat.com/sysadmin/tips-avoiding-burnout +[7]: https://www.socallinuxexpo.org/scale/18x/presentations/10-things-i-wish-i-knew-experiencing-burnout +[8]: https://www.socallinuxexpo.org/scale/18x/ From d9b1ce8a6ba5484470f7bbb8110a55e620497476 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 7 Mar 2020 01:06:10 +0800 Subject: [PATCH 138/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200306=20Commun?= =?UTF-8?q?icating=20with=20other=20users=20on=20the=20Linux=20command=20l?= =?UTF-8?q?ine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200306 Communicating with other users on the Linux command line.md --- ...h other users on the Linux command line.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20200306 Communicating with other users on the Linux command line.md diff --git a/sources/tech/20200306 Communicating with other users on the Linux command line.md b/sources/tech/20200306 Communicating with other users on the Linux command line.md new file mode 100644 index 0000000000..838c022976 --- /dev/null +++ b/sources/tech/20200306 Communicating with other users on the Linux command line.md @@ -0,0 +1,148 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Communicating with other users on the Linux command line) +[#]: via: (https://www.networkworld.com/article/3530343/communicating-with-other-users-on-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Communicating with other users on the Linux command line +====== + +Thinkstock / Linux + +Sending messages to other users on the Linux command line can be very easy, but there are a number of commands that you might want to consider. In this post, we’ll look at four commands and see how each of them works. + +### wall + +The **wall** command (as in "write all") allows you to send a message to all users who are currently logged into the system. This implies that the system is likely a server and that users are working on the command line. While the wall command is generally used by sysadmins to send out notices to users to let send out information (e.g., that the server is going down for maintenance), it can be used by any user. + +A sysadmin might send out a message like this: + +``` +$ wall The system will be going down in 15 minutes to address a serious problem +``` + +Everyone logged into the system will see something like this: + +``` +Broadcast message from admin@dragonfly (pts/0) (Thu Mar 5 08:56:42 2020): + +The system is going down in 15 minutes to address a serious problem +``` + +If you want to use single quote marks in your message, enclose the message in double quote marks like this: + +``` +$ wall “Don’t forget to save your work before logging off” +``` + +The outside quote marks will not show up in the transmitted message, but, without them, the command sits and waits for a closing single quote. + +### mesg + +If, for some reason, you don’t want to accept messages from another user, you can stop them from arriving with the **mesg** command. This command can be used with a “n” argument to refuse mail from the user or a “y” argument to allow the messages to arrive. + +[][1] + +``` +$ mesg n doug +$ mesg y doug +``` + +The blocked user will not be notified that their messages have been blocked. You can also block or allow all messages with a **mesg** command like one of these: + +``` +$ mesg y +$ mesg n +``` + +### write + +Another command for sending text without reverting to email is **write**. This command can be used to communicate with a specific user. + +``` +$ write nemo +Are you still at your desk? +I need to talk with you right away. +^C +``` + +Enter your text and use **^C** to exit when you’re done. The command allows you to send text, but doesn’t start a two-way conversation. It just sends the text. If the user is logged in on more than one terminal, you can specify which terminal you want to send the message to or you can rely on the system to choose the one with the shortest idle time. + +``` +$ write nemo#1 +``` + +If the user you are trying to write to has messages blocked, you should see something like this: + +``` +$ write nemo +write: nemo has messages disabled +``` + +### talk/ytalk + +The **talk** or **ytalk** command gives you a chance to have an interactive chat with one or more other users. The command will bring up a double-pane (top and bottom) window. Each individual will type into the top portion of the display on their screen and see the responses in the bottom section(s). The respondents can respond to a talk request by typing "talk" followed by the username of the person addressing them. + +``` +Message from Talk_Daemon@dragonfly at 10:10 ... +talk: connection requested by dory@127.0.0.1. +talk: respond with: talk dory@127.0.0.1 + +$ talk dory +``` + +The window can involve more than two participants if **ytalk** is used. As you can see in the example below (the result of the "talk dory" command shown above), talk is often ytalk. + +``` +----------------------------= YTalk version 3.3.0 =-------------------------- +Is the report ready? + +-------------------------------= nemo@dragonfly =---------------------------- +Just finished it +``` + +As explained above, on the other side of the conversation, the talk session window panes are reversed: + +``` +----------------------------= YTalk version 3.3.0 =-------------------------- +Just finished it + +-------------------------------= dory@dragonfly =---------------------------- +Is the report ready? +``` + +Again, use **^C** to exit. + +To talk with someone on another system, you just need to add a **-h** option and the hostname or IP address with a command like this: + +``` +$ talk -h 192.168.0.11 nemo +``` + +### Wrap-Up + +There are a number of basic commands for sending messages to other logged-in users on Linux systems, and they can be especially useful when you need to send out a quick message to all of the users, prefer a quick exchange to a phone call or want to easily involve more than two people in a quick messaging session. + +Some commands, like **wall**, allow a message to be broadcast, but are not interactive. Others, like **talk**, allow both lengthy and multi-user chats, avoiding the need to set up a conference call when a fairly quick exchange of information is all that's required. + +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/3530343/communicating-with-other-users-on-the-linux-command-line.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/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) +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From 3a7c5ddebdca3241dfe9a8d183a57b87efca477b Mon Sep 17 00:00:00 2001 From: caiichenr <34886864+caiichenr@users.noreply.github.com> Date: Sat, 7 Mar 2020 01:18:03 +0800 Subject: [PATCH 139/207] Update and rename sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md to translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md --- ...reaking breakpoint for Python debugging.md | 238 ------------------ ...reaking breakpoint for Python debugging.md | 237 +++++++++++++++++ 2 files changed, 237 insertions(+), 238 deletions(-) delete mode 100644 sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md create mode 100644 translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md diff --git a/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md b/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md deleted file mode 100644 index 0cafd51c17..0000000000 --- a/sources/tech/20190813 Building a non-breaking breakpoint for Python debugging.md +++ /dev/null @@ -1,238 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (caiichenr) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Building a non-breaking breakpoint for Python debugging) -[#]: via: (https://opensource.com/article/19/8/debug-python) -[#]: author: (Liran Haimovitch https://opensource.com/users/liranhaimovitch) - -Building a non-breaking breakpoint for Python debugging -====== -Have you ever wondered how to speed up a debugger? Here are some lessons -learned while building one for Python. -![Real python in the graphic jungle][1] - -This is the story of how our team at [Rookout][2] built non-breaking breakpoints for Python and some of the lessons we learned along the way. I'll be presenting all about the nuts and bolts of debugging in Python at [PyBay 2019][3] in San Francisco this month. Let's dig in. - -### The heart of Python debugging: sys.set_trace - -There are many Python debuggers out there. Some of the more popular include: - - * **pdb**, part of the Python standard library - * **PyDev**, the debugger behind the Eclipse and PyCharm IDEs - * **ipdb**, the IPython debugger - - - -Despite the range of choices, almost every Python debugger is based on just one function: **sys.set_trace**. And let me tell you, **[sys.settrace][4]** might just be the most complex function in the Python standard library. - -![set_trace Python 2 docs page][5] - -In simpler terms, **settrace** registers a trace function for the interpreter, which may be called in any of the following cases: - - * Function call - * Line execution - * Function return - * Exception raised - - - -A simple trace function might look like this: - - -``` -def simple_tracer(frame, event, arg): -  co = frame.f_code -  func_name = co.co_name -  line_no = frame.f_lineno -  print("{e} {f} {l}".format( -e=event, f=func_name, l=line_no)) -  return simple_tracer -``` - -When looking at this function, the first things that come to mind are its arguments and return values. The trace function arguments are: - - * **frame** object, which is the full state of the interpreter at the point of the function's execution - * **event** string, which can be **call**, **line**, **return**, or **exception** - * **arg** object, which is optional and depends on the event type - - - -The trace function returns itself because the interpreter keeps track of two kinds of trace functions: - - * **Global trace function (per thread):** This trace function is set for the current thread by **sys.settrace** and is invoked whenever a new **frame** is created by the interpreter (essentially on every function call). While there's no documented way to set the trace function for a different thread, you can call **threading.settrace** to set the trace function for all newly created **threading** module threads. - * **Local trace function (per frame):** This trace function is set by the interpreter to the value returned by the global trace function upon frame creation. There's no documented way to set the local trace function once the frame has been created. - - - -This mechanism is designed to allow the debugger to have more granular control over which frames are traced to reduce performance impact. - -### Building our debugger in three easy steps (or so we thought) - -With all that background, writing your own debugger using a custom trace function looks like a daunting task. Luckily, **pdb**, the standard Python debugger, is built on top of **Bdb**, a base class for building debuggers. - -A naive breakpoints debugger based on **Bdb** might look like this: - - -``` -import bdb -import inspect - -class Debugger(bdb.Bdb): -  def __init__(self): -      Bdb.__init__(self) -      self.breakpoints = dict() -      self.set_trace() - -def set_breakpoint(self, filename, lineno, method): -  self.set_break(filename, lineno) -  try : -      self.breakpoints[(filename, lineno)].add(method) -  except KeyError: -      self.breakpoints[(filename, lineno)] = [method] - -def user_line(self, frame): -  if not self.break_here(frame): -      return - -  # Get filename and lineno from frame -  (filename, lineno, _, _, _) = inspect.getframeinfo(frame) - -  methods = self.breakpoints[(filename, lineno)] -  for method in methods: -      method(frame) -``` - -All this does is: - - 1. Inherits from **Bdb** and write a simple constructor initializing the base class and tracing. - 2. Adds a **set_breakpoint** method that uses **Bdb** to set the breakpoint and keeps track of our breakpoints. - 3. Overrides the **user_line** method that is called by **Bdb** on certain user lines. The function makes sure it is being called for a breakpoint, gets the source location, and invokes the registered breakpoints - - - -### How well did the simple Bdb debugger work? - -Rookout is about bringing a debugger-like user experience to production-grade performance and use cases. So, how well did our naive breakpoint debugger perform? - -To test it and measure the global performance overhead, we wrote two simple test methods and executed each of them 16 million times under multiple scenarios. Keep in mind that no breakpoint was executed in any of the cases. - - -``` -def empty_method(): -   pass - -def simple_method(): -   a = 1 -   b = 2 -   c = 3 -   d = 4 -   e = 5 -   f = 6 -   g = 7 -   h = 8 -   i = 9 -   j = 10 -``` - -Using the debugger takes a shocking amount of time to complete. The bad results make it clear that our naive **Bdb** debugger is not yet production-ready. - -![First Bdb debugger results][6] - -### Optimizing the debugger - -There are three main ways to reduce debugger overhead: - - 1. **Limit local tracing as much as possible:** Local tracing is very costly compared to global tracing due to the much larger number of events per line of code. - 2. **Optimize "call" events and return control to the interpreter faster:** The main work in **call** events is deciding whether or not to trace. - 3. **Optimize "line" events and return control to the interpreter faster:** The main work in **line** events is deciding whether or not we hit a breakpoint. - - - -So we forked **Bdb**, reduced the feature set, simplified the code, optimized for hot code paths, and got impressive results. However, we were still not satisfied. So, we took another stab at it, migrated and optimized our code to **.pyx**, and compiled it using [Cython][7]. The final results (as you can see below) were still not good enough. So, we ended up diving into CPython's source code and realizing we could not make tracing fast enough for production use. - -![Second Bdb debugger results][8] - -### Rejecting Bdb in favor of bytecode manipulation - -After our initial disappointment from the trial-and-error cycles of standard debugging methods, we decided to look into a less obvious option: bytecode manipulation. - -The Python interpreter works in two main stages: - - 1. **Compiling Python source code into Python bytecode:** This unreadable (for humans) format is optimized for efficient execution and is often cached in those **.pyc** files we have all come to love. - 2. **Iterating through the bytecode in the _interpreter loop_:** This executes one instruction at a time. - - - -This is the pattern we chose: use **bytecode manipulation** to set **non-breaking breakpoints** with no global overhead. This is done by finding the bytecode in memory that represents the source line we are interested in and inserting a function call just before the relevant instruction. This way, the interpreter does not have to do any extra work to support our breakpoints. - -This approach is not magic. Here's a quick example. - -We start with a very simple function: - - -``` -def multiply(a, b): -   result = a * b -   return result -``` - -In documentation hidden in the **[inspect][9]** module (which has several useful utilities), we learn we can get the function's bytecode by accessing **multiply.func_code.co_code**: - - -``` -`'|\x00\x00|\x01\x00\x14}\x02\x00|\x02\x00S'` -``` - -This unreadable string can be improved using the **[dis][10]** module in the Python standard library. By calling **dis.dis(multiply.func_code.co_code)**, we get: - - -``` -  4          0 LOAD_FAST               0 (a) -             3 LOAD_FAST               1 (b) -             6 BINARY_MULTIPLY     -             7 STORE_FAST              2 (result) - -  5         10 LOAD_FAST               2 (result) -            13 RETURN_VALUE       -``` - -This gets us closer to understanding what happens behind the scenes of debugging but not to a straightforward solution. Unfortunately, Python does not offer a method for changing a function's bytecode from within the interpreter. You can overwrite the function object, but that's not good enough for the majority of real-world debugging scenarios. You have to go about it in a roundabout way using a native extension. - -### Conclusion - -When building a new tool, you invariably end up learning a lot about how stuff works. It also makes you think out of the box and keep your mind open to unexpected solutions. - -Working on non-breaking breakpoints for Rookout has taught me a lot about compilers, debuggers, server frameworks, concurrency models, and much much more. If you are interested in learning more about bytecode manipulation, Google's open source **[cloud-debug-python][11]** has tools for editing bytecode. - -* * * - -_Liran Haimovitch will present "[Understanding Python’s Debugging Internals][12]" at [PyBay][3], which will be held August 17-18 in San Francisco. Use code [OpenSource35][13] for a discount when you purchase your ticket to let them know you found out about the event from our community._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/8/debug-python - -作者:[Liran Haimovitch][a] -选题:[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/liranhaimovitch -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_jungle_lead.jpeg?itok=pFKKEvT- (Real python in the graphic jungle) -[2]: https://rookout.com/ -[3]: https://pybay.com/ -[4]: https://docs.python.org/3/library/sys.html#sys.settrace -[5]: https://opensource.com/sites/default/files/uploads/python2docs.png (set_trace Python 2 docs page) -[6]: https://opensource.com/sites/default/files/uploads/debuggerresults1.png (First Bdb debugger results) -[7]: https://cython.org/ -[8]: https://opensource.com/sites/default/files/uploads/debuggerresults2.png (Second Bdb debugger results) -[9]: https://docs.python.org/2/library/inspect.html -[10]: https://docs.python.org/2/library/dis.html -[11]: https://github.com/GoogleCloudPlatform/cloud-debug-python -[12]: https://pybay.com/speaker/liran-haimovitch/ -[13]: https://ti.to/sf-python/pybay2019/discount/OpenSource35 diff --git a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md b/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md new file mode 100644 index 0000000000..aa3a5fa109 --- /dev/null +++ b/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md @@ -0,0 +1,237 @@ +[#]: collector: (lujun9972) +[#]: translator: (caiichenr) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Building a non-breaking breakpoint for Python debugging) +[#]: via: (https://opensource.com/article/19/8/debug-python) +[#]: author: (Liran Haimovitch https://opensource.com/users/liranhaimovitch) + +在 Python 调试过程中设置不中断的断点 +====== +你对如何让调试器变得更快产生过兴趣吗?本文将分享我们在为 Python 构建调试器时得到的一些经验。 +![Real python in the graphic jungle][1] + +整段故事讲的是我们在 [Rookout][2] 公司的团队为 Python 调试器开发不中断断点的经历,以及开发过程中得到的经验。我将在本月于旧金山举办的 [PyBay 2019][3] 上介绍有关 Python 调试过程的更多细节,但现在就让我们立刻开始这段故事。 + +### Python 调试器的心脏:sys.set_trace + +在诸多可选的 Python 调试器中,使用最广泛的三个是: + + * **pdb**,它是 Python 标准库的一部分 + * **PyDev**,它是内嵌在 Eclipse 和 Pycharm 等 IDE 中的调试器 + * **ipdb**,它是IPython的调试器 + + + +Python 调试器的选择虽多,但它们几乎都基于同一个函数:**sys.set_trace**。 值得一提的是, **[sys.settrace][4]** 可能也是 Python 标准库中最复杂的函数。 + +![set_trace Python 2 docs page][5] + +简单来讲,**settrace** 的作用是为解释器注册一个跟踪函数,它在下列四种情形发生时被调用: + + * 函数调用 (Function call) + * 语句执行 (Line execution) + * 函数返回 (Function return) + * 异常抛出 (Exception raised) + + + +一个简单的跟踪函数看上去大概是这样: + + +``` +def simple_tracer(frame, event, arg): +  co = frame.f_code +  func_name = co.co_name +  line_no = frame.f_lineno +  print("{e} {f} {l}".format( +e=event, f=func_name, l=line_no)) +  return simple_tracer +``` + +在分析函数时我们首先关注的是参数和返回值,该跟踪函数的参数分别是: + + * **frame**,当前堆栈帧,它是包含当前函数执行时解释器里完整状态的对象 + * **event**,它是一个值可能为 **"call"**, **"line"**, **"return"**, 或 **"exception"** 的字符串 + * **arg**,它的取值基于 event 的类型,是一个可选项 + + + +该跟踪函数的返回值是它自身,这是由于解释器需要持续跟踪两类跟踪函数: + + * **全局跟踪函数(每线程):** 该跟踪函数由当前线程调用 **sys.settrace** 来设置,并在解释器创建一个新 **frame** 时被调用(即代码中发生函数调用时)。虽然没有现成的方式来为不同的线程设置跟踪函数,但你可以调用 **threading.settrace** 来为所有新创建的 **threading** 模块线程设置跟踪函数。 + * **局部跟踪函数(每一帧):** 解释器将该跟踪函数的值设置为全局跟踪函数创建帧时的返回值。同样也没有现成的方法能够在帧被创建时自动设置局部跟踪函数。 + + + +该机制的目的是让调试器对被跟踪的帧有更精确的把握,以减少对性能的影响。 + +### 简单三步构建调试器 (我们最初的设想) + +仅仅依靠上文提到的内容,用自制的跟踪函数来构建一个真正的调试器似乎有些不切实际。幸运的是,Python 的标准调试器 **pdb** 是基于 **Bdb** 构建的,后者是 Python 标准库中专门用于构建调试器的基类。 + +基于 **Bdb** 的简易断点调试器看上去是这样的: + + +``` +import bdb +import inspect + +class Debugger(bdb.Bdb): +  def __init__(self): +      Bdb.__init__(self) +      self.breakpoints = dict() +      self.set_trace() + +def set_breakpoint(self, filename, lineno, method): +  self.set_break(filename, lineno) +  try : +      self.breakpoints[(filename, lineno)].add(method) +  except KeyError: +      self.breakpoints[(filename, lineno)] = [method] + +def user_line(self, frame): +  if not self.break_here(frame): +      return + +  # Get filename and lineno from frame +  (filename, lineno, _, _, _) = inspect.getframeinfo(frame) + +  methods = self.breakpoints[(filename, lineno)] +  for method in methods: +      method(frame) +``` + +这个调试器类的全部构成是: + + 1. 继承 **Bdb**,定义一个简单的构造函数来初始化基类,并开始跟踪。 + 2. 添加 **set_breakpoint** 方法,它使用 **Bdb** 来设置断点,并跟踪这些断点。 + 3. 重载 **Bdb** 在当前用户行调用的 **user_line** 方法,该方法一定被一个断点调用,之后获取该断点的源位置,并调用已注册的断点。 + + + +### 这个简易的 Bdb 调试器效率如何呢? + +Rookout 的目标是在生产级性能的使用场景下提供接近普通调试器的使用体验。那么,让我们来看看先前构建出来的简易调试器表现的如何。 + +为了衡量调试器的整体性能开销,我们使用如下两个简单的函数来进行测试,它们分别在不同的情景下执行了 1600 万次。请注意,在所有情景下断点都不会被执行。 + + +``` +def empty_method(): +   pass + +def simple_method(): +   a = 1 +   b = 2 +   c = 3 +   d = 4 +   e = 5 +   f = 6 +   g = 7 +   h = 8 +   i = 9 +   j = 10 +``` + +在使用调试器的情况下需要大量的时间才能完成测试。糟糕的结果指明了,这个简陋 **Bdb** 调试器的性能还远不足以在生产环境中使用。 + +![First Bdb debugger results][6] + +### 对调试器进行优化 + +降低调试器的额外开销主要有三种方法: + + 1. **尽可能的限制局部跟踪:** 由于每一行代码都可能包含大量事务,局部跟踪比全局跟踪的开销要大得多。 + 2. **优化 "call" 事务并尽快将控制权还给解释器:** 在 **call** 事务发生时调试器的主要工作是判断是否需要对该事务进行跟踪。 + 3. **优化 "line" 事务并尽快将控制权还给解释器:** 在 **line** 事务发生时调试器的主要工作是判断我们在此处是否需要设置一个断点。 + + + +于是我们克隆了 **Bdb** 项目,精简特征,简化代码,针对使用场景进行优化。这些工作虽然得到了一些效果,但仍无法满足我们的需求。因此我们又继续进行了其它的尝试,将代码优化并迁移至 **.pyx** 使用 [Cython][7] 进行编译,可惜结果(如下图所示)依旧不够理想。最终,我们在深入了解 CPython 源码之后意识到,让跟踪过程快到满足生产需求是不可能的。 + +![Second Bdb debugger results][8] + +### 放弃 Bdb 转而尝试字节码操作 + +熬过先前对标准调试方法进行的试验-失败-再试验循环所带来的失望,我们将目光转向另一种选择:字节码操作。 + +Python 解释器的工作主要分为两个阶段: + + 1. **将Python源码编译成Python字节码:** 这种不可读(对人类而言)的格式专为执行的效率而优化,它们通常缓存在我们熟知的 **.pyc** 文件当中。 + 2. **遍历 _interpreter loop_ 中的字节码:** 在这一步中解释器会逐条的执行指令 + + + +我们选择的模式是:使用 **字节码操作** 来设置没有全局额外开销的 **不中断断点**。 这种方式的实现首先需要在内存中的字节码里找到我们感兴趣的部分,然后在该部分的相关机器指令前插入一个函数调用。如此一来,解释器无需任何额外的工作即可实现我们的不中断断点。 + +这种方法并不依靠魔法来实现,让我们简要地举个例子。 + +首先定义一个简单的函数: + + +``` +def multiply(a, b): +   result = a * b +   return result +``` + +在 **[inspect][9]** 模块(其包含了许多实用的单元)的文档里,我们得知可以通过访问 **multiply.func_code.co_code** 来获取函数的字节码: + + +``` +`'|\x00\x00|\x01\x00\x14}\x02\x00|\x02\x00S'` +``` + +使用 Python 标准库中的 **[dis][10]** 模块可以翻译这些不可读的字符串。调用 **dis.dis(multiply.func_code.co_code)** 之后,我们就可以得到: + + +``` +  4          0 LOAD_FAST               0 (a) +             3 LOAD_FAST               1 (b) +             6 BINARY_MULTIPLY     +             7 STORE_FAST              2 (result) + +  5         10 LOAD_FAST               2 (result) +            13 RETURN_VALUE       +``` + +与直截了当的解决方案相比,这种方法让我们更靠近发生在调试器背后的事情。可惜 Python 并没有提供在解释器中修改函数字节码的方法。我们可以对函数对象进行重写,不过那样做的效率满足不了大多数实际的调试场景。最后我们不得不采用一种迂回的方式来使用原生拓展才能完成这一任务。 + +### 总结 + +在构建一个新工具时,总会学到许多事情的工作原理。这种刨根问底的过程能够使你的思路跳出桎梏,从而得到意料之外的解决方案。 + +在 Rookout 团队中构建不中断断点的这段时间里,我学到了许多有关编译器、调试器、服务器框架、并发模型等等领域的知识。如果你希望更深入的了解字节码操作,谷歌的开源项目 **[cloud-debug-python][11]** 为编辑字节码提供了一些工具。 + +* * * + +_Liran Haimovitch 将于 2019 年八月 17-18 日在旧金山举办的 [PyBay][3] 中发表题为 "[Understanding Python’s Debugging Internals][12]" 的演说,使用 [OpenSource35][13] 可以获得购票优惠,并使他们得知您是在我们的社区得知此事。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/8/debug-python + +作者:[Liran Haimovitch][a] +选题:[lujun9972][b] +译者:[caiichenr](https://github.com/caiichenr) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/liranhaimovitch +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_jungle_lead.jpeg?itok=pFKKEvT- (Real python in the graphic jungle) +[2]: https://rookout.com/ +[3]: https://pybay.com/ +[4]: https://docs.python.org/3/library/sys.html#sys.settrace +[5]: https://opensource.com/sites/default/files/uploads/python2docs.png (set_trace Python 2 docs page) +[6]: https://opensource.com/sites/default/files/uploads/debuggerresults1.png (First Bdb debugger results) +[7]: https://cython.org/ +[8]: https://opensource.com/sites/default/files/uploads/debuggerresults2.png (Second Bdb debugger results) +[9]: https://docs.python.org/2/library/inspect.html +[10]: https://docs.python.org/2/library/dis.html +[11]: https://github.com/GoogleCloudPlatform/cloud-debug-python +[12]: https://pybay.com/speaker/liran-haimovitch/ +[13]: https://ti.to/sf-python/pybay2019/discount/OpenSource35 From 225e161672c5cf4f9a5a8cf936dc0044d95ade23 Mon Sep 17 00:00:00 2001 From: caiichenr <34886864+caiichenr@users.noreply.github.com> Date: Sat, 7 Mar 2020 01:23:35 +0800 Subject: [PATCH 140/207] Update 20190813 Building a non-breaking breakpoint for Python debugging.md --- ...Building a non-breaking breakpoint for Python debugging.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md b/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md index aa3a5fa109..ed94d222e6 100644 --- a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md +++ b/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md @@ -159,12 +159,12 @@ def simple_method(): Python 解释器的工作主要分为两个阶段: - 1. **将Python源码编译成Python字节码:** 这种不可读(对人类而言)的格式专为执行的效率而优化,它们通常缓存在我们熟知的 **.pyc** 文件当中。 + 1. **将 Python 源码编译成 Python 字节码:** 这种不可读(对人类而言)的格式专为执行的效率而优化,它们通常缓存在我们熟知的 **.pyc** 文件当中。 2. **遍历 _interpreter loop_ 中的字节码:** 在这一步中解释器会逐条的执行指令 -我们选择的模式是:使用 **字节码操作** 来设置没有全局额外开销的 **不中断断点**。 这种方式的实现首先需要在内存中的字节码里找到我们感兴趣的部分,然后在该部分的相关机器指令前插入一个函数调用。如此一来,解释器无需任何额外的工作即可实现我们的不中断断点。 +我们选择的模式是:使用**字节码操作**来设置没有全局额外开销的**不中断断点**。这种方式的实现首先需要在内存中的字节码里找到我们感兴趣的部分,然后在该部分的相关机器指令前插入一个函数调用。如此一来,解释器无需任何额外的工作即可实现我们的不中断断点。 这种方法并不依靠魔法来实现,让我们简要地举个例子。 From bf65a2715a2e929b4dc84ac78a21af193214fb58 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 7 Mar 2020 10:29:22 +0800 Subject: [PATCH 141/207] Rename sources/tech/20200306 How I learned about burnout the hard way.md to sources/talk/20200306 How I learned about burnout the hard way.md --- .../20200306 How I learned about burnout the hard way.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200306 How I learned about burnout the hard way.md (100%) diff --git a/sources/tech/20200306 How I learned about burnout the hard way.md b/sources/talk/20200306 How I learned about burnout the hard way.md similarity index 100% rename from sources/tech/20200306 How I learned about burnout the hard way.md rename to sources/talk/20200306 How I learned about burnout the hard way.md From 6c76c528c6dccb307bd354cc9512dd50debd179f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 7 Mar 2020 12:25:12 +0800 Subject: [PATCH 142/207] PRF @geekpi --- ...se logzero for simple logging in Python.md | 61 +++++++------------ 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200226 Use logzero for simple logging in Python.md b/translated/tech/20200226 Use logzero for simple logging in Python.md index f246475da4..8ed6bd41e7 100644 --- a/translated/tech/20200226 Use logzero for simple logging in Python.md +++ b/translated/tech/20200226 Use logzero for simple logging in Python.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use logzero for simple logging in Python) @@ -9,23 +9,23 @@ 使用 logzero 在 Python 中进行简单日志记录 ====== -一个方便的日志库快速入门,来帮助你掌握这个重要的编程概念。 -![Snake charmer cartoon with a yellow snake and a blue snake][1] -logzero 库使日志记录就像打印语句一样容易,是简单性的杰出代表。我不确定 logzero 的名称是否要与 pygame-zero、GPIO Zero 和 guizero 这样的 “zero 样板库”契合,但是肯定属于该类别。它是一个 Python 库,使得日志记录变得简单明了。 +> 快速了解一个方便的日志库,来帮助你掌握这个重要的编程概念。 -你可以使用它的基本日志记录到标准输出,就像你可以使用 print 来获得信息和调试一样,它还有学习更高级日志记录(例如记录到文件)的平滑学习曲线。 +![](https://img.linux.net.cn/data/attachment/album/202003/07/122445v743hy7ajdyrrda1.jpg) + +logzero 库使日志记录就像打印语句一样容易,是简单性的杰出代表。我不确定 logzero 的名称是否要与 pygame-zero、GPIO Zero 和 guizero 这样的 “zero 样板库”契合,但是肯定属于该类别。它是一个 Python 库,可以使日志记录变得简单明了。 + +你可以使用它基本的记录到标准输出的日志记录,就像你可以使用 print 来获得信息和调试一样,学习它的更高级日志记录(例如记录到文件)的学习曲线也很平滑。 首先,使用 pip 安装 logzero: - ``` -`$ sudo pip3 install logzero` +$ sudo pip3 install logzero ``` 在 Python 文件中,导入 logger 并尝试以下一个或所有日志实例: - ``` from logzero import logger @@ -39,14 +39,13 @@ logger.error("error") ![Python, Raspberry Pi: import logger][2] -因此现在不要再使用 **print** 来了解发生了什么,而应使用有相关日志级别的 logger。 +因此现在不要再使用 `print` 来了解发生了什么,而应使用有相关日志级别的日志器。 ### 在 Python 中将日志写入文件 如果你阅读至此,并会在你写代码时做一点改变,这对我就足够了。如果你要了解更多,请继续阅读! -写到**标准输出**对于测试新程序不错,但是仅当你登录到运行脚本的计算机时才有用。在很多时候,你需要远程执行代码并在事后查看错误。这种情况下,记录到文件很有帮助。让我们尝试一下: - +写到标准输出对于测试新程序不错,但是仅当你登录到运行脚本的计算机时才有用。在很多时候,你需要远程执行代码并在事后查看错误。这种情况下,记录到文件很有帮助。让我们尝试一下: ``` from logzero import logger, logfile @@ -54,32 +53,28 @@ from logzero import logger, logfile logfile('/home/pi/test.log') ``` -现在,你的日志条目将记录到文件 **test.log** 中。记住确保[脚本有权限] [3]写入该文件及其目录结构。 +现在,你的日志条目将记录到文件 `test.log` 中。记住确保[脚本有权限][3]写入该文件及其目录结构。 你也可以指定更多选项: - ``` -`logfile(’/home/pi/test.log’, maxBytes=1e6, backupCount=3)` +logfile('/home/pi/test.log', maxBytes=1e6, backupCount=3) ``` -现在,当提供给 **logfile** 文件达到 1MB(10^6 字节)时,它将通过 **test.log.1**、**test.log.2** 等文件轮询写入。这种行为可以避免系统打开和关闭大量 I/O 密集的日志文件,以至于系统无法打开和关闭。你或许还要记录到 **/var/log**。假设你使用的是 Linux,那么创建一个目录并将用户设为所有者,以便可以写入该目录: - +现在,当提供给 `test.log` 文件的数据达到 1MB(10^6 字节)时,它将通过 `test.log.1`、`test.log.2` 等文件轮替写入。这种行为可以避免系统打开和关闭大量 I/O 密集的日志文件,以至于系统无法打开和关闭。更专业一点,你或许还要记录到 `/var/log`。假设你使用的是 Linux,那么创建一个目录并将用户设为所有者,以便可以写入该目录: ``` $ sudo mkdir /var/log/test $ sudo chown pi /var/log/test ``` -然后在你的 Python 代码中,更改 **logfile** 路径: - +然后在你的 Python 代码中,更改 `logfile` 路径: ``` -`logfile(’/var/log/test/test.log’, maxBytes=1e6, backupCount=3)` +logfile('/var/log/test/test.log', maxBytes=1e6, backupCount=3) ``` -当要在 **logfile** 中捕获异常时,可以使用 **logging.exception**:。 - +当要在 `logfile` 中捕获异常时,可以使用 `logging.exception`: ``` try: @@ -88,8 +83,7 @@ except Exception as e:     logger.exception(e) ``` -这将输出(在 b 为零的情况下): - +这将输出(在 `b` 为零的情况下): ``` [E 190422 23:41:59 test:9] division by zero @@ -99,8 +93,7 @@ except Exception as e:      ZeroDivisionError: division by zero ``` -你会得到日志,还有完整回溯。另外,你可以使用 **logging.error** 并隐藏回溯: - +你会得到日志,还有完整回溯。另外,你可以使用 `logging.error` 并隐藏回溯: ``` try: @@ -111,28 +104,20 @@ except Exception as e: 现在,将产生更简洁的结果: - ``` -`[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero` +[E 190423 00:04:16 test:9] ZeroDivisionError: division by zero ``` -* * * - -* * * - -* * * - -**![Logging output][4]** +![Logging output][4] 你可以在 [logzero.readthedocs.io] [5] 中阅读更多选项。 ### logzero 为教育而生 -对于新手程序员来说,日志记录可能是一个具有挑战性的概念。大多数框架依赖于流控制和大量变量操作来生成有意义的日志,但是 logzero不同。由于它的语法类似于 print 语句,因此它在教育上很成功,因为它无需解释其他概念。在你的下个项目中试试它。 +对于新手程序员来说,日志记录可能是一个具有挑战性的概念。大多数框架依赖于流控制和大量变量操作来生成有意义的日志,但是 logzero 不同。由于它的语法类似于 `print` 语句,因此它在教育上很成功,因为它无需解释其他概念。在你的下个项目中试试它。 -\-- -_此文章最初发布在[我的博客] [6]上,经许可重新发布。_ +此文章最初发布在[我的博客][6]上,经许可重新发布。 -------------------------------------------------------------------------------- @@ -141,7 +126,7 @@ via: https://opensource.com/article/20/2/logzero-python 作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5ddf5a770393d7a980caecb7e357102467825ed6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 7 Mar 2020 12:26:15 +0800 Subject: [PATCH 143/207] PUB @geekpi https://linux.cn/article-11970-1.html --- .../20200226 Use logzero for simple logging in Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200226 Use logzero for simple logging in Python.md (98%) diff --git a/translated/tech/20200226 Use logzero for simple logging in Python.md b/published/20200226 Use logzero for simple logging in Python.md similarity index 98% rename from translated/tech/20200226 Use logzero for simple logging in Python.md rename to published/20200226 Use logzero for simple logging in Python.md index 8ed6bd41e7..e6bcd095c4 100644 --- a/translated/tech/20200226 Use logzero for simple logging in Python.md +++ b/published/20200226 Use logzero for simple logging in Python.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11970-1.html) [#]: subject: (Use logzero for simple logging in Python) [#]: via: (https://opensource.com/article/20/2/logzero-python) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) From d89011fc84938be626099c71a6267789ba505aa4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 8 Mar 2020 00:55:11 +0800 Subject: [PATCH 144/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200308=20The=20?= =?UTF-8?q?De-Googled=20Android=20Fork=20is=20Making=20Good=20Progress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200308 The De-Googled Android Fork is Making Good Progress.md --- ...ed Android Fork is Making Good Progress.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20200308 The De-Googled Android Fork is Making Good Progress.md diff --git a/sources/tech/20200308 The De-Googled Android Fork is Making Good Progress.md b/sources/tech/20200308 The De-Googled Android Fork is Making Good Progress.md new file mode 100644 index 0000000000..e5d1838cd3 --- /dev/null +++ b/sources/tech/20200308 The De-Googled Android Fork is Making Good Progress.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The De-Googled Android Fork is Making Good Progress) +[#]: via: (https://itsfoss.com/gael-duval-interview/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +The De-Googled Android Fork is Making Good Progress +====== + +A couple years ago, we covered the [Eelo project][1]. If you remember, the Eelo project was started by [Gael Duval][2] who once created Mandrake Linux. The goal of the Eelo project was to remove all Google services from Android to give you an [alternate mobile operating system][3] that doesn’t track you and invade your privacy. + +A lot has happened to Eelo since then. It’s not called Eelo anymore, now it’s called /e/. So, what’s happening with this project? We talked to Gael Duval himself. Here’s what he shared with us. + +![][4] + +_**Why did you create this Eelo or /e/ project in the first place?**_ + +**Gael:** In 2017, I realized that using Android and iPhone, Google and many mobile apps was not compatible with my personal privacy. + +A later study by a US University confirmed this: using an iPhone or and Android phone sends between 6 to 12 MB of personal data to Google servers, daily! And this doesn’t count mobile apps. + +So I looked for reasonable alternatives to iPhone and Android phones but didn’t find any. Either I found options for hobbyists, like Ubuntu Touch, that were not compatible with existing apps and not fully unGoogled either. Or there were alternative ROMs with all the Google fat inside, and no associated basic online services that could be used without tweaking the system. + +Therefore, an idea came to mind: why not fork Android, remove all the Google features, even low level, such as connectivity check, DNS…, replace default apps with more virtuous apps, add basic online services, and integrate all this into a consistent form that could be used by Mum and Dad and any people without tech or expert knowledge? + +_**How is it any different from other custom Android ROMs?**_ + +**Gael:** It doesn’t send a bit of data to Google, and is and will be more and more privacy-focused. + +Low-level: we remove any Android feature that sends data to Google servers. Even the connectivity check when you start the smartphone! To my knowledge, there is not any other Android ROM that does this at the moment. We change default DNS settings and offer users an option to set the DNS of their choice. We change NTP (automatic time configuration) settings to the default NTP servers because there is no reason to use Google NTP servers actually. Then we remove Google services, and we replace with a software layout called microG that can still receive push notifications and have geolocation data for apps (using Mozilla geolocation service). + +Then we change the default apps by non-Google apps, including the maps applications, mail etc., most are open source applications and I can say that there is 99% probability that all will be open source before the end of this year. + +Then we add our own Android application installer, with close to 80 000 available applications at the moment. + +We provide a different web browser, which is a fork of Chromium, were all features that data to Google are removed, and were the default search engine is not Google… + +And we operate online services: + + * search, using a meta-search system that we have improve for a better user experience + * online drive with encrypted data, calendar etc. using a modified version of NextCloud + * mail… + + + +And for we provide a unique identifier that can be used to access all those services, either on the web or from the /e/ OS system, by login once. Then you can sync all your data, calendar, email etc. between your smartphone and your personal /e/ cloud (it can also be self-hosted). +The purpose of the project is to provide a normal, ready to use, and attractive “digital life” to users, without sending all your personal data to Google. + +_**If it is completely ‘ungoogled’, how do users install new apps? Do you have your own app store? If yes, how can we trust that these apps don’t spy on user data?**_ + +**Gael:** Yes – we have our own application installer, with about 80 000 applications. And we analyse each application to unveil the number of trackers, and we display this information to our users, for each application. We are also adding Progressive Web Apps soon to this application installer. + +/e/ OS is about freedom of choice. We want the core system to be better, and then offer as many possible options to users, by informing them as much as possible. In short: they can still any application they need. Next step will be to offer a feature to actually block trackers used in applications. + +_**What is the target user base for /e/? Can an average Joey use it without much trouble?**_ + +![][5] + +**Gael:** We started with tech-savvy users, and we’re expanding the user base to people with less knowledge. At the moment, our typical user base is a mix of tech-savvy users, who can flash a smartphone with /e/ OS and people who are very concerned with Google and their data privacy but have very limited technical knowledge. For those people we have some smartphones pre-installed with /e/ OS for sale, on high-grade refurbished hardware. + +We are also announcing this week an “/e/ easy installer” that will make the flashing process much more easier, by pluging the smartphone to a PC and launching a dedicated application that will make most of the job. + +Then, the next step will be to expand our target users to a more global market, once we find the good partners. But clearly, there is a demand for something different than the Apple-Google worldwide market duopoly on the mobile. + +_**Initially the project was named eelo and it is called /e/ or [e foundation][6]. Personally, I find the name /e/ weird and it is not easily recognizable. Why did you change the project name?**_ + +**Gael:** We have been “attacked” by a company called “eelloo”. They considered that “eelo” would interfere with their business. They are in the HR business solutions, but registered their trademark in all the classes related to mobile OS, smartphones etc. This is silly and a shame, but we had no money to defend us strongly at the time. + +However the/e/ name will be abandonned for something else quite soon. + +_**It’s been a couple of years since the initial launch. How do you see the adoption of /e/?**_ + +**Gael:** We launched the first beta 18 months ago, and we have started to sell smartphones with /e/ a little more than 6 months ago. The adoption is growing a lot at the moment, we have to add terabytes of online storage regularly! + +Also with the /e/ installer arriving, and some official partnerships with some hardware mobile manufacturers in the pipe, this is going to accelerate a lot this year. + +However, this is not surprising, privacy concerns are rising both for individuals and corporations, and I think the rejection of Google is also trending. + +_**What are your future plans to grow /e/?**_ + +**Gael:** The growth is very natural. There is a strong community of users who realize how unique our approach is. These guys are contributing, supporting us and talking a lot about the project. + +With the easy installer coming along and strategic partnerships with hardware makers, this is going to accelerate a lot. + +Also, and this is more personal, I think that there is a natural connection between /e/ OS, and the Linux world. OK, /e/ OS is based on Android, but it’s still a Linux kernel and it’s the same spirit, it’s Open Source… So I’d really like to have more natural integration between my /e/ smartphone and my Linux desktop. There should be some nice features added in this spirit in the next versions of /e/ OS. + +_**What can /e/ users and our readers do to help e foundation?**_ + +**Gael:** Join us, talk about what we are doing, send your feedback, organize some meetups… Help improve the /e/ Wikipedia page which is very poor and doesn’t represent at all what we are actually doing. + +We also have a [permanent crowdfunding campaign where users can support the project financially][7], pay for the servers etc. And, in addition to giving back in term of open source product, we send cool stuff in return :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gael-duval-interview/ + +作者:[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/eelo-mobile-os/ +[2]: https://en.wikipedia.org/wiki/Ga%C3%ABl_Duval +[3]: https://itsfoss.com/open-source-alternatives-android/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/e-os-interview.jpg?ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/e-foundation-smartphones.jpg?resize=800%2C590&ssl=1 +[6]: https://e.foundation/ +[7]: https://e.foundation/donate/ From 153c6beceb683e3fd7dd0e9ad3cdfda27d2aeec4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 8 Mar 2020 00:56:58 +0800 Subject: [PATCH 145/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200307=20Compos?= =?UTF-8?q?e=20music=20as=20code=20using=20Sonic=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200307 Compose music as code using Sonic Pi.md --- ...07 Compose music as code using Sonic Pi.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20200307 Compose music as code using Sonic Pi.md diff --git a/sources/tech/20200307 Compose music as code using Sonic Pi.md b/sources/tech/20200307 Compose music as code using Sonic Pi.md new file mode 100644 index 0000000000..6944a5f6ea --- /dev/null +++ b/sources/tech/20200307 Compose music as code using Sonic Pi.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Compose music as code using Sonic Pi) +[#]: via: (https://opensource.com/article/20/3/sonic-pi) +[#]: author: (Matt Bargenquast https://opensource.com/users/mbargenquast) + +Compose music as code using Sonic Pi +====== +There's no need for instrumental mastery with this accessible open +source program that can turn you into a musical virtuoso. +![Bird singing and music notes][1] + +Maybe you're like me, and you learned a musical instrument when you were in school. For me, it was the piano, and later, the viola. However, I've always held that, as my childhood interests shifted towards computers and coding, I subsequently neglected my music practice. I do wonder what I would have done if I'd had something like Sonic Pi when I was younger. Sonic Pi is an open source program that lets you compose and perform music through code itself. It's the perfect marriage of those two worlds. + +Opensource.com is no stranger to Sonic Pi—we [featured an interview][2] with the creator, Dr. Sam Aaron, back in 2015. Since that time, a lot has changed, and Sonic Pi has grown substantially in many ways. It's reached a major new version milestone, with the long-awaited v3.2 release made publically available on February 28, 2020. A growing community of developers is actively contributing to its [GitHub project][3], while an equally thriving community of composers shares ideas and support in the [official forums][4]. The project is now also financially assisted through a [Patreon campaign][5], and Sam himself has been spreading the word of Sonic Pi through schools, conferences, and workshops worldwide. + +What really shines about Sonic Pi is its approachability. Releases are available for many major flavors of OS, including Windows, macOS, Linux, and of course, the Raspberry Pi itself. In fact, getting started with Sonic Pi on a Raspberry Pi couldn't be simpler; it comes pre-installed with [Raspbian][6], so if you have an existing Raspbian-based setup, you'll find it situated in the programming menu. + +Upon loading Sonic Pi for the first time, you'll be greeted with a simple interface with two main areas: an editor in which to write your code, and a section devoted to Sonic Pi's expansive tutorial. For newcomers, the tutorial is an essential resource for learning the basics, featuring accompanying music programs to reinforce each concept being taught. + +If you're following along, let's code ourselves a simple bit of music and explore the potential of live-coding music. Type or paste the following code into the Sonic Pi editor: + + +``` +live_loop :beat do +  sample :drum_heavy_kick +  sleep 1 +end +``` + +Even if you're a Sonic Pi novice, many coders may immediately understand what's going on here. We're playing a drum kick sample, sleeping for a second, and then repeating. Click the Run button or press ALT+R (meta+R on macOS), and you should hear it begin to play. + +This isn't a very exciting song yet, so let's liven it up with a snare playing on the off-beat. Replace the existing code with the block below and Run again. You can leave the existing beat playing while you do this; you'll notice that your changes will be applied naturally, in time with the beat: + + +``` +live_loop :beat do +  sample :drum_heavy_kick +  sleep 0.5 +  sample :drum_snare_soft +  sleep 0.5 +end +``` + +While we're at it, let's add a hi-hat right before every fourth beat, just to make things a little interesting. Add this new block below our existing one and Run again: + + +``` +live_loop :hihat do +  sleep 3.9 +  sample :drum_cymbal_closed +  sleep 0.1 +end +``` + +We've got our beat going now, so let's add a bassline! Sonic Pi comes with a variety of synths built-in, along with effects filters such as reverb and distortion. We'll use a combination of the "dsaw" and "tech_saw" synths to give it an electronic retro-synth feel. Add the block below to your existing program, Run, and have a listen: + + +``` +live_loop :bass do +  use_synth :dsaw +  play :a2, attack: 1, release: 2, amp: 0.3 +  sleep 2.5 +  use_synth :tech_saws +  play :a1, attack: 1, release: 1.5, amp: 0.8 +  sleep 1.5 +end +``` + +You'll note above that we have full control over the [ADSR][7] envelope when playing notes, so we can decide when each sound should peak and fade. + +Lastly, let's add a lead synth and try out one of those effects features known as the "slicer." To spice things up, we'll also introduce an element of pseudo-randomness by letting Sonic Pi pick from a series of potential chords. This is where some of the fun improvisation and "happy accidents" can begin to occur. Add the block below to your existing program and Run: + + +``` +live_loop :lead do +  with_fx :slicer do +    chords = [(chord :A4, :minor7), (chord :A4, :minor), (chord :D4, :minor7), (chord :F4, :major7)] +    use_synth :blade +    play chords.choose, attack: 1, release: 2, amp: 1 +    sleep 2 +  end +end +``` + +Great! Now, we're certainly not going to be competing with Daft Punk any time soon, but hopefully, through this process, you've seen how we can go from a bare beat to something much bigger, in real-time, by adding some simple morsels of code. It is well worth watching one of Sam Aaron's [live coding performances][8] on YouTube for a demonstration of how creative and adaptive Sonic Pi can let you be. + +![Sonic Pi composition example][9] + +Our finished piece, in full + +If you've ever wanted to learn a musical instrument, but felt held back by thoughts like "I don't have rhythm" or "my hands aren't nimble enough," Sonic Pi is a versatile instrument for which none of those things matter. All you need are the ideas, the inspiration, and an inexpensive computer such as the humble Raspberry Pi. The rest is at your fingertips—literally! + +Here are a few handy links to get you started: + + * The Official Sonic Pi [website][10] and [tutorial][11] + * [Getting Started with Sonic Pi][12] ([projects.raspberrypi.org][13]) + * Sonic Pi [Github project][3] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/sonic-pi + +作者:[Matt Bargenquast][a] +选题:[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/mbargenquast +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/music-birds-recording-520.png?itok=UoM7brl0 (Bird singing and music notes) +[2]: https://opensource.com/life/15/10/interview-sam-aaron-sonic-pi +[3]: https://github.com/samaaron/sonic-pi/ +[4]: https://in-thread.sonic-pi.net/ +[5]: https://www.patreon.com/samaaron +[6]: https://www.raspberrypi.org/downloads/raspbian/ +[7]: https://en.wikipedia.org/wiki/Envelope_(music) +[8]: https://www.youtube.com/watch?v=JEHpS1aTKp0 +[9]: https://opensource.com/sites/default/files/uploads/sonicpi.png (Sonic Pi composition example) +[10]: https://sonic-pi.net/ +[11]: https://sonic-pi.net/tutorial.html +[12]: https://projects.raspberrypi.org/en/projects/getting-started-with-sonic-pi +[13]: http://projects.raspberrypi.org From f896cec50453a215a71718c47b20859652391dbf Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 8 Mar 2020 09:19:54 +0800 Subject: [PATCH 146/207] Rename sources/tech/20200308 The De-Googled Android Fork is Making Good Progress.md to sources/talk/20200308 The De-Googled Android Fork is Making Good Progress.md --- ...0200308 The De-Googled Android Fork is Making Good Progress.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200308 The De-Googled Android Fork is Making Good Progress.md (100%) diff --git a/sources/tech/20200308 The De-Googled Android Fork is Making Good Progress.md b/sources/talk/20200308 The De-Googled Android Fork is Making Good Progress.md similarity index 100% rename from sources/tech/20200308 The De-Googled Android Fork is Making Good Progress.md rename to sources/talk/20200308 The De-Googled Android Fork is Making Good Progress.md From c7f406e90bec10e4ad87eb5e78e56e024621558c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 8 Mar 2020 09:50:20 +0800 Subject: [PATCH 147/207] PRF @geekpi --- .../20200302 Install GNU Emacs on Windows.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200302 Install GNU Emacs on Windows.md b/translated/tech/20200302 Install GNU Emacs on Windows.md index 3ef9810f0c..c31199d72a 100644 --- a/translated/tech/20200302 Install GNU Emacs on Windows.md +++ b/translated/tech/20200302 Install GNU Emacs on Windows.md @@ -1,41 +1,41 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Install GNU Emacs on Windows) [#]: via: (https://opensource.com/article/20/3/emacs-windows) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -在 Windows 上安装 GNU Emacs +如何在 Windows 上安装 GNU Emacs ====== -即使你的操作系统是闭源的,你仍然可以使用这个流行的开源文本编辑器。 -![Tall building with windows][1] -GNU Emacs 是一个专为各种程序员设计的流行的文本编辑器。因为它是在 Unix 上开发的,并在 Linux(macOS 中也有)上得到了广泛使用,所以人们有时没有意识到它也可用于 Microsoft Windows 上。你也无需成为有经验的或专职的程序员即可使用 Emacs。只需单击几下就可以下载并安装 Emacs,本文向你展示了如何进行。 +> 即使你的操作系统是闭源的,你仍然可以使用这个流行的开源文本编辑器。 + +![](https://img.linux.net.cn/data/attachment/album/202003/08/094942ihwcnsqojnup46wo.jpg) + +GNU Emacs 是一个专为各种程序员设计的流行的文本编辑器。因为它是在 Unix 上开发的,并在 Linux(macOS 中也有)上得到了广泛使用,所以人们有时没有意识到它也可用于微软 Windows 上。你也无需成为有经验的或专职的程序员即可使用 Emacs。只需单击几下就可以下载并安装 Emacs,本文向你展示了如何进行。 你可以手动安装 Windows,也可以使用包管理器安装,例如 [Chocolatey][2]。 ### 7-zip -如果还没在 Windows 中安装 7-zip,那么就先安装它。[7-zip][3] 是一个开源的存档程序,能够创建和解压 ZIP、7z、TAR、XZ、BZIP2 和 GZIP(以及更多)文件。对于 Windows 用户来说,这是一个宝贵的工具。 +如果还没在 Windows 中安装 7-zip,那么就先安装它。[7-zip][3] 是一个开源的归档程序,能够创建和解压 ZIP、7z、TAR、XZ、BZIP2 和 GZIP(以及更多)文件。对于 Windows 用户来说,这是一个宝贵的工具。 -安装 7-zip 后,在 Windows 资源管理器中浏览文件时,右键单击菜单中就有新的 7-zip 存档选项。 +安装 7-zip 后,在 Windows 资源管理器中浏览文件时,右键单击菜单中就有新的 7-zip 归档选项。 ### Powershell 和 Chocolatey 要在 Windows 上使用 Chocolatey 安装 GNU Emacs : - ``` -`PS> choco install emacs-full` +PS> choco install emacs-full ``` 安装后,在 Powershell 中启动 Emacs: - ``` -`PS> emacs` +PS> emacs ``` ![Emacs running on Windows][4] @@ -46,35 +46,35 @@ GNU Emacs 是一个专为各种程序员设计的流行的文本编辑器。因 ![GNU Windows downloader][6] -它会打开连接到离你最近的服务器,并展示所有可用的 Emacs 版本。找到发行版本号最高的目录,然后单击进入。Windows 有许多不同的 Emacs 构建,但是最通用的版本只是被命名为 emacs-VERSION-ARCHITECTURE.zip。**VERSION** 取决于你要下载的版本,而 **ARCHITECTURE** 取决于你使用的是 32 位还是 64 位计算机。大多数现代计算机都是 64 位的,但是如果你有疑问,可以下载 32 位版本,它可在两者上运行。 +它会打开连接到离你最近的服务器,并展示所有可用的 Emacs 版本。找到发行版本号最高的目录,然后单击进入。Windows 有许多不同的 Emacs 构建,但是最通用的版本只是被命名为 `emacs-VERSION-ARCHITECTURE.zip`。`VERSION` 取决于你要下载的版本,而 `ARCHITECTURE` 取决于你使用的是 32 位还是 64 位计算机。大多数现代计算机都是 64 位的,但是如果你有疑问,可以下载 32 位版本,它可在两者上运行。 -如果要下载 64 位计算机的 Emacs v26,你应该点击 emacs-26.2-x86_64.zip 的链接。有较小的下载包(例如 “no-deps” 等),但是你必须熟悉如何从源码构建 Emacs,知道它需要哪些库以及你的计算机上已经拥有哪些库。通常,获取较大版本的 Emacs 最容易,因为它包含了在计算机上运行所需的一切。 +如果要下载 64 位计算机的 Emacs v26,你应该点击 `emacs-26.2-x86_64.zip` 的链接。有较小的下载包(例如 “no-deps” 等),但是你必须熟悉如何从源码构建 Emacs,知道它需要哪些库以及你的计算机上已经拥有哪些库。通常,获取较大版本的 Emacs 最容易,因为它包含了在计算机上运行所需的一切。 ### 解压 Emacs -接下来,解压下载的 ZIP 文件。要解压缩,请右键单击 Emacs ZIP 文件,然后从 7-zip 子菜单中选择 **Extract to Emacs-VERSION**。这是一个很大的压缩包,因此解压可能需要一段时间,但是完成后,你将拥有一个新目录,其中包含与 Emacs 一起分发的所有文件。例如,在此例中,下载了 emacs-26.2-x86_64.zip,因此解压后的目录为 emacs-26.2-x86_64。 +接下来,解压下载的 ZIP 文件。要解压缩,请右键单击 Emacs ZIP 文件,然后从 7-zip 子菜单中选择 “Extract to Emacs-VERSION”。这是一个很大的压缩包,因此解压可能需要一段时间,但是完成后,你将拥有一个新目录,其中包含与 Emacs 一起分发的所有文件。例如,在此例中,下载了 `emacs-26.2-x86_64.zip`,因此解压后的目录为 `emacs-26.2-x86_64`。 ### 启动 Emacs -在 Emacs 目录中,找到 **bin** 目录。此文件夹存储随 Emacs 一起分发的所有二进制可执行文件(EXE 文件)。双击 emacs.exe 文件启动应用。 +在 Emacs 目录中,找到 `bin` 目录。此文件夹存储随 Emacs 一起分发的所有二进制可执行文件(EXE 文件)。双击 `emacs.exe` 文件启动应用。 ![Emacs running on Windows][7] -你可以在桌面上创建 **emacs.exe** 的快捷方式,以便于访问。 +你可以在桌面上创建 `emacs.exe` 的快捷方式,以便于访问。 ### 学习 Emacs Emacs 并不像传闻那样难用。它具有自己的传统和惯例,但是当你其中输入文本时,你可以像在记事本或者网站的文本框中那样使用它。 -重要的区别是在你_编辑_输入的文本时。 +重要的区别是在你*编辑*输入的文本时。 但是,学习的唯一方法是开始使用它,因此,使 Emacs 成为完成简单任务的首选文本编辑器。当你通常打开记事本、Word 或 Evernote 或其他工具来做快速笔记或临时记录时,请启动 Emacs。 Emacs 以基于终端的应用而闻名,但它显然有 GUI,因此请像使用其他程序一样经常使用它的 GUI。从菜单而不是使用键盘复制、剪切和粘贴(paste)(或用 Emacs 的术语 “yank”),然后从菜单或工具栏打开和保存文件。从头开始,并根据应用本身来学习它,而不是根据你以往对其他编辑器的经验就认为它应该是怎样。 -### 下载[速查表][8]! +- 下载[速查表][8]! -_感谢 Matthias Pfuetzner 和 Stephen Smoogen。_ +感谢 Matthias Pfuetzner 和 Stephen Smoogen。 -------------------------------------------------------------------------------- @@ -83,7 +83,7 @@ via: https://opensource.com/article/20/3/emacs-windows 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e7bff410bd91b9fd67bd3a64185dd549f4cdd8e9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 8 Mar 2020 09:51:11 +0800 Subject: [PATCH 148/207] PUB @geekpi https://linux.cn/article-11971-1.html --- .../20200302 Install GNU Emacs on Windows.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200302 Install GNU Emacs on Windows.md (98%) diff --git a/translated/tech/20200302 Install GNU Emacs on Windows.md b/published/20200302 Install GNU Emacs on Windows.md similarity index 98% rename from translated/tech/20200302 Install GNU Emacs on Windows.md rename to published/20200302 Install GNU Emacs on Windows.md index c31199d72a..7432b0e600 100644 --- a/translated/tech/20200302 Install GNU Emacs on Windows.md +++ b/published/20200302 Install GNU Emacs on Windows.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11971-1.html) [#]: subject: (Install GNU Emacs on Windows) [#]: via: (https://opensource.com/article/20/3/emacs-windows) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 780b080dc3d469a83ad164348307dfd1770a85c2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 8 Mar 2020 10:10:16 +0800 Subject: [PATCH 149/207] PRF @wxy --- ...g Console Gaming Experience on the Desktop.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md index c8d6710e02..7f95da2c67 100644 --- a/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md +++ b/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop) @@ -10,7 +10,7 @@ Drauger OS Linux 旨在为台式机带来主机游戏体验 ====== -多年来(或数十年),人们抱怨不[使用Linux][1] 的原因之一是缺乏主流游戏。[Linux 上的游戏][2]在最近几年有了显著改进,特别是 [Steam Proton][3] 项目的引入使你可以[在 Linux 上玩很多 Windows 专用的游戏][4]。 +多年来(或数十年),人们抱怨不[使用Linux][1] 的原因之一是它缺乏主流游戏。[Linux 上的游戏][2]在最近几年有了显著改进,特别是 [Steam Proton][3] 项目的引入使你可以[在 Linux 上玩很多 Windows 专用的游戏][4]。 这也鼓励了一些[以游戏为中心的 Linux发行版][5]。以 [Lakka][6] 为例,你可以[借助 Lakka Linux 将旧计算机变成复古的街机游戏机][7]。 @@ -34,9 +34,9 @@ Drauger OS 开箱即用地安装了多个应用程序和工具,以改善游戏 * Steam * [DXVK][15] -它还具有一组与游戏无关的有趣工具。[Drauger Installer][16] 是 .deb 安装程序,是 Gdebi 的替代品。[多软件库应用安装器][17](mrai)是“用于基于 Debian 的 Linux 操作系统的类似于 AUR-helper 的脚本”。Mrai 旨在与 apt、snap、flatpaks 配合使用,并且可以从 GitHub 安装应用程序。 +它还具有一组与游戏无关的有趣工具。[Drauger 安装器][16]是 .deb 安装程序,是 Gdebi 的替代品。[多软件库应用安装器][17](mrai)是“用于基于 Debian 的 Linux 操作系统的类似于 AUR-helper 的脚本”。Mrai 旨在与 apt、snap、flatpaks 配合使用,并且可以从 GitHub 安装应用程序。 -有趣的是,Drauger OS 的名称是一个错误。首席开发者 [Thomas Castleman][18](即 batcastle)曾打算为其发行版命名为 Draugr,但是却打错了名字。在 Drauger OS 播客的[第 23 集][19]中,Castleman 说保持这个拼写错误的名称,因为要对其进行更正需要大量工作。根据 [Wikipedia][20] 的描述,Draugr 是“来自北欧神话中的不死生物”。 +有趣的是,Drauger OS 的名称是一个错误。开发负责人 [Thomas Castleman][18](即 batcastle)曾打算为其发行版命名为 Draugr,但是却打错了名字。在 Drauger OS 播客的[第 23 集][19]中,Castleman 说会保留这个拼写错误的名称,因为要对其进行更正需要大量工作。根据 [Wikipedia][20] 的描述,Draugr 是“来自北欧神话中的不死生物”。 是的,你没看错。Drauger OS 是仅有的几个具有自己的[播客][21]的发行版之一。当被问到这个问题时,Castleman 告诉我:“无论他们的情况如何,我都希望确保我们的社区拥有最大的透明度。”多数情况下,播客是 Drauger OS 博客的音频版本,但有时他们会在没有时间撰写博客文章时使用它来发布公告。 @@ -44,7 +44,7 @@ Drauger OS 开箱即用地安装了多个应用程序和工具,以改善游戏 ![Drauger OS][22] -Druager OS 背后的开发人员正在开发其下一个主要版本:7.5.1。此版本将基于 Ubuntu 19.10。将有三个主要变化。首先,将使用“我们内部构建的内核” [替换][23] Liquorix 内核。该内核将基于 Linux Kernel GitHub 存储库,“因此,它变得越来越原汁原味”。 +Druager OS 背后的开发人员正在开发其下一个主要版本:7.5.1。此版本将基于 Ubuntu 19.10。将有三个主要变化。首先,将使用“我们内部构建的内核” [替换][23] Liquorix 内核。该内核将基于 Linux 内核 GitHub 存储库,“因此,它会变得越来越原汁原味”。 新版本的第二个主要变化将是为其桌面提供新布局。根据用户的反馈,他们决定将其更改为看起来更类似于 GNOME 的样子。 @@ -93,15 +93,15 @@ via: https://itsfoss.com/drauger-os/ 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/john/ [b]: https://github.com/lujun9972 [1]: https://itsfoss.com/why-use-linux/ -[2]: https://itsfoss.com/linux-gaming-guide/ -[3]: https://itsfoss.com/steam-play-proton/ +[2]: https://linux.cn/article-7316-1.html +[3]: https://linux.cn/article-10054-1.html [4]: https://itsfoss.com/steam-play/ [5]: https://itsfoss.com/linux-gaming-distributions/ [6]: http://www.lakka.tv/ From 8be4e6b17ec425c7ff3874167dec32b5647008e1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 8 Mar 2020 10:13:40 +0800 Subject: [PATCH 150/207] PUB @wxy https://linux.cn/article-11972-1.html --- ...ims to Bring Console Gaming Experience on the Desktop.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md (99%) diff --git a/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md b/published/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md similarity index 99% rename from translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md rename to published/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md index 7f95da2c67..d574442156 100644 --- a/translated/tech/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md +++ b/published/20200304 Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11972-1.html) [#]: subject: (Drauger OS Linux Aims to Bring Console Gaming Experience on the Desktop) [#]: via: (https://itsfoss.com/drauger-os/) [#]: author: (John Paul https://itsfoss.com/author/john/) @@ -64,7 +64,7 @@ Drauger OS [系统要求][25]非常适中。请记住,Drauger OS 仅在 64 位 * 图形处理器:集成 * 屏幕分辨率:60Hz 时为 1024×768 * 外部端口:1 个用于显示的端口(HDMI/DisplayPort/VGA/DVI),2 个用于安装 USB 驱动器和键盘的 USB 端口(鼠标可选,但建议使用) -   + #### 推荐系统要求 * CPU:四核、2.2Ghz、64 位处理器 From c566ce0021e4c3ed82f868a0622829cff185c826 Mon Sep 17 00:00:00 2001 From: cycoe Date: Sun, 8 Mar 2020 15:45:35 +0800 Subject: [PATCH 151/207] [Translating] Translating by Cycoe --- .../20190925 Debugging in Emacs- The Grand Unified Debugger.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md b/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md index f1a7fe8060..b82a27dadc 100644 --- a/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md +++ b/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cycoe) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 341de4daa2b9e29667723dc26cc8d42fc214d8a5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 8 Mar 2020 17:50:30 +0800 Subject: [PATCH 152/207] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Fisherman110 恭喜你,完成了第一篇翻译。这篇比较长,内容也稍显晦涩,确实不好翻译。 --- ...80306 Exploring free and open web fonts.md | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/translated/tech/20180306 Exploring free and open web fonts.md b/translated/tech/20180306 Exploring free and open web fonts.md index 605f7514e7..3e688cbd35 100644 --- a/translated/tech/20180306 Exploring free and open web fonts.md +++ b/translated/tech/20180306 Exploring free and open web fonts.md @@ -1,59 +1,57 @@ - -探索免费而开放的网络字体 +探索自由而开放的 Web 字体 ====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-docdish-yellow-typewriter-keys.png?itok=0sPgIdMG) +> 谷歌字体和开放字体库中的免费 Web 字体已经改变了游戏规则,但仅在有限的范围内。 -毫无疑问,近些年来互联网的面貌已经被开放免费的字体所改变。在早些的2010年,你在网络浏览器上几乎只能看到微软制作的最普通的“网络安全字体”[core fonts] -[1]。但这一年(2010)正好是好几轮技术革新开始的见证之年:Web开放字体格式的应用给网络高效传输字体文件提供了一个开放的标准,像[Google Fonts]和 -[Open Font Library]这样的网络字体服务使网络内容发布者在开放证书证书下可以免费使用海量的字体库。 +![](https://img.linux.net.cn/data/attachment/album/202003/08/174910xoklikblgkkbooib.jpg) -要夸大这些网络排印领域大事件的积极影响是很难的。但是要将网络开放字体的成功与开源的网络排印划上等号作为一个整体却非常容易,而且得到的结论是挑战已经远离了我们,困难悉数被解决了。然而事实并非如此,如果你很关注网络字体,好消息是你会有非常多的机会参与到对这些字体的改进工作当中去。 +毫无疑问,近些年来互联网的面貌已经被开源字体所改变。早在 2010 年之前,你在 Web 浏览器上几乎只能看到微软制作的通常“Web 安全”的[核心字体][1]。但这一年(2010)正好是好几轮技术革新开始的见证之年:[Web 开放字体格式][2]Web Open Font Format(WOFF)的引入为通过 HTTP 有效地传输字体文件提供了一个开放的标准,以及像[谷歌字体][3]和[开放字体库][4]Open Font Library这样的 Web 字体服务的推出,使得 Web 内容发布者可以在开源许可证之下免费使用海量的字体库。 -对新手来说,必须要意识到谷歌字体和开源字体库为网页提供了特殊的”服务提供“(service—delivering)字体但是他们给其他使用情况制定字体解决方案。这不是服务方的短视,这是是意味这我们必须去建立其他的解决方案。 +这些事件对 Web 排版的积极影响再夸大都不过分。但是要将 Web 开放字体的成功与整个开源排版等同起来,并得到结论——挑战已经远离了我们,困难悉数被解决了——却很容易。然而事实并非如此,如果你很关注字体,那么好消息是你有好多机会参与到对这些字体的改进工作当中去。 -需要解决的问题还非常多。可能最明显的例子就是给linux桌面机器的其他软件安装字体使用所遇到的尴尬情况。你可以通过任何一种服务下载任何一种网络字体,但是你能得到的是一个最普通的压缩包文件,里面有一些TTF或OTF二进制文件和一个普通文本文件的证书。接下来会发生什么完完全全需要你去猜。 +对新手来说,至关重要的是必须要意识到谷歌字体和开放字体库提供了专用的服务(为网页提供字体),而没有为其他使用情况制定字体解决方案。这不是服务方面的缺点,这只是意味着我们必须去开发其它的解决方案。 -大部分用户很快学会了”正确“的步骤就是手动地复制这些字体二进制文件到他们硬件驱动里一大把的文件夹里的某个文件夹里。但是这样做只能使这个文件被操作系统检索到。它并不能为用户体验带来什么。再强调一遍,这不是网络字体服务的缺陷,然而它是对于关于服务到哪里停止和更多工作需要在其他方面做这个观点的证据。 +需要解决的问题还非常多。可能最明显的例子就是给 Linux 桌面计算机的其他软件安装字体所遇到的尴尬情况。你可以通过任何一种服务下载任何一种 Web 字体,但是你得到的只是一个最普通的压缩包文件,里面有一些 TTF 或 OTF 二进制文件和一个普通文本文件的许可证。接下来会发生什么完完全全需要你去猜。 -在用户视角来说,一个巨大的提升可能就是直接在“下载“这个阶段系统或者桌面环境变得更智能。它(系统或桌面环境)不仅会把字体文件安装到正确的位置上,更重要的是,当用户选择在一个工程使用的字体时,它会自己添加用户所需要得到的重要的元数据。 +大部分用户很快学会了“正确”的步骤就是手动地复制这些字体二进制文件到他们硬盘里几个特殊文件夹里的某一个里。但是这样做只能使这个文件对操作系统可见。它并不能为用户体验带来什么提升。再强调一遍,这不是 Web 字体服务的缺陷,相反它佐证了对于关于服务到哪里停止和需要在其他方面做更多工作的观点。 -附加信息的组成与它如何展示给用户连接着另一个挑战:在linux环境管理一个字体库明显不如任何其他操作系统愉快。字体管理软件总是时不时的出现一下(例如[GTK+ Font Manager][5] 这是最近的一个例子),但是他们(字体管理软件)很少能正确的时候出现。我一直在思考一大堆这些软件让人失望的方面。一个核心的原因是他们把自己限制只展示自己在二进制字体文件内嵌的信息:基本字符集的覆盖,粗细,宽度,和斜度的设定,内置的证书和版权说明等等。 +在用户视角来说,一个巨大的提升可能就是在“只是下载”这个阶段,操作系统或者桌面环境变得更智能。系统或桌面环境不仅会把字体文件安装到正确的位置上,更重要的是,当用户选择要在一个项目中使用的字体时,它会自己添加用户所需要的重要的元数据。 -但是在选择字体的过程中为了工作的选择(字体)都不能在内置数据中找到。正经的字体用户像信息设计者,杂志文章作者,或者书籍美工设计者,他们的字体选择是在每一份文件的需求上做出的。这些需求包含了证书信息,很自然的,它还包含了更多,像关于设计师和厂商的信息,潮流风格的趋势,或者字体在使用当中的细节。 +这些附加信息包含的内容与它如何呈现给用户与另一个挑战有关:与其它操作系统相比,在 Linux 环境管理一个字体库显然不那么令人满意。字体管理器总是时不时的出现一下(例如 [GTK+ 字体管理器][5],这是最近的一个例子),但是它们很少变得流行起来。我一直在思考一大堆这些软件让人失望的方面。一个核心的原因是它们把自己局限于只展示内嵌在二进制字体文件内的信息:基本字符集的覆盖、粗细/宽度和斜率的设定,内置的许可证和版权说明等等。 -举个例子,如果你的文档包含了英语和阿拉伯文,你多半想要一种某个很熟悉拉丁文和阿拉伯文设计师设计同时设计两种语言的字体。否则,你将浪费一大堆时间来微调字体大小和行间距来使两种语言良好地结合在一起。你可能从经验中学到,特定的设计师或服务商(字体)比其他人更善于多语言设计。或许和你职业相关的是今天的时尚杂志几乎无一例外的采用"[Didone][6]"风格的字体,"[Didone][6]"是指一种两百多年前最先被[Firmin Didot][7] 和 [Giambattista Bodoni][8]设计出来的反差超级大的字体风格。这种字体恰好就是现在的潮流。 +但是除了这些内嵌数据中的内容,在选择字体的过程中还涉及很多决策。严肃的字体用户,像信息设计者、杂志文章作者,或者书籍美工设计者,他们的字体选择是根据每一份文件的要求和需求做出的。这当然包含了许可证信息,但它还包含了更多,像关于设计师和厂商的信息、潮流风格的趋势,或者字体在使用中的细节。 -但是这些字体(Didone, Didot, or Bodoni)中没有一种有可能会出现在内置的二进制文件中,你也不容易发现拉丁文和阿拉伯文是否相得益彰或其他关于字体的背后故事。这些信息有可能出现在补充的材料中,类似某种样本或字体文件中,如果这些东西存在的话。 +举个例子,如果你的文档包含了英语和阿拉伯文,你多半想要拉丁文和阿拉伯文的字体由同时熟悉这两种字母系统script的设计师所设计。否则,你将浪费一大堆时间来微调字体大小和行间距来使两种字母系统良好地结合在一起。你可能从经验中学到,某些设计师或字体厂商比其他人更善于多种字母系统设计。或许和你职业相关的是今天的时尚杂志几乎无一例外的采用 “[Didone][6]”风格的字体,“[Didone][6]”是指一种两百多年前最先被 [Firmin Didot][7] 和 [Giambattista Bodoni][8] 设计出来的超高反差的字体风格。这种字体恰好就是现在的潮流。 -字体样本是一份设计好的文档(一般是PDF),它展示了这种字体在使用的情况而且包括了背景信息。字体样本经常起到两重作用,作为市场样本和在挑选字体时的样本。一份样品精心的设计展示了字体在实际应用中的情况和一种自动生产字符表所不能形成的风格。字体样本文件也有可能包含了一些其他重要信息,比如怎样激活字体的开放特色,它提供了什么样的数学表达式和古体字,或者它怎么在跨支持的语言上风格多样。要使这些资源能够被字体管理软件上的用户使用还要走过帮助用户找到合适他们工程的字体的漫长之路。 +但是像 Didone、Didot 或 Bodoni 这些术语都不可能会出现在二进制文件的内置数据当中,你也不容易判断拉丁文和阿拉伯文是否相得益彰或其它关于字体的历史背景。这些信息有可能出现在补充的材料中,类似某种字形样本或字体文件中,如果这些东西存在的话。 -当然,如果我们要去考虑一个字体管理软件能够解决文件和样本问题,我们也必须仔细观察各种发行版提供的字体包伴随着什么。linux的用户刚开始只有自动安装的那几种字体,并且提供仓库的包是大部分用户除了下载最普通的压缩包档案之外的唯一字体来源。这些资源包往往非常的“骨感”。商业字体总的来说都包含了样本,文档,还有其他的支持项目,然而开源字体往往没有(这些配套文件)。 +字形样本specimen是一份设计好的文档(一般是 PDF),它展示了这种字体的使用情况,而且包括了背景信息。字形样本经常在挑选字体时充当市场营销和外观样例的双重角色。一份精心设计的样本展示了字体在实际应用中的情况和在自动生成的字符表中所不能体现的风格。字形样本文件也有可能包含了一些其他重要信息,比如怎样激活字体的 OpenType 特性、提供的数学表达式或古体字,或者它在支持的多种语言上的风格变化。在字体管理应用程序中向用户提供此类材料,对于帮助用户找到适合其项目需求的字体将大有帮助。 -也有一些很棒的开源字体提供了高质量的样本和文档的例子(例如 [SIL Gentium][9] 和 [Bungee][10] 是两种极度不一样但是有效的方案),但是他们几乎不涉足下端的整合包链条。我们肯定能做的(比他们)更好。 +当然,如果我们希望一个字体管理软件能够处理文件和样本问题,我们也必须仔细观察一下各种发行版提供的字体包所随附的内容。Linux 的用户刚开始只有自动安装的那几种字体,并且发行版存储库提供的包是大部分用户除了下载通用的压缩包档案之外的唯一字体来源。这些包往往非常的“简陋”。商业字体总的来说都包含了样本、文档,还有其他的支持项目,然而开源字体往往没有这些配套文件。 -在和系统的字体交互方面提供更丰富的用户体验上面还有一些技术问题。比如说,[AppStream][11]的元数据标准定义了几项针对字体文件的参数,但是现在为止这些参数没有包含样本,设计师和厂商,和其他相关细节的任何信息。另外一个例子,[SPDX][13] (软件包信息交换)格式也没有包含很多软件证书(和证书参数),这些软件证书是用来分配指定字体的。 +也有一些优秀的开放字体提供了高质量的样本和文档(例如 [SIL Gentium][9] 和 [Bungee][10] 是两种差异明显但是都有效的方案),但是它们几乎不涉足下游的打包工作链。我们显然可以做的更好一些。 -最后,就像任何一个唱片爱好者都会告诉你,一个不允许你编辑和完善你的mp3库的ID3信息(mp3头部的一个字节,记录歌手信息)的音乐播放器很快就会变得让人失望。你想要处理标志里的错误,你想要添加比如笔记和乐队,艺术家这样的基本信息,你想要提升你的音乐库。你可能想要做一样的事情来使你的本地字体仓库保持在一个方便使用的状态。 +要在系统的字体交互方面提供更丰富的用户体验上面还存在一些技术问题。一方面,[AppStream][11] 的元数据标准定义了一些字体文件特有的参数,但是到现在为止,这些参数没有包含样本、设计师/厂商和其他相关细节的任何信息。另外一个例子,[SPDX][13](软件包数据交换Software Package Data Exchange)格式也没有包含太多用于分发字体的软件许可证(及许可证变体)。 -但是改动字体文件的内置数据已经被禁止了,因为字体往往是被内置或附加到其他文件里的。如果你拿字体二进制文件来胡闹的话,那么你需要重新为你的展示幻灯片分配字体,任何一个人下载这些幻灯片最终都会面对错误的元数据但他们自己并没有过失。所以任何一个要提升字体管理体验的人都要弄清楚如何来战略的讨论内置或外置的字体元数据里反反复复的变化。 +最后,就像任何一个唱片爱好者都会告诉你的,一个不允许你编辑和完善你的 MP3 曲库中的 ID3 信息的音乐播放器很快就会变得令人失望(LCTT 译注:ID3 信息是 MP3 文件头部的元信息,用于存储歌曲信息)。你想要处理标签里的错误、想要添加注释和专辑封面之类的信息,本质上,这就是完善你的音乐库。同样,你可能也想要让你的本地字体库也保持在一个方便使用的状态。 -除了技术角度之外,丰富字体管理的体验也是一个设计的挑战。就像我前面说的一样,有几种开放的字体也带了良好的样本和精心写好的证明文件。但是有更多的字体包两者都没有,还有大量的更老的字体包已经没有人维护了。这很可能意味着大部分开放字体包想要获得样本和证明文件的唯一办法就是让(字体)社区去为它们创造。 +但是改动字体文件的内置数据一直有所忌讳,因为字体往往是被内置或附加到其他文件里的。如果你随意改变了字体二进制文件中的字段,然后将其与你的演示文稿一起重新分发,那么下载这些演示文稿的任何人最终都会得到错误的元数据,但这个错误不是他们自己造成的。所以任何一个要改善字体管理体验的人都要想明白如何从策略上解决对内置或外置的字体元数据的重复修改。 -可能那(前面说的)是一个很高的要求。但是开源设计社区现在比它以前任何时候都要庞大,并且它(社区)是全面免费开源软件运动中的一个高度活跃的组成部分。所以谁知道呢。可能明年这个时候会发现,在linux桌面系统下载和使用字体会变成一种完全不同的体验。 +除了技术角度之外,丰富的字体管理经验也是一项设计挑战。就像我在前面说的一样,有几种开放字体也带了良好的样本和精心编写的文档。但是更多的字体包这两者都没有,还有大量的更老的字体包已经没有人维护了。这很可能意味着大部分开放字体包想要获得样本和证明文件的唯一办法就是让社区去创建它们。 -在关于现代Linux用户的文字设计上的挑战的一连串思考中包含了打包文件,证明文件设计,甚至有可能需要在桌面环境加入不少新的软件成分。还有其他一连串的东西也需要考虑。共通性就是在网络字体服务不及的地方,事情就变得更加困难。 +也许这是一个很高的要求。但是开源设计社区现在比以往任何时候都要庞大,它是整个自由开源软件运动中的一个高度活跃的组成部分。所以谁知道呢,也许明年这个时候会发现,在 Linux 桌面系统查找、下载和使用字体会变成一种完全不同的体验。 -最好的消息是,从我的视角来看,就是现在比起以前有更多的人对这个议题感兴趣。我认为我们要感谢像谷歌字体和开放字体库这样的网络字体服务巨头让开放字体得到了更高的关注。 +在这一连串关于现代 Linux 用户的文字设计上的挑战的思考中包含了打包、文档设计,甚至有可能需要在桌面环境加入不少新的软件部分。此外还有其他一系列的东西也需要考虑。其共通性就是在 Web 字体服务不可及的地方,事情就会变得更加困难。 +从我的视角来看,最好的消息是现在比起以前有更多的人对这个话题感兴趣。我认为我们要感谢像谷歌字体和开放字体库这样的 Web 字体服务巨头让开放字体得到了更高的关注。 -------------------------------------------------------------------------------- via: https://opensource.com/article/18/3/webfonts 作者:[Nathan Willis][a] -译者:https://github.com/Fisherman110 -校对:[校对者ID](https://github.com/校对者ID) +译者:[Fisherman110](https://github.com/Fisherman110) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 44f232fc2c56d0aed9a8a9b453cddf19af2888d1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 8 Mar 2020 17:51:41 +0800 Subject: [PATCH 153/207] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Fisherman110 本文首发地址:https://linux.cn/article-11974-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/Fisherman110 请注册以领取 LCCN: https://lctt.linux.cn/ --- .../20180306 Exploring free and open web fonts.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180306 Exploring free and open web fonts.md (100%) diff --git a/translated/tech/20180306 Exploring free and open web fonts.md b/published/20180306 Exploring free and open web fonts.md similarity index 100% rename from translated/tech/20180306 Exploring free and open web fonts.md rename to published/20180306 Exploring free and open web fonts.md From fe7ef3c5e8c78ddebb6b1cac9289f90adb63b1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Sun, 8 Mar 2020 06:27:48 -0700 Subject: [PATCH 154/207] Translating File name: 20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md Translator: mengxinayn --- ...sic Vim Commands You Need to Know to Work in Vim Editor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md b/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md index 657fb6a93b..6b959364b7 100644 --- a/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md +++ b/sources/tech/20200219 Basic Vim Commands You Need to Know to Work in Vim Editor.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -157,7 +157,7 @@ via: https://www.2daygeek.com/basic-vim-commands-cheat-sheet-quick-start-guide/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[萌新阿岩](https://github.com/mengxinayan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 12a1e0aa16c51981f7b8511f177b897174d65fd8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 9 Mar 2020 08:34:31 +0800 Subject: [PATCH 155/207] translated --- ...ientific calculator for your smartphone.md | 61 ------------------- ...ientific calculator for your smartphone.md | 58 ++++++++++++++++++ 2 files changed, 58 insertions(+), 61 deletions(-) delete mode 100644 sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md create mode 100644 translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md diff --git a/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md deleted file mode 100644 index b69120beaa..0000000000 --- a/sources/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Calculator N+ is an open source scientific calculator for your smartphone) -[#]: via: (https://opensource.com/article/19/11/calculator-n-mobile) -[#]: author: (Ricardo Berlasso https://opensource.com/users/rgb-es) - -Calculator N+ is an open source scientific calculator for your smartphone -====== -The Android app does a wide range of advanced mathematical functions in -the palm of your hand. -![scientific calculator][1] - -Mobile phones are becoming more powerful every day, so it is no surprise that they can beat most computers from the not-so-distant past. This also means the tools available on them are getting more powerful every day. - -Previously, I wrote about [scientific calculators for the Linux desktop][2], and I'm following that up here with information about [Calculator N+][3], an awesome GPL v3.0-licensed computer algebra system (CAS) app for Android devices. - -Calculator N+ is presented as a "powerful calculator for Android," but that's a humble statement; the app not only works with arbitrary precision, displaying results with roots and fractions in all their glory, it does a _lot_ more. - -Finding polynomial roots? Check. Factorization? Check. Symbolic derivatives, integrals, and limits? Check. Number theory (modular arithmetic, combinatorics, prime factorization)? Check. - -You can also solve systems of equations, simplify expressions (including trigonometric ones), convert units… you name it! - -![Calculator N+ graphical interface][4] - -Results are output in LaTeX. The menu in the top-left provides many powerful functions ready to use with a simple touch. Also in that menu, you'll find Help files for all of the app's functions. At the top-right of the screen, you can toggle between exact and decimal representation. Finally, tapping the blue bar at the bottom of the screen gives you access to the whole library of functions available in the app. But be careful! If you are not a mathematician, physicist, or engineer, such a long list may seem overwhelming. - -All of this power comes from the [Symja library][5], another great GPL 3 project. - -Both projects are under active development, and they are getting better with each version. In particular, version 3.4.6 of Calculator N+ gets a major leap in user interface (UI) quality. And yes, there are still some rough corners here and there, but taming this much power in the tiny UI of a smartphone is a difficult task, and I think the app developers are solving its remaining issues quite well. Kudos to them! - -If you are a teacher, a student, or work on a STEM field, check out Calculator N+. It's free, no ads, open source, and covers all your math needs. (Except, of course, during math exams, where smartphones should never be allowed to prevent cheating.) - -Calculator N+ is available in the [Google Play Store][6], or you can [build it from source code][7] using the instructions on the GitHub page. - -If you know any other useful open source apps for science or engineering, let us know in the comments. - -The app makes use of the sensors on your phone and offers a digital science notebook to record your... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/11/calculator-n-mobile - -作者:[Ricardo Berlasso][a] -选题:[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/rgb-es -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) -[2]: https://opensource.com/article/18/1/scientific-calculators-linux -[3]: https://github.com/tranleduy2000/ncalc -[4]: https://opensource.com/sites/default/files/uploads/calculatornplus_sqrt-frac.png (Calculator N+ graphical interface) -[5]: https://github.com/axkr/symja_android_library -[6]: https://play.google.com/store/apps/details?id=com.duy.calculator.free -[7]: https://github.com/tranleduy2000/ncalc/blob/master/README.md diff --git a/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md new file mode 100644 index 0000000000..43d232c6aa --- /dev/null +++ b/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Calculator N+ is an open source scientific calculator for your smartphone) +[#]: via: (https://opensource.com/article/19/11/calculator-n-mobile) +[#]: author: (Ricardo Berlasso https://opensource.com/users/rgb-es) + +Calculator N+ 是一款智能手机上的开源科学计算器 +====== +这个 Android 应用可在掌中计算许多高级数学函数。 +![scientific calculator][1] + +移动电话每天都在变得越来越强大,因此毫不奇怪它们可以击败大多数不太久前的大多数计算机。这也意味着上面的工具每天都在变得越来越强大。 + +之前,我写过一篇 [Linux 桌面上的科学计算器][2],我接着将介绍 [Calculator N +][3],这是一个很棒的 GPL v3.0 许可证下的,适用于 Android 设备的计算机代数系统(CAS)应用。 + +Calculator N+ 被认为是“适用于 Android 的强大计算器”,但这是一个谦虚的说法。它不仅可以以任意精度工作,还可以显示根数和分数等_很多_功能。 + +寻找多项式根?可以。分解因数?可以。导数、积分和极限?可以。数论(模算术、组合学、素因数分解)?可以。 + +你还可以求解系统方程、简化表达式(包括三角函数)、转换单位,只要你想到的,它都能做! + +![Calculator N+ graphical interface][4] + +结果以 LaTeX 输出。左上方的菜单提供了许多强大的功能,只需触摸一下即可使用。同样在该菜单中,你将找到该应用所有功能的帮助文件。在屏幕的右上角,你可以在精确和十进制表示之间切换。最后,点击屏幕底部的蓝色条,即可访问应用中的所有功能库。不过要小心!如果你不是数学家、物理学家或工程师,那么这么长的列表会看上去很震撼。 + +所有这些功能都来自 [Symja 库][5],这是另一个出色的 GPL 3 项目。 + +这两个项目都处于积极开发中,并且每个版本都在不断完善。特别是,Calculator N+ 的 v3.4.6 在用户界面 (UI) 品质方面取得了重大飞跃。但是还是存在一些不好的地方,但是要在智能手机的小巧的用户界面中发挥如此强大的功能是一项艰巨的任务,我认为应用开发人员正在很好地解决其剩余的问题。对他们表示敬意! + +如果你是老师、学生或在理工科领域工作,请试试 Calculator N+。它是免费、无广告、开源的,并可以满足你所有的数学需求。(当然,除了数学考试期间,为防止作弊绝对不允许使用智能手机。) + +可以在 [Google Play 商店][6]找到 Calculator N+,也可以使用 GitHub 页面上的说明[从源代码构建][7]。 + +如果你知道用于科学或工程的其他有用的开源应用,请在评论中告知我们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/11/calculator-n-mobile + +作者:[Ricardo Berlasso][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rgb-es +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) +[2]: https://opensource.com/article/18/1/scientific-calculators-linux +[3]: https://github.com/tranleduy2000/ncalc +[4]: https://opensource.com/sites/default/files/uploads/calculatornplus_sqrt-frac.png (Calculator N+ graphical interface) +[5]: https://github.com/axkr/symja_android_library +[6]: https://play.google.com/store/apps/details?id=com.duy.calculator.free +[7]: https://github.com/tranleduy2000/ncalc/blob/master/README.md From 062fe204c123755a63b0279043dfa99099bceba7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 9 Mar 2020 08:42:00 +0800 Subject: [PATCH 156/207] translating --- ...clude-Hold-Prevent a Specific Package from an apt Upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md b/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md index b4e47fcc36..e55c7a24e0 100644 --- a/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md +++ b/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7226419e857261b4bc381a93c0301e5f60d386ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 9 Mar 2020 09:15:20 +0800 Subject: [PATCH 157/207] PRF @geekpi --- ...w to Add New Brushes in GIMP -Quick Tip.md | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md index 1e43b2bc71..e6e4070e45 100644 --- a/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md +++ b/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -7,10 +7,10 @@ [#]: via: (https://itsfoss.com/add-brushes-gimp/) [#]: author: (Community https://itsfoss.com/author/itsfoss/) -如何在 GIMP 中添加新画笔(快速技巧) +快速技巧:如何在 GIMP 中添加新画笔 ====== -[GIMP][1] 是最流行的免费和开源图像编辑器,它也许是 Linux 上最好的 [Adobe Photoshop 替代品][2]。 +[GIMP][1] 是最流行的自由开源的图像编辑器,它也许是 Linux 上最好的 [Adobe Photoshop 替代品][2]。 当你[在 Ubuntu 或其他任何操作系统上安装了 GIMP 后][3],你会发现已经安装了一些用于基本图像编辑的画笔。如果你需要更具体的画笔,你可以随时在 GIMP 中添加新画笔。 @@ -22,60 +22,59 @@ 在 GIMP 中安装新画笔需要三个步骤: - * 获取新画笔 - * 将其放入指定的文件夹中 - * 刷新 GIMP 中的画笔 - - +* 获取新画笔 +* 将其放入指定的文件夹中 +* 刷新 GIMP 中的画笔 #### 步骤 1:下载新的 GIMP 画笔 第一步是获取新的 GIMP 画笔。你从哪里获取?当然是从互联网上。 -你可以在 Google 或[隐私搜索引擎,如 Duck Duck Go][5] 种搜索 “GIMP画笔”,并从网站下载一个你喜欢的。 +你可以在 Google 或[如 Duck Duck Go 这种隐私搜索引擎][5]来搜索 “GIMP brushes”,并从网站下载一个你喜欢的。 GIMP 画笔通常以 .gbr 和 .gih 文件格式提供。.gbr 文件用于常规画笔,而 .gih 用于动画画笔。 -你知道吗? - -从 2.4 版本起,GIMP 使安装和使用 Photoshop 画笔(.abr 文件)非常简单。你只需将 Photoshop 画笔文件放在正确的文件夹中。 -请记住,最新的 Photoshop 画笔可能无法完美地在 GIMP 中使用。 +> 你知道吗? +> +> 从 2.4 版本起,GIMP 使安装和使用 Photoshop 画笔(.abr 文件)非常简单。你只需将 Photoshop 画笔文件放在正确的文件夹中。 +> +> 请记住,最新的 Photoshop 画笔可能无法完美地在 GIMP 中使用。 #### 步骤 2:将新画笔复制到它的位置 获取画笔文件后,下一步是复制该文件并将其粘贴到 GIMP 配置目录中所在的文件夹。 -在 **Windows** 上,你必须进入类似 “**C:\Documents and Settings\myusername.gimp-2.10\brushes**” 这样的文件夹。 +> 在微软 Windows 上,你必须进入类似 `C:\Documents and Settings\myusername.gimp-2.10\brushes` 这样的文件夹。 -我将展示 **Linux** 上的详细步骤,因为 It’s FOSS 是一个专注于 Linux 的网站。 +我将展示 Linux 上的详细步骤,因为我们是一个专注于 Linux 的网站。 -选择画笔文件后,在 **Home** 目录中按下 **Ctrl+h** [查看 Linux 中的隐藏文件][6]。 +选择画笔文件后,在家目录中按下 `Ctrl+h` [查看 Linux 中的隐藏文件][6]。 ![Press Ctrl+H to see hidden files in the home directory][7] -你应该进入 **.config/GIMP/2.10/brushes** 文件夹(如果你使用的是 GIMP 2.10)。如果使用其他版本,那么应在 .config/GIMP 下看到相应文件夹。 +你应该进入 `.config/GIMP/2.10/brushes` 文件夹(如果你使用的是 GIMP 2.10)。如果使用其他版本,那么应在 `.config/GIMP` 下看到相应文件夹。 ![Adding New Brushes in GIMP][8] -将画笔文件粘贴到此文件夹中。可选地,你可以通过再次按 **Ctrl+h** 来隐藏隐藏的文件。 +将画笔文件粘贴到此文件夹中。可选地,你可以通过再次按 `Ctrl+h` 来隐藏隐藏的文件。 #### 步骤 3:刷新画笔(避免重启 GIMP) GIMP 将在启动时自动加载画笔。如果已在运行,并且不想关闭它,你可以刷新画笔。 -在 GIMP 的主菜单中找到 **Windows**->**Dockable Dialogues**->**Brushes**。 +在 GIMP 的主菜单中找到 “Windows->Dockable Dialogues->Brushes”。 ![Refresh GIMP Brushes by going go to Windows->Dockable Dialogues-> Brushes][9] -在右侧栏的 **Brushes** 对话框中找到**刷新**图标。 +在右侧栏的 Brushes 对话框中找到“refresh”图标。 ![Refresh GIMP Brushes][10] 如果你的画笔没有出现,那么你可以试试重启 GIMP。 -额外的技巧! - -在 [GIMP 中添加新画笔还能让你轻松给图片添加水印][11]。只需将 logo 用作画笔,并点击一下就可添加到图片中。 +> 额外的技巧! +> +> 在 [GIMP 中添加新画笔还能让你轻松给图片添加水印][11]。只需将 logo 用作画笔,并点击一下就可添加到图片中。 我希望你喜欢这个快速 GIMP 技巧。敬请期待更多。 @@ -86,7 +85,7 @@ via: https://itsfoss.com/add-brushes-gimp/ 作者:[Community][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8a36ebebc3a992bcb2f9e87e2848bb32ab93ac41 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 9 Mar 2020 09:18:08 +0800 Subject: [PATCH 158/207] PUB @geekpi https://linux.cn/article-11975-1.html --- .../20200302 How to Add New Brushes in GIMP -Quick Tip.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200302 How to Add New Brushes in GIMP -Quick Tip.md (97%) diff --git a/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md b/published/20200302 How to Add New Brushes in GIMP -Quick Tip.md similarity index 97% rename from translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md rename to published/20200302 How to Add New Brushes in GIMP -Quick Tip.md index e6e4070e45..4608cec762 100644 --- a/translated/tech/20200302 How to Add New Brushes in GIMP -Quick Tip.md +++ b/published/20200302 How to Add New Brushes in GIMP -Quick Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11975-1.html) [#]: subject: (How to Add New Brushes in GIMP [Quick Tip]) [#]: via: (https://itsfoss.com/add-brushes-gimp/) [#]: author: (Community https://itsfoss.com/author/itsfoss/) From 07587be7d54bb6f48455ef971cd5372d81696cca Mon Sep 17 00:00:00 2001 From: Hank Chow <280630620@qq.com> Date: Mon, 9 Mar 2020 10:14:58 +0800 Subject: [PATCH 159/207] typo corrected --- ...rce Private Messenger That Doesn-t Need Your Phone Number.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md index 3cb2f915c4..c50d0437e0 100644 --- a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md +++ b/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -107,7 +107,7 @@ Session 采用了去中心化的架构实现消息的传输和路由。如果你 ### 总结 -当然,最完美的事物是不存在的。我也会一直使用 Session 并考虑它发展的方向,这是一个注重引得的用户应该做的事情。 +当然,最完美的事物是不存在的。我也会一直使用 Session 并考虑它发展的方向,这是一个注重隐私的用户应该做的事情。 欢迎在评论区发表你的看法。 From 63485d086d24d9d83ffaca95f24c84ccc434e9b1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 9 Mar 2020 10:49:31 +0800 Subject: [PATCH 160/207] PRF @wxy --- ...ed with the Rust package manager, Cargo.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md b/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md index b289dd6f00..d16c2624bd 100644 --- a/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md +++ b/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting started with the Rust package manager, Cargo) @@ -12,7 +12,7 @@ Rust 包管理器 Cargo 入门 > 了解 Rust 的软件包管理器和构建工具。 -![Shipping containers stacked in a yard][1] +![](https://img.linux.net.cn/data/attachment/album/202003/09/104906tdl21k977t8999qt.jpg) [Rust][2] 是一种现代编程语言,可提供高性能、可靠性和生产力。几年来,它一直被 StackOverflow 调查评为[最受欢迎的语言][3]。 @@ -20,21 +20,21 @@ Rust 包管理器 Cargo 入门 ### 安装 Rust 和 Cargo -在开始之前,你需要安装 Rust 和 Cargo。Rust 项目提供了一个可下载的脚本来处理安装。要获取该脚本,请打开浏览器以访问 [https://sh.rustup.rs][4] 并保存该文件。阅读脚本以确保你对它的具体行为有所了解,然后运行它: +在开始之前,你需要安装 Rust 和 Cargo。Rust 项目提供了一个可下载的脚本来处理安装。要获取该脚本,请打开浏览器以访问 [https://sh.rustup.rs][4] 并保存该文件。阅读该脚本以确保你对它的具体行为有所了解,然后再运行它: ``` $ sh ./rustup.rs ``` -你也可以参考这个[安装 Rust][5]网页以获取更多信息。 +你也可以参考这个[安装 Rust][5] 的网页以获取更多信息。 -安装 Rust 和 Cargo 之后,你必须获取source `env` 文件: +安装 Rust 和 Cargo 之后,你必须获取source `env` 文件中的配置: ``` $ source $HOME/.cargo/env ``` -更好的是,将所需目录添加到 `PATH` 环境变量中: +更好的办法是,将所需目录添加到 `PATH` 环境变量中: ``` export PATH=$PATH:~/.cargo/bin @@ -91,11 +91,11 @@ $ ./hello Hello, world! ``` -这些步骤对于较小的程序或任何你想快速测试的东西就足够了。但是,在进行涉及多人的大型计划时,Cargo 是前进的最佳之路。 +这些步骤对于较小的程序或任何你想快速测试的东西就足够了。但是,在进行涉及到多人的大型程序时,Cargo 是前进的最佳之路。 ### 使用 Cargo 创建新包 -Cargo 是 Rust 的构建系统和包管理器。它可以帮助开发人员下载和管理依赖项,并帮助创建 Rust 包。在Rust 社区中,Rust 中的“包”通常被称为“crate”(板条箱),但是在本文中,这两个词是可以互换的。请参阅 Rust 社区提供的 Cargo [FAQ][6] 来区分。 +Cargo 是 Rust 的构建系统和包管理器。它可以帮助开发人员下载和管理依赖项,并帮助创建 Rust 包。在 Rust 社区中,Rust 中的“包”通常被称为“crate”(板条箱),但是在本文中,这两个词是可以互换的。请参阅 Rust 社区提供的 Cargo [FAQ][6] 来区分。 如果你需要有关 Cargo 命令行实用程序的任何帮助,请使用 `--help` 或 `-h` 命令行参数: @@ -134,7 +134,7 @@ fn main() { 下一个要处理的文件是 `Cargo.toml`,这是你的包的配置文件。它包含有关包的信息,例如其名称、版本、作者信息和 Rust 版本信息。 -程序通常依赖于外部库或依赖项来运行,这使你可以编写应用程序来执行不知道如何编码或不想花时间编码的任务。你所有的依赖项都将在此文件中列出。此时,对你的新程序你没有任何依赖关系。打开 `Cargo.toml` 文件并查看其内容: +程序通常依赖于外部库或依赖项来运行,这使你可以编写应用程序来执行不知道如何编码或不想花时间编码的任务。你所有的依赖项都将在此文件中列出。此时,你的新程序还没有任何依赖关系。打开 `Cargo.toml` 文件并查看其内容: ``` $ cat hello_opensource/Cargo.toml @@ -250,7 +250,7 @@ fn main() { } ``` -现在,构建程序并再次运行它。这次,你会在屏幕上看到 `Hello, Opensource world!`: +现在,构建该程序并再次运行它。这次,你会在屏幕上看到 `Hello, Opensource world!`: ``` $ cargo build @@ -293,9 +293,9 @@ $ cargo build     Finished dev [unoptimized + debuginfo] target(s) in 4.48s ``` -现在,Cargo 会联系 [Crates.io][9],这是 Rust 用于存储 crate(或包)的中央仓库,并下载和编译 `rand`。但是,等等 —— `libc` 包是怎么回事?你没有要要安装 libc 啊。是的,`rand` 包依赖于 `libc` 包;因此,Cargo 也会下载并编译 `libc`。 +现在,Cargo 会联系 [Crates.io][9](这是 Rust 用于存储 crate(或包)的中央仓库),并下载和编译 `rand`。但是,等等 —— `libc` 包是怎么回事?你没有要安装 libc 啊。是的,`rand` 包依赖于 `libc` 包;因此,Cargo 也会下载并编译 `libc`。 -库的新版本不断涌现,而 Cargo 提供了一种使用 `update` 命令更新其所有依赖关系的简便方法: +库的新版本会不断涌现,而 Cargo 提供了一种使用 `update` 命令更新其所有依赖关系的简便方法: ``` cargo update @@ -449,7 +449,7 @@ $ cargo build --release ### 使用 Cargo 创建库还是二进制文件 -任何软件程序都可以粗略地分类为独立二进制文件或库。一个独立二进制文件也许即使是当中外部库使用的,自身也是可以运行的。但是,作为一个库,是可以被另一个独立二进制文件所利用的。到目前为止,你在本教程中构建的所有程序都是独立二进制文件,因为这是 Cargo 的默认设置。 要创建一个**库**,请添加 `--lib` 选项: +任何软件程序都可以粗略地分类为独立二进制文件或库。一个独立二进制文件也许即使是当做外部库使用的,自身也是可以运行的。但是,作为一个库,是可以被另一个独立二进制文件所利用的。到目前为止,你在本教程中构建的所有程序都是独立二进制文件,因为这是 Cargo 的默认设置。 要创建一个**库**,请添加 `--lib` 选项: ``` $ cargo new --lib libhello @@ -514,7 +514,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out 这是使用 `-v` 选项运行 `build` 和 `clean` 的几个例子。 -在 `build` 命令中,你可以看到这些给定的命令行选项触发了底层的 `rustc`(Rust编译器): +在 `build` 命令中,你可以看到这些给定的命令行选项触发了底层的 `rustc`(Rust 编译器): ``` $ cargo build -v @@ -523,7 +523,7 @@ $ cargo build -v     Finished dev [unoptimized + debuginfo] target(s) in 0.36s ``` -而 `clean` 命令表明它只是删除包含中间文件和二进制文件的目录: +而 `clean` 命令表明它只是删除了包含中间文件和二进制文件的目录: ``` $ cargo clean -v @@ -534,7 +534,7 @@ $ cargo clean -v 要扩展你的技能,请尝试使用 Rust 和 Cargo 编写并运行一个稍微复杂的程序。很简单就可以做到:例如,尝试列出当前目录中的所有文件(可以用 9 行代码完成),或者尝试自己回显输入。小型的实践应用程序可帮助你熟悉语法以及编写和测试代码的过程。 -本文为刚起步的 Rust 程序员提供了大量信息,以使他们可以开始入门 Cargo。但是,当你开始处理更大、更复杂的程序时,你需要对 Cargo 有更深入的了解。当你准备好迎接更多内容时,请下载并阅读 Rust 团队编写的开源《[Cargo 手册][10]》,看看你可以创造什么! +本文为刚起步的 Rust 程序员提供了大量信息,以使他们可以开始入门 Cargo。但是,当你开始处理更大、更复杂的程序时,你需要对 Cargo 有更深入的了解。当你准备好迎接更多内容时,请下载并阅读 Rust 团队编写的开源的《[Cargo 手册][10]》,看看你可以创造什么! -------------------------------------------------------------------------------- @@ -543,7 +543,7 @@ via: https://opensource.com/article/20/3/rust-cargo 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fb69cc74526e887426b0cf59c1a243f374edb983 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 9 Mar 2020 10:50:09 +0800 Subject: [PATCH 161/207] PUB @wxy https://linux.cn/article-11977-1.html --- ...03 Getting started with the Rust package manager, Cargo.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200303 Getting started with the Rust package manager, Cargo.md (99%) diff --git a/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md b/published/20200303 Getting started with the Rust package manager, Cargo.md similarity index 99% rename from translated/tech/20200303 Getting started with the Rust package manager, Cargo.md rename to published/20200303 Getting started with the Rust package manager, Cargo.md index d16c2624bd..55f3f7491d 100644 --- a/translated/tech/20200303 Getting started with the Rust package manager, Cargo.md +++ b/published/20200303 Getting started with the Rust package manager, Cargo.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11977-1.html) [#]: subject: (Getting started with the Rust package manager, Cargo) [#]: via: (https://opensource.com/article/20/3/rust-cargo) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) From 7973649db38529e524c52eb3ca76ec13dd840eda Mon Sep 17 00:00:00 2001 From: qianmigntian Date: Mon, 9 Mar 2020 15:29:04 +0800 Subject: [PATCH 162/207] Translated by qianmingtian --- ...stall and Use Wireshark on Ubuntu Linux.md | 126 +++++++++--------- 1 file changed, 60 insertions(+), 66 deletions(-) diff --git a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md index b1f3b76e2b..e83fa0bc77 100644 --- a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md +++ b/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -7,35 +7,33 @@ [#]: via: (https://itsfoss.com/install-wireshark-ubuntu/) [#]: author: (Community https://itsfoss.com/author/itsfoss/) -Install and Use Wireshark on Ubuntu Linux +Ubuntu 上 Wireshark 的安装与使用 ====== -_**Brief: You’ll learn to install the latest Wireshark on Ubuntu and other Ubuntu-based distribution in this tutorial. You’ll also learn how to run Wireshark without sudo and how to set it up for packet sniffing.**_ +_** 简介:在本指南中,你将学习如何在 Ubuntu 和其他基于 Ubuntu 的发行版上安装最新的 Wireshark。同时你也将学习如何在没有 sudo 的情况下来运行 Wireshark ,以及如何设置它来进行数据包嗅探。**_ -[Wireshark][1] is a free and open-source network protocol analyzer widely used around the globe. +[Wireshark][1] 是一款免费开源网络协议分析器,它在全球被广泛使用。 -With Wireshark, you can capture incoming and outgoing packets of a network in real-time and use it for network troubleshooting, packet analysis, software and communication protocol development, and many more. +通过使用 Wireshark ,你可以实时捕获网络的传入和传出数据包,并将其用于网络故障排除、数据包分析、软件和通信协议开发等。 -It is available on all major desktop operating systems like Windows, Linux, macOS, BSD and more. +它适用于所有主流的桌面操作系统,如 Windows 、 Linux 、 macOS 、 BSD 等。 -In this tutorial, I will guide you to install Wireshark on Ubuntu and other Ubuntu-based distributions. I’ll also show a little about setting up and configuring Wireshark to capture packets. - -### Installing Wireshark on Ubuntu based Linux distributions +在本教程中,我将指导你在 Ubuntu 和其他基于 Ubuntu 的发行版上安装 Wireshark 。我还将介绍如何设置和配置 Wireshark 来捕获数据包。 +### 在基于 Ubuntu 的 Linux 发行版上安装 Wireshark ![][2] -Wireshark is available on all major Linux distributions. You should check out the [official installation instructions][3]. because in this tutorial, I’ll focus on installing the latest Wireshark version on Ubuntu-based distributions only. - -Wireshark is available in the Universe repository of Ubuntu. You can [enable universe repository][4] and then install it like this: +Wireshark 适用于所有主流 Linux 发行版。你应该查看[官方安装说明][3]。因为在本教程中,我将着重在仅基于 Ubuntu 的发行版上安装最新版本的 Wireshark 。 +Wireshark 可以在 Ubuntu 的 Universe 存储库中找到。你可以[启用 universe 存储库][4],然后按如下方式安装: ``` sudo add-apt-repository universe sudo apt install wireshark ``` -One slight problem in this approach is that you might not always get the latest version of Wireshark. +这种方法的一个小问题是,你可能并不总是得到最新版本的 Wireshark 。 -For example, in Ubuntu 18.04, if you [use the apt command][5] to check the available version of Wireshark, it is 2.6. +例如,在 Ubuntu 18.04 中,如果你使用 [apt][5] 命令检查 Wireshark 的可用版本,可用版本会显示是 2.6 。 ``` [email protected]:~$ apt show wireshark @@ -47,138 +45,133 @@ Origin: Ubuntu Maintainer: Balint Reczey <[email protected]> ``` -However, [Wireshark 3.2 stable version][6] has been released months ago. New release brings new features, of course. +然而, [Wireshark 3.2 稳定版][6]已经在几个月前发布了。当然,新版本拥有新的特性。 -So, what do you do in such case? Thankfully, Wiresshark developers provide an official PPA that you can use to install the latest stable version of Wireshark on Ubuntu and other Ubuntu-based distributions. +那么在这种情况下,你应该怎么办呢?谢天谢地, Wireshark 开发者提供了一种官方 PPA 方式,你可以使用它在 Ubuntu 和其它基于 Ubuntu 的发行版上安装最新稳定版本的 Wireshark. -I hope you are acquainted with PPA. If not, please [read our excellent guide on PPA to understand it completely][7]. +我希望你熟悉 PPA 。如果没有,请[阅读我们关于 PPA 的优秀指南,以便完全理解它][7]。 -Open a terminal and use the following commands one by one: +打开终端并逐个使用以下命令: ``` sudo add-apt-repository ppa:wireshark-dev/stable sudo apt update sudo apt install wireshark ``` +即使安装了旧版本的 Wireshark ,它也将更新为新版本。 -Even if you have an older version of Wireshark installed, it will be updated to the newer version. +安装时,系统将询问你是否允许非超级用户捕获数据包。选择“是”允许,选择“否”限制非超级用户捕获数据包,最后完成安装。 -While installing, you will be asked whether to allow non-superusers to capture packets. Select Yes to allow and No to restrict non-superusers to capture packets & finish the installation. - -### Running Wireshark without sudo - -If you have selected **No** in the previous installation, then run the following command as root: +### 不使用 sudo 运行 Wireshark +如果在上一次安装中选择了**否**,则以root用户身份运行以下命令: ``` sudo dpkg-reconfigure wireshark-common ``` -And select **Yes** by pressing the tab key and then using enter key: - +然后按 tab 键并使用回车键选择**是**: ![][8] -Since you have allowed the non-superuser to capture packets, you have to add the user to wireshark group. Use the [usermod command][9] to add yourself to the wireshark group. +由于你允许非超级用户捕获数据包,因此你必须将该用户添加到 wireshark 组。使用[ usermod ][9]命令将自己添加到 wireshark 组。 ``` sudo usermod -aG wireshark $(whoami) ``` -Finally, [restart your Ubuntu system][10] to make the necessary changes to your system. +最后,[重启你的 Ubuntu 系统][10]对你的系统进行必要的修改。 -Trivia +冷知识 -First released in 1998, Wireshark was initially known as Ethereal. Developers had to change its name to Wireshark in 2006 due to trademark issues. +Wireshark 于 1998 年首次发布,最初被称为 Ethereal 。2006 年,由于商标问题,开发商不得不将其名称改为 Wireshark 。 -### Starting Wireshark +### 启动 Wireshark -Launching Wireshark application can be done from the application launcher or the CLI. +你可以从应用程序启动器或者命令行启动 Wireshark 应用。 -To start from CLI, just type **wireshark** on your console: +如果从命令行启动,只需要在你的控制台中输入 **wireshark** : ``` wireshark ``` - -From **GUI**, search for Wireshark application on the search bar and hit enter. +要是从**图形化界面**启动,需要在搜索栏搜索 Wireshark 应用,并按回车键。 ![][11] -Now let’s play with Wireshark. +现在,让我们来玩玩 Wireshark 吧。 -### Capturing packets using Wireshark +### 使用 Wireshark 捕获数据包 -When you start Wireshark, you will see a list of interfaces that you can use to capture packets to and from. +当你启动 Wireshark 的时候,你会看到一个接口列表,你可以使用它来捕获这个接口接收和发送的数据包。 -There are many types of interfaces available which you can monitor using Wireshark such as, Wired, External devices, etc. According to your preference, you can choose to show specific types of interfaces in the welcome screen from the marked area in the given image below. +你可以使用 Wireshark 监视许多类型的接口,例如,有线、外部设备等。根据你的偏好,你可以从下图中的标记区域选择在欢迎屏幕中显示特定类型的接口。 ![Select interface][12] -For instance, I listed only the **Wired** network interfaces. +例如,我只列出了**有线**网络接口。 ![][13] -Next, to start capturing packets, you have to select the interface (which in my case is ens33) and click on the **Start capturing packets** icon as marked in the image below. - +接下来,要开始捕获数据包,你必须选择接口(在我的示例中是 ens33 ),然后单击**开始捕获数据包**图标,如下图所示。 ![Start capturing packets with Wireshark][14] -You can also capture packets to and from multiple interfaces at the same time. Just press and hold the **CTRL** button while clicking on the interfaces that you want to capture to and from and then hit the **Start capturing packets** icon as marked in the image below. +你还可以同时从多个接口捕获数据包。只需按住 **CTRL** 按钮,同时单击要捕获的接口,然后点击**开始捕获数据包**图标,如下图所示。 ![][15] -Next, I tried using **ping google.com** command in the terminal and as you can see, many packets were captured. +接下来,我尝试在终端中使用 **ping google.com** 命令,如你所见,捕获了许多数据包。 ![Captured packets][16] -Now you can select on any packet to check that particular packet. After clicking on a particular packet you can see the information about different layers of TCP/IP Protocol associated with it. +现在你可以选择任何数据包来检查该特定数据包。在点击一个特定的包之后,你可以看到与它相关的 TCP/IP 协议的不同层的信息。 ![Packet info][17] -You can also see the RAW data of that particular packet at the bottom as shown in the image below. +你还可以在底部看到该特定数据包的原始数据,如下图所示。 ![Check RAW data in the captured packets][18] -This is why end-to-end encryption is important +这就是为什么端到端加密很重要。 -Imagine you are logging into a website that doesn’t use HTTPS. Anyone on the same network as you can sniff the packets and see the user name and password in the RAW data. -This is why most chat applications use end to end encryption and most websites these days use https (instead of http). +假设你正在登录一个不使用 HTTPS 的网站。与你在同一网络上的任何人都可以嗅探数据包,并在原始数据中看到用户名和密码。 -#### Stopping packet capture in Wireshark +这就是为什么现在大多数聊天应用程序使用端到端加密,而大多数网站使用 https (而不是 http )。 -You can click on the red icon as marked in the given image to stop capturing Wireshark packets. +#### 在 Wireshark 中停止数据包捕获 + +你可以点击如图所示的红色图标停止捕获数据包。 ![Stop packet capture in Wireshark][19] -#### Save captured packets to a file +#### 将捕获的数据包保存成文件 -You can click on the marked icon in the image below to save captured packets to a file for future use. +你可以单击下图中标记的图标,将捕获的数据包保存到文件中以备将来使用。 ![Save captured packets by Wireshark][20] -**Note**: _Output can be exported to XML, PostScript®, CSV, or plain text._ -Next, select a destination folder, and type the file name and click on **Save**. -Then select the file and click on **Open**. +**注意**:_输出可以导出为 XML 、 PostScript 、 CSV 或纯文本_ + +接下来,选择一个目标文件夹,键入文件名并单击**保存**。 + +然后选择文件并单击**打开**。 ![][21] +现在你可以随时打开和分析保存的数据包。要打开文件,请按 **\+o** +或从Wireshark转到**文件 > 打开**。 -Now you can open and analyze the saved packets anytime. To open the file, press **\ + o** -or go to **File > Open** from Wireshark. - -The captured packets should be loaded from the file. +捕获的数据包将从文件中加载。 ![][22] -### Conclusion +### 结语 +Wireshark 支持许多不同的通信协议。有许多选项和功能,使你能够以独特的方式捕获和分析网络数据包。你可以从 Wireshark 的[官方文档][23]了解更多关于 Wireshark 的信息。 -Wireshark supports many different communication protocols. There are many options and features that provide you the power to capture and analyze the network packets in a unique way. You can learn more about Wireshark from their [official documentation][23]. - -I hope this detailed helped you to install Wireshark on Ubuntu. Please let me know your questions and suggestions. +我希望这个教程能帮助你在 Ubuntu 上安装 Wireshark 。请让我知道你的问题和建议。 ![][24] - ### Kushal Rai -A computer science student & Linux and open source lover. He likes sharing knowledge for he believes technology shapes the perception of modern world. Kushal also loves music and photography. +计算机科学专业的学生、Linux 和开源爱好者。他喜欢分享知识,因为他相信技术塑造了对现代世界的感知。 Kushal 也喜欢音乐和摄影。 -------------------------------------------------------------------------------- @@ -186,13 +179,14 @@ via: https://itsfoss.com/install-wireshark-ubuntu/ 作者:[Community][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[qianmigntian][c] 校对:[校对者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 +[c]: https://github.com/qianmigntian [1]: https://www.wireshark.org/ [2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/wireshark_ubuntu.png?ssl=1 [3]: https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallUnixInstallBins.html From 5bf2e0d8534745bd1abe68669fe66c81c04e2db0 Mon Sep 17 00:00:00 2001 From: qianmigntian Date: Mon, 9 Mar 2020 15:32:18 +0800 Subject: [PATCH 163/207] Translated by qianmingtian --- .../tech/20200305 Install and Use Wireshark on Ubuntu Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md (100%) diff --git a/sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md similarity index 100% rename from sources/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md rename to translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md From 2d2699d0a8e9f63a3444b8fbb43168871cf7c98c Mon Sep 17 00:00:00 2001 From: qianmigntian Date: Mon, 9 Mar 2020 15:33:21 +0800 Subject: [PATCH 164/207] Translated by qianmingtian --- .../tech/20200305 Install and Use Wireshark on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md index e83fa0bc77..c4f7b35f2d 100644 --- a/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md +++ b/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -10,7 +10,7 @@ Ubuntu 上 Wireshark 的安装与使用 ====== -_** 简介:在本指南中,你将学习如何在 Ubuntu 和其他基于 Ubuntu 的发行版上安装最新的 Wireshark。同时你也将学习如何在没有 sudo 的情况下来运行 Wireshark ,以及如何设置它来进行数据包嗅探。**_ +_** 简介:在本教程中,你将学习如何在 Ubuntu 和其他基于 Ubuntu 的发行版上安装最新的 Wireshark。同时你也将学习如何在没有 sudo 的情况下来运行 Wireshark ,以及如何设置它来进行数据包嗅探。**_ [Wireshark][1] 是一款免费开源网络协议分析器,它在全球被广泛使用。 From b8d4b462ae09181a936eec784c1453547befe362 Mon Sep 17 00:00:00 2001 From: qianmigntian Date: Mon, 9 Mar 2020 15:33:49 +0800 Subject: [PATCH 165/207] Translated by qianmingtian --- .../tech/20200305 Install and Use Wireshark on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md index c4f7b35f2d..637c1a4c3d 100644 --- a/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md +++ b/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -10,7 +10,7 @@ Ubuntu 上 Wireshark 的安装与使用 ====== -_** 简介:在本教程中,你将学习如何在 Ubuntu 和其他基于 Ubuntu 的发行版上安装最新的 Wireshark。同时你也将学习如何在没有 sudo 的情况下来运行 Wireshark ,以及如何设置它来进行数据包嗅探。**_ +_**简介:在本教程中,你将学习如何在 Ubuntu 和其他基于 Ubuntu 的发行版上安装最新的 Wireshark。同时你也将学习如何在没有 sudo 的情况下来运行 Wireshark ,以及如何设置它来进行数据包嗅探。**_ [Wireshark][1] 是一款免费开源网络协议分析器,它在全球被广泛使用。 From 005975a65017be04842573f7f32c4ef8bb1721be Mon Sep 17 00:00:00 2001 From: cycoe Date: Mon, 9 Mar 2020 19:40:37 +0800 Subject: [PATCH 166/207] [Translated] Translated by Cycoe --- ...ng in Emacs- The Grand Unified Debugger.md | 97 ----------------- ...ng in Emacs- The Grand Unified Debugger.md | 101 ++++++++++++++++++ 2 files changed, 101 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md create mode 100644 translated/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md diff --git a/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md b/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md deleted file mode 100644 index b82a27dadc..0000000000 --- a/sources/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cycoe) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Debugging in Emacs: The Grand Unified Debugger) -[#]: via: (https://opensourceforu.com/2019/09/debugging-in-emacs-the-grand-unified-debugger/) -[#]: author: (Vineeth Kartha https://opensourceforu.com/author/vineeth-kartha/) - -Debugging in Emacs: The Grand Unified Debugger -====== - -[![][1]][2] - -_This article briefly explores the features of the Grand Unified Debugger, a debugging tool for Emacs._ - -If you are a C/C++ developer, it is highly likely that you have crossed paths with GDB (the GNU debugger) which is, without doubt, one of the most powerful and unrivalled debuggers out there. Its only drawback is that it is command line based, and though that offers a lot of power, it is sometimes a bit restrictive as well. This is why smart people started coming up with IDEs to integrate editors and debuggers, and give them a GUI. There are still developers who believe that using the mouse reduces productivity and that mouse-click based GUIs are temptations by the devil. -Since Emacs is one of the coolest text editors out there, I am going to show you how to write, compile and debug code without having to touch the mouse or move out of Emacs. - -![Figure 1: Compile command in Emacs’ mini buffer][3] - -![Figure 2: Compilation status][4] - -The Grand Unified Debugger, or GUD as it is commonly known, is an Emacs mode in which GDB can be run from within Emacs. This provides all the features of Emacs in GDB. The user does not have to move out of the editor to debug the code written. - -**Setting the stage for the Grand Unified Debugger** -If you are using a Linux machine, then it is likely you will have GDB and gcc already installed. The next step is to ensure that Emacs is also installed. I am assuming that the readers are familiar with GDB and have used it at least for basic debugging. If not, please do check out some quick introductions to GDB that are widely available on the Internet. - -For people who are new to Emacs, let me introduce you to some basic terminology. Throughout this article, you will see shortcut commands such as C-c, M-x, etc. C means the Ctrl key and M means the Alt key. C-c means the Ctrl + c keys are pressed. If you see C-c c, it means Ctrl + c is pressed followed by c. Also, in Emacs, the main area where you edit the text is called the main buffer, and the area at the bottom of the Emacs window, where commands are entered, is called the mini buffer. -Start Emacs and to create a new file, press _C-x C-f_. This will prompt you to enter a file name. Let us call our file ‘buggyFactorial.cpp’. Once the file is open, type in the code shown below: - -``` -#include -#include -int factorial(int num) { -int product = 1; -while(num--) { -product *= num; -} -return product; -} -int main() { -int result = factorial(5); -assert(result == 120); -} -``` - -Save the file with _C-x C-s_. Once the file is saved, it’s time to compile the code. Press _M-x_ and in the prompt that comes up, type in compile and hit Enter. Then, in the prompt, replace whatever is there with _g++ -g buggyFactorial.cpp_ and again hit _Enter_. - -This will open up another buffer in Emacs that will show the status of the compile and, hopefully, if the code typed in is correct, you will get a buffer like the one shown in Figure 2. - -To hide this compilation status buffer, make sure your cursor is in the compilation buffer (you can do this without the mouse using _C-x o_-this is used to move the cursor from one open buffer to the other), and then press _C-x 0_. The next step is to run the code and see if it works fine. Press M-! and in the mini buffer prompt, type _./a.out._ - -See the mini buffer that says the assertion is failed. Clearly, something is wrong with the code, because the factorial (5) is 120. So let’s debug the code now. - -![Figure 3: Output of the code in the mini buffer][5] - -![Figure 4: The GDB buffer in Emacs][6] - -**Debugging the code using GUD** -Now, since we have the code compiled, it’s time to see what is wrong with it. Press M-x and in the prompt, enter _gdb._ In the next prompt that appears, write _gdb -i=mi a.out_, which will start GDB in the Emacs buffer and if everything goes well, you should get the window that’s shown in Figure 4. -At the gdb prompt, type break main and then r to run the program. This should start running the program and should break at the _main()_. - -As soon as GDB hits the break point at main, a new buffer will open up showing the code that you are debugging. Notice the red dot on the left side, which is where your breakpoint was set. There will be a small indicator that shows which line of the code you are on. Currently, this will be the same as the break point itself (Figure 5). - -![Figure 5: GDB and the code in split windows][7] - -![Figure 6: Show the local variables in a separate frame in Emacs][8] - -To debug the factorial function, we need to step into it. For this, you can either use the _gdb_ prompt and the gdb command step, or you can use the Emacs shortcut _C-c C-s_. There are other similar shortcuts, but I prefer using the GDB commands. So I will use them in the rest of this article. -Let us keep an eye on the local variables while stepping through the factorial number. Check out Figure 6 for how to get an Emacs frame to show the local variables. - -Step through the code in the GDB prompt and watch the value of the local variable change. In the first iteration of the loop itself, we see a problem. The value of the product should have been 5 and not 4. - -This is where I leave you and now it’s up to the readers to explore and discover the magic land called GUD mode. Every gdb command works in the GUD mode as well. I leave the fix to this code as an exercise to readers. Explore and see how you can customise things to make your workflow simpler and become more productive while debugging. - --------------------------------------------------------------------------------- - -via: https://opensourceforu.com/2019/09/debugging-in-emacs-the-grand-unified-debugger/ - -作者:[Vineeth Kartha][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensourceforu.com/author/vineeth-kartha/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Screenshot-from-2019-09-25-15-39-46.png?resize=696%2C440&ssl=1 (Screenshot from 2019-09-25 15-39-46) -[2]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Screenshot-from-2019-09-25-15-39-46.png?fit=800%2C506&ssl=1 -[3]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_1.png?resize=350%2C228&ssl=1 -[4]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_2.png?resize=350%2C228&ssl=1 -[5]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_3.png?resize=350%2C228&ssl=1 -[6]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_4.png?resize=350%2C227&ssl=1 -[7]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_5.png?resize=350%2C200&ssl=1 -[8]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_6.png?resize=350%2C286&ssl=1 diff --git a/translated/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md b/translated/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md new file mode 100644 index 0000000000..7bdeff9b48 --- /dev/null +++ b/translated/tech/20190925 Debugging in Emacs- The Grand Unified Debugger.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Debugging in Emacs: The Grand Unified Debugger) +[#]: via: (https://opensourceforu.com/2019/09/debugging-in-emacs-the-grand-unified-debugger/) +[#]: author: (Vineeth Kartha https://opensourceforu.com/author/vineeth-kartha/) + +Emacs 调试秘籍之——GUD 调试器 +====== + +[![][1]][2] + +_本文简短地对 Emacs 的调试工具 GUD(译注:全称 Grand Unified Debugger,鉴于其缩写形式更为人熟知,以下全文将使用缩写替代此全称)的特性进行了探索。_ + +如果你是一个 C 或 C++ 开发者,你很可能已经使用过 GDB(GNU 调试器),毫无疑问,它是现今最强大、最无可匹敌的调试器之一。它唯一的缺点就是它基于命令行,虽然仍能提供许多强大的功能,但有时也会具有一些局限性。这也就是为什么聪明的人们开始追求整合了编辑器和调试器的图形化GUI集成Integrated开发Development环境Environment。仍有些开发者坚信使用鼠标会降低工作效率,在 GUI 上用鼠标点~点~点~是来自恶魔的诱惑。 + +因为 Emacs 是现今最酷的文本编辑器之一,我将为你展示如何在不碰鼠标且不离开 Emacs 的情况下,实现写代码、编译代码、调试代码的过程。 + +![图 1: Emacs 迷你缓冲区中的编译命令][3] + +![图 2: 编译状态][4] + +GUD 是 Emacs 下的一个模式mode,用于在 Emacs 中运行 GDB。它向 GDB 提供了 Emacs 的所有特性,使用户无需离开编辑器就可以对代码进行调试。 + +**使用 GUD 的前期准备** +如果你正在使用一个 Linux 机器,很可能你已经安装了 GDB 和 gcc,接下来就是要确保已经安装了 Emacs。以下的内容我将假设读者熟悉 GDB 并且至少用它做过基本的调试。如果你未曾接触过 GDB,你可以做个快速入门,这些资料在网上随处可得。 + +对于那些 Emacs 新手,我将向你介绍一些基本术语。纵览整篇文章,你将看到诸如 _C-c M-x_ 等快捷键。此处 _C_ 代表 _Ctrl_ 键,_M_ 代表 _Alt_ 键。_C-c_ 代表 _Ctrl_ 键和 _c_ 键被同时按下。如果你看到 _C-c c_,它代表同时按下 _Ctrl_ 键和 _c_ 键,紧接着按下 _c_ 键。在 Emacs 中,编辑文本的主要区域被称为main缓冲区buffer,而在 Emacs 窗口下方用于输入命令的区域被称为迷你mini缓冲区buffer。 + +启动 Emacs,并按下 _C-x C-f_ 来创建一个新文件。Emacs 将提示你输入一个文件名,此处让我们将文件命名为 `buggyFactorial.cpp`。一旦文件打开,输入如下代码: + +``` +#include +#include + +int factorial(int num) { + int product = 1; + while(num--) { + product *= num; + } + return product; +} +int main() { + int result = factorial(5); + assert(result == 120); +} +``` + +使用 _C-x C-s_ 快捷键保存文件。文件保存完毕,是时候进行编译了。按下 _M-x_,在弹出的提示符prompt后输入 _compile_ 并点击回车。然后在提示符后,将内容替换为 _g++ -g buggyFactorial.cpp_ 并再次点击回车。 + +这将在 Emacs 中开启另一个缓冲区,显示编译的状态。如果你的代码输入没有错误,你将预期得到如图 2 所示的缓冲区。 + +要想隐藏编译缓冲区,首先确保你的光标在编译缓冲区中(你可以不使用鼠标,而是通过 _C-x o_ 快捷键将光标从一个缓冲区移动到另一个),然后按下 _C-x 0_。下一步就是运行代码,并观察是否运行良好。按下 _M-!_ 快捷键并在迷你缓冲区的提示符后面输入 _./a.out_。 + +你可以看到迷你缓冲区中显示断言失败。很明显代码中有错误,因为 5 的阶乘是 120。那么让我们现在开始调试吧。 + +![图 3: 代码在迷你缓冲区中的输出][5] + +![图 4: Emacs 中的 GDB 缓冲区][6] + +**使用 GUD 调式代码** +现在,我们的代码已经编译完成,是时候看看到底哪里出错了。按下 _M-x_ 快捷键并在提示符后输入 _gdb_。在接下来的提示符后,输入 _gdb -i=mi a.out_。如果一切顺利,GDB 会在 Emacs 缓冲区中启动,你会看到如图 4 所示的窗口。 +在 _gdb_ 提示符后,输入 _break main_ 来设置断点,并输入 _r_ 来运行程序。程序会开始运行并停在 _main()_ 函数处。 + +一旦 GDB 到达了 _main_ 处设置的断点,就会弹出一个新的缓冲区显示你正在调试的代码。注意左侧的红点,正是你设置断点的位置,同时会有一个小的标志提示你当前代码运行到了哪一行。当前,该标志就在断点处(如图 5)。 + +![图 5: GDB 与代码显示在两个分离的窗口][7] + +![图 6: 在 Emacs 中使用独立帧显示局部变量][8] + +为了调试 _factorial_ 函数,我们需要单步运行。想要达到此目的,你可以使用 _gdb_ 提示符和 GDB 命令 _step_,或者使用 Emacs 快捷键 _C-c C-s_。还有其它一些快捷键,但我更喜欢 GDB 命令。因此我将在本文的后续部分使用它们。 + +单步运行时让我们注意一下局部变量中的阶乘值。参考图 6 来设置在 Emacs 帧中显示局部变量值。 + +在 GDB 提示符中进行单步运行并观察局部变量值的变化。在循环的第一次迭代中,我们发现了一个问题。此处乘法的结果应该是 5 而不是 4。 + +本文到这里也差不多结束了,读者可以自行探索发现 GUD 模式这片新大陆。GDB 中的所有命令都可以在 GUD 模式中运行。我将此代码的修复留给读者作为一个练习。看看你在调试的过程中,可以做哪一些定制化,来使你的工作流更加简单和高效。 + +-------------------------------------------------------------------------------- + +via: https://opensourceforu.com/2019/09/debugging-in-emacs-the-grand-unified-debugger/ + +作者:[Vineeth Kartha][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensourceforu.com/author/vineeth-kartha/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Screenshot-from-2019-09-25-15-39-46.png?resize=696%2C440&ssl=1 (Screenshot from 2019-09-25 15-39-46) +[2]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Screenshot-from-2019-09-25-15-39-46.png?fit=800%2C506&ssl=1 +[3]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_1.png?resize=350%2C228&ssl=1 +[4]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_2.png?resize=350%2C228&ssl=1 +[5]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_3.png?resize=350%2C228&ssl=1 +[6]: https://i0.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_4.png?resize=350%2C227&ssl=1 +[7]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_5.png?resize=350%2C200&ssl=1 +[8]: https://i1.wp.com/opensourceforu.com/wp-content/uploads/2019/09/Figure_6.png?resize=350%2C286&ssl=1 From a3abbf1d62f8c90e38d4a84377b83050d18c637c Mon Sep 17 00:00:00 2001 From: MFG <48886453+MFGJT@users.noreply.github.com> Date: Mon, 9 Mar 2020 23:21:11 +0800 Subject: [PATCH 167/207] Translated by MFGJT (#17678) * Update 20190422 9 ways to save the planet.md * Update 20190422 9 ways to save the planet.md * Update 20190422 9 ways to save the planet.md * Rename sources/tech/20190422 9 ways to save the planet.md to translated/tech/20190422 9 ways to save the planet.md * Update 20190422 9 ways to save the planet.md * Update 20190422 9 ways to save the planet.md * Update 20190422 9 ways to save the planet.md * Update 20190422 9 ways to save the planet.md * Update 20190422 9 ways to save the planet.md * Update 20190422 9 ways to save the planet.md --- .../20190422 9 ways to save the planet.md | 96 ------------------ .../20190422 9 ways to save the planet.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 96 deletions(-) delete mode 100644 sources/tech/20190422 9 ways to save the planet.md create mode 100644 translated/tech/20190422 9 ways to save the planet.md diff --git a/sources/tech/20190422 9 ways to save the planet.md b/sources/tech/20190422 9 ways to save the planet.md deleted file mode 100644 index a448fa7660..0000000000 --- a/sources/tech/20190422 9 ways to save the planet.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MFGJT) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 ways to save the planet) -[#]: via: (https://opensource.com/article/19/4/save-planet) -[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) - -9 ways to save the planet -====== -These ideas have an open source twist. -![][1] - -What can be done to help save the planet? The question can seem depressing at a time when it feels like an individual's contribution isn't enough. But, who are we Earth dwellers if not for a collection of individuals? So, I asked our writer community to share ways that open source software or hardware can be used to make a difference. Here's what I heard back. - -### 9 ways to save the planet with an open source twist - -**1.** **Disable the blinking cursor in your terminal.** - -It might sound silly, but the trivial, blinking cursor can cause up to [2 watts per hour of extra power consumption][2]. To disable it, go to Terminal Settings: Edit > Preferences > Cursor > Cursor blinking > Disabled. - -_Recommended by Mars Toktonaliev_ - -**2\. Reduce your consumption of animal products and processed foods.** - -One way to do this is to add these open source apps to your phone: Daily Dozen, OpenFoodFacts, OpenVegeMap, and Food Restrictions. These apps will help you eat a healthy, plant-based diet, find vegan- and vegetarian-friendly restaurants, and communicate your dietary needs to others, even if they do not speak the same language. To learn more about these apps read [_4 open source apps to support eating a plant-based diet_][3]. - -_Recommendation by Joshua Allen Holm_ - -**3\. Recycle old computers.** - -How? With Linux, of course. Pay it forward by giving creating a new computer for someone who can't one and keep a computer out of the landfill. Here's how we do it at [The Asian Penguins][4]. - -_Recommendation by Stu Keroff_ - -**4\. Turn off devices when you're not using them.** - -Use "smart power strips" that have a "master" outlet and several "controlled" outlets. Plug your PC into the master outlet, and when you turn on the computer, your monitor, printer, and anything else plugged into the controlled outlets turns on too. A simpler, low-tech solution is a power strip with a timer. That's what I use at home. You can use switches on the timer to set a handy schedule to turn the power on and off at specific times. Automatically turn off your network printer when no one is at home. Or for my six-year-old laptop, extend the life of the battery with a schedule to alternate when it's running from wall power (outlet is on) and when it's running from the battery (outlet is off). - -_Recommended by Jim Hall_ - -**5\. Reduce the use of your HVAC system.** - -Sunlight shining through windows adds a lot of heat to your home during the summer. Use Home Assistant to [automatically adjust][5] window blinds and awnings [based on the time of day][6], or even based on the angle of the sun. - -_Recommended by Michael Hrivnak_ - -**6\. Turn your thermostat off or to a lower setting while you're away.** - -If your home thermostat has an "Away" feature, activating it on your way out the door is easy to forget. With a touch of automation, any connected thermostat can begin automatically saving energy while you're not home. [Stataway][7] is one such project that uses your phone's GPS coordinates to determine when it should set your thermostat to "Home" or "Away". - -_Recommended by Michael Hrivnak_ - -**7\. Save computing power for later.** - -I have an idea: Create a script that can read the power output from an alternative energy array (wind and solar) and begin turning on servers (taking them from a power-saving sleep mode to an active mode) in a computing cluster until the overload power is used (whatever excess is produced beyond what can be stored/buffered for later use). Then use the overload power during high-production times for compute-intensive projects like rendering. This process would be essentially free of cost because the power can't be buffered for other uses. I'm sure the monitoring, power management, and server array tools must exist to do this. Then, it's just an integration problem, making it all work together. - -_Recommended by Terry Hancock_ - -**8\. Turn off exterior lights.** - -Light pollution affects more than 80% of the world's population, according to the [World Atlas of Artificial Night Sky Brightness][8], published (Creative Commons Attribution-NonCommercial 4.0) in 2016 in the open access journal _Science Advances_. Turning off exterior lights is a quick way to benefit wildlife, human health, our ability to enjoy the night sky, and of course energy consumption. Visit [darksky.org][9] for more ideas on how to reduce the impact of your exterior lighting. - -_Recommended by Michael Hrivnak_ - -**9\. Reduce your CPU count.** - -For me, I remember I used to have a whole bunch of computers running in my basement as my IT playground/lab. I've become more conscious now of power consumption and so have really drastically reduced my CPU count. I like to take advantage of VMs, zones, containers... that type of technology a lot more these days. Also, I'm really glad that small form factor and SoC computers, such as the Raspberry Pi, exist because I can do a lot with one, such as run a DNS or Web server, without heating the room and running up my electricity bill. - -P.S. All of these computers are running Linux, FreeBSD, or Raspbian! - -_Recommended by Alan Formy-Duvall_ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/save-planet - -作者:[Jen Wike Huger ][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pixelated-world.png?itok=fHjM6m53 -[2]: https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02406.html -[3]: https://opensource.com/article/19/4/apps-plant-based-diets -[4]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide -[5]: https://www.home-assistant.io/docs/automation/trigger/#sun-trigger -[6]: https://www.home-assistant.io/components/cover/ -[7]: https://github.com/mhrivnak/stataway -[8]: http://advances.sciencemag.org/content/2/6/e1600377 -[9]: http://darksky.org/ diff --git a/translated/tech/20190422 9 ways to save the planet.md b/translated/tech/20190422 9 ways to save the planet.md new file mode 100644 index 0000000000..9014a4a53d --- /dev/null +++ b/translated/tech/20190422 9 ways to save the planet.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (MFGJT) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 ways to save the planet) +[#]: via: (https://opensource.com/article/19/4/save-planet) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) + +九种拯救地球的方法 +====== +这些主意都用到了有关开源的内容的技巧 + +![][1] + +图片来源:Geralt. CC0. + +人们可以做些什么来拯救地球?这个问题可能会让人感到压抑,因为有时我们感觉个人可以做的贡献太少了。但是作为地球公民,我们从来不是一个人。所以,我向我们的作家社区征集了一些开源软件或硬件可以帮助改变现状的方法。以下是他们的回复。 + +### 9种利用开源的内容来拯救地球的方法 + +**1.** **在你的终端禁用闪烁的光标。** + +这听起来可能有点傻,但是那个无关紧要的闪烁的光标可能导致[每小时两瓦特的额外电力开销][2]。如果要禁用光标闪烁,可以通过更改终端设置:编辑(edit)>偏好设置(preferences)>光标>光标闪烁>禁用。 + +_由 Mars Toktonaliev 推荐_ + +**2\. 减少有关动物产品和加工食物的消费。** + +一种拯救地球的方法是在你的手机中添加这些开源的 APP:Daily Dozen,OpenFoodFacts,OpenVegeMap,和 Food Restrictions。这些APP可以帮助你准备一份健康的素食饮食计划,为你找到素食主义者和严格素食主义者可以就餐的餐厅,还可以帮助你把你的饮食需求告诉别人,即使他们不和你讲同一种语言。如果想要了解更多有关这些的APP的信息,你可以阅读[_4款帮助你准备素食饮食的开源APP_][3]. + +_由J oshua Allen Holm 推荐_ + +**3\. 回收旧电脑。** + +怎么回收?当然是用Linux。通过给一个没办法自己获得一台电脑的人一台新电脑的方式传递爱心,你可以避免让这台电脑进到垃圾填埋场。可以在 [The Asian Penguins][4] 看看我们是怎么做的。 + +_由 Stu Keroff 推荐_ + +**4\. 在你不使用设备时关闭它们** + +你可以使用带有主插座和控制插座的“智能插座板”。把你的电脑连接到主插座上,这样的话当你打开电脑时所有你连接到控制插座上的设备如显示器,打印机等也都会打开。一个更简单的不那么先进的方法是使用一个带有计时器的插座板。我在家里就是用的这个。你可以用计时器上的开关设定一个定时开关电源的时间表。这样可以在没有人在家时自动关闭网络打印机。或者以我的用了六年的笔记本电脑为例,我通过一个在使用外接电源(外接电源打开)和使用电脑电池(外接电源关闭)的电源计划延长了电脑电池的寿命。 + +_由 Jim Hall 推荐_ + +**5\. 减少供暖通风系统的使用。** + +在夏天,通过窗户的阳光可以为室内提供很多热量。使用 Home Assistant [自动调节][5]窗帘和遮阳棚,这可以是[基于一天中的时间的][6],甚至是基于太阳高度角的。 + +_由 Michael Hrivnak 推荐_ + +**6\. 当你不在家时,把你的温度调节器调到一个低一些的温度。** + +如果你的家用温度调节器有“离开”功能,你很容易忘记在出门时启用它。通过一点自动化,任何连接到网络的温度调节器都可以在你不在家时自动节省能量。[Stataway][7] 就是一个这样项目。它通过调用你的手机的GPS坐标来决定是将你的温度调节器设置为“在家”还是“离开”。 + +_由 Michael Hrivnak 推荐_ + +**7\. 为未来储蓄算力** + +我有一个主意:创建一个可以读取可选的能量阵列(如风能或太阳能)的输出的脚本。这个脚本应该将计算集群中的服务器从睡眠模式更改为激活模式直到过量的电能(超出可以储存的部分)被用尽。然后在高产能时段使用这些过量的电能来进行需要大量计算的项目,比如渲染。这个过程本质应该是免费的,因为使用的能量无法被储存起来挪作他用。我相信现有的监控、能量管理和服务器阵列工具一定可以实现这个功能。那么剩下的只是一些整合上的问题,好让整个系统工作。 + +_由 Terry Hancock 推荐_ + +**8\. 关掉你的灯** + +根据 [World Atlas of Artificial Night Sky Brightness][8] 的说法,光污染影响了全世界超过80%的污染。这一结论在2016年被发表(遵循 Creative Commons Attribution-NonCommercial 4.0 协议)在公开权限的期刊 _Science Advances_ 上。关闭外部的灯是一个可以快速使野生生物、人类健康受益并让我们享受夜晚的天空的方法,而且可以减少能量消耗。访问 [darksky.org][9] 来查看更多减少你的外部灯光的影响的方法。 + +_由 Michael Hrivnak 推荐_ + +**9\. 减少你的CPU数量** + +就我个人而言,我记得我以前有很多在地下室运行的电脑作为我的IT游乐场/实验室。我现在对于能量消耗更加注意了,所以真的大量地减少了我的CPU数量。我现在更喜欢利用虚拟机、区域和容器等科技。另外,我很高兴有小型电脑和SoC电脑这种东西,比如 Raspberry Pi。因为我可以用一台这样的电脑做很多事情,比如运行一个DNS或者网络服务器,而无需使整个屋子变热并积累昂贵的电费账单。 + +P.S. 这些电脑都运行于 Linux,FreeBSD,或者 Raspbian 系统! + +_由 Alan Formy-Duvall 推荐_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/save-planet + +作者:[Jen Wike Huger ][a] +选题:[lujun9972][b] +译者:[MFGJT](https://github.com/MFGJT) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pixelated-world.png?itok=fHjM6m53 +[2]: https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02406.html +[3]: https://opensource.com/article/19/4/apps-plant-based-diets +[4]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide +[5]: https://www.home-assistant.io/docs/automation/trigger/#sun-trigger +[6]: https://www.home-assistant.io/components/cover/ +[7]: https://github.com/mhrivnak/stataway +[8]: http://advances.sciencemag.org/content/2/6/e1600377 +[9]: http://darksky.org/ From 571cb1fecdb9319abfdf9fd2bfaffed1ff010757 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 10 Mar 2020 00:41:24 +0800 Subject: [PATCH 168/207] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MFGJT 恭喜你完成了第一篇翻译贡献! --- .../20190422 9 ways to save the planet.md | 73 +++++++++---------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/translated/tech/20190422 9 ways to save the planet.md b/translated/tech/20190422 9 ways to save the planet.md index 9014a4a53d..ab882523c6 100644 --- a/translated/tech/20190422 9 ways to save the planet.md +++ b/translated/tech/20190422 9 ways to save the planet.md @@ -1,88 +1,87 @@ [#]: collector: (lujun9972) [#]: translator: (MFGJT) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (9 ways to save the planet) [#]: via: (https://opensource.com/article/19/4/save-planet) [#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) -九种拯救地球的方法 +九种用开源拯救地球的方法 ====== -这些主意都用到了有关开源的内容的技巧 -![][1] +> 这些主意都用到了有关的开源技巧。 -图片来源:Geralt. CC0. +![](https://img.linux.net.cn/data/attachment/album/202003/10/004034vbl5qb5lbij66zil.jpg) 人们可以做些什么来拯救地球?这个问题可能会让人感到压抑,因为有时我们感觉个人可以做的贡献太少了。但是作为地球公民,我们从来不是一个人。所以,我向我们的作家社区征集了一些开源软件或硬件可以帮助改变现状的方法。以下是他们的回复。 -### 9种利用开源的内容来拯救地球的方法 +### 九种利用开源的方法来拯救地球的方式 -**1.** **在你的终端禁用闪烁的光标。** +#### 1、在你的终端禁用闪烁的光标 -这听起来可能有点傻,但是那个无关紧要的闪烁的光标可能导致[每小时两瓦特的额外电力开销][2]。如果要禁用光标闪烁,可以通过更改终端设置:编辑(edit)>偏好设置(preferences)>光标>光标闪烁>禁用。 +这听起来可能有点傻,但是那个无关紧要的闪烁的光标可能导致[每小时两瓦特的额外电力开销][2]。如果要禁用光标闪烁,可以通过更改终端设置:编辑Edit > 偏好设置Preferences > 光标Cursor > 光标闪烁Cursor blinking > 禁用Disabled。 -_由 Mars Toktonaliev 推荐_ +*由 Mars Toktonaliev 推荐* -**2\. 减少有关动物产品和加工食物的消费。** +#### 2、减少有关动物产品和加工食物的消费 -一种拯救地球的方法是在你的手机中添加这些开源的 APP:Daily Dozen,OpenFoodFacts,OpenVegeMap,和 Food Restrictions。这些APP可以帮助你准备一份健康的素食饮食计划,为你找到素食主义者和严格素食主义者可以就餐的餐厅,还可以帮助你把你的饮食需求告诉别人,即使他们不和你讲同一种语言。如果想要了解更多有关这些的APP的信息,你可以阅读[_4款帮助你准备素食饮食的开源APP_][3]. +这样做的一种方法是在你的手机中添加这些开源的 App:Daily Dozen、OpenFoodFacts、OpenVegeMap 和 Food Restrictions。这些 App 可以帮助你准备一份健康的素食饮食计划,为你找到素食主义者和严格素食主义者可以就餐的餐厅,还可以帮助你把你的饮食需求告诉别人,即使他们不和你讲同一种语言。如果想要了解更多有关这些的 App 的信息,你可以阅读《[4 款“吃草”的开源应用][3]》。 -_由J oshua Allen Holm 推荐_ +*由 Joshua Allen Holm 推荐* -**3\. 回收旧电脑。** +#### 3、让旧电脑重焕新生 -怎么回收?当然是用Linux。通过给一个没办法自己获得一台电脑的人一台新电脑的方式传递爱心,你可以避免让这台电脑进到垃圾填埋场。可以在 [The Asian Penguins][4] 看看我们是怎么做的。 +怎么做?当然是用 Linux。通过给那些自己得不到新电脑的人创造一台新电脑来传递爱心,同时也可以避免让这台电脑进到垃圾填埋场。可以在 [The Asian Penguins][4] 看看我们是怎么做的。 -_由 Stu Keroff 推荐_ +*由 Stu Keroff 推荐* -**4\. 在你不使用设备时关闭它们** +#### 4、在你不使用设备时关闭它们 -你可以使用带有主插座和控制插座的“智能插座板”。把你的电脑连接到主插座上,这样的话当你打开电脑时所有你连接到控制插座上的设备如显示器,打印机等也都会打开。一个更简单的不那么先进的方法是使用一个带有计时器的插座板。我在家里就是用的这个。你可以用计时器上的开关设定一个定时开关电源的时间表。这样可以在没有人在家时自动关闭网络打印机。或者以我的用了六年的笔记本电脑为例,我通过一个在使用外接电源(外接电源打开)和使用电脑电池(外接电源关闭)的电源计划延长了电脑电池的寿命。 +你可以使用带有主插座和控制插座的“智能插座板”。把你的电脑连接到主插座上,这样的话当你打开电脑时所有你连接到控制插座上的设备如显示器,打印机等也都会打开。一个更简单的、技术含量更低的方法是使用一个带有计时器的插座板。我在家里就是用的这个。你可以用计时器上的开关设定一个定时开关电源的时间表。这样可以在没有人在家时自动关闭网络打印机。或者以我的用了六年的笔记本电脑为例,我通过一个交替使用外接电源(插座打开)和使用电脑电池(插座关闭)的电源计划延长了电脑电池的寿命。 -_由 Jim Hall 推荐_ +*由 Jim Hall 推荐* -**5\. 减少供暖通风系统的使用。** +#### 5、减少供暖通风系统(HVAC)的使用 -在夏天,通过窗户的阳光可以为室内提供很多热量。使用 Home Assistant [自动调节][5]窗帘和遮阳棚,这可以是[基于一天中的时间的][6],甚至是基于太阳高度角的。 +在夏天,透过窗户的阳光可以为室内提供很多热量。使用 Home Assistant 可以[基于一天中的时间的][6],甚至是基于太阳高度角[自动调节][5]窗帘和遮阳棚。 -_由 Michael Hrivnak 推荐_ +*由 Michael Hrivnak 推荐* -**6\. 当你不在家时,把你的温度调节器调到一个低一些的温度。** +#### 6、出门就把恒温器关闭或调低 -如果你的家用温度调节器有“离开”功能,你很容易忘记在出门时启用它。通过一点自动化,任何连接到网络的温度调节器都可以在你不在家时自动节省能量。[Stataway][7] 就是一个这样项目。它通过调用你的手机的GPS坐标来决定是将你的温度调节器设置为“在家”还是“离开”。 +如果你的家用恒温器具有“离开”功能,你很容易忘记在出门时启用它。借助自动化,任何连接到网络的恒温器都可以在你不在家时自动节省能量。[Stataway][7] 就是一个这样项目。它通过调用你的手机的 GPS 坐标来决定是将你的恒温器设置为“在家”还是“离开”。 -_由 Michael Hrivnak 推荐_ +*由 Michael Hrivnak 推荐* -**7\. 为未来储蓄算力** +#### 7、为未来储蓄算力 -我有一个主意:创建一个可以读取可选的能量阵列(如风能或太阳能)的输出的脚本。这个脚本应该将计算集群中的服务器从睡眠模式更改为激活模式直到过量的电能(超出可以储存的部分)被用尽。然后在高产能时段使用这些过量的电能来进行需要大量计算的项目,比如渲染。这个过程本质应该是免费的,因为使用的能量无法被储存起来挪作他用。我相信现有的监控、能量管理和服务器阵列工具一定可以实现这个功能。那么剩下的只是一些整合上的问题,好让整个系统工作。 +我有一个主意:创建一个可以读取可选的能量阵列(如风能或太阳能)的输出的脚本。这个脚本应该将计算集群中的服务器从睡眠模式更改为激活模式,直到过量的电能(超出可以储存的部分)被用尽。然后在高产能时段使用这些过量的电能来进行需要大量计算的项目,比如渲染。这个过程本质应该是免费的,因为使用的能量无法被储存起来挪作它用。我相信现有的监控、能量管理和服务器阵列工具一定可以实现这个功能。那么剩下的只是一些整合上的问题,就可以让整个系统工作起来。 -_由 Terry Hancock 推荐_ +*由 Terry Hancock 推荐* -**8\. 关掉你的灯** +#### 8、关掉你的灯 -根据 [World Atlas of Artificial Night Sky Brightness][8] 的说法,光污染影响了全世界超过80%的污染。这一结论在2016年被发表(遵循 Creative Commons Attribution-NonCommercial 4.0 协议)在公开权限的期刊 _Science Advances_ 上。关闭外部的灯是一个可以快速使野生生物、人类健康受益并让我们享受夜晚的天空的方法,而且可以减少能量消耗。访问 [darksky.org][9] 来查看更多减少你的外部灯光的影响的方法。 +根据[人工夜空亮度图集][8]World Atlas of Artificial Night Sky Brightness的说法,光污染影响了全世界超过 80% 的人口。这一结论在 2016 年(遵循 CC-NC 4.0 协议)发表在公开访问的期刊《科学进展Science Advances》上。关闭外部照明是一个可以使野生生物、人类健康受益并让我们享受夜晚的天空的快速途径,而且可以减少能量消耗。访问 [darksky.org][9] 来查看更多减少外部照明影响的方法。 -_由 Michael Hrivnak 推荐_ +*由 Michael Hrivnak 推荐* -**9\. 减少你的CPU数量** +#### 9、减少你的 CPU 数量 -就我个人而言,我记得我以前有很多在地下室运行的电脑作为我的IT游乐场/实验室。我现在对于能量消耗更加注意了,所以真的大量地减少了我的CPU数量。我现在更喜欢利用虚拟机、区域和容器等科技。另外,我很高兴有小型电脑和SoC电脑这种东西,比如 Raspberry Pi。因为我可以用一台这样的电脑做很多事情,比如运行一个DNS或者网络服务器,而无需使整个屋子变热并积累昂贵的电费账单。 +就我个人而言,我记得我以前有很多在地下室运行的电脑作为我的 IT 游乐场/实验室。我现在对于能源消耗更加注意了,所以确实大大地减少了我的 CPU 数量。我现在更喜欢利用虚拟机、区域和容器等技术。另外,我很高兴有小型电脑和 SoC 电脑这种东西,比如树莓派,因为我可以用一台这样的电脑做很多事情,比如运行一个 DNS 或者 Web 服务器,而无需使整个屋子变热并积累昂贵的电费账单。 -P.S. 这些电脑都运行于 Linux,FreeBSD,或者 Raspbian 系统! +P.S. 这些电脑都运行于 Linux、FreeBSD,或者 Raspbian 系统! -_由 Alan Formy-Duvall 推荐_ +*由 Alan Formy-Duvall 推荐* -------------------------------------------------------------------------------- via: https://opensource.com/article/19/4/save-planet -作者:[Jen Wike Huger ][a] +作者:[Jen Wike Huger][a] 选题:[lujun9972][b] 译者:[MFGJT](https://github.com/MFGJT) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -90,7 +89,7 @@ via: https://opensource.com/article/19/4/save-planet [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pixelated-world.png?itok=fHjM6m53 [2]: https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02406.html -[3]: https://opensource.com/article/19/4/apps-plant-based-diets +[3]: https://linux.cn/article-10926-1.html [4]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide [5]: https://www.home-assistant.io/docs/automation/trigger/#sun-trigger [6]: https://www.home-assistant.io/components/cover/ From 54691dbbd345f54275a5f8b27d916b4789a6c12c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 10 Mar 2020 00:42:43 +0800 Subject: [PATCH 169/207] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MFGJT 本文首发地址:https://linux.cn/article-11978-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/MFGJT 请注册以领取 LCCN: https://lctt.linux.cn/ --- .../tech => published}/20190422 9 ways to save the planet.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190422 9 ways to save the planet.md (98%) diff --git a/translated/tech/20190422 9 ways to save the planet.md b/published/20190422 9 ways to save the planet.md similarity index 98% rename from translated/tech/20190422 9 ways to save the planet.md rename to published/20190422 9 ways to save the planet.md index ab882523c6..28a8cf2c55 100644 --- a/translated/tech/20190422 9 ways to save the planet.md +++ b/published/20190422 9 ways to save the planet.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MFGJT) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11978-1.html) [#]: subject: (9 ways to save the planet) [#]: via: (https://opensource.com/article/19/4/save-planet) [#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) From b7be6b750bc8fc4906292a7b4f4009b51880b87c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 10 Mar 2020 00:55:34 +0800 Subject: [PATCH 170/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200309=20Fish?= =?UTF-8?q?=20=E2=80=93=20A=20Friendly=20Interactive=20Shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200309 Fish - A Friendly Interactive Shell.md --- ...309 Fish - A Friendly Interactive Shell.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20200309 Fish - A Friendly Interactive Shell.md diff --git a/sources/tech/20200309 Fish - A Friendly Interactive Shell.md b/sources/tech/20200309 Fish - A Friendly Interactive Shell.md new file mode 100644 index 0000000000..9e892e04ff --- /dev/null +++ b/sources/tech/20200309 Fish - A Friendly Interactive Shell.md @@ -0,0 +1,194 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fish – A Friendly Interactive Shell) +[#]: via: (https://fedoramagazine.org/fish-a-friendly-interactive-shell/) +[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) + +Fish – A Friendly Interactive Shell +====== + +![Fish — A Friendly Interactive Shell][1] + +Are you looking for an alternative to bash? Are you looking for something more user-friendly? Then look no further because you just found the golden fish! + +Fish (friendly interactive shell) is a smart and user-friendly command line shell that works on Linux, MacOS, and other operating systems. Use it for everyday work in your terminal and for scripting. Scripts written in fish are less cryptic than their equivalent bash versions. + +### Fish’s user-friendly features + + * **Suggestions** +Fish will suggest commands that you have written before. This boosts productivity when typing same commands often. + * **Sane scripting** +Fish avoids using cryptic characters. This provides a clearer and friendlier syntax. + * **Completion based on man pages** +Fish will autocomplete parameters based on the the command’s man page. + * **Syntax highlighting** +Fish will highlight command syntax to make it visually friendly. + + + +### Installation + +#### Fedora Workstation + +Use the _dnf_ command to install fish: + +``` +$ sudo dnf install fish +``` + +Make fish your default shell by installing the _util-linux-user_ package and then running the _chsh_ (change shell) command with the appropriate parameters: + +``` +$ sudo dnf install util-linux-user +$ chsh -s /usr/bin/fish +``` + +You will need to log out and back in for this change to take effect. + +#### Fedora Silverblue + +Because this is not GUI application, you will need to layer it using _rpm-ostree_. Use the following command to install fish on Fedora Silverblue: + +``` +$ rpm-ostree install fish +``` + +On Fedora Silverblue you will need to reboot your PC to switch to the new ostree image. + +If you want to make fish your main shell on Fedora Silverblue, the easiest way is to update the _/etc/passwd_ file. Find your user and change _/bin/bash_ to _/usr/bin/fish_. + +You will need [root privileges][2] to edit the _/etc/passwd_ file. Also you will need to log out and back in for this change to take effect. + +### Configuration + +The per-user configuration file for fish is _~/.config/fish/config.fish_. To make configuration changes for all users, edit _/etc/fish/config.fish_ instead. + +The per-user configuration file must be created manually. The installation scripts will not create _~/.config/fish/config.fish_. + +Here are a couple configuration examples shown alongside their bash equivalents to get you started: + +#### Creating aliases + + * _~/.bashrc_: alias ll='ls -lh' + * _~/.config/fish/config.fish_: alias ll='ls -lh' + + + +#### Setting environment variables + + * _~/.bashrc_: export PATH=$PATH:~/bin + * _~/.config/fish/config.fish_: set -gx PATH $PATH ~/bin + + + +### Working with fish + +When fish is configured as your default shell, the command prompt will look similar to what is shown in the below image. If you haven’t configured fish to be your default shell, just run the _fish_ command to start it in your current terminal session. + +![][3] + +As you start typing commands, you will notice the syntax highlighting: + +![][4] + +Cool, isn’t it? 🙂 + +You will also see commands being suggested as you type. For example, start typing the previous command a second time: + +![][5] + +Notice the gray text that appears as you type. The gray text is fish suggesting the command you wrote before. To autocomplete it, just press **CTRL+F**. + +Get argument suggestions based on the preceding command’s man page by typing a dash (**–**) and then the **TAB** key: + +![][6] + +If you press **TAB** once, it will show you the first few suggestions (or every suggestion, if there are only a few arguments available). If you press **TAB** a second time, it will show you all suggestions. If you press **TAB** three times consecutively, it will switch to interactive mode and you can select an argument using the arrow keys. + +Otherwise, fish works similar to most other shells. The remaining differences are well documented. So it shouldn’t be difficult to find other features that you may be interested in. + +### Make fish even more powerful + +Make the fish even more powerful with [powerline][7]. Powerline adds command execution time, colored git status, current git branch and much more to fish’s interface. + +Before installing powerline for fish, you must install [Oh My Fish][8]. Oh My Fish extends fish’s core infrastructure to enable the installation of additional plugins. The easiest way to install Oh My Fish is to use the _curl_ command: + +``` +> curl -L https://get.oh-my.fish | fish +``` + +If you don’t want to pipe the installation commands directly to _curl_, see the installation section of Oh My Fish’s [README][9] for alternative installation methods. + +Fish’s powerline plugin is [bobthefish][7]. Bobthefish requires the _powerline-fonts_ package. + +**On Fedora Workstation**: + +``` +> sudo dnf install powerline-fonts +``` + +**On Fedora Silverblue**: + +``` +> rpm-ostree install powerline-fonts +``` + +On Fedora Silverblue you will have to reboot to complete the installation of the fonts. + +After you have installed the _powerline-fonts_ package, install _bobthefish_: + +``` +> omf install bobthefish +``` + +Now you can experience the full awesomeness of fish with powerline: + +![][10] + +### Additional resources + +Check out these web pages to learn even more about fish: + + * [Official page][11] + * [Documentation][12] + * [Tutorial][13] + * [FAQ][14] + * [Web playground][15] + * [Mailing lists][16] + * [GitHub][17] + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fish-a-friendly-interactive-shell/ + +作者:[Michal Konečný][a] +选题:[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/zlopez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/03/fish-816x345.jpg +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-00-35.png +[4]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-19-24.png +[5]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-25-31.png +[6]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-14-58-07.png +[7]: https://github.com/oh-my-fish/theme-bobthefish +[8]: https://github.com/oh-my-fish/oh-my-fish +[9]: https://github.com/oh-my-fish/oh-my-fish/blob/master/README.md#installation +[10]: https://fedoramagazine.org/wp-content/uploads/2020/03/Screenshot-from-2020-03-03-15-38-07.png +[11]: https://fishshell.com/ +[12]: https://fishshell.com/docs/current/index.html +[13]: https://fishshell.com/docs/current/tutorial.html +[14]: https://fishshell.com/docs/current/faq.html +[15]: https://rootnroll.com/d/fish-shell/ +[16]: https://sourceforge.net/projects/fish/lists/fish-users +[17]: https://github.com/fish-shell/fish-shell/ From e915c9d3e0cb74233b95188f286071fcdbce1c51 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 10 Mar 2020 00:56:39 +0800 Subject: [PATCH 171/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200310=20Basili?= =?UTF-8?q?sk:=20A=20Firefox=20Fork=20For=20The=20Classic=20Looks=20and=20?= =?UTF-8?q?Classic=20Extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md --- ...he Classic Looks and Classic Extensions.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md diff --git a/sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md b/sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md new file mode 100644 index 0000000000..d2b1ce5d4c --- /dev/null +++ b/sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Basilisk: A Firefox Fork For The Classic Looks and Classic Extensions) +[#]: via: (https://itsfoss.com/basilisk-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Basilisk: A Firefox Fork For The Classic Looks and Classic Extensions +====== + +_**Brief: Basilisk is a Firefox fork that supports legacy extensions and much more. Here, we take a look at its features and try it out.**_ + +### Basilisk: Open Source XUL-Based Web Browser + +Even though it is better to stick with the regular web browsers like Firefox or Chromium available for Linux – it doesn’t hurt to know about other browsers. Recently, I stumbled upon a Firefox fork, [Basilisk][1] web browser that features the classic Firefox user interface along with legacy add-ons support (just like [Waterfox][2]). + +![itsfoss.com homepage on Basilisk][3] + +If you are in the dire need of using a legacy extensions or miss the classic look and feel of Firefox, the Basilisk web browser can save your day. The web browser is being maintained by the team behind [Pale Moon][4] browser (which is another Firefox fork I will be looking at next). + +If you’re looking for open-source [Chrome alternatives][5], you may have a quick look at what Basilisk offers. + +**Note:** _Basilisk is a development software. Even though I didn’t have any major usability issues for the time I used, you should not rely on it as the only browser to use._ + +### Features of Basilisk web browser + +![][6] + +Basilisk works out of the box. However, here are some features you might want to take a look before considering to use it: + + * [XUL][7]-based web browser + * It features the ‘Australis’ Firefox interface, which was quite popular back in the time of v29 – v56 Firefox version. + * [NPAPI][8] plugins supported (Flash, Unity, Java, etc.) + * Support for XUL/Overlay Mozilla-style extensions. + * Uses [Goanna][9] open-source browser engine which is a fork of Mozilla’s [Gecko][10] + * Does not use Rust or the Photon user interface + * Supports 64-bit systems only + + + +### Installing Basilisk on Linux + +You may not find it listed in your Software Center. So, you will have to head to its official [download page][11] to get the tarball (tar.xz) file. + +Once you download it, simply extract it and head inside the folders. Next, you will find a “**Basilisk**” executable file in it. You need to simply run it by double-clicking on it or performing a right-click and selecting “**Run**“. + +You may check out its [GitHub page][12] for more information. + +![][13] + +You can also use the terminal and run the file by following the steps below while navigating to the directory you downloaded it to: + +``` +cd basilisk-latest.linux64 +cd basilisk +./basilisk +``` + +[Download Basilisk][1] + +### Using Basilisk browser + +![][14] + +Basilisk is a decent Firefox fork if you want the legacy extensions support. It is being actively developed by the team behind Pale Moon and is potentially a great option for users who want the classic look and feel of Mozilla’s Firefox (before the Quantum update) without comprising on the modern web support. + +I didn’t have any issues with browsing webpages. However, I did notice that “**YouTube**” detects this as an obsolete browser and warns that it will stop supporting it soon enough. + +_**So, I’m not sure if Basilisk will be a fit for every web service out there – but if you really need the archived legacy extensions that you used on Firefox’s older releases, this could be a solution for your problem.**_ + +**Wrapping Up** + +Do you think a Firefox fork is worth trying out? What do you prefer? Share your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/basilisk-browser/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.basilisk-browser.org/ +[2]: https://itsfoss.com/waterfox-browser/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-itsfoss.jpg?ssl=1 +[4]: https://www.palemoon.org +[5]: https://itsfoss.com/open-source-browsers-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-options-1.jpg?ssl=1 +[7]: https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XUL +[8]: https://wiki.mozilla.org/NPAPI +[9]: https://en.wikipedia.org/wiki/Goanna_(software) +[10]: https://developer.mozilla.org/en-US/docs/Mozilla/Gecko +[11]: https://www.basilisk-browser.org/download.shtml +[12]: https://github.com/MoonchildProductions/Basilisk +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-folder-1.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/basilisk-browser-1.jpg?ssl=1 From 0ecd1dc553d78bb6f33208b1728b4a33735a4054 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 10 Mar 2020 00:58:58 +0800 Subject: [PATCH 172/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200309=20Level?= =?UTF-8?q?=20up=20your=20use=20of=20Helm=20on=20Kubernetes=20with=20Chart?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200309 Level up your use of Helm on Kubernetes with Charts.md --- ...r use of Helm on Kubernetes with Charts.md | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 sources/tech/20200309 Level up your use of Helm on Kubernetes with Charts.md diff --git a/sources/tech/20200309 Level up your use of Helm on Kubernetes with Charts.md b/sources/tech/20200309 Level up your use of Helm on Kubernetes with Charts.md new file mode 100644 index 0000000000..9a08bdb973 --- /dev/null +++ b/sources/tech/20200309 Level up your use of Helm on Kubernetes with Charts.md @@ -0,0 +1,288 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Level up your use of Helm on Kubernetes with Charts) +[#]: via: (https://opensource.com/article/20/3/helm-kubernetes-charts) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +Level up your use of Helm on Kubernetes with Charts +====== +Configuring known apps using the Helm package manager. +![Ships at sea on the web][1] + +Applications are complex collections of code and configuration that have a lot of nuance to how they are installed. Like all open source software, they can be installed from source code, but most of the time users want to install something simply and consistently. That’s why package managers exist in nearly every operating system, which manages the installation process. + +Similarly, Kubernetes depends on package management to simplify the installation process. In this article, we’ll be using the Helm package manager and its concept of stable charts to create a small application. + +### What is Helm package manager? + +[Helm][2] is a package manager for applications to be deployed to and run on Kubernetes. It is maintained by the [Cloud Native Computing Foundation][3] (CNCF) with collaboration with the largest companies using Kubernetes. Helm can be used as a command-line utility, which [I cover how to use here][4]. + +#### Installing Helm + +Installing Helm is quick and easy for Linux and macOS. There are two ways to do this, you can go to the release [page][5], download your preferred version, untar the file, and move the Helm executable to your** /usr/local/bin** or your **/usr/bin** whichever you are using. + +Alternatively, you can use your operating system package manage (**dnf**, **snap**, **brew**, or otherwise) to install it. There are instructions on how to install on each OS on this [GitHub page][6]. + +### What are Helm Charts? + +We want to be able to repeatably install applications, but also to customize them to our environment. That’s where Helm Charts comes into play. Helm coordinates the deployment of applications using standardized templates called Charts. Charts are used to define, install, and upgrade your applications at any level of complexity. + +> A _Chart_ is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew formula, an Apt dpkg, or a Yum RPM file. +> +> [Using Helm][7] + +Charts are quick to create, and I find them straightforward to maintain. If you have one that is accessible from a public version control site, you can publish it to the [stable repository][8] to give it greater visibility. In order for a Chart to be added to stable, it must meet a number of [technical requirements][9]. In the end, if it is considered properly maintained by the Helm maintain, it can then be published to [Helm Hub][10]. + +Since we want to use the community-curated stable charts, we will make that easier by adding a shortcut:  + + +``` +$ helm repo add stable +"stable" has been added to your repositories +``` + +### Running our first Helm Chart + +Since I’ve already covered the basic Helm usage in [this article][11], I’ll focus on how to edit and use charts in this article. To follow along, you’ll need Helm installed and access to some Kubernetes environment, like minikube (which you can walk through [here][12] or [here][13]). + +Starting I will be picking one chart. Usually, in my article I use Jenkins as my example, and I would gladly do this if the chart wasn’t really complex. This time I’ll be using a basic chart and will be creating a small wiki, using [mediawiki and its chart][14].   + +So how do I get this chart? Helm makes that as easy as a pull. + +By default, charts are compressed in a .tgz file, but we can unpack that file to customize our wiki by using the **\--untar** flag. + + +``` +$ helm pull stable/mediawiki --untar +$ ls +mediawiki/ +$ cd mediawiki/ +$ ls +Chart.yaml         README.md          requirements.lock  templates/ +OWNERS             charts/            requirements.yaml  values.yaml +``` + +Now that we have this we can begin customizing the chart. + +### Editing your Helm Chart + +When the file was untared there was a massive amount of files that came out. While it does look frightening, there really is only one file we should be working with and that's the **values.yaml** file. + +Everything that was unpacked was a list of template files that has all the information for the basic application configurations. All the template files actually depend on what is configured in the values.yaml file. Most of these templates and chart files actually are for creating service accounts in the cluster and the various sets of required application configurations that would usually be put together if you were to build this application on a regular server. + +But on to the values.yaml file and what we should be changing in it. Open it in your favorite text editor or IDE. We see a [YAML][15] file with a ton of configuration. If we zoom in just on the container image file, we see its repository, registry, and tags amongst other details. + + +``` +## Bitnami DokuWiki image version +## ref: +## +image: +  registry: docker.io +  repository: bitnami/mediawiki +  tag: 1.34.0-debian-10-r31 +  ## Specify a imagePullPolicy +  ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' +  ## ref: +  ## +  pullPolicy: IfNotPresent +  ## Optionally specify an array of imagePullSecrets. +  ## Secrets must be manually created in the namespace. +  ## ref: +  ## +  # pullSecrets: +  #   - myRegistryKeySecretName +``` + +As you can see in the file each configuration for the values is well-defined. Our pull policy is set to **IfNotPresent**. This means if I run a **helm pull** command, it will not overwrite my existing version. If it’s set to always, the image will default to the latest version of the image on every pull. I’ll be using the default in this case, as in the past I have run into images being broken if it goes to the latest version without me expecting it (remember to version control your software, folks). + +### Customizing our Helm Chart + +So let’s configure this values file with some basic changes and make it our own. I’ll be changing some naming conventions, the wiki username, and the mediawiki site name. _Note: This is another snippet from values.yaml. All of this customization happens in that one file._ + + +``` +## User of the application +## ref: +## +mediawikiUser: cherrybomb + +## Application password +## Defaults to a random 10-character alphanumeric string if not set +## ref: +## +# mediawikiPassword: + +## Admin email +## ref: +## +mediawikiEmail: [root@example.com][16] + +## Name for the wiki +## ref: +## +mediawikiName: Jess's Home of Helm +``` + +After this, I’ll make some small modifications to our database name and user account. I changed the defaults to "jess" so you can see where changes were made. + + +``` +externalDatabase: + ## Database host +  host: + +  ## Database port +  port: 3306 + +  ## Database user +  user: jess_mediawiki + +  ## Database password +  password: + +  ## Database name +  database: jess_mediawiki + +## +## MariaDB chart configuration +## +## +## +mariadb: + ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters +  enabled: true +  ## Disable MariaDB replication +  replication: +    enabled: false + +  ## Create a database and a database user +  ## ref: +  ## +  db: +    name: jess_mediawiki +    user: jess_mediawiki +``` + +And finally, I’ll be adding some ports in our load balancer to allow traffic from the local host. I'm running on minikube and find the **LoadBalancer** option works well. + + +``` +service: + ## Kubernetes svc type +  ## For minikube, set this to NodePort, elsewhere use LoadBalancer +  ## +  type: LoadBalancer +  ## Use serviceLoadBalancerIP to request a specific static IP, +  ## otherwise leave blank +  ## +  # loadBalancerIP: +  # HTTP Port +  port: 80 +  # HTTPS Port +  ## Set this to any value (recommended: 443) to enable the https service port +  # httpsPort: 443 +  ## Use nodePorts to requets some specific ports when usin NodePort +  ## nodePorts: +  ##   http: <to set explicitly, choose port between 30000-32767> +  ##   https: <to set explicitly, choose port between 30000-32767> +  ## +  # nodePorts: +  #  http: "30000" +  #  https: "30001" +  ## Enable client source IP preservation +  ## ref +  ## +  externalTrafficPolicy: Cluster +``` + +Now that we have made the configurations to allow traffic and create the database, we know that we can go ahead and deploy our chart. + +### Deploy and enjoy! + +Now that we have our custom version of the wiki, it's time to create a deployment. Before we get into that, let’s first confirm that nothing else is installed with Helm, to make sure my cluster has available resources to run our wiki. + + +``` +$ helm ls +NAME    NAMESPACE       REVISION        UPDATED STATUS  CHART   APP VERSION +``` + +There are no other deployments through Helm right now, so let's proceed with ours.  + + +``` +$ helm install jesswiki -f values.yaml stable/mediawiki +NAME: jesswiki +LAST DEPLOYED: Thu Mar  5 12:35:31 2020 +NAMESPACE: default +STATUS: deployed +REVISION: 2 +NOTES: +1\. Get the MediaWiki URL by running: + +  NOTE: It may take a few minutes for the LoadBalancer IP to be available. +        Watch the status with: 'kubectl get svc --namespace default -w jesswiki-mediawiki' + +  export SERVICE_IP=$(kubectl get svc --namespace default jesswiki-mediawiki --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}") +  echo "Mediawiki URL: http://$SERVICE_IP/" + +2\. Get your MediaWiki login credentials by running: + +    echo Username: user +    echo Password: $(kubectl get secret --namespace default jesswiki-mediawiki -o jsonpath="{.data.mediawiki-password}" | base64 --decode) +$ +``` + +Perfect! Now we will navigate to the wiki, which is accessible at the cluster IP address. To confirm that address: + + +``` +kubectl get svc --namespace default -w jesswiki-mediawiki +NAME                 TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE +jesswiki-mediawiki   LoadBalancer   10.103.180.70   <pending>     80:30220/TCP   17s +``` + +Now that we have the IP, we go ahead and check to see if it’s up:  + +![A working wiki installed through helm charts][17] + +Now we have our new wiki up and running, and we can enjoy our new application with our personal edits. Use the command from the output above to get the password and start to fill in your wiki. + +### Conclusion + +Helm is a powerful package manager that makes installing and uninstalling applications on top of Kubernetes as simple as a single command. Charts add to the experience by giving us curated and tested templates to install applications with our unique customizations. Keep exploring what Helm and Charts have to offer and let me know what you do with them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/helm-kubernetes-charts + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web) +[2]: https://www.google.com/url?q=https://helm.sh/&sa=D&ust=1583425787800000 +[3]: https://www.google.com/url?q=https://www.cncf.io/&sa=D&ust=1583425787800000 +[4]: https://www.google.com/url?q=https://opensource.com/article/20/2/kubectl-helm-commands&sa=D&ust=1583425787801000 +[5]: https://www.google.com/url?q=https://github.com/helm/helm/releases/tag/v3.1.1&sa=D&ust=1583425787801000 +[6]: https://www.google.com/url?q=https://github.com/helm/helm&sa=D&ust=1583425787802000 +[7]: https://helm.sh/docs/intro/using_helm/ +[8]: https://www.google.com/url?q=https://github.com/helm/charts&sa=D&ust=1583425787803000 +[9]: https://github.com/helm/charts/blob/master/CONTRIBUTING.md#technical-requirements +[10]: https://www.google.com/url?q=https://hub.helm.sh/&sa=D&ust=1583425787803000 +[11]: https://www.google.com/url?q=https://opensource.com/article/20/2/kubectl-helm-commands&sa=D&ust=1583425787803000 +[12]: https://www.google.com/url?q=https://opensource.com/article/18/10/getting-started-minikube&sa=D&ust=1583425787804000 +[13]: https://www.google.com/url?q=https://opensource.com/article/19/7/security-scanning-your-devops-pipeline&sa=D&ust=1583425787804000 +[14]: https://www.google.com/url?q=https://github.com/helm/charts/tree/master/stable/mediawiki&sa=D&ust=1583425787805000 +[15]: https://en.wikipedia.org/wiki/YAML +[16]: mailto:root@example.com +[17]: https://opensource.com/sites/default/files/uploads/lookitworked.png (A working wiki installed through helm charts) From f1bf5265aa30e995d5cbd1b73350bd6465bd9efd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 10 Mar 2020 01:02:05 +0800 Subject: [PATCH 173/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200309=206=20Ra?= =?UTF-8?q?spberry=20Pi=20tutorials=20to=20try=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200309 6 Raspberry Pi tutorials to try out.md --- ...309 6 Raspberry Pi tutorials to try out.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20200309 6 Raspberry Pi tutorials to try out.md diff --git a/sources/tech/20200309 6 Raspberry Pi tutorials to try out.md b/sources/tech/20200309 6 Raspberry Pi tutorials to try out.md new file mode 100644 index 0000000000..5edd665983 --- /dev/null +++ b/sources/tech/20200309 6 Raspberry Pi tutorials to try out.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 Raspberry Pi tutorials to try out) +[#]: via: (https://opensource.com/article/20/3/raspberry-pi-tutorials) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +6 Raspberry Pi tutorials to try out +====== +Each of these Raspberry Pi projects is designed to make your life easier +and more productive. +![Cartoon graphic of Raspberry Pi board][1] + +There's nothing like the thrill of experiencing the result of your Raspberry Pi creation. After hours of coding, testing, and building with your bare hands, your project starts to finally take shape and you can’t help but yell "woohoo!." I’m fascinated by the possibilities of what the Raspberry Pi can bring to daily life. Whether you are looking to learn something new, try a productivity hack, or just have fun, there is a Raspberry Pi project for you in this round-up.  + +### Set up a VPN server + +This [tutorial][2] teaches you how to use the Raspberry Pi to add a layer of network security. Not only does this project have practical advantages, but it also sets you up for lots of fun to be had. The extra security will give you peace of mind to play around with other projects, like the ones listed below. + +### Create an object-tracking camera + +The Raspberry Pi is appealing because it offers a low barrier of entry to learn about new technologies like machine learning. This [step-by-step guide][3] gives thorough instructions on how to build a camera that pans and tilts in order to track movement with TensorFlow and your Raspberry Pi.  + +### Display your favorite memories using a photo slideshow + +Have you ever asked yourself: "What should I do with all of these digital photos?." If you are like me, then the answer is **yes**. I am definitely known as the picture-taker in my circle of friends and family. That’s why I love this Raspberry Pi project. In [this tutorial][4], you’ll learn how to set up a photo slideshow so you can display your favorite memories in your home with ease. No printer necessary! + +### Play retro video games + +If you feel nostalgic about retro gaming systems, you’ll want to try [this tutorial][5]. Learn what kind of devices work for running an Amiga emulator including the Raspberry Pi. After going through the set-up instructions, you’ll be playing your favorite Amiga games on your Raspberry Pi. + +### Build a clock for your entertainment center + +Home entertainment centers have evolved so much in the last decade. My family relies solely on streaming services for watching shows and movies. I love this because I can control my TV from my mobile device or voice assistant. However, there’s a level of convenience that’s missing when you no longer can glance at a clock! Follow [these quick steps][6] to build your own clock display from scratching using your Raspberry Pi. + +### Scale your homebrewed beer operation + +In [this tutorial][7], a seasoned homebrewer shares his experience with setting up an electric beer-brewing system. This project requires more of an investment in hardware and parts upfront, but the resulting efficiency and consistency make it all worth it. Cheers to that! + +If you are a Raspberry Pi newb like me, then I recommend checking out our downloadable Raspberry Pi guides. Our [one-page cheat sheet][8] offers step-by-step instructions for how to get started. For more tips and tutorials, our [comprehensive guide][9] covers topics like choosing a Raspberry Pi, keeping it updated, contributing to the community and everything in between.  + +Which Raspberry Pi project will you try? Let us know in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/raspberry-pi-tutorials + +作者:[Lauren Pritchett][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi_cartoon.png?itok=m3TcBONJ (Cartoon graphic of Raspberry Pi board) +[2]: https://opensource.com/article/19/6/raspberry-pi-vpn-server +[3]: https://opensource.com/article/20/1/object-tracking-camera-raspberry-pi +[4]: https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi +[5]: https://opensource.com/article/19/3/amiga-raspberry-pi +[6]: https://opensource.com/article/17/7/raspberry-pi-clock +[7]: https://opensource.com/article/17/7/brewing-beer-python-and-raspberry-pi +[8]: https://opensource.com/downloads/getting-started-raspberry-pi-cheat-sheet +[9]: https://opensource.com/downloads/raspberry-pi-guide From bbf9cd08ed6c4e15c62c5ce36951db87616d0b58 Mon Sep 17 00:00:00 2001 From: wenwensnow <963555237@qq.com> Date: Mon, 9 Mar 2020 23:11:31 +0100 Subject: [PATCH 174/207] Update 20200225 3 eBook readers for the Linux desktop.md --- ...5 3 eBook readers for the Linux desktop.md | 68 ++++++++++++------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/sources/tech/20200225 3 eBook readers for the Linux desktop.md index 700f56aeed..fc133b55f3 100644 --- a/sources/tech/20200225 3 eBook readers for the Linux desktop.md +++ b/sources/tech/20200225 3 eBook readers for the Linux desktop.md @@ -10,80 +10,98 @@ 3 eBook readers for the Linux desktop 针对Linux桌面版的3个电子书阅读器 ====== Any of these open source eBook applications will make it easy to read -your books on a larger screen. 任意一个开源电子书应用都能使你在更大屏幕上的阅读体验得到提升。 -![Computer browser with books on the screen][1] +your books on a larger screen. 任意一个开源电子书应用都能使你在大屏设备上的阅读体验得到提升。 +![电脑浏览器阅读书籍界面][1] I usually read eBooks on my phone or with my Kobo eReader. I've never been comfortable reading books on larger screens. However, many people regularly read books on their laptops or desktops. If you are one of them (or think you might be), I'd like to introduce you to three eBook readers for the Linux desktop. +我通常使用手机或Kobo电子阅读器阅读电子书,在大屏设备上阅读书籍总是令人不快。但很多人经常在自己的笔记本或桌面上阅读电子书,如果你有这种需求(或你认为以后会遇到这种情况),我想向你介绍三种针对Linux桌面版的电子书阅读器。 -### Bookworm +### Bookworm -[Bookworm][2] is billed as a "simple, focused eBook reader." And it is. Bookworm has a basic set of features, which some people will complain about being _too basic_ or lacking _functionality_ (whatever that word means). Bookworm does one thing and does it well without unnecessary frills. +[Bookworm][2]目标是成为一个"简洁,专注于电子书的阅读器."事实证明它也确实做到了. Bookworm has a basic set of features, which some people will complain about being _too basic_ or lacking _functionality_ (whatever that word means). Bookworm does one thing and does it well without unnecessary frills. -The application's interface is very clean and uncluttered. +Bookworm 内置一套基础功能,有人抱怨它太过 _简单_ ,缺少 _功能_ (虽然功能这词显然有点指意不明)。Bookworm在没有任何无用部分的情况下起到了应有作用。 -![Bookworm e-book application][3] -You navigate through a book by pressing: +The application's interface is very clean and uncluttered. 应用界面整洁干净。 - * The space bar to move down a page - * The Down and Up arrow keys to move down and up a single line - * The Right and Left arrow keys to jump to the next or previous chapter +![Bookworm 电子书应用][3] + +You navigate through a book by pressing: 你可通过以下方式查看书籍: + + * The space bar to move down a page 空格键前往下一页 + * The Down and Up arrow keys to move down and up a single line 上下方向键跳转所在行 + * The Right and Left arrow keys to jump to the next or previous chapter 左右方向键跳转至前或后一章 -You can also annotate portions of a book and insert bookmarks to jump back to a page. +You can also annotate portions of a book and insert bookmarks to jump back to a page. 你也可以通过添加注释或书签跳转至特定页面 -![Annotations in Bookworm][4] +![Bookworm注释][4] Bookworm doesn't have many configuration options. You can change the size and spacing of a book's font, enable a two-page reading view or dark mode, and add folders that Bookworm will scan to find new eBooks. -![Bookworm preferences][5] +Bookworm 没有太多设置选项。你能调整书籍字体大小及间距,开启双页或夜间模式。在应用中添加文件夹,Bookworm会自动扫描文件夹中的电子书。 + +![Bookworm 参数设置][5] Bookworm supports the most widely used eBook formats: EPUB, PDF, MOBI, and [FB2][6]. You can also use Bookworm to read popular digital comic book formats [CBR][7] and CBZ. I've tested Bookworm with only the first three formats. PDF files are readable, but they load slowly and the formatting can be rather ugly. +Bookworm 支持常用的电子书格式:EPUB, PDF, MOBI ,[FB2][6],你还能用它阅读[CBR][7] 和CBZ格式的数字版漫画。我只在Bookworm上测试了前三种格式,PDF倒是能打开,但加载速度很慢,格式也很难看。 ### Foliate -As far as features go, [Foliate][8] is a step or two above Bookworm. Not only does it have several more features, but it also has more configuration options. You get all of that in a zippy, clean, and uncluttered package. +As far as features go, [Foliate][8] is a step or two above Bookworm. Not only does it have several more features, but it also has more configuration options. You get all of that in a zippy, clean, and uncluttered package. +单从功能上来说,[Foliate][8] 确实比Bookworm强上一些。Foliate不仅功能更强,它还有更多设置选项。这个功能多样,简单干净的应用满足以上所有要求。 -![Foliate e-book application][9] +![Foliate 电子书应用][9] You can navigate through an eBook in Foliate using the space bar, arrow keys, or PgUp and PgDn keys. There's nothing unique there. +在Foliate中可以通过空格,方向键,向上或向下翻页键浏览电子书,这里没什么特别的。 You can also annotate text, look up and translate words and phrases, and look up the meanings of words. If you have a text-to-speech application installed on your computer, Foliate can use it to read books aloud. +你还可以在书籍中添加注释,查找以及翻译字句,查询字词含义。如果你电脑上安装了智能语音应用,Foliate还能将文本朗读出来。 -![Annotating a book in Foliate][10] +![在Foliate中的注释文本][10] Foliate has a few more customization options than Bookworm. You can change a book's font and its size, the spacing of lines, and the size of a book's margins. You can also increase or decrease the brightness and select one of four built-in themes. +Foliate与Bookworm相比有更多自定义选项。你能在应用中修改字体类型及大小,行间距,电子书页边距,也可以调高或降低屏幕亮度,选择四个应用内置主题。 -![Foliate settings][11] +![Foliate 设置][11] -You can read books in the EPUB, MOBI, AZW, and AZW3 formats using Foliate. In case you're wondering, the latter three are closed formats used with books published for Amazon's Kindle eReader +You can read books in the EPUB, MOBI, AZW, and AZW3 formats using Foliate. In case you're wondering, the latter three are closed formats used with books published for Amazon's Kindle eReader +你可以在Foliate上阅读 EPUB, MOBI, AZW, AZW3 格式的电子书。为防止你万一好奇我可以提前告诉你,后三种格式是在亚马逊Kindle阅读器上发布书籍所特有的格式。 -### Calibre's eBook viewer +### Calibre's eBook viewer Calibre电子书阅读器 -[eBook viewer][12] is a component of the [Calibre][13] eBook management tool. Like its parent, the eBook viewer feature isn't the prettiest piece of software out there. +[电子书阅读器][12] is a component of the [Calibre][13] eBook management tool. Like its parent, the eBook viewer feature isn't the prettiest piece of software out there. +是[Calibre][13] 电子书管理工具的一个组件。就像之前提到的一样,电子书阅读器这部分并不是软件整体最出彩的部分。 -![E-book Viewer application][14] +![电子书阅读器应用][14] -Don't let that put you off, though. It's a solid desktop eBook reader. +Don't let that put you off, though. It's a solid desktop eBook reader. 不过别被上面的话吓到,它也确实是个桌面电子书阅读器。 You navigate through an eBook in Calibre's e-book viewer using the arrow and PgUp/PgDn keys or by pressing the space bar. You can also look up words in an online dictionary and add bookmarks throughout a book. E-book viewer lacks an annotation function, but its built-in search engine is solid, and you can save books as PDFs (though I'm not sure why you'd want to). +在Calibre电子书阅读器中,你可以通过方向键,向上/向下翻页键以及空格浏览书籍,还能在在线字典中查找词语含义,添加书签。 这一阅读器没有添加注释功能,但内置的搜索引擎却很好用,你还能将书籍保存为PDF格式(虽然我不太明白你为什么要这么做) Configuration options are an area where this eBook viewer shines. It has far more of them than both Bookworm and Foliate combined. You can change everything from fonts to the layout of text to how text is broken up into pages. On top of that, you can customize the keyboard shortcuts for using the application and add your favorite dictionary website or sites to help you look up words in a book you're reading. +不过参数设置这里确是它出彩的地方,它比Bookworm和Foliate加起来都多。从字体到文本布局,页面如何分割你都能改。除此之外,你还能自定义应用按键设置,将你喜欢的词典网站添加进来,方便阅读查找。 -![E-book Viewer preferences][15] +![电子书参数设置][15] One useful feature of Calibre's eBook viewer is the ability to apply your own CSS file to your e-books. CSS, in case you're wondering, is a way to format web pages (which is what many e-books are made of). If you're a master with CSS, you can copy and paste your CSS file into the **User stylesheet** tab in eBook viewer's Preferences window. That's the ultimate in customization. +Calibre电子书阅读器一个很有用的功能,就是把自行设置的CSS配置文件效果应用到电子书上。为防止你万一好奇我可以提前告诉你,CSS是一种调整网页格式的方法(这类文件就是许多电子书的一个组成部分)。如果你能熟练使用CSS,你可以将自己的CSS文件复制粘贴到电子书阅读器配置窗口的**User stylesheet** 部分。这就是个性化的究极方法。 eBook viewer, according to its developer, "can display all the major e-book formats." If you're wondering what those formats are, [here's a list][16]. I've tested it with just a few of those formats and have had no problems with them. +据开发者描述,这一电子书阅读器“能支持所有主流电子书格式。”如果你想知道具体支持格式是什么,[这是列表][16]。我测试了列表中的一小部分格式,没有发现问题。 -### Final thought +### Final thought 最后总结 Whether you're looking for a simple eBook reader or one with bells and whistles and whatever else, the three applications in this article are good choices. Any of them can make reading an eBook on a larger screen easier. +不管你只是单纯想找个电子书阅读器,还是有个更多复杂功能的阅读器,上文提到的三个应用都很不错,并且它们都能多少提升你在大屏设备上的阅读体验。 * * * -_This article is based on an article published on [Open Source Musings][17] and appears here via a [CC BY-SA 4.0][18] license._ +_这篇文章基于一篇发布在[Open Source Musings][17]上的文章,并适用于[CC BY-SA 4.0][18]许可证_ -------------------------------------------------------------------------------- From f812373394f38142b072e3f5bdf88a2875c290d9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 10 Mar 2020 08:29:09 +0800 Subject: [PATCH 175/207] translated --- ...and lowercase on the Linux command line.md | 161 ------------------ ...and lowercase on the Linux command line.md | 161 ++++++++++++++++++ 2 files changed, 161 insertions(+), 161 deletions(-) delete mode 100644 sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md create mode 100644 translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md diff --git a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md deleted file mode 100644 index b830a88c9d..0000000000 --- a/sources/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md +++ /dev/null @@ -1,161 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Converting between uppercase and lowercase on the Linux command line) -[#]: via: (https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Converting between uppercase and lowercase on the Linux command line -====== -Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. -[andy.brandon50][1] [(CC BY-SA 2.0)][2] - -There are many ways to change text on the Linux command line from lowercase to uppercase and vice versa. In fact, you have an impressive set of commands to choose from. This post examines some of the best commands for the job and how you can get them to do just what you want. - -### Using tr - -The **tr** (translate) command is one of the easiest to use on the command line or within a script. If you have a string that you want to be sure is in uppercase, you just pass it through a **tr** command like this: - -``` -$ echo Hello There | tr [:lower:] [:upper:] -HELLO THERE -``` - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] - -Below is an example of using this kind of command in a script when you want to be sure that all of the text that is added to a file is in uppercase for consistency: - -``` -#!/bin/bash - -echo -n "Enter department name: " -read dept -echo $dept | tr [:lower:] [:upper:] >> depts -``` - -Switching the order to [:upper:] [:lower:] would have the opposite effect, putting all the department names in lowercase: - -``` -echo $dept | tr [:upper:] [:lower:] >> depts -``` - -Similarly, you could use the **sed** command's **A-Z** and **a-z** strings to accomplish the same thing: - -``` -echo $dept | tr a-z A-Z >> depts -``` - -As you undoubtedly suspect, reversing the order of the a-z and A-Z strings will have the opposite effect, turning the text to all lowercase. - -### Using awk - -The **awk** command lets you do the same thing with its **toupper** and **tolower** options. The command in the script shown in the previous example could be done this way instead: - -[][4] - -``` -echo $dept | awk '{print toupper($0)}' >> depts -``` - -The reverse (switching to lowercase) would look like this: - -``` -echo $dept | awk '{print tolower($0)}' >> depts -``` - -### Using sed - -The **sed** (stream editor) command also does a great job of switching between upper- and lowercase. This command would have the same effect as the first of the two shown above. - -``` -echo $dept | sed 's/[a-z]/\U&/g' >> depts -``` - -Switching from uppercase to lowercase would simply involve replacing the **U** near the end of the line with an **L**. - -``` -echo $dept | sed 's/[A-Z]/\L&/g' >> depts -``` - -### Manipulating text in a file - -Both **awk** and **sed** also allow you to change the case of text for entire files. So, you just found out your boss wanted those department names in all lowercase? No problem. Just run a command like this with the file name provided: - -``` -$ awk '{print tolower($0)}' depts -finance -billing -bookkeeping -``` - -If you want to overwrite the **depts** file, instead of just displaying its contents in lowercase, you would need to do something like this: - -``` -$ awk '{print tolower($0)}' depts > depts- -$ mv depts- depts -``` - -Making the change with **sed**, however, you can avoid that last step because **sed** can edit a file "in place" as shown here, leaving the file intact, but the text in all lowercase: - -``` -$ sed 's/[A-Z]/\L&/g' depts -``` - -### Capitalizing first letters only - -To capitalize only the first letters of words in a string, you can do something like this: - -``` -$ echo design \& engineering| sed -e "s/\b\(.\)/\u\1/g" -Design & Engineering -``` - -That command will ensure that first letters are capitalized, but won't change the rest of the letters. - -### Making sure only first letters are uppercase - -It's a little more challenging when you want to change text so that only first letters are in uppercase. Say you're manipulating a list of staff members' names and you want them to be formatted in the normal Firstname Lastname manner. - -##### with sed - -You could use a considerably more complex **sed** command to ensure this result: - -``` -$ echo design \& ENGINEERING | sed 's/\b\([[:alpha:]]\)\([[:alpha:]]*\)\b/\u\1\L\2/g' -Design & Engineering -``` - -##### with python - -If you have python loaded, you can run a command like this that also formats text so that only the first letters of each word are capitalized and the command may be a little easier to parse than the **sed** command shown above: - -``` -$ echo -n "design & engineering" | python3 -c "import sys; print(sys.stdin.read().title())" -Design & Engineering -``` - -There are many ways to change the formatting of text between upper- and lowercase. Which works best depends in part of whether you're manipulating a single string or an entire file and how you want the end result to look. - -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/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.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.flickr.com/photos/54027476@N07/4999959929 -[2]: https://creativecommons.org/licenses/by-sa/2.0/legalcode -[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 diff --git a/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md new file mode 100644 index 0000000000..57f5e7525e --- /dev/null +++ b/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Converting between uppercase and lowercase on the Linux command line) +[#]: via: (https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +在 Linux 命令行中转换大小写 +====== +转换文本的大小写可能非常繁琐,尤其是当你要避免无意间的拼写错误时。幸运的是,Linux 提供了一些命令,可以使工作变得非常容易。 +[andy.brandon50][1] [(CC BY-SA 2.0)][2] + +有很多方法可以在 Linux 命令行中将文本从小写更改为大写,反之亦然。实际上,你有一组这样的命令可以选择。这篇文章检验了一些最佳的命令来完成这项工作,以及你该如何让它们正常工作。 + +### 使用 tr + +**tr** (translate) 命令是在命令行或脚本中最容易使用的命令之一。如果你要确定要一串大写字符串,你只需将它传给 **tr**,如下所示: + +``` +$ echo Hello There | tr [:lower:] [:upper:] +HELLO THERE +``` + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] + +下面是一个在脚本中使用这个命令的例子,当你要确保添加到文件中的所有文本都使用大写形式以保持一致性时: + +``` +#!/bin/bash + +echo -n "Enter department name: " +read dept +echo $dept | tr [:lower:] [:upper:] >> depts +``` + +将顺序切换为[:upper:] [:lower:] 会产生相反的效果,将所有部门名称都转换为小写: + +``` +echo $dept | tr [:upper:] [:lower:] >> depts +``` + +同样,你可以使用 **sed** 命令的 **A-Z** 和 **a-z** 字符串完成相同的操作: + +``` +echo $dept | tr a-z A-Z >> depts +``` + +毫无疑问,反转 a-z 和 A-Z 字符串的顺序将产生相反的效果,将文本全部变为小写。 + +### 使用 awk + +**awk** 命令可让你使用它的 **toupper** 和 **tolower** 选项执行相同的操作。上例脚本中的命令可以用这种方式代替: + +[][4] + +``` +echo $dept | awk '{print toupper($0)}' >> depts +``` + +相反操作(切换为小写)如下所示: + +``` +echo $dept | awk '{print tolower($0)}' >> depts +``` + +### 使用 sed + +**sed** (流编辑器)命令也可用于切换大小写。它与上面显示的两个命令中的第一个具有相同的效果。 + +``` +echo $dept | sed 's/[a-z]/\U&/g' >> depts +``` + +从大写字母切换到小写字母只需将行尾附近的 **U** 替换为 **L**。 + +``` +echo $dept | sed 's/[A-Z]/\L&/g' >> depts +``` + +### 操作文件中的文本 + +**awk** 和 **sed**都能更改整个文件的文本大小写。因此,你发现你的老板需要部门所有名字的小写么?没问题。只需带上文件名运行以下命令: + +``` +$ awk '{print tolower($0)}' depts +finance +billing +bookkeeping +``` + +如果要覆盖 **depts** 文件,而不仅仅是以小写形式显示,则需要执行以下操作: + +``` +$ awk '{print tolower($0)}' depts > depts- +$ mv depts- depts +``` + +但是,使用 **sed** 进行更改,你可以避免最后一步,因为 **sed** 可以“原地”编辑文件,如下所示,文件完整,但文本全部小写: + +``` +$ sed 's/[A-Z]/\L&/g' depts +``` + +### 仅首字母大写 + +要仅将字符串中单词的首字母大写,那么可以执行以下操作: + +``` +$ echo design \& engineering| sed -e "s/\b\(.\)/\u\1/g" +Design & Engineering +``` + +该命令将确保首字母大写,但不会更改其余字母。 + +### 确保只有首字母大写 + +当要更改文本以使只有首字母大写时,这更具挑战性。假设你正在处理一个工作人员姓名列表,并且希望以正常的“名 姓”方式对其格式化。 + +##### 使用 sed + +你可以使用更复杂的 **sed** 命令来确保以下结果: + +``` +$ echo design \& ENGINEERING | sed 's/\b\([[:alpha:]]\)\([[:alpha:]]*\)\b/\u\1\L\2/g' +Design & Engineering +``` + +##### 使用 python + +如果你已安装 python,你可以运行这样的命令,它还可以设置文本格式,以便每个单词只有首字母大写,并且它可能比上面显示的 **sed** 命令更易于解析: + +``` +$ echo -n "design & engineering" | python3 -c "import sys; print(sys.stdin.read().title())" +Design & Engineering +``` + +有多种方法可以在大小写之间更改文本格式。哪种方法效果最好取决于你要处理的是单个字符串还是整个文件,以及想要的最终结果。 + +加入 [Facebook][5] 和 [LinkedIn][6] 上的 Network World 社区,评论热门主题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html + +作者:[Sandra Henry-Stocker][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.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.flickr.com/photos/54027476@N07/4999959929 +[2]: https://creativecommons.org/licenses/by-sa/2.0/legalcode +[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 \ No newline at end of file From 68e45c9f35bd20ed4a7e2a406557ed547bccfafe Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 10 Mar 2020 08:36:42 +0800 Subject: [PATCH 176/207] translating --- sources/tech/20200113 How to setup a DNS server with bind.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200113 How to setup a DNS server with bind.md b/sources/tech/20200113 How to setup a DNS server with bind.md index 897dc825a8..22ca80e554 100644 --- a/sources/tech/20200113 How to setup a DNS server with bind.md +++ b/sources/tech/20200113 How to setup a DNS server with bind.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8e5ec85263eefd61e6a9e53920cf4cf1fe616744 Mon Sep 17 00:00:00 2001 From: wenwensnow <963555237@qq.com> Date: Tue, 10 Mar 2020 01:59:38 +0100 Subject: [PATCH 177/207] Update 20200225 3 eBook readers for the Linux desktop.md --- ...5 3 eBook readers for the Linux desktop.md | 66 +++++++------------ 1 file changed, 23 insertions(+), 43 deletions(-) diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/sources/tech/20200225 3 eBook readers for the Linux desktop.md index fc133b55f3..d92173eb57 100644 --- a/sources/tech/20200225 3 eBook readers for the Linux desktop.md +++ b/sources/tech/20200225 3 eBook readers for the Linux desktop.md @@ -7,97 +7,77 @@ [#]: via: (https://opensource.com/article/20/2/linux-ebook-readers) [#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) -3 eBook readers for the Linux desktop 针对Linux桌面版的3个电子书阅读器 +Linux桌面版本下的3个电子书阅读器应用 ====== -Any of these open source eBook applications will make it easy to read -your books on a larger screen. 任意一个开源电子书应用都能使你在大屏设备上的阅读体验得到提升。 + +任意一个开源电子书应用都能使你在大屏设备上的阅读体验得到提升。 ![电脑浏览器阅读书籍界面][1] -I usually read eBooks on my phone or with my Kobo eReader. I've never been comfortable reading books on larger screens. However, many people regularly read books on their laptops or desktops. If you are one of them (or think you might be), I'd like to introduce you to three eBook readers for the Linux desktop. -我通常使用手机或Kobo电子阅读器阅读电子书,在大屏设备上阅读书籍总是令人不快。但很多人经常在自己的笔记本或桌面上阅读电子书,如果你有这种需求(或你认为以后会遇到这种情况),我想向你介绍三种针对Linux桌面版的电子书阅读器。 +我通常使用手机或Kobo阅读器阅读电子书,在大屏设备上阅读书籍总是令人不快。但很多人经常在自己的笔记本或桌面上阅读电子书,如果你有这种需求(或者你认为以后会遇到这种情况),我想向你介绍三种Linux桌面版下的电子书阅读器。 ### Bookworm -[Bookworm][2]目标是成为一个"简洁,专注于电子书的阅读器."事实证明它也确实做到了. Bookworm has a basic set of features, which some people will complain about being _too basic_ or lacking _functionality_ (whatever that word means). Bookworm does one thing and does it well without unnecessary frills. +[Bookworm][2]意在成为一个"简洁,专注于电子书的阅读器."事实证明它也确实做到了。Bookworm 内置一系列基础功能,有人抱怨它太过 _简单_ ,缺少 _功能_ (虽然功能这词显然有点指意不明)。Bookworm在没有任何无用部分的情况下起到了应有作用。 -Bookworm 内置一套基础功能,有人抱怨它太过 _简单_ ,缺少 _功能_ (虽然功能这词显然有点指意不明)。Bookworm在没有任何无用部分的情况下起到了应有作用。 - - -The application's interface is very clean and uncluttered. 应用界面整洁干净。 +应用界面整洁干净。 ![Bookworm 电子书应用][3] -You navigate through a book by pressing: 你可通过以下方式查看书籍: +你可通过以下方式查看书籍: - * The space bar to move down a page 空格键前往下一页 - * The Down and Up arrow keys to move down and up a single line 上下方向键跳转所在行 - * The Right and Left arrow keys to jump to the next or previous chapter 左右方向键跳转至前或后一章 + * 空格键前往下一页 + * 上下方向键跳转所在行 + * 左右方向键跳转至前或后一章 - - -You can also annotate portions of a book and insert bookmarks to jump back to a page. 你也可以通过添加注释或书签跳转至特定页面 +你也可以通过添加注释或书签跳转至特定页面 ![Bookworm注释][4] -Bookworm doesn't have many configuration options. You can change the size and spacing of a book's font, enable a two-page reading view or dark mode, and add folders that Bookworm will scan to find new eBooks. - -Bookworm 没有太多设置选项。你能调整书籍字体大小及间距,开启双页或夜间模式。在应用中添加文件夹,Bookworm会自动扫描文件夹中的电子书。 +Bookworm 没有太多设置选项。你能调整书籍字体大小及间距,开启双页或夜间模式。在应用中添加新文件夹后,Bookworm会自动扫描文件夹中的电子书。 ![Bookworm 参数设置][5] -Bookworm supports the most widely used eBook formats: EPUB, PDF, MOBI, and [FB2][6]. You can also use Bookworm to read popular digital comic book formats [CBR][7] and CBZ. I've tested Bookworm with only the first three formats. PDF files are readable, but they load slowly and the formatting can be rather ugly. Bookworm 支持常用的电子书格式:EPUB, PDF, MOBI ,[FB2][6],你还能用它阅读[CBR][7] 和CBZ格式的数字版漫画。我只在Bookworm上测试了前三种格式,PDF倒是能打开,但加载速度很慢,格式也很难看。 ### Foliate -As far as features go, [Foliate][8] is a step or two above Bookworm. Not only does it have several more features, but it also has more configuration options. You get all of that in a zippy, clean, and uncluttered package. -单从功能上来说,[Foliate][8] 确实比Bookworm强上一些。Foliate不仅功能更强,它还有更多设置选项。这个功能多样,简单干净的应用满足以上所有要求。 +单从功能上来说,[Foliate][8] 确实比Bookworm强上一些。Foliate不仅功能更强,它还有更多设置选项。这个功能多样,简单干净的应用满足了所有要求。 ![Foliate 电子书应用][9] -You can navigate through an eBook in Foliate using the space bar, arrow keys, or PgUp and PgDn keys. There's nothing unique there. 在Foliate中可以通过空格,方向键,向上或向下翻页键浏览电子书,这里没什么特别的。 -You can also annotate text, look up and translate words and phrases, and look up the meanings of words. If you have a text-to-speech application installed on your computer, Foliate can use it to read books aloud. 你还可以在书籍中添加注释,查找以及翻译字句,查询字词含义。如果你电脑上安装了智能语音应用,Foliate还能将文本朗读出来。 ![在Foliate中的注释文本][10] -Foliate has a few more customization options than Bookworm. You can change a book's font and its size, the spacing of lines, and the size of a book's margins. You can also increase or decrease the brightness and select one of four built-in themes. Foliate与Bookworm相比有更多自定义选项。你能在应用中修改字体类型及大小,行间距,电子书页边距,也可以调高或降低屏幕亮度,选择四个应用内置主题。 ![Foliate 设置][11] -You can read books in the EPUB, MOBI, AZW, and AZW3 formats using Foliate. In case you're wondering, the latter three are closed formats used with books published for Amazon's Kindle eReader -你可以在Foliate上阅读 EPUB, MOBI, AZW, AZW3 格式的电子书。为防止你万一好奇我可以提前告诉你,后三种格式是在亚马逊Kindle阅读器上发布书籍所特有的格式。 +你可以在Foliate上阅读 EPUB, MOBI, AZW, AZW3 格式的电子书。以防万一我可以提前告诉你,后三种格式是亚马逊Kindle阅读器上架书籍所特有的格式。 -### Calibre's eBook viewer Calibre电子书阅读器 +### Calibre电子书阅读器 -[电子书阅读器][12] is a component of the [Calibre][13] eBook management tool. Like its parent, the eBook viewer feature isn't the prettiest piece of software out there. -是[Calibre][13] 电子书管理工具的一个组件。就像之前提到的一样,电子书阅读器这部分并不是软件整体最出彩的部分。 +[电子书阅读器][12]是[Calibre][13] 电子书管理工具的一个组件,就像之前提到的一样,电子书阅读器这部分并不是软件整体最棒的部分。 ![电子书阅读器应用][14] -Don't let that put you off, though. It's a solid desktop eBook reader. 不过别被上面的话吓到,它也确实是个桌面电子书阅读器。 +不过别被上面的话吓到,它也的确是个桌面电子书阅读器。 -You navigate through an eBook in Calibre's e-book viewer using the arrow and PgUp/PgDn keys or by pressing the space bar. You can also look up words in an online dictionary and add bookmarks throughout a book. E-book viewer lacks an annotation function, but its built-in search engine is solid, and you can save books as PDFs (though I'm not sure why you'd want to). -在Calibre电子书阅读器中,你可以通过方向键,向上/向下翻页键以及空格浏览书籍,还能在在线字典中查找词语含义,添加书签。 这一阅读器没有添加注释功能,但内置的搜索引擎却很好用,你还能将书籍保存为PDF格式(虽然我不太明白你为什么要这么做) +在Calibre电子书阅读器中,你可以通过方向键,向上/向下翻页键以及空格浏览书籍,还能在在线字典中查找词语含义,添加书签。 这一阅读器没有注释功能,但内置的搜索引擎却很好用,你还能将书籍保存为PDF格式(虽然我不太明白你为什么要这么做) -Configuration options are an area where this eBook viewer shines. It has far more of them than both Bookworm and Foliate combined. You can change everything from fonts to the layout of text to how text is broken up into pages. On top of that, you can customize the keyboard shortcuts for using the application and add your favorite dictionary website or sites to help you look up words in a book you're reading. -不过参数设置这里确是它出彩的地方,它比Bookworm和Foliate加起来都多。从字体到文本布局,页面如何分割你都能改。除此之外,你还能自定义应用按键设置,将你喜欢的词典网站添加进来,方便阅读查找。 +不过参数设置这里确是它出彩的地方,它的可选设置比Bookworm和Foliate加起来都多,从字体到文本布局,页面分割方式你都能改。除此之外,你还能自定义应用按键设置,将你喜欢的词典网站添加进来,方便阅读查找。 ![电子书参数设置][15] -One useful feature of Calibre's eBook viewer is the ability to apply your own CSS file to your e-books. CSS, in case you're wondering, is a way to format web pages (which is what many e-books are made of). If you're a master with CSS, you can copy and paste your CSS file into the **User stylesheet** tab in eBook viewer's Preferences window. That's the ultimate in customization. -Calibre电子书阅读器一个很有用的功能,就是把自行设置的CSS配置文件效果应用到电子书上。为防止你万一好奇我可以提前告诉你,CSS是一种调整网页格式的方法(这类文件就是许多电子书的一个组成部分)。如果你能熟练使用CSS,你可以将自己的CSS文件复制粘贴到电子书阅读器配置窗口的**User stylesheet** 部分。这就是个性化的究极方法。 +Calibre电子书阅读器一个很有用的功能,就是把自行设置的CSS配置文件效果应用到电子书上。以防万一我可以提前告诉你,CSS是一种调整网页格式的方法(这类文件就是许多电子书的一个组成部分)。如果你是使用CSS的高手,你可以将自己的CSS文件复制粘贴到配置窗口的**User stylesheet** 部分,这就是个性化的究极办法。 -eBook viewer, according to its developer, "can display all the major e-book formats." If you're wondering what those formats are, [here's a list][16]. I've tested it with just a few of those formats and have had no problems with them. -据开发者描述,这一电子书阅读器“能支持所有主流电子书格式。”如果你想知道具体支持格式是什么,[这是列表][16]。我测试了列表中的一小部分格式,没有发现问题。 +据开发者描述,这一电子书阅读器“能支持所有主流电子书格式。” 如果你想知道具体支持格式是什么,[这是列表链接][16]。我测试了列表中的一小部分格式,没有发现问题。 -### Final thought 最后总结 +### 留在最后的话 -Whether you're looking for a simple eBook reader or one with bells and whistles and whatever else, the three applications in this article are good choices. Any of them can make reading an eBook on a larger screen easier. -不管你只是单纯想找个电子书阅读器,还是有个更多复杂功能的阅读器,上文提到的三个应用都很不错,并且它们都能多少提升你在大屏设备上的阅读体验。 +不管你只是单纯想找个电子书阅读器,还是有个更多复杂功能的应用,上文提到的三个选择都很不错,而且它们都能提升你在大屏设备上的阅读体验。 * * * From 640662562059350c20b18dc60224ce5758da0af5 Mon Sep 17 00:00:00 2001 From: wenwensnow <963555237@qq.com> Date: Tue, 10 Mar 2020 02:02:31 +0100 Subject: [PATCH 178/207] Rename sources/tech/20200225 3 eBook readers for the Linux desktop.md to translated/tech/20200225 3 eBook readers for the Linux desktop.md --- .../tech/20200225 3 eBook readers for the Linux desktop.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200225 3 eBook readers for the Linux desktop.md (100%) diff --git a/sources/tech/20200225 3 eBook readers for the Linux desktop.md b/translated/tech/20200225 3 eBook readers for the Linux desktop.md similarity index 100% rename from sources/tech/20200225 3 eBook readers for the Linux desktop.md rename to translated/tech/20200225 3 eBook readers for the Linux desktop.md From bb8969d9a147b4f34fc1b418096be063bff47456 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 10 Mar 2020 11:36:10 +0800 Subject: [PATCH 179/207] PRF @geekpi --- ...ientific calculator for your smartphone.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md index 43d232c6aa..9b5ec94738 100644 --- a/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md +++ b/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md @@ -1,34 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Calculator N+ is an open source scientific calculator for your smartphone) [#]: via: (https://opensource.com/article/19/11/calculator-n-mobile) [#]: author: (Ricardo Berlasso https://opensource.com/users/rgb-es) -Calculator N+ 是一款智能手机上的开源科学计算器 +Calculator N+:一款智能手机上的开源科学计算器 ====== -这个 Android 应用可在掌中计算许多高级数学函数。 -![scientific calculator][1] -移动电话每天都在变得越来越强大,因此毫不奇怪它们可以击败大多数不太久前的大多数计算机。这也意味着上面的工具每天都在变得越来越强大。 +> 这个 Android 应用可在掌中计算许多高级数学函数。 -之前,我写过一篇 [Linux 桌面上的科学计算器][2],我接着将介绍 [Calculator N +][3],这是一个很棒的 GPL v3.0 许可证下的,适用于 Android 设备的计算机代数系统(CAS)应用。 +![](https://img.linux.net.cn/data/attachment/album/202003/10/113543hlb5xu7b5e17ba90.jpg) -Calculator N+ 被认为是“适用于 Android 的强大计算器”,但这是一个谦虚的说法。它不仅可以以任意精度工作,还可以显示根数和分数等_很多_功能。 +移动电话每天都在变得越来越强大,因此毫不奇怪它们可以击败不太久前的大多数计算机。这也意味着移动手机上的工具每天都在变得越来越强大。 + +之前,我写过一篇 [两款 Linux 桌面端可用的科学计算器][2],我接着将介绍 [Calculator N+][3],这是一款很棒的适用于 Android 设备的计算机代数系统(CAS)应用,采用 GPL v3.0 许可证下。 + +Calculator N+ 被认为是“适用于 Android 的强大计算器”,但这是一个谦虚的说法。它不仅可以以任意精度工作,还可以显示根数和分数等*很多*功能。 寻找多项式根?可以。分解因数?可以。导数、积分和极限?可以。数论(模算术、组合学、素因数分解)?可以。 -你还可以求解系统方程、简化表达式(包括三角函数)、转换单位,只要你想到的,它都能做! +你还可以求解方程系统、简化表达式(包括三角函数)、转换单位,只要你想到的,它都能做! ![Calculator N+ graphical interface][4] -结果以 LaTeX 输出。左上方的菜单提供了许多强大的功能,只需触摸一下即可使用。同样在该菜单中,你将找到该应用所有功能的帮助文件。在屏幕的右上角,你可以在精确和十进制表示之间切换。最后,点击屏幕底部的蓝色条,即可访问应用中的所有功能库。不过要小心!如果你不是数学家、物理学家或工程师,那么这么长的列表会看上去很震撼。 +其结果以 LaTeX 输出。左上方的菜单提供了许多强大的功能,只需触摸一下即可使用。同样在该菜单中,你将找到该应用所有功能的帮助文件。在屏幕的右上角,你可以在精确表示法和十进制表示法之间切换。最后,点击屏幕底部的蓝色栏,即可访问应用中的所有函数库。不过要小心!如果你不是数学家、物理学家或工程师,那么这么长的列表会看上去很吓人。 所有这些功能都来自 [Symja 库][5],这是另一个出色的 GPL 3 项目。 -这两个项目都处于积极开发中,并且每个版本都在不断完善。特别是,Calculator N+ 的 v3.4.6 在用户界面 (UI) 品质方面取得了重大飞跃。但是还是存在一些不好的地方,但是要在智能手机的小巧的用户界面中发挥如此强大的功能是一项艰巨的任务,我认为应用开发人员正在很好地解决其剩余的问题。对他们表示敬意! +这两个项目都处于积极开发中,并且每个版本都在不断完善。特别是,Calculator N+ 的 v3.4.6 在用户界面(UI)品质方面取得了重大飞跃。虽然还是存在一些不够好的地方,但是要在智能手机的小巧的用户界面中发挥如此强大的功能是一项艰巨的任务,我认为应用开发人员正在很好地解决其剩余的问题。对他们表示敬意! 如果你是老师、学生或在理工科领域工作,请试试 Calculator N+。它是免费、无广告、开源的,并可以满足你所有的数学需求。(当然,除了数学考试期间,为防止作弊绝对不允许使用智能手机。) @@ -43,14 +45,14 @@ via: https://opensource.com/article/19/11/calculator-n-mobile 作者:[Ricardo Berlasso][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/rgb-es [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) -[2]: https://opensource.com/article/18/1/scientific-calculators-linux +[2]: https://linux.cn/article-9643-1.html [3]: https://github.com/tranleduy2000/ncalc [4]: https://opensource.com/sites/default/files/uploads/calculatornplus_sqrt-frac.png (Calculator N+ graphical interface) [5]: https://github.com/axkr/symja_android_library From 558852dcccda8cb87815b9f0eff823aa71bb2a04 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 10 Mar 2020 11:36:41 +0800 Subject: [PATCH 180/207] PUB @geekpi https://linux.cn/article-11981-1.html --- ...n open source scientific calculator for your smartphone.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191126 Calculator N- is an open source scientific calculator for your smartphone.md (98%) diff --git a/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md b/published/20191126 Calculator N- is an open source scientific calculator for your smartphone.md similarity index 98% rename from translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md rename to published/20191126 Calculator N- is an open source scientific calculator for your smartphone.md index 9b5ec94738..3ba3711fe6 100644 --- a/translated/tech/20191126 Calculator N- is an open source scientific calculator for your smartphone.md +++ b/published/20191126 Calculator N- is an open source scientific calculator for your smartphone.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11981-1.html) [#]: subject: (Calculator N+ is an open source scientific calculator for your smartphone) [#]: via: (https://opensource.com/article/19/11/calculator-n-mobile) [#]: author: (Ricardo Berlasso https://opensource.com/users/rgb-es) From fbf5effd1f72a89cfc628bf8aacad575b8e2c9a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 10 Mar 2020 12:53:46 +0800 Subject: [PATCH 181/207] Translating --- ...9 Here Are The Most Beautiful Linux Distributions in 2020.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md b/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md index 3188c97fa7..80e861ffdd 100644 --- a/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md +++ b/sources/tech/20200219 Here Are The Most Beautiful Linux Distributions in 2020.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 257631310b586fad918ccb065053b14ca3ad68ca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 10 Mar 2020 17:29:19 +0800 Subject: [PATCH 182/207] PRF @HankChow --- ...ger That Doesn-t Need Your Phone Number.md | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md index c50d0437e0..d380acf6e1 100644 --- a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md +++ b/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) @@ -18,7 +18,7 @@ Signal 作为一款私人通信应用,正在变得愈发流行。而我们下 对于私人通信服务来说,有没有既能保护通信安全性,又尊重用户跨平台隐私的集大成者呢?很多注重个人隐私的用户似乎都在寻找这个问题的答案。 -最近,我留意到 [Loki Foundation][3] 开发的一款叫做 [Session][2] 的开源通信应用。从技术上来说,Session 是另一款[开源、加密的通信应用 Signal][4] 的一个复刻。 +最近,我留意到 [Loki 基金会][3]开发的一款叫做 [Session][2] 的开源通信应用。从技术上来说,Session 是另一款[开源、加密的通信应用 Signal][4] 的一个复刻。 在本文中,我会讲述我自己使用 Session 的体验,以及 Session 的一些主要功能。 @@ -34,7 +34,7 @@ Session 在这个领域中算是一款比较新的应用了,因此我还会在 在 Signal 或者其它类似的通信应用中,用户都需要提供手机号码才得以成功注册。注重隐私的用户们都认为这样的做法会潜藏着巨大的安全隐患。 -而使用 Session 则简单得多。在 PC 或手机上安装应用之后,只需要点击“创建账号Create Account”,无须提供手机号码,它就会生成一个类似 **05652245af9a8bfee4f5a8138fd5c……..** 这样的随机且唯一的 Session ID。 +而使用 Session 则简单得多。在 PC 或手机上安装应用之后,只需要点击“创建账号Create Account”,无须提供手机号码,它就会生成一个类似 05652245af9a8bfee4f5a8138fd5c..... 这样的随机且唯一的 Session ID。 此后,把 Session ID 分享给想要添加的联系人就可以了。Session 还支持二维码,其他人可以通过扫描二维码添加你的 Session ID 为好友。 @@ -62,14 +62,12 @@ Session 在这个领域中算是一款比较新的应用了,因此我还会在 最基本的选项包括: - * **消息有效期**:你可以控制一条消息在接收者阅读前的保留时长 - * **已读回执**:消息发送者可以知晓你已经阅读该消息 - - +* **消息有效期**:你可以控制一条消息在接收者阅读前的保留时长 +* **已读回执**:消息发送者可以知晓你已经阅读该消息 #### Session 使用去中心化网络保护你的元数据 -尽管 Session 不使用端对端peer-to-peer技术,但它也不适用中心化的服务器。 +尽管 Session 不使用端对端peer-to-peer技术,但它也不使用中心化的服务器。 Session 采用了去中心化的架构实现消息的传输和路由。如果你不熟悉这方面的内容,可以关注 Session 的官方博客,尝试了解[中心化网络和去中心化网络的区别][11],以及它的实际工作原理。 @@ -85,11 +83,11 @@ Session 采用了去中心化的架构实现消息的传输和路由。如果你 另外,你也可以在它的 [Github 发布页面][14] 获取到对应的 .deb 安装文件。 -[下载 Session][12] +- [下载 Session][12] ### 我使用 Session 的体验 -我在各种平台上都试用过 Session,其中在 PC 上我使用了 Pop!_OS 19.10 的 .AppImage 文件运行这个应用。 +我在各种平台上都试用过 Session,其中在 PC 上我使用了 Pop!\_OS 19.10 的 .AppImage 文件运行这个应用。 总的来说,使用的体验很不错,用户界面也没有出现问题。 @@ -99,11 +97,9 @@ Session 采用了去中心化的架构实现消息的传输和路由。如果你 当然,我也发现了一些需要改进的地方: - * 在接受好友请求时会出现延迟 - * 设备间连接的方式不太直观 - * 当你在不同的设备上使用同一个 Session ID 向同一个人回复消息时,对方会收到两个不同的对话 - - +* 在接受好友请求时会出现延迟 +* 设备间连接的方式不太直观 +* 当你在不同的设备上使用同一个 Session ID 向同一个人回复消息时,对方会收到两个不同的对话 ### 总结 @@ -119,7 +115,7 @@ via: https://itsfoss.com/session-messenger/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -128,7 +124,7 @@ via: https://itsfoss.com/session-messenger/ [1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-app.jpg?ssl=1 [2]: https://getsession.org/ [3]: https://loki.foundation/ -[4]: https://itsfoss.com/signal-messaging-app/ +[4]: https://linux.cn/article-11764-1.html [5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/02/session-create.jpg?ssl=1 [6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/session-application-id.jpg?ssl=1 [7]: https://en.wikipedia.org/wiki/Blockchain From 86eae745cd44c69a0100a3f1e2765944dc155993 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 10 Mar 2020 17:30:25 +0800 Subject: [PATCH 183/207] PUB @HankChow https://linux.cn/article-11982-1.html --- ...e Private Messenger That Doesn-t Need Your Phone Number.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md (98%) diff --git a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md b/published/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md similarity index 98% rename from translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md rename to published/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md index d380acf6e1..1d98fdf187 100644 --- a/translated/tech/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md +++ b/published/20200303 Session- An Open Source Private Messenger That Doesn-t Need Your Phone Number.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11982-1.html) [#]: subject: (Session: An Open Source Private Messenger That Doesn’t Need Your Phone Number) [#]: via: (https://itsfoss.com/session-messenger/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From a07c10d3f4fc96b2ea8de4a7729c6e1792f8f3bd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 11 Mar 2020 01:09:22 +0800 Subject: [PATCH 184/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200310=20Contai?= =?UTF-8?q?ners=20vs.=20VMs,=20Istio=20in=20production,=20and=20more=20ind?= =?UTF-8?q?ustry=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200310 Containers vs. VMs, Istio in production, and more industry news.md --- ...o in production, and more industry news.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20200310 Containers vs. VMs, Istio in production, and more industry news.md diff --git a/sources/tech/20200310 Containers vs. VMs, Istio in production, and more industry news.md b/sources/tech/20200310 Containers vs. VMs, Istio in production, and more industry news.md new file mode 100644 index 0000000000..95b124cf87 --- /dev/null +++ b/sources/tech/20200310 Containers vs. VMs, Istio in production, and more industry news.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Containers vs. VMs, Istio in production, and more industry news) +[#]: via: (https://opensource.com/article/20/3/survey-istio-industry-news) +[#]: author: (Tim Hildred https://opensource.com/users/thildred) + +Containers vs. VMs, Istio in production, and more industry news +====== +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. + +## [Tech adoption in the cloud native world: Containers and more][2] + +> * Adoption of containers in production rose to from 73% in 2018 to 84% in 2019. Among this group, those running at least 250 containers rose from 46% in 2018 to 58% in 2019. From 2017 to 2019, the number of respondents with more than 50 machines (physical or virtual) in their fleet rose from 77% in 2017 to 81% in 2019. +> * Implication: Container adoption appears to have mitigated the growth of VMs that need to be managed. However, be wary of claims that the raw number of machines being managed will decline. +> + + +**The impact**: It intuitively makes sense that virtual machine growth would slow down as container use grows; there are lots of containers being deployed inside VMs to take advantage of the best features of both, and lots of apps that won't be containerized any time soon (looking at you legacy enterprise monoliths). + +## [Everything we learned running Istio in production][3] + +> At HelloFresh we organize our teams into squads and tribes. Each tribe has their own Kubernetes namespace. As mentioned above, we enabled sidecar injection namespace by namespace then application by application. Before enabling applications for Istio we held workshops so that squads understood the changes happening to their application. Since we employ the model of “you build it, you own it”, this allows teams to understand traffic flows when troubleshooting. Not only that, it also raised the knowledge bar within the company. We also created Istio related [OKR’s][4] to track our progress and reach our Istio adoption goals. + +**The impact**: The parts of technology adoption that aren't technology adoption are ignored at your own peril. + +## [Aether: the first open source edge cloud platform][5] + +> Aether is bringing together projects that have been under development and operating in their own sandbox, and under that framework ONF is trying to support a diversity of edge services on a converged platform, Sloane explained. ONF’s various projects will remain separate and continue to be consumable separately, but Aether is its attempt to bring multiple capabilities together to simplify private edge cloud operations for enterprises. +> +> "We think we’re creating a new collaborative place where the industry and community can come together to help drive some maybe consolidation and critical mass behind a common platform that can then help common functionality proliferate in these edge clouds," he said. + +**The impact**: The problems being solved with technology today are too complex to be solved with a single technology. The business problems being solved on top of that require focus on the truly, value-adding. Taken together, businesses need to find ways to collaborate on their shared needs and compete on what makes them unique in the market. You couldn't find a better way to do that than open source. + +## [Women in cloud careers are challenging the narrative][6] + +> "As cloud is a relatively new technology, my experience of [being a 'woman in tech'][7] may not be typical, as the cloud industry is extremely diverse," Yordanova says. "In fact, my team has an equal gender split with a real mix of personalities, cultures and strengths from people who grew up with this technology." + +**The impact**: One thing I like to think about is the idea of leapfrogging; that you might be able to skip a certain step or stage in a process because the circumstance that caused its existence in the first place no longer applies. The cloud era didn't have as long a period with static stereotypes of who made it and who it was for, so maybe it carries less of the baggage of some previous generations of technology? + +## [How StarlingX shines in the starry sky of open source projects in China][8] + +> Our team is in China, so one of our missions is to help the Chinese community to develop the software, contribute code, documentation, and more.  Most of the StarlingX project meetings are held late at night in China, so the presence and participation for the Chinese community members are quite challenging. To overcome these obstacles, together with other community members (like friends in 99cloud) in China, we made some initiatives, such as engaging with other Chinese community members at the meet-ups, hands-on workshops ad-hoc tech meetings in Chinese, translating some documents to Chinese, and continuously interacting in WeChat groups (just like a 24/7 on-call services for and by everyone) + +**The impact**: As Chinese contributions to open source projects continue to grow this seems like a situation that is likely to reverse, or at least equalize. It doesn't really make sense that "learn English" should be a pre-requisite to participating in the open source development process. + +_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/3/survey-istio-industry-news + +作者:[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://thenewstack.io/cncf-survey-snapshot-tech-adoption-in-the-cloud-native-world/ +[3]: https://engineering.hellofresh.com/everything-we-learned-running-istio-in-production-part-1-51efec69df65 +[4]: https://en.wikipedia.org/wiki/OKR +[5]: https://www.sdxcentral.com/articles/news/onf-projects-coalesce-for-enterprise-edge-cloud/2020/03/ +[6]: https://www.cloudpro.co.uk/leadership/cloud-essentials/8446/how-women-in-cloud-are-challenging-the-narrative +[7]: https://www.itpro.co.uk/business-strategy/33301/diversity-not-a-company-priority-claim-nearly-half-of-women-in-tech +[8]: https://superuser.openstack.org/articles/starlingx-community-interview-how-starlingx-shines-in-the-starry-sky-of-open-source-projects-in-china/ From 3e0196ec01f48d6ff042ae81cb8ddf4d2b5fb1f1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 11 Mar 2020 01:12:55 +0800 Subject: [PATCH 185/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200310=20Gettin?= =?UTF-8?q?g=20started=20with=20Emacs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200310 Getting started with Emacs.md --- .../20200310 Getting started with Emacs.md | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 sources/tech/20200310 Getting started with Emacs.md diff --git a/sources/tech/20200310 Getting started with Emacs.md b/sources/tech/20200310 Getting started with Emacs.md new file mode 100644 index 0000000000..bb5ceffb86 --- /dev/null +++ b/sources/tech/20200310 Getting started with Emacs.md @@ -0,0 +1,181 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Emacs) +[#]: via: (https://opensource.com/article/20/3/getting-started-emacs) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Getting started with Emacs +====== +10 tips for diving into the world of this useful group of open source +text editors. +![Computer keyboard typing][1] + +Many people say they want to learn [Emacs][2], but many of them shy away after the briefest encounter. It's not because Emacs is bad or even that complex. The problem, I believe, is that people don't actually want to learn Emacs; they want to be comfortable with Emacs traditions. They want to understand the arcane keyboard shortcuts and unfamiliar terminology. They want to use Emacs as they believe it's "meant to be used." + +I sympathize with this because that's how I felt about Emacs. I thought that all true Emacs users only ran it inside a terminal, and never used arrow keys or menus, much less a mouse. That's a great way to discourage yourself from getting started with Emacs. There are enough unique .emacs config files out there to prove that if there's one common strain among Emacs users, it's that everyone uses Emacs differently. + +Learning Emacs is easy. It's loving Emacs that's hard. To love Emacs, you have to discover the features it has that you've been looking for, sometimes without knowing you've been missing them. And that takes experience. + +The only way to get that experience is to start at the beginning—by actively using Emacs. Here are ten tips to help you figure out what works best for you. + +### Start with the GUI + +One of the greatest things about Emacs (and its friendly competitor, [Vim][3], too) is that it can be run in a terminal, which is useful when you SSH into a server, but not very significant on computers built within the last 15 years or so. The GUI version of Emacs can be run on extremely [low-powered devices][4], and it has lots of pragmatic features that both novice and experienced users can appreciate. + +For example, if you don't know how to copy a word with just keyboard shortcuts in Emacs, the Edit menu's Copy, Cut, and Paste selections provide the path of least resistance. There's no reason to punish yourself for choosing Emacs. Use its menus, use your mouse to select regions and click in-buffer buttons, and don't let unfamiliarity stand in your way of being productive. + +![Emacs slackware][5] + +These features are built into Emacs because users use them. You should use them when you need them and work your way up to the obscure commands you think you might need when you eventually use Emacs over SSH on a VT100 terminal with no Alt or arrow keys. + +### Get used to the terminology + +Emacs has special terms for its UI elements. The evolution of personal computing didn't build upon the same terms, so many are relatively foreign to the modern computer user, and others are the same but have different meanings. Here are some of the most common terms: + + * Frame: In Emacs, the frame is what modern computing calls a "window." + * Buffer: A buffer is a communication channel for Emacs. It may serve as a command-line for an Emacs process, or a shell, or just the contents of a file. + * Window: A window is your view into a buffer. + * Mini-buffer: The primary command-line, located at the bottom of the Emacs window. + + + +![Emacs tutorial map][6] + +### Making sense of Emacs modifier keys + +On a PC keyboard, the Ctrl key is referred to as C, and the Alt key is referred to as M. These aren't the C and M keys, and because they're always paired with an accompanying letter or symbol key, they're easy to recognize in the documentation. + +For example, C-x means Ctrl+X in modern keyboard notation, and M-x is Alt+X. You press the keys together just as you do when you're cutting text from any application. + +There's another level of keyboard shortcuts, though, quite unlike anything on modern computers. Sometimes, a keyboard shortcut isn't just one key combo and instead consists of a series of key presses. + +For instance, C-x C-f means to press Ctrl+X as usual, and then Ctrl+C as usual. + +Sometimes, a keyboard shortcut has a mixture of key types. The combo C-x 3 means to press Ctrl+X as usual, and then the number 3 key. + +The way Emacs can do these fancy power combos is because certain keys put Emacs into a special command mode. If you press C-X (that's Ctrl+X), you're telling Emacs to enter an idle state, waiting for a second key or keyboard shortcut. + +Emacs documentation, both official and unofficial, is full of keyboard shortcuts. Practice mentally translating C to Ctrl and M to Alt, and all those docs will make a lot more sense to you. + +### Alternate shortcuts for cut, copy, and paste + +Canonically, copying text is performed with a series of keyboard shortcuts that depend on how you want to copy or cut. + +For instance, you can cut a whole word with M-d (Emacs lingo for Alt+d), or a whole line with C-k (Ctrl+K), or a highlighted region with M-m (Alt+M). You can get used to that if you want, but if you like Ctrl+C and Ctrl+X and Ctrl-V, then you can use those instead. + +Enabling modern cut-copy-paste requires activating a feature called CUA (Common User Access). To activate CUA, click on the Options menu and select Use CUA Keys. With this enabled, C-c copies highlighted text, C-x cuts highlighted text, and C-v pastes text. This mode is only actually active when you've selected text, so you can still learn the usual C-x and C-c bindings that Emacs normally uses. + +### It's OK to share + +Emacs is an application and has no awareness of your feelings or loyalty towards it. If you want to use Emacs only for tasks that "feel" right for Emacs, and different editor (like Vim) for other tasks, you can do that. + +Your interactions with an application influence how you work, so if the pattern of keypresses required in Emacs doesn't agree with a specific task, then don't force yourself to use Emacs for that task. Emacs is just one of many open source tools available to you, and there's no reason to limit yourself to just one tool. + +### Explore new functions + +Most of what Emacs does is an elisp function that can be invoked from a menu selection, keyboard shortcut, or in some cases, a specific event. All functions can be executed from the mini-buffer (the command-line at the bottom of the Emacs frame). You could, in theory, even navigate your cursor by typing in functions like **forward-word** and **backward-word** and **next-line** and **previous-line**, and so on. It would be unbearably inefficient, but that's the kind of direct access to the code you're running. In a way, Emacs is its own API. + +You can find out about new functions by reading about Emacs on community blogs, or you can take a more direct approach and use the describe-function function. To get help on any function, press M-x (that's Alt+X) and then type describe-function, and then press Return or Enter. You are prompted for a function name, and then shown a description of that function. + +You can get a list of all available functions by typing M-x (Alt+X), followed by ?. + +You can also get pop-up descriptions of functions as you type them by pressing M-x and then typing **auto-complete-mode**, and then pressing Return or Enter. With this mode active, as you type any Emacs function into your document, you're offered auto-completion options, along with a description of the function. + +![Emacs function][7] + +When you find a useful function and use it, Emacs tells you the keyboard binding for it, if one is set. If one doesn't exist, you can assign one yourself by opening your $HOME/.emacs configuration file and entering a keyboard shortcut assignment. The syntax is global-set-key, followed by the keyboard shortcut you want to use, followed by the function you want to invoke. + +For example, to assign the screenwriter-slugline function to a keyboard binding: + + +``` +`(global-set-key (kbd “C-c s”) 'screenwriter-slugline)` +``` + +Reload your configuration file, and the keyboard shortcut is available to you: + + +``` +`M-x load-file ~/.emacs` +``` + +### Panic button + +As you use Emacs and try new functions, you're bound to start invoking something you didn't mean to invoke. The universal panic button in Emacs is C-g (that's Ctrl+G). +I remember this by associating G with GNU, and I imagine I'm calling upon GNU to rescue me from a poor decision, but feel free to make up your own mnemonic. + +If you press C-g a few times, the Emacs mini-buffer returns to a latent state, pop-up windows are hidden, and you're back to the safety of a plain old boring text editor. + +### Ignore the keyboard shortcuts + +There are too many potential keyboard shortcuts to summarize them all here, much less for you ever to hope to memorize. That's by design. Emacs is meant to be customized, and when people write plugins for Emacs, they get to define their own special keyboard shortcuts. + +The idea isn't to memorize all shortcuts right away. Your goal, instead, is to get comfortable using Emacs. The more comfortable you become in Emacs, the more you'll get tired of resorting to the menu bar all the time, and you'll start to memorize the combos important to you. + +Everyone has their own favorite shortcuts based on what they typically do in Emacs. Someone who spends all day writing code in Emacs may know all the keyboard shortcuts for running a debugger or for launching language-specific modes, but know nothing about Org-mode or Artist-mode. It's natural, and it's fine. + +### Practice Emacs when you use Bash + +One advantage to knowing Emacs keyboard shortcuts is that many of them also apply in Bash: + + * C-a—go to the beginning of a line + * C-e—go to the end of a line + * C-k—cut the whole line + * M-f—go forward a word + * M-b—go back a word + * M-d—cut a word + * C-y—yank back (paste) the most recently cut content + * M-Shift-U—capitalize a word + * C-t—swap two characters (for example, sl becomes ls) + + + +There are many more examples, and it an make your interactions with your Bash terminal faster than you ever imagined. + +### Packages + +Emacs has a built-in package manager to help you discover new plugins. Its package manager contains modes to help you edit specific types of text (for instance, if you edit JSON files frequently, you might try ejson-mode), embedded applications, themes, spellchecking options, linters, and more. This is where Emacs has the potential to become crucial to your daily computing; once you find a great Emacs package, you may not be able to live without it. + +![Emacs emoji][8] + +You can browse packages by pressing M-x (that's Alt+X) and then typing **package-list-packages** command and then pressing Return or Enter. The package manager updates its cache each time you launch it, so be patient the first time you use it while it downloads a list of available packages. Once loaded, you can navigate with your keyboard or mouse (remember, Emacs is a GUI application). Each package name is a button, so either move your cursor over it and press Return or just click it with your mouse. You can read about the package in the new window that appears in your Emacs frame, and then install it with the Install button. + +Some packages need special configuration, which is sometimes listed in its description, but other times require you to visit the package's home page to read more about it. For example, the auto-complete package ac-emoji installs easily but requires you to have a symbol font defined. It works either way, but you only see the corresponding emoji if you have the font installed, and you might not know that unless you visit its homepage. + +### Tetris + +Emacs has games, believe it or not. There's Sudoku, quizzes, minesweeper, a just-for-fun psychotherapist, and even Tetris. These aren't particularly useful, but interacting with Emacs on any level is great practice, and games are a great way to maximize your time spent in Emacs. + +![Emacs tetris][9] + +Tetris is also how I was introduced to Emacs in the first place, so of all versions of the game, it's the Emacs version that's truly my favorite. + +### Using Emacs + +GNU Emacs is popular because it's impossibly flexible and highly extensible. People get so accustomed to Emacs keyboard shortcuts that they habitually try to use them in all other applications, and they build applications into Emacs, so they never have to leave in the first place. If you want Emacs to play an important role in your computing life, the ultimate key is to embrace the unknown and start using Emacs. Stumble through it until you've discovered how to make it work for you, and then settle in for 40 years of comfort. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/getting-started-emacs + +作者:[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/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) +[2]: https://opensource.com/downloads/emacs-cheat-sheet +[3]: https://opensource.com/downloads/cheat-sheet-vim +[4]: https://opensource.com/article/17/2/pocketchip-or-pi +[5]: https://opensource.com/sites/default/files/uploads/emacs-slackware.jpg (Emacs slackware) +[6]: https://opensource.com/sites/default/files/uploads/emacs-tutorial-map.png (Emacs tutorial map) +[7]: https://opensource.com/sites/default/files/uploads/emacs-function.jpg (Emacs function) +[8]: https://opensource.com/sites/default/files/uploads/emacs-emoji_0.jpg (Emacs emoji) +[9]: https://opensource.com/sites/default/files/uploads/emacs-tetris.jpg (Emacs tetris) From 293b42194338ba5f9248865099fbae98c037337e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 11 Mar 2020 01:15:28 +0800 Subject: [PATCH 186/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200310=202020?= =?UTF-8?q?=20Will=20Be=20a=20Year=20of=20Hindsight=20for=20SD-WAN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md --- ... Will Be a Year of Hindsight for SD-WAN.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/talk/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md diff --git a/sources/talk/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md b/sources/talk/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md new file mode 100644 index 0000000000..cddc7346ed --- /dev/null +++ b/sources/talk/20200310 2020 Will Be a Year of Hindsight for SD-WAN.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (2020 Will Be a Year of Hindsight for SD-WAN) +[#]: via: (https://www.networkworld.com/article/3531315/2020-will-be-a-year-of-hindsight-for-sd-wan.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +2020 Will Be a Year of Hindsight for SD-WAN +====== + +metamorworks + +The expression “hindsight is 20/20” couldn’t be truer for software-defined wide-area networking (SD-WAN). To summarize the past few years: Cloud computing and digital transformation drove companies to re-evaluate traditional WAN technology, which no longer met their growing business needs. That’s when SD-WAN emerged as a promising new technology. + +SD-WAN was designed to address the problem of traffic management from physical devices and to enable software-based provisioning from the cloud. Many initial SD-WAN deployments were fueled by the desire to replace expensive multi-protocol label switching (MPLS). Companies were hopeful that it could magically solve all their networking problems. But in practice, basic SD-WAN solutions fell well short on this promise. + +Fast forward to the present, and much of the hype surrounding SD-WAN has settled, and early implementations are behind us. Now it’s time to look back on what we learned in 2019 and what to improve upon in 2020. So, let’s dive in. + +### **1\. It’s not about cost savings.** + +Most companies choose SD-WAN as an MPLS replacement because it can lower WAN costs. However, [cost savings][1] can vary with SD-WAN, so it shouldn’t be used as a primary driver for deploying the technology. Companies should instead focus on improving network agility—such as enabling faster site deployment and reducing configuration times—whatever their needs may be. The main driver for SD-WAN is to make networks more efficient; if done successfully, the cost savings will follow.  + +### **2\. WAN optimization is necessary.** + +Speaking of efficiency, [WAN optimization][2] improves the performance of application and data traffic. By applying techniques like protocol acceleration, deduplication, compression, and caching, WAN optimization can increase bandwidth, reduce latency, and mitigate packet loss. The initial notion was that SD-WAN could eliminate the requirement for WAN optimization altogether, but we now know that some applications need additional performance. The technologies complement—not replace—each other. And they should be used to address different problems. + +### **3\. Security can’t be an afterthought.** + +SD-WAN has many benefits, one of which is using broadband internet to quickly send enterprise application traffic. But this approach also poses security risks since it exposes users and their local networks to the untrusted public internet. Security should be part of SD-WAN implementation from the beginning, as opposed to an afterthought. Companies can achieve the desired application performance and protection by positioning security close to branch locations using services like [cloud-hosted security][3]. + +### **4\. Visibility is critical to SD-WAN success.** + +Having [visibility][4] into application and data traffic takes the guesswork out of network management. The best place to start is at the pre-deployment phase, where companies can assess their existing capabilities and what’s missing before SD-WAN is implemented. Visibility, in the form of day-to-day monitoring and alerts, continues to play an important role after deployment. Companies that understand what’s going on in their network are better prepared to respond to performance issues and can use that knowledge to avoid future problems. + +### **5\. Wireless WAN isn’t ready for prime time.** + +SD-WAN connects users to applications via any transport, including broadband and 4G/LTE (Long Term Evolution) wireless. That’s why [mobile connectivity][5] is increasingly being integrated into SD-WAN solutions. While companies are eager to use 4G as a potential transport alternative—especially in remote locations—the resulting costs of pay-per-use 4G services are high. Additionally, 4G can be problematic due to latency and bandwidth limitations. The best approach is to wait for service providers to deploy 5G with better pricing options. This will be the year when we see 5G rollouts and more focus on wireless SD-WAN.  + +Be sure to watch this SD-WAN video series: [Everything you should know about SD-WAN][6]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3531315/2020-will-be-a-year-of-hindsight-for-sd-wan.html + +作者:[Zeus Kerravala][a] +选题:[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/Zeus-Kerravala/ +[b]: https://github.com/lujun9972 +[1]: https://blog.silver-peak.com/to-maximize-the-value-of-sd-wan-look-past-hardware-savings +[2]: https://blog.silver-peak.com/sd-wan-vs-wan-optimization +[3]: https://blog.silver-peak.com/sd-wans-enable-scalable-local-internet-breakout-but-pose-security-risk +[4]: https://blog.silver-peak.com/know-the-true-business-drivers-for-sd-wan +[5]: https://blog.silver-peak.com/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality +[6]: https://www.silver-peak.com/everything-you-need-to-know-about-sd-wan From 18c594c33e9df89701b0172e0edc524aa65f89ba Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 11 Mar 2020 08:24:07 +0800 Subject: [PATCH 187/207] translated --- ... a Specific Package from an apt Upgrade.md | 190 ------------------ ... a Specific Package from an apt Upgrade.md | 190 ++++++++++++++++++ 2 files changed, 190 insertions(+), 190 deletions(-) delete mode 100644 sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md create mode 100644 translated/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md diff --git a/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md b/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md deleted file mode 100644 index e55c7a24e0..0000000000 --- a/sources/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade) -[#]: via: (https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade -====== - -Sometimes you may accidentally update packages that are not updated due to some application dependency. - -This is always the case during the entire system update or automatic package upgrade process. - -If this happens, it may break the application function. - -This creates a serious problem and you need to spend a lot of time fixing the problem. - -See the following article if you want to **[Exclude Specific Packages from Yum Update][1]** - -How to avoid this kind of situation? - -How do I exclude packages from apt-get update? - -Yes, it can be done using the following three methods on Debian and Ubuntu systems. - - * **[apt-mark Command][2]** - * **[dpkg Command][3]** - * aptitude Command - - - -We will show in detail each. - -### Method-1: How to Exclude Packages Update on Debian/Ubuntu System Using the apt-mark Command - -The apt-mark is used to mark/unmark a package as being automatically installed. - -The Hold option is used to mark a package as blocked, which prevents the package from being automatically installed, upgraded, or removed. - -The unhold option is used to cancel a previously set hold on a package to allow all actions to be repeated. - -Run the following command to hold the given package using the **apt-mark** command. - -``` -$ sudo apt-mark hold nano -nano set on hold. -``` - -Once you have hold some packages, run the following apt-mark command to view them. - -``` -$ sudo apt-mark showhold -nano -``` - -This will show that the **“nano”** package will not be upgraded when you perform a full system update. - -``` -$ sudo apt update - -Reading package lists… Done -Building dependency tree -Reading state information… Done -Calculating upgrade… Done -The following packages have been kept back: - nano -0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. -``` - -Run the following command to unhold the “nano” package using the apt-mark command. - -``` -$ sudo apt-mark unhold nano -Canceled hold on nano. -``` - -### Method-2: How to Exclude Packages Update on Debian/Ubuntu System Using the dpkg Command - -The dpkg command is a CLI tool to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg is aptitude. - -Run the following command to block a given package using the dpkg command. - -**Syntax:** - -``` -$ echo "package_name hold" | sudo dpkg --set-selections -``` - -Run the below dpkg command to hold the **“apache2”** package. - -``` -$ echo "apache2 hold" | sudo dpkg --set-selections -``` - -Once you have hold some packages, run the following command to view them. - -``` -$ sudo dpkg --get-selections | grep "hold" -apache2 hold -``` - -It will show that the **“apache2”** package will not be upgraded when you perform a full system update. - -``` -$ sudo apt update - -Reading package lists… Done -Building dependency tree -Reading state information… Done -Calculating upgrade… Done -The following packages have been kept back: - apache2 -0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. -``` - -Run the following command to unhold the given package using the dpkg command. - -**Syntax:** - -``` -$ echo "package_name install" | sudo dpkg --set-selections -``` - -Run the following command to unhold the “apache2” package using the dpkg command. - -``` -$ echo "apache2 install" | sudo dpkg --set-selections -``` - -### Method-3: How to Exclude Packages Update on Debian/Ubuntu System Using the aptitude Command - -The aptitude command is a text-based package management interface to the Debian and it’s derivative. - -It allows the user to view a list of packages and to perform package management tasks such as installing, upgrading, and removing packages. Actions may be performed from a visual interface or from the command-line. - -Run the following command to hold the given package using the aptitude command. - -``` -$ sudo aptitude hold python3 -``` - -Once you have hold some packages, run the following aptitude command to view them. - -``` -$ sudo dpkg --get-selections | grep "hold" -or -$ sudo apt-mark showhold - -python3 -``` - -This will show that the **“python3”** package will not be upgraded when you perform a full system update. - -``` -$ sudo apt update - -Reading package lists… Done -Building dependency tree -Reading state information… Done -Calculating upgrade… Done -The following packages have been kept back: - python3 -0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. -``` - -Run the following command to unhold the **“python3”** package using the apt-mark command. - -``` -$ sudo aptitude unhold python3 -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/ - -作者:[Magesh Maruthamuthu][a] -选题:[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.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/redhat-centos-yum-update-exclude-specific-packages/ -[2]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[3]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ diff --git a/translated/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md b/translated/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md new file mode 100644 index 0000000000..53dc123695 --- /dev/null +++ b/translated/tech/20200306 Three Ways to Exclude-Hold-Prevent a Specific Package from an apt Upgrade.md @@ -0,0 +1,190 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Three Ways to Exclude/Hold/Prevent a Specific Package from an apt Upgrade) +[#]: via: (https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +从 apt 升级中排除/保留/阻止特定软件包的三种方法 +====== + +有时,由于某些应用依赖性,你可能会意外更新未更新的软件包。 + +在整个系统更新或自动包升级过程中一直会发生。 + +如果发生这种情况,可能会破坏应用的功能。 + +这会造成严重的问题,你需要花费大量时间来解决问题。 + +如果你要**[从 Yum Update 中排除特定软件包][1]**,请参考它。 + +如何避免这种情况? + +如何从 apt-get 更新中排除软件包? + +是的,可以在 Debian 和 Ubuntu 系统上使用以下三种方法来完成。 + + * **[apt-mark 命令][2]** + * **[dpkg 命令][3]** + * aptitude 命令 + + + +我们将分别详细展示。 + +### 方法 1:如何使用 apt-mark 命令排除 Debian/Ubuntu 系统上的软件包更新 + +apt-mark 用于将软件包标记/取消标记为自动安装。 + +hold 选项用于将软件包标记为已阻止,以防止软件包被自动安装、升级或删除。 + +unhold 选项用于取消软件包的先前设置,以允许重复执行所有操作。 + +运行以下命令以使用 apt-mark 命令保留指定的软件包。 + +``` +$ sudo apt-mark hold nano +nano set on hold. +``` + +保留软件包后,请运行以下 apt-mark 命令查看它们。 + +``` +$ sudo apt-mark showhold +nano +``` + +这表明在执行完整的系统更新时,不会升级 **“nano”** 包。 + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + nano +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +运行以下命令,使用 apt-mark 命令取消对 “nano” 包的保留。 + +``` +$ sudo apt-mark unhold nano +Canceled hold on nano. +``` + +### 方法 2:如何使用 dpkg 命令在 Debian/Ubuntu 系统上排除软件包更新 + +dpkg 命令是一个 CLI 工具,用于安装,构建,删除和管理 Debian 软件包。dpkg 的主要且更用户友好的前端是 aptitude。 + +运行以下命令使用 dpkg 命令阻止给定的软件包。 + +**语法:** + +``` +$ echo "package_name hold" | sudo dpkg --set-selections +``` + +运行以下 dpkg 命令以保留 **“apache2”** 包。 + +``` +$ echo "apache2 hold" | sudo dpkg --set-selections +``` + +保留软件包后,请运行以下命令查看它们。 + +``` +$ sudo dpkg --get-selections | grep "hold" +apache2 hold +``` + +它会显示在执行完整的系统更新时,不会升级 **“apache2”** 包。 + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + apache2 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +运行以下命令,使用 dpkg 命令取消对指定软件包的保留。 + +**语法:** + +``` +$ echo "package_name install" | sudo dpkg --set-selections +``` + +运行以下命令,使用 dpkg 命令取消保留 “apache2” 包。 + +``` +$ echo "apache2 install" | sudo dpkg --set-selections +``` + +### 方法 3:如何使用 aptitude 命令排除 Debian/Ubuntu 系统上的软件包更新 + +aptitude 命令是 Debian 及其衍生版本的基于文​​本的软件包管理界面。 + +它允许用户查看软件包列表并执行软件包管理任务,例如安装、升级和删除软件包。它可以从可视界面或命令行执行操作。 + +运行以下命令,使用 aptitude 命令保留指定的软件包。 + +``` +$ sudo aptitude hold python3 +``` + +保留某些软件包后,请运行以下 aptitude 命令查看它们。 + +``` +$ sudo dpkg --get-selections | grep "hold" +或者 +$ sudo apt-mark showhold + +python3 +``` + +这表明在执行完整的系统更新时,不会升级 **“python3”** 软件包。 + +``` +$ sudo apt update + +Reading package lists… Done +Building dependency tree +Reading state information… Done +Calculating upgrade… Done +The following packages have been kept back: + python3 +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +``` + +使用 apt-mark 命令运行以下命令以解除对 **“python3”** 软件包的保留。 + +``` +$ sudo aptitude unhold python3 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/debian-ubuntu-exclude-hold-prevent-packages-from-apt-get-upgrade/ + +作者:[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/redhat-centos-yum-update-exclude-specific-packages/ +[2]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ From e152b4c5bc4d957f3f2c0e7684c8d17a444c1f32 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 11 Mar 2020 08:28:27 +0800 Subject: [PATCH 188/207] translating --- sources/tech/20200309 6 Raspberry Pi tutorials to try out.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200309 6 Raspberry Pi tutorials to try out.md b/sources/tech/20200309 6 Raspberry Pi tutorials to try out.md index 5edd665983..a129774aae 100644 --- a/sources/tech/20200309 6 Raspberry Pi tutorials to try out.md +++ b/sources/tech/20200309 6 Raspberry Pi tutorials to try out.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 842d6d4d019c06a22f74b26bc6f33cdc4efe8549 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 11 Mar 2020 09:22:30 +0800 Subject: [PATCH 189/207] Rename sources/tech/20200310 Containers vs. VMs, Istio in production, and more industry news.md to sources/news/20200310 Containers vs. VMs, Istio in production, and more industry news.md --- ...ainers vs. VMs, Istio in production, and more industry news.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200310 Containers vs. VMs, Istio in production, and more industry news.md (100%) diff --git a/sources/tech/20200310 Containers vs. VMs, Istio in production, and more industry news.md b/sources/news/20200310 Containers vs. VMs, Istio in production, and more industry news.md similarity index 100% rename from sources/tech/20200310 Containers vs. VMs, Istio in production, and more industry news.md rename to sources/news/20200310 Containers vs. VMs, Istio in production, and more industry news.md From 5fb5beb96bfd34c5b6a7ecc54d3934c7c10b7b9e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 11 Mar 2020 10:01:20 +0800 Subject: [PATCH 190/207] PRF @geekpi --- ...and lowercase on the Linux command line.md | 56 +++++++++---------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md index 57f5e7525e..f291e1b619 100644 --- a/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md +++ b/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Converting between uppercase and lowercase on the Linux command line) @@ -9,23 +9,23 @@ 在 Linux 命令行中转换大小写 ====== -转换文本的大小写可能非常繁琐,尤其是当你要避免无意间的拼写错误时。幸运的是,Linux 提供了一些命令,可以使工作变得非常容易。 -[andy.brandon50][1] [(CC BY-SA 2.0)][2] -有很多方法可以在 Linux 命令行中将文本从小写更改为大写,反之亦然。实际上,你有一组这样的命令可以选择。这篇文章检验了一些最佳的命令来完成这项工作,以及你该如何让它们正常工作。 +> 转换文本的大小写可能非常繁琐,尤其是当你要避免无意间的拼写错误时。幸运的是,Linux 提供了一些命令,可以使工作变得非常容易。 + +![](https://img.linux.net.cn/data/attachment/album/202003/11/095821df7u8nlyfyyydqvf.jpg) + +有很多方法可以在 Linux 命令行中将文本从小写更改为大写,反之亦然。实际上,有一组这样的命令可以选择。这篇文章检验了一些最佳的命令来完成这项工作,以及你该如何让它们正常工作。 ### 使用 tr -**tr** (translate) 命令是在命令行或脚本中最容易使用的命令之一。如果你要确定要一串大写字符串,你只需将它传给 **tr**,如下所示: +`tr`(translate)命令是在命令行或脚本中最容易使用的命令之一。如果你要确定要一串大写字符串,你只需将它传给 `tr`,如下所示: ``` $ echo Hello There | tr [:lower:] [:upper:] HELLO THERE ``` -[[Get regularly scheduled insights by signing up for Network World newsletters.]][3] - -下面是一个在脚本中使用这个命令的例子,当你要确保添加到文件中的所有文本都使用大写形式以保持一致性时: +下面是一个在脚本中使用这个命令的例子,当你要确保添加到文件中的所有文本都使用大写形式以保持一致性时(LCTT 译注:这里输入部门名称作为示例): ``` #!/bin/bash @@ -35,25 +35,23 @@ read dept echo $dept | tr [:lower:] [:upper:] >> depts ``` -将顺序切换为[:upper:] [:lower:] 会产生相反的效果,将所有部门名称都转换为小写: +将顺序切换为 `[:upper:] [:lower:]` 会产生相反的效果,将所有大写的部门名称都转换为小写: ``` echo $dept | tr [:upper:] [:lower:] >> depts ``` -同样,你可以使用 **sed** 命令的 **A-Z** 和 **a-z** 字符串完成相同的操作: +同样,你可以使用 `sed` 命令的 `A-Z` 和 `a-z` 字符串完成相同的操作: ``` echo $dept | tr a-z A-Z >> depts ``` -毫无疑问,反转 a-z 和 A-Z 字符串的顺序将产生相反的效果,将文本全部变为小写。 +毫无疑问,反转 `a-z` 和 `A-Z` 字符串的顺序将产生相反的效果,将文本全部变为小写。 ### 使用 awk -**awk** 命令可让你使用它的 **toupper** 和 **tolower** 选项执行相同的操作。上例脚本中的命令可以用这种方式代替: - -[][4] +`awk` 命令可让你使用它的 `toupper` 和 `tolower` 选项执行相同的操作。上例脚本中的命令可以用这种方式代替: ``` echo $dept | awk '{print toupper($0)}' >> depts @@ -67,13 +65,13 @@ echo $dept | awk '{print tolower($0)}' >> depts ### 使用 sed -**sed** (流编辑器)命令也可用于切换大小写。它与上面显示的两个命令中的第一个具有相同的效果。 +`sed`(stream editor)命令也可用于切换大小写。它与上面显示的两个命令中的第一个具有相同的效果。 ``` echo $dept | sed 's/[a-z]/\U&/g' >> depts ``` -从大写字母切换到小写字母只需将行尾附近的 **U** 替换为 **L**。 +从大写字母切换到小写字母只需将行尾附近的 `U` 替换为 `L`。 ``` echo $dept | sed 's/[A-Z]/\L&/g' >> depts @@ -81,7 +79,7 @@ echo $dept | sed 's/[A-Z]/\L&/g' >> depts ### 操作文件中的文本 -**awk** 和 **sed**都能更改整个文件的文本大小写。因此,你发现你的老板需要部门所有名字的小写么?没问题。只需带上文件名运行以下命令: +`awk` 和 `sed` 都能更改整个文件的文本大小写。因此,你发现你的老板需要所有部门名称的小写么?没问题。只需带上文件名运行以下命令: ``` $ awk '{print tolower($0)}' depts @@ -90,22 +88,22 @@ billing bookkeeping ``` -如果要覆盖 **depts** 文件,而不仅仅是以小写形式显示,则需要执行以下操作: +如果要覆盖 `depts` 文件,而不仅仅是以小写形式显示,则需要执行以下操作: ``` $ awk '{print tolower($0)}' depts > depts- $ mv depts- depts ``` -但是,使用 **sed** 进行更改,你可以避免最后一步,因为 **sed** 可以“原地”编辑文件,如下所示,文件完整,但文本全部小写: +但是,使用 `sed` 进行更改,你可以避免最后一步,因为 `sed` 可以“原地”编辑文件,如下所示,文件完整,但文本全部小写: ``` $ sed 's/[A-Z]/\L&/g' depts ``` -### 仅首字母大写 +### 仅将首字母转换为大写 -要仅将字符串中单词的首字母大写,那么可以执行以下操作: +要仅将字符串中单词的首字母转换为大写,那么可以执行以下操作: ``` $ echo design \& engineering| sed -e "s/\b\(.\)/\u\1/g" @@ -118,18 +116,18 @@ Design & Engineering 当要更改文本以使只有首字母大写时,这更具挑战性。假设你正在处理一个工作人员姓名列表,并且希望以正常的“名 姓”方式对其格式化。 -##### 使用 sed +#### 使用 sed -你可以使用更复杂的 **sed** 命令来确保以下结果: +你可以使用更复杂的 `sed` 命令来确保以下结果: ``` $ echo design \& ENGINEERING | sed 's/\b\([[:alpha:]]\)\([[:alpha:]]*\)\b/\u\1\L\2/g' Design & Engineering ``` -##### 使用 python +#### 使用 Python -如果你已安装 python,你可以运行这样的命令,它还可以设置文本格式,以便每个单词只有首字母大写,并且它可能比上面显示的 **sed** 命令更易于解析: +如果你已安装 Python,你可以运行这样的命令,它还可以设置文本格式,以便每个单词只有首字母大写,并且它可能比上面显示的 `sed` 命令更易于解析: ``` $ echo -n "design & engineering" | python3 -c "import sys; print(sys.stdin.read().title())" @@ -138,8 +136,6 @@ Design & Engineering 有多种方法可以在大小写之间更改文本格式。哪种方法效果最好取决于你要处理的是单个字符串还是整个文件,以及想要的最终结果。 -加入 [Facebook][5] 和 [LinkedIn][6] 上的 Network World 社区,评论热门主题。 - -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html @@ -147,15 +143,15 @@ via: https://www.networkworld.com/article/3529409/converting-between-uppercase-a 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ [b]: https://github.com/lujun9972 -[1]: https://www.flickr.com/photos/54027476@N07/4999959929 +[1]:https://images.idgesg.net/images/article/2019/04/alphabetic_letters_characters_language_by_andybrandon50_cc_by-sa_2-0_1500x1000-100794409-large.jpg [2]: https://creativecommons.org/licenses/by-sa/2.0/legalcode [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 \ No newline at end of file +[6]: https://www.linkedin.com/company/network-world From 03e0e6159aa0f0ca221aed9b62ef98aa5c3cb5f6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 11 Mar 2020 10:01:52 +0800 Subject: [PATCH 191/207] PUB @geekpi https://linux.cn/article-11983-1.html --- ...tween uppercase and lowercase on the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200228 Converting between uppercase and lowercase on the Linux command line.md (98%) diff --git a/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md b/published/20200228 Converting between uppercase and lowercase on the Linux command line.md similarity index 98% rename from translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md rename to published/20200228 Converting between uppercase and lowercase on the Linux command line.md index f291e1b619..a90b4d411c 100644 --- a/translated/tech/20200228 Converting between uppercase and lowercase on the Linux command line.md +++ b/published/20200228 Converting between uppercase and lowercase on the Linux command line.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11983-1.html) [#]: subject: (Converting between uppercase and lowercase on the Linux command line) [#]: via: (https://www.networkworld.com/article/3529409/converting-between-uppercase-and-lowercase-on-the-linux-command-line.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From efb1764c028fdcc37003fd290f25c9c3567b9ed0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 11 Mar 2020 15:40:14 +0800 Subject: [PATCH 192/207] APL --- .../20200211 Basic kubectl and Helm commands for beginners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md b/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md index 318fd943f8..3827ee9dff 100644 --- a/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md +++ b/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 27d5cb95724901f919d208028f877790989b6a85 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 11 Mar 2020 17:59:10 +0800 Subject: [PATCH 193/207] TSL --- ...kubectl and Helm commands for beginners.md | 211 ------------------ ...kubectl and Helm commands for beginners.md | 198 ++++++++++++++++ 2 files changed, 198 insertions(+), 211 deletions(-) delete mode 100644 sources/tech/20200211 Basic kubectl and Helm commands for beginners.md create mode 100644 translated/tech/20200211 Basic kubectl and Helm commands for beginners.md diff --git a/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md b/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md deleted file mode 100644 index 3827ee9dff..0000000000 --- a/sources/tech/20200211 Basic kubectl and Helm commands for beginners.md +++ /dev/null @@ -1,211 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Basic kubectl and Helm commands for beginners) -[#]: via: (https://opensource.com/article/20/2/kubectl-helm-commands) -[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) - -Basic kubectl and Helm commands for beginners -====== -Take a trip to the grocery store to shop for the commands you'll need to -get started with these Kubernetes tools. -![A person working.][1] - -Recently, my husband was telling me about an upcoming job interview where he would have to run through some basic commands on a computer. He was anxious about the interview, but the best way for him to learn and remember things has always been to equate the thing he doesn't know to something very familiar to him. Because our conversation happened right after I was roaming the grocery store trying to decide what to cook that evening, it inspired me to write about kubectl and Helm commands by equating them to an ordinary trip to the grocer. - -[Helm][2] is a tool to manage applications within Kubernetes. You can easily deploy charts with your application information, allowing them to be up and preconfigured in minutes within your Kubernetes environment. When you're learning something new, it's always helpful to look at chart examples to see how they are used, so if you have time, take a look at these stable [charts][3]. - -[Kubectl][4] is a command line that interfaces with Kubernetes environments, allowing you to configure and manage your cluster. It does require some configuration to work within environments, so take a look through the [documentation][5] to see what you need to do. - -I'll use namespaces in the examples, which you can learn about in my article [_Kubernetes namespaces for beginners_][6]. - -Now that we have that settled, let's start shopping for basic kubectl and Helm commands! - -### Helm list - -What is the first thing you do before you go to the store? Well, if you're organized, you make a **list**. LIkewise, this is the first basic Helm command I will explain. - -In a Helm-deployed application, **list** provides details about an application's current release. In this example, I have one deployed application—the Jenkins CI/CD application. Running the basic **list** command always brings up the default namespace. Since I don't have anything deployed in the default namespace, nothing shows up: - - -``` -$helm list -NAME    NAMESPACE    REVISION    UPDATED    STATUS    CHART    APP VERSION -``` - -However, if I run the command with an extra flag, my application and information appear: - - -``` -$helm list --all-namespaces -NAME     NAMESPACE  REVISION  UPDATED                   STATUS      CHART           APP  VERSION -jenkins  jenkins        1         2020-01-18 16:18:07 EST   deployed    jenkins-1.9.4   lts -``` - -Finally, I can direct the **list** command to check only the namespace I want information from: - - -``` -$helm list --namespace jenkins -NAME     NAMESPACE  REVISION  UPDATED                   STATUS    CHART          APP VERSION -jenkins    jenkins      1              2020-01-18 16:18:07 EST  deployed  jenkins-1.9.4  lts     -``` - -Now that I have a list and know what is on it, I can go and get my items with **get** commands! I'll start with the Kubernetes cluster; what can I get from it? - -### Kubectl get - -The **kubectl get** command gives information about many things in Kubernetes, including pods, nodes, and namespaces. Again, without a namespace flag, you'll always land in the default. First, I'll get the namespaces in the cluster to see what's running: - - -``` -$kubectl get namespaces -NAME             STATUS   AGE -default          Active   53m -jenkins          Active   44m -kube-node-lease  Active   53m -kube-public      Active   53m -kube-system      Active   53m -``` - -Now that I have the namespaces running in my environment, I'll get the nodes and see how many are running: - - -``` -$kubectl get nodes -NAME       STATUS   ROLES       AGE   VERSION -minikube   Ready    master  55m   v1.16.2 -``` - -I have one node up and running, mainly because my Minikube is running on one small server. To get the pods running on my one node: - - -``` -$kubectl get pods -No resources found in default namespace. -``` - -Oops, it's empty. I'll get what's in my Jenkins namespace with: - - -``` -$kubectl get pods --namespace jenkins -NAME                      READY  STATUS   RESTARTS  AGE -jenkins-7fc688c874-mh7gv  1/1    Running  0         40m -``` - -Good news! There's one pod, it hasn't restarted, and it has been running for 40 minutes. Well, since I know the pod is up, I want to see what I can get from Helm. - -### Helm get - -**Helm get** is a little more complicated because this **get** command requires more than an application name, and you can request multiple things from applications. I'll begin by getting the values used to make the application, and then I'll show a snip of the **get all** action, which provides all the data related to the application. - - -``` -$helm get values jenkins -n jenkins -USER-SUPPLIED VALUES: -null -``` - -Since I did a very minimal stable-only install, the configuration didn't change. If I run the **all** command, I get everything out of the chart: - - -``` -`$helm get all jenkins -n jenkins` -``` - -![output from helm get all command][7] - -This produces a ton of data, so I always recommend keeping a copy of a Helm chart so you can look over the templates in the chart. I also create my own values to see what I have in place. - -Now that I have all my goodies in my shopping cart, I'll check the labels that **describe** what's in them. These examples pertain only to kubectl, and they describe what I've deployed through Helm. - -### Kubectl describe - -As I did with the **get** command, which can describe just about anything in Kubernetes, I'll limit my examples to namespaces, pods, and nodes. Since I know I'm working with one of each, this will be easy. - - -``` -$kubectl describe ns jenkins -Name:           jenkins -Labels:         <none> -Annotations:  <none> -Status:         Active -No resource quota. -No resource limits. -``` - -I can see my namespace's name and that it is active and has no resource nor quote limits. - -The **describe pods** command produces a large amount of information, so I'll provide a small snip of the output. If you run the command without the pod name, it will return information for all of the pods in the namespace, which can be overwhelming. So, be sure you always include the pod name with this command. For example: - - -``` -`$kubectl describe pods jenkins-7fc688c874-mh7gv --namespace jenkins` -``` - -![output of kubectl-describe-pods][8] - -This provides (among many other things) the status of the container, how the container is managed, the label, and the image used in the pod. The data not in this abbreviated output includes resource requests and limits along with any conditions, init containers, and storage volume information applied in a Helm values file. This data is useful if your application is crashing due to inadequate resources, a configured init container that runs a prescript for configuration, or generated hidden passwords that shouldn't be in a plain text YAML file. - -Finally, I'll use **describe node**, which (of course) describes the node. Since this example has just one, named Minikube, that is what I'll use; if you have multiple nodes in your environment, you must include the node name of interest. - -As with pods, the node command produces an abundance of data, so I'll include just a snip of the output. - - -``` -`$kubectl describe node minikube` -``` - -![output of kubectl describe node][9] - -Note that **describe node** is one of the more important basic commands. As this image shows, the command returns statistics that indicate when the node is running out of resources, and this data is excellent for alerting you when you need to scale up (if you do not have autoscaling in your environment). Other things not in this snippet of output include the percentages of requests made for all resources and limits, as well as the age and allocation of resources (e.g., for my application). - -### Checking out - -With these commands, I've finished my shopping and gotten everything I was looking for. Hopefully, these basic commands can help you, too, in your day-to-day with Kubernetes. - -I urge you to work with the command line often and learn the shorthand flags available in the Help sections, which you can access by running these commands: - - -``` -`$helm --help` -``` - -and - - -``` -`$kubectl -h` -``` - -### Peanut butter and jelly - -Some things just go together like peanut butter and jelly. Helm and kubectl are a little like that. - -I often use these tools in my environment. Because they have many similarities in a ton of places, after using one, I usually need to follow up with the other. For example, I can do a Helm deployment and watch it fail using kubectl. Try them together, and see what they can do for you. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/kubectl-helm-commands - -作者:[Jessica Cherry][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jrepka -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) -[2]: https://helm.sh/ -[3]: https://github.com/helm/charts/tree/master/stable -[4]: https://kubernetes.io/docs/reference/kubectl/kubectl/ -[5]: https://kubernetes.io/docs/reference/kubectl/overview/ -[6]: https://opensource.com/article/19/12/kubernetes-namespaces -[7]: https://opensource.com/sites/default/files/uploads/helm-get-all.png (output from helm get all command) -[8]: https://opensource.com/sites/default/files/uploads/kubectl-describe-pods.png (output of kubectl-describe-pods) -[9]: https://opensource.com/sites/default/files/uploads/kubectl-describe-node.png (output of kubectl describe node) diff --git a/translated/tech/20200211 Basic kubectl and Helm commands for beginners.md b/translated/tech/20200211 Basic kubectl and Helm commands for beginners.md new file mode 100644 index 0000000000..555c36b142 --- /dev/null +++ b/translated/tech/20200211 Basic kubectl and Helm commands for beginners.md @@ -0,0 +1,198 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Basic kubectl and Helm commands for beginners) +[#]: via: (https://opensource.com/article/20/2/kubectl-helm-commands) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +适用于初学者的基本 kubectl 和 Helm 命令 +====== + +> 像去杂货店购物一样,你需要用这些命令入门 Kubernetes。 + +![A person working.][1] + +最近,我丈夫告诉我他即将要去参加一个工作面试,面试时他需要在计算机上运行一些基本命令。他对这场面试感到焦虑,但是对于他来说,学习和记住事情的最好方法是将不了解的事物比喻为非常熟悉的事物。因为我们的谈话是在我逛杂货店试图决定当晚要烹饪的食物之后进行的,所以这启发我用一次去杂货店的行程来描述 `kubectl` 和 `helm` 命令。 + +[Helm][2](“舵轮”)是在 Kubernetes(来自希腊语,意思是“舵手” 或 “领航员”)中管理应用程序的工具。你可以轻松地使用你的应用程序信息来部署“海图chart”,从而可以在你的 Kubernetes 环境中几分钟之内让它们就绪并预配置好。在学习新知识时,查看示例的“海图”以了解其用法总是很有帮助的,因此,如果有时间,请查看这些稳定版的“[海图][3]”。 + +[kubectl][4] 是与 Kubernetes 环境的命令行界面,允许你配置和管理集群。它需要一些配置才能在环境中工作,因此请仔细阅读其[文档][5]以了解你需要做什么。 + +我将在示例中使用命名空间,你可以在我的文章《[Kubernetes 命名空间入门][6]》中了解它。 + +现在我们已经准备好了,让我们开始 `kubectl`和 `helm` 基本命令的购物之旅! + +### 用 Helm 列出清单 + +你去商店之前要做的第一件事是什么?好吧,如果你做事有条理,就可以创建一个“清单”。同样,这是我将解释的第一个基本的 Helm 命令。 + +在一个用 Helm 部署的应用程序中,`list` 命令提供有关应用程序当前版本的详细信息。在此示例中,我有一个已部署的应用程序:Jenkins CI/CD 应用程序。运行基本的 `list` 命令总是会显示默认的命名空间。由于我没有在默认的命名空间中部署任何内容,因此不会显示任何内容: + +``` +$helm list +NAME    NAMESPACE    REVISION    UPDATED    STATUS    CHART    APP VERSION +``` + +但是,如果运行带有额外标志的命令,则会显示我的应用程序和信息: + +``` +$helm list --all-namespaces +NAME     NAMESPACE  REVISION  UPDATED                   STATUS      CHART           APP  VERSION +jenkins  jenkins        1         2020-01-18 16:18:07 EST   deployed    jenkins-1.9.4   lts +``` + +最后,我可以指示 `list` 命令只检查我想从中获取信息的命名空间: + +``` +$helm list --namespace jenkins +NAME     NAMESPACE  REVISION  UPDATED                   STATUS    CHART          APP VERSION +jenkins    jenkins      1              2020-01-18 16:18:07 EST  deployed  jenkins-1.9.4  lts     +``` + +现在我有了一个清单,并且知道该清单上有什么,我可以使用 `get` 命令来“获取”我的物品!我将从 Kubernetes 集群开始,我能从中获取到什么? + +### 用 Kubectl 获取物品 + +`kubectl get` 命令提供有关 Kubernetes 中许多事物的信息,包括“吊舱Pod”、节点和命名空间。同样,没有指定命名空间标志,你就会使用默认的命名空间。首先,我获取集群中的命名空间以查看正在运行的命名空间: + +``` +$kubectl get namespaces +NAME             STATUS   AGE +default          Active   53m +jenkins          Active   44m +kube-node-lease  Active   53m +kube-public      Active   53m +kube-system      Active   53m +``` + +现在我已经知道了在我的环境中运行的命名空间了,接下来将获取节点并查看有多少个正在运行: + +``` +$kubectl get nodes +NAME       STATUS   ROLES       AGE   VERSION +minikube   Ready    master  55m   v1.16.2 +``` + +我有一个节点正在运行,这主要是因为我的 Minikube 运行在一台小型服务器上。要得到在我的这一个节点上运行的“吊舱”: + +``` +$kubectl get pods +No resources found in default namespace. +``` + +啊哦,它是空的。我将通过以下方式获取 Jenkins 命名空间中的内容: + +``` +$kubectl get pods --namespace jenkins +NAME                      READY  STATUS   RESTARTS  AGE +jenkins-7fc688c874-mh7gv  1/1    Running  0         40m +``` + +好消息!这里有个“吊舱”,它还没有重新启动过,已运行了 40 分钟了。好的,我知道“吊舱”已经装好,所以我想看看用 Helm 命令可以得到什么。 + +### 用 Helm 获取信息 + +`helm get` 稍微复杂一点,因为这个“获取”命令所需要的不仅仅是一个应用程序名称,而且你可以从应用程序中请求多个内容。我将从获取用于制作应用程序的值开始,然后展示“获取全部”的操作结果的片段,该操作将提供与该应用程序相关的所有数据。 + +``` +$helm get values jenkins -n jenkins +USER-SUPPLIED VALUES: +null +``` + +由于我最小限度的只安装了稳定版,因此配置没有更改。如果我运行“获取全部”命令,我将得到所有“海图”: + +``` +$helm get all jenkins -n jenkins +``` + +![output from helm get all command][7] + +这会产生大量数据,因此我始终建议保留一份 Helm “海图”的副本,以便你可以查看“海图”中的模板。我还创建自己的值来了解自己所拥有的。 + +现在,我把所有的商品都放在购物车中了,我会检查一下“描述”它们包含什么的标签。这些示例仅与 `kubectl` 命令有关,它们描述了我通过 Helm 部署的内容。 + +### 用 kubectl 查看描述 + +正如我使用“获取”命令(该命令可以描述 Kubernetes 中的几乎所有内容)所做的那样,我将示例限制定命名空间、“吊舱”和节点上。由于我知道它们每一个是什么,因此这很容易。 + +``` +$kubectl describe ns jenkins +Name:           jenkins +Labels:         <none> +Annotations:  <none> +Status:         Active +No resource quota. +No resource limits. +``` + +我可以看到我的命名空间的名称,并且它是活动的,没有资源或限额限制。 + +`describe pods` 命令会产生大量信息,因此我将提供一小段输出。如果你在不使用“吊舱”名称的情况下运行该命令,它将返回名称空间中所有“吊舱”的信息,这可能会很麻烦。因此,请确保在此命令中始终包含“吊舱”名称。例如: + +``` +$kubectl describe pods jenkins-7fc688c874-mh7gv --namespace jenkins +``` + +![output of kubectl-describe-pods][8] + +这提供容器的状态、管理方式、标签以及“吊舱”中使用的镜像(还有很多其他信息)。不在这个简化过的输出中的数据包括资源请求和限制以及在 Helm 配置值文件中应用的任何条件、初始化容器和存储卷信息。如果你的应用程序由于资源不足而崩溃,或者是运行前置脚本进行配置的已初始化配置的容器,或者生成不应该存在于纯文本 YAML 文件中的隐藏密码,则此数据很有用。 + +最后,我将使用 `describe node` 命令,当然,它是用来描述节点的。由于本示例只有一个名为 Minikube 的示例,因此我将使用这个名字。如果你的环境中有多个节点,则必须包含你想查找的的节点名称。 + +与“吊舱”一样,这个节点的命令会产生大量数据,因此我将仅包括输出片段。 + +``` +$kubectl describe node minikube +``` + +![output of kubectl describe node][9] + +注意,`describe node` 是更重要的基本命令之一。如此图所示,该命令返回统计信息,该信息指示节点何时资源用尽,并且该数据非常适合在需要扩展时(如果你的环境中没有自动扩展)向你发出警报。此输出片段中未包含的其他内容包括对所有资源和限制的请求所占的百分比,以及资源的使用期限和分配(例如,对于我的应用程序而言)。 + +### 买单 + +使用这些命令,我完成了购物并得到了我想要的一切。希望这些基本命令也能在你使用 Kubernetes 的日常工作中提供帮助。 + +我鼓励你经常使用命令行并学习“帮助”部分中的速记标志,你可以通过运行以下命令来查看这些标志: + +``` +$helm --help +``` + +或 + +``` +$kubectl -h +``` + +### 花生酱和果冻 + +有些东西像花生酱和果冻一样混在一起。Helm 和 `kubectl` 就有点像那样。 + +我经常在自己的环境中使用这些工具。因为它们在很多地方都有很多相似之处,所以在使用其中一个之后,我通常需要跟进另一个。例如,我可以进行 Helm 部署,并使用 `kubectl` 观察它是否失败。一起试试它们,看看它们能为你做什么。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/kubectl-helm-commands + +作者:[Jessica Cherry][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/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) +[2]: https://helm.sh/ +[3]: https://github.com/helm/charts/tree/master/stable +[4]: https://kubernetes.io/docs/reference/kubectl/kubectl/ +[5]: https://kubernetes.io/docs/reference/kubectl/overview/ +[6]: https://linux.cn/article-11749-1.html +[7]: https://opensource.com/sites/default/files/uploads/helm-get-all.png (output from helm get all command) +[8]: https://opensource.com/sites/default/files/uploads/kubectl-describe-pods.png (output of kubectl-describe-pods) +[9]: https://opensource.com/sites/default/files/uploads/kubectl-describe-node.png (output of kubectl describe node) From a9ee27a9bf14265fbf3aebc691c39385ecacac3d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Mar 2020 00:55:08 +0800 Subject: [PATCH 194/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200311=20Using?= =?UTF-8?q?=20the=20Quarkus=20Framework=20on=20Fedora=20Silverblue=20?= =?UTF-8?q?=E2=80=93=20Just=20a=20Quick=20Look?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200311 Using the Quarkus Framework on Fedora Silverblue - Just a Quick Look.md --- ...n Fedora Silverblue - Just a Quick Look.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20200311 Using the Quarkus Framework on Fedora Silverblue - Just a Quick Look.md diff --git a/sources/tech/20200311 Using the Quarkus Framework on Fedora Silverblue - Just a Quick Look.md b/sources/tech/20200311 Using the Quarkus Framework on Fedora Silverblue - Just a Quick Look.md new file mode 100644 index 0000000000..1d72cd1d03 --- /dev/null +++ b/sources/tech/20200311 Using the Quarkus Framework on Fedora Silverblue - Just a Quick Look.md @@ -0,0 +1,209 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using the Quarkus Framework on Fedora Silverblue – Just a Quick Look) +[#]: via: (https://fedoramagazine.org/using-the-quarkus-framework-on-fedora-silverblue-just-a-quick-look/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +Using the Quarkus Framework on Fedora Silverblue – Just a Quick Look +====== + +![Using the Quarkus Framework on Fedora Silverblue – Just a Quick Look][1] + +[Quarkus][2] is a framework for Java development that is described on their web site as: + +> A Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM, crafted from the best of breed Java libraries and standards +> +> – Feb. 5, 2020 + +Silverblue — a Fedora Workstation variant with a container based workflow central to its functionality — should be an ideal host system for the Quarkus framework. + +There are currently two ways to use Quarkus with Silverblue. It can be run in a pet container such as Toolbox/Coretoolbox. Or it can be run directly in a terminal emulator. This article will focus on the latter method. + +### Why Quarkus + +[According to Quarkus.io][3]: “Quarkus has been designed around a containers first philosophy. What this means in real terms is that Quarkus is optimized for low memory usage and fast startup times.” To achieve this, they employ first class support for Graal/Substrate VM, build time Metadata processing, reduction in reflection usage, and native image preboot. For details about why this matters, read [Container First][3] at Quarkus. + +### Prerequisites + +A few prerequisites will need to configured before you can start using Quarkus. First, you need an IDE of your choice. Any of the popular ones will do. VIM or Emacs will work as well. The Quarkus site provides full details on how to set up the three major Java IDE’s (Eclipse, Intellij Idea, and Apache Netbeans). You will need a version of JDK installed. JDK 8, JDK 11 or any distribution of OpenJDK is fine. GrallVM 19.2.1 or 19.3.1 is needed for compiling down to native. You will also need Apache Maven 3.53+ or Gradle. This article will use Maven because that is what the author is more familiar with. Use the following command to layer Java 11 OpenJDK and Maven onto Silverblue: + +``` +$ rpm-ostree install java-11-openjdk* maven +``` + +Alternatively, you can download your favorite version of Java and install it directly in your home directory. + +After rebooting, configure your _JAVA_HOME_ and _PATH_ environment variables to reference the new applications. Next, go to the [GraalVM download page][4], and get GraalVM version 19.2.1 or version 19.3.1 for Java 11 OpenJDK. Install Graal as per the instructions provided. Basically, copy and decompress the archive into a directory under your home directory, then modify the _PATH_ environment variable to include Graal. You use it as you would any JDK. So you can set it up as a platform in the IDE of your choice. Now is the time to setup the native image if you are going to use one. For more details on setting up your system to use Quarkus and the Quarkus native image, check out their [Getting Started tutorial][5]. With these parts installed and the environment setup, you can now try out Quarkus. + +### Bootstrapping + +Quarkus recommends you create a project using the bootstrapping method. Below are some example commands entered into a terminal emulator in the Gnome shell on Silverblue. + +``` +$ mvn io.quarkus:quarkus-maven-plugin:1.2.1.Final:create \ + -DprojectGroupId=org.jakfrost \ + -DprojectArtifactId=silverblue-logo \ + -DclassName="org.jakfrost.quickstart.GreetingResource" \ + -Dpath="/hello" +$ cd silverblue-logo +``` + +The bootstrapping process shown above will create a project under the current directory with the name _silverblue-logo_. After this completes, start the application in development mode: + +``` +$ ./mvnw compile quarkus:dev +``` + +With the application running, check whether it responds as expected by issuing the following command: + +``` +$ curl -w '\n' http://localhost:8080/hello +``` + +The above command should print _hello_ on the next line. Alternatively, test the application by browsing to __ with your web browser. You should see the same lonely _hello_ on an otherwise empty page. Leave the application running for the next section. + +### Injection + +Open the project in your favorite IDE. If you are using Netbeans, simply open the project directory where the _pom.xml_ file resides. Now would be a good time to have a look at the _pom.xml_ file. + +Quarkus uses ArC for its dependency injection. ArC is a dependency of quarkus-resteasy, so it is already part of the core Quarkus installation. Add a companion bean to the project by creating a java class in your IDE called _GreetingService.java_. Then put the following code into it: + +``` +import javax.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class GreetingService { + + public String greeting(String name) { + return "hello " + name; + } + +} +``` + +The above code is a verbatim copy of what is used in the injection example in the Quarkus Getting Started tutorial. Modify _GreetingResource.java_ by adding the following lines of code: + +``` +import javax.inject.Inject; +import org.jboss.resteasy.annotations.jaxrs.PathParam; + +@Inject + GreetingService service;//inject the service + + @GET //add a getter to use the injected service + @Produces(MediaType.TEXT_PLAIN) + @Path("/greeting/{name}") + public String greeting(@PathParam String name) { + return service.greeting(name); + } +``` + +If you haven’t stopped the application, it will be easy to see the effect of your changes. Just enter the following _curl_ command: + +``` +$ curl -w '\n' http://localhost:8080/hello/greeting/Silverblue +``` + +The above command should print _hello Silverblue_ on the following line. The URL should work similarly in a web browser. There are two important things to note: + + 1. The application was running and Quarkus detected the file changes on the fly. + 2. The injection of code into the app was very easy to perform. + + + +### The native image + +Next, package your application as a native image that will work in a _podman_ container. Exit the application by pressing **CTRL-C**. Then use the following command to package it: + +``` +$ ./mvnw package -Pnative -Dquarkus.native.container-runtime=podman +``` + +Now, build the container: + +``` +$ podman build -f src/main/docker/Dockerfile.native -t silverblue-logo/silverblue-logo +``` + +Now run it with the following: + +``` +$ podman run -i --rm -p 8080:8080 localhost/silverblue-logo/silverblue-logo +``` + +To get the container build to successfully complete, it was necessary to copy the _/target_ directory and contents into the _src/main/docker/_ directory. Investigation as to the reason why is still required, and though the solution used was quick and easy, it is not an acceptable way to solve the problem. + +Now that you have the container running with the application inside, you can use the same methods as before to verify that it is working. + +Point your browser to the URL and you should get a _index.html_ that is automatically generated by Quarkus every time you create or modify an application. It resides in the _src/main/resources/META-INF/resources/_ directory. Drop other HTML files in this _resources_ directory to have Quarkus serve them on request. + +For example, create a file named _logo.html_ in the _resources_ directory containing the below markup: + +``` + + + + + Silverblue + + + + +
+ Fedora Silverblue +
+ + +``` + +Next, save the below image alongside the _logo.html_ file with the name _fedora-silverblue-logo.png_: + +![][6] + +Now view the results at . + +#### Testing your application + +Quarkus supports junit 5 tests. Look at your project’s _pom.xml_ file. In it you should see two test dependencies. The generated project will contain a simple test, named _GreetingResourceTest.java_. Testing for the native file is only supported in _prod_ mode. However, you can test the _jar_ file in _dev_ mode. These tests are RestAssured, but you can use whatever test library you wish with Quarkus. Use Maven to run the tests: + +``` +$ ./mvnw test +``` + +More details can be found in the Quarkus [Getting Started][7] tutorial. + +#### Further reading and tutorials + +Quarkus has an extensive collection of [tutorials and guides][8]. They are well worth the time to delve into the breadth of this microservices framework. + +Quarkus also maintains a [publications][9] page that lists some very interesting articles on actual use cases of Quarkus. This article has only just scratched the surface of the topic. If what was presented here has piqued your interest, then follow the above links for more information. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-the-quarkus-framework-on-fedora-silverblue-just-a-quick-look/ + +作者:[Stephen Snow][a] +选题:[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/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/02/quarkus-816x345.jpg +[2]: https://quarkus.io/ +[3]: https://quarkus.io/vision/container-first +[4]: https://www.graalvm.org/downloads/ +[5]: https://quarkus.io/get-started/ +[6]: https://fedoramagazine.org/wp-content/uploads/2020/02/fedora-silverblue-logo.png +[7]: https://quarkus.io/guides/getting-started +[8]: https://quarkus.io/guides/ +[9]: https://quarkus.io/publications/ From 1638a0f5240e00d8e499dd3de3298f598bc63420 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Mar 2020 01:01:19 +0800 Subject: [PATCH 195/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200312=20Amazon?= =?UTF-8?q?=20Has=20Launched=20Its=20Own=20Linux=20Distribution=20But=20It?= =?UTF-8?q?=E2=80=99s=20Not=20for=20Everyone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md --- ... Distribution But It-s Not for Everyone.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md diff --git a/sources/tech/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md b/sources/tech/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md new file mode 100644 index 0000000000..4e2c42ba52 --- /dev/null +++ b/sources/tech/20200312 Amazon Has Launched Its Own Linux Distribution But It-s Not for Everyone.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Amazon Has Launched Its Own Linux Distribution But It’s Not for Everyone) +[#]: via: (https://itsfoss.com/bottlerocket-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Amazon Has Launched Its Own Linux Distribution But It’s Not for Everyone +====== + +Amazon has [launched][1] its own Linux-based open source operating system, Bottlerocket. + +Before you get too excited and try to install and run it, I must tell you that it’s not your regular Linux distribution like Ubuntu, Fedora or Debian. What is it then? + +### Bottlerocket: Linux distribution from Amazon for running containers + +![][2] + +If you are not aware of containers in Linux, I recommend reading [this article][3] from Red Hat. + +A lot has changed in the IT industry since the term cloud computing was first coined. It takes few seconds to deploy a Linux server (usually running in a VM) thanks to cloud server providers like Amazon AWS, Google, [Linode][4], Digital Ocean etc. On top of that, you can deploy applications and services on these servers in form of containers thanks to tools like Docker and Kubernetes. + +The thing is that when your sole purpose is to run containers on a Linux system, a full-fledged Linux distribution is not always required. This is why there are container specific Linux that provide only the necessary packages. This reduces the size of the operating system drastically which further reduces the deployment time. + +**[Bottlerocket][5] Linux is purpose-built by Amazon Web Services for running containers on virtual machines or bare metal hosts.** It supports docker images and other images that follow the [OCI image][6] format. + +### Features of Bottlerocket Linux + +![][7] + +Here’s what this new Linux distribution from Amazon offers: + +#### No package-by-package updates + +The traditional Linux distribution update procedure is composed of updating individual packages. Bottlerocket uses image-based updates instead. + +Thanks to this approach, conflicts and breakage are avoided with the possibility of a rapid and complete rollback (if necessary). + +#### Read-only file system + +Bottlerocket also uses a primarily read-only file system. Its integrity is checked at boot time via dm-verity. For additional security measures, SSH access is also discouraged and is only available through the [admin container][8] (additional mechanism). + +AWS already rules the cloud world and with it + +#### Automated updates + +You can automate updates to Bottlerocket by using an orchestration service like Amazon EKS. + +Amazon also claims that including only the essential software to run containers reduces the attack surface compared to general purpose Linux distributions. + +### What do you think? + +Amazon is not the first to create a ‘container specific Linux’. I think CoreOS was among the first such distributions. [CoreOS was acquired by Red Hat][9] which itself was [sold to IBM][10]. Red Hat recently discontinued CoreOS and replaced it with [Fedora CoreOS][11]. + +Cloud server is a big industry that will continue to grow bigger. A giant like Amazon will do everything to stay at par or ahead with its competitors. In my opinion, Bottlerocket is an answer to (now) IBM’s Fedora CoreOS. + +Though [Bottlerocket repositories are available on GitHub][12], I could not find any ready to image yet. At the moment of writing this article, it is only [available as a preview on AWS][5]. + +What are your views on it? What does Amazon gain with Bottlerocket? If you used something like CoreOS before, will you switch to Bottlerocket? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/bottlerocket-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://aws.amazon.com/blogs/aws/bottlerocket-open-source-os-for-container-hosting/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/botlerocket-logo.png?ssl=1 +[3]: https://www.redhat.com/en/topics/containers/whats-a-linux-container +[4]: https://www.linode.com/ +[5]: https://aws.amazon.com/bottlerocket/ +[6]: https://www.opencontainers.org/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/BottleRocket.png?ssl=1 +[8]: https://github.com/bottlerocket-os/bottlerocket-admin-container +[9]: https://itsfoss.com/red-hat-acquires-coreos/ +[10]: https://itsfoss.com/ibm-red-hat-acquisition/ +[11]: https://getfedora.org/en/coreos/ +[12]: https://github.com/bottlerocket-os/bottlerocket From ac7dbce9ebaea74eb5735615bfa7eaa889b8db9f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Mar 2020 01:03:08 +0800 Subject: [PATCH 196/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200311=20Direct?= =?UTF-8?q?ing=20Kubernetes=20traffic=20with=20Traefik?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200311 Directing Kubernetes traffic with Traefik.md --- ...recting Kubernetes traffic with Traefik.md | 394 ++++++++++++++++++ 1 file changed, 394 insertions(+) create mode 100644 sources/tech/20200311 Directing Kubernetes traffic with Traefik.md diff --git a/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md b/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md new file mode 100644 index 0000000000..76a457be59 --- /dev/null +++ b/sources/tech/20200311 Directing Kubernetes traffic with Traefik.md @@ -0,0 +1,394 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Directing Kubernetes traffic with Traefik) +[#]: via: (https://opensource.com/article/20/3/kubernetes-traefik) +[#]: author: (Lee Carpenter https://opensource.com/users/carpie) + +Directing Kubernetes traffic with Traefik +====== +A step-by-step walkthrough on ingressing traffic into a +Kubernetes-Raspberry Pi cluster. +![Digital creative of a browser on the internet][1] + +In this article, we will deploy a couple of simple websites and learn how to ingress traffic from the outside world into our cluster using Traefik. After that, we will learn how to remove Kubernetes resources as well. Let’s get started! + +### Materials needed + +To follow along with the article, you only need [the k3s Raspberry Pi cluster][2] we built in a previous article. Since your cluster will be pulling images from the web, the cluster will need to be able to access the internet. + +Some configuration files and sample HTML files will be shown in this article for explanation purposes. All sample files can be downloaded [here][3]. + +### Deploying a simple website + +Previously, we did a direct deploy with **kubectl**. This is not the typical way to deploy things, however. Generally, YAML configuration files are used, and that is what we will use in this article. We will start at the top and create our configuration files in a top-down approach. + +### Deployment configuration + +First up is the deployment configuration. The configuration is shown below, and the explanation follows. I typically use the samples from the [Kubernetes documentation][4] as a starting point and then modify them to suit my needs. For example, the configuration below was modified after copying the sample from the [deployment docs][5]. + +Create a file, **mysite.yaml**, with the following contents: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: mysite-nginx +  labels: +    app: mysite-nginx +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: mysite-nginx +  template: +    metadata: +      labels: +        app: mysite-nginx +    spec: +      containers: +      - name: nginx +        image: nginx +        ports: +        - containerPort: 80 +``` + +Most of this is boilerplate. The important parts, we have named our deployment **mysite-nginx** with an **app** label of **mysite-nginx **as well. We have specified that we want one **replica** which means there will only be one pod created. We also specified **one container**, which we named **nginx**. We specified the **image** to be **nginx**. This means, on deployment, k3s will download the **nginx** image from DockerHub and create a pod from it. Finally, we specified a **containerPort** of **80**, which just means that inside the container the pod will listen on port **80**. + +I emphasized "inside the container" above because it is an important distinction. As we have the container configured, it is only accessible inside the container, and it is further restricted to an internal network. This is necessary to allow multiple containers to listen on the same container ports. In other words, with this configuration, some other pod could listen on its container port 80 as well and not conflict with this one. To provide formal access to this pod, we need a **service** configuration. + +### Service configuration + +In Kubernetes, a **service** is an abstraction. It provides a means to access a pod or set of pods. One connects to the service and the service routes to a single pod or load balances to multiple pods if multiple pod replicas are defined. + +The service can be specified in the same configuration file, and that is what we will do here. Separate configuration areas with **`---`**. Add the following to **mysite.yaml**: + + +``` +\--- +apiVersion: v1 +kind: Service +metadata: +  name: mysite-nginx-service +spec: +  selector: +    app: mysite-nginx +  ports: +    - protocol: TCP +      port: 80 +``` + +In this configuration, we have named our service **mysite-nginx-service**. We provided a `selector` of **app: mysite-nginx**. This is how the service chooses the application containers it routes to. Remember, we provided an **app** label for our container as **mysite-nginx**. This is what the service will use to find our container. Finally, we specified that the service protocol is **TCP** and the service listens on port **80**. + +### Ingress configuration + +The ingress configuration specifies how to get traffic from outside our cluster to services inside our cluster. Remember, k3s comes pre-configured with Traefik as an ingress controller. Therefore, we will write our ingress configuration specific to Traefik. Add the following to **mysite.yaml **( and don’t forget to separate with **`---`**): + + +``` +\--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: +  name: mysite-nginx-ingress +  annotations: +    kubernetes.io/ingress.class: "traefik" +spec: +  rules: +  - http: +      paths: +      - path: / +        backend: +          serviceName: mysite-nginx-service +          servicePort: 80 +``` + +In this configuration, we have named the ingress record **mysite-nginx-ingress**. And we told Kubernetes that we expect **traefik** to be our ingress controller with the **kubernetes.io/ingress.class** annotation. + +In the **rules** section, we are basically saying, when **http** traffic comes in, and the **path** matches **`/`** (or anything below that), route it to the **backend** service specified by the **serviceName mysite-nginx-service**, and route it to **servicePort 80**. This connects incoming HTTP traffic to the service we defined earlier. + +### Something to deploy + +That is really it as far as configuration goes. If we deployed now, we would get the default **nginx** page, but that is not what we want. Let’s create something simple but custom to deploy. Create the file **index.html** with the following contents: + + +``` +<html> +<head><title>K3S!</title> +  <style> +    html { +      font-size: 62.5%; +    } +    body { +      font-family: sans-serif; +      background-color: midnightblue; +      color: white; +      display: flex; +      flex-direction: column; +      justify-content: center; +      height: 100vh; +    } +    div { +      text-align: center; +      font-size: 8rem; +      text-shadow: 3px 3px 4px dimgrey; +    } +  </style> +</head> +<body> +  <div>Hello from K3S!</div> +</body> +</html> +``` + +We have not yet covered storage mechanisms in Kubernetes, so we are going to cheat a bit and just store this file in a Kubernetes config map. This is not the recommended way to deploy a website, but it will work for our purposes. Run the following: + + +``` +`kubectl create configmap mysite-html --from-file index.html` +``` + +This command creates a `configmap` resource named **mysite-html** from the local file **index.html**. This essentially stores a file (or set of files) inside a Kubernetes resource that we can call out in configuration. It is typically used to store configuration files (hence the name), so we are abusing it a bit here. In a later article, we will discuss proper storage solutions in Kubernetes. + +With the config map created, let’s mount it inside our **nginx** container. We do this in two steps. First, we need to specify a **volume**, calling out the config map. Then we need to mount the volume into the **nginx** container. Complete the first step by adding the following under the **spec** label, just after **containers** in **mysite.yaml**: + + +``` +      volumes: +      - name: html-volume +        configMap: +          name: mysite-html +``` + +This tells Kubernetes that we want to define a **volume**, with the name **html-volume** and that volume should contain the contents of the **configMap** named **html-volume** (which we created in the previous step). + +Next, in the **nginx** container specification, just under **ports**, add the following: + + +``` +        volumeMounts: +        - name: html-volume +          mountPath: /usr/share/nginx/html +``` + +This tells Kubernetes, for the **nginx** container, we want to mount a **volume** named **html-volume** at the path (in the container) **/usr/share/nginx/html**. Why **/usr/share/nginx/html**? That is where the **nginx** image serves HTML from. By mounting our volume at that path, we have replaced the default contents with our volume contents. + +For reference, the **deployment** section of the configuration file should now look like this: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: mysite-nginx +  labels: +    app: mysite-nginx +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: mysite-nginx +  template: +    metadata: +      labels: +        app: mysite-nginx +    spec: +      containers: +      - name: nginx +        image: nginx +        ports: +        - containerPort: 80 +        volumeMounts: +        - name: html-volume +          mountPath: /usr/share/nginx/html +      volumes: +      - name: html-volume +        configMap: +          name: mysite-html +``` + +### Deploy it! + +Now we are ready to deploy! We can do that with: + + +``` +`kubectl apply -f mysite.yaml` +``` + +You should see something similar to the following: + + +``` +deployment.apps/mysite-nginx created +service/mysite-nginx-service created +ingress.networking.k8s.io/mysite-nginx-ingress created +``` + +This means that Kubernetes created resources for each of the three configurations we specified. Check on the status of the pods with: + + +``` +`kubectl get pods` +``` + +If you see a status of **ContainerCreating**, give it some time and run **kubectl get pods** again. Typically, the first time, it will take a while because k3s has to download the **nginx** image to create the pod. After a while, you should get a status of **Running**. + +### Try it! + +Once the pod is running, it is time to try it. Open up a browser and type **kmaster** into the address bar. + +![][6] + +Congratulations! You’ve deployed a website on your k3s cluster! + +### Another one + +So now we have a whole k3s cluster running a single website. But we can do more! What if we have another website we want to serve on the same cluster? Let’s see how to do that. + +Again, we need something to deploy. It just so happens that my dog has a message she has wanted the world to know for some time. So, I crafted some HTML just for her (available from the samples zip file). Again, we will use the config map trick to host our HTML. This time we are going to poke a whole directory (the **html** directory) into a config map, but the invocation is the same. + + +``` +`kubectl create configmap mydog-html --from-file html` +``` + +Now we need to create a configuration file for this site. It is almost exactly the same as the one for **mysite.yaml**, so start by copying **mysite.yaml** to **mydog.yaml**. Now edit **mydog.yaml** to be: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: mydog-nginx +  labels: +    app: mydog-nginx +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: mydog-nginx +  template: +    metadata: +      labels: +        app: mydog-nginx +    spec: +      containers: +      - name: nginx +        image: nginx +        ports: +        - containerPort: 80 +        volumeMounts: +        - name: html-volume +          mountPath: /usr/share/nginx/html +      volumes: +      - name: html-volume +        configMap: +          name: mydog-html +\--- +apiVersion: v1 +kind: Service +metadata: +  name: mydog-nginx-service +spec: +  selector: +    app: mydog-nginx +  ports: +    - protocol: TCP +      port: 80 +\--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: +  name: mydog-nginx-ingress +  annotations: +    kubernetes.io/ingress.class: "traefik" +    traefik.frontend.rule.type: PathPrefixStrip +spec: +  rules: +  - http: +      paths: +      - path: /mydog +        backend: +          serviceName: mydog-nginx-service +          servicePort: 80 +``` + +We can do most of the edits by simply doing a search and replace of **mysite** to **mydog**. The two other edits are in the ingress section. We changed **path** to **/mydog **and we added an annotation, **traefik.frontend.rule.type: PathPrefixStrip**. + +The specification of the path **/mydog** instructs Traefik to route any incoming request that requests a path starting with **/mydog** to the **mydog-nginx-service**. Any other path will continue to be routed to **mysite-nginx-service.** + +The new annotation, **PathPrefixStrip**, tells Traefik to strip off the prefix **/mydog** before sending the request to **mydog-nginx-service**. We did this because the **mydog-nginx** application doesn’t expect a prefix. This means we could change where the service was mounted simply by changing the prefix in the ingress record. + +Now we can deploy like we did before: + + +``` +`kubectl apply -f mydog.yaml` +``` + +And now, my dog’s message should be available at . + +![][7] + +Phew! The message is out! Maybe we can all get some sleep tonight. + +So now, we have a k3s cluster hosting two websites with Traefik making decisions, based on path names, as to which service to pass the request to! We are not limited to path-based routing, however. We could use hostname based routing as well, which we will explore in a future article. + +Also, the websites we just hosted are standard unencrypted HTML sites. Everything these days is encrypted with SSL/TLS. In our next article, we will add support to our k3s cluster to host SSL/TLS HTTPS sites as well! + +### Cleaning up + +Before you go, since this article mostly dealt with sample sites, I would like to show you how to delete things in case you don’t want the samples hanging around on your cluster. + +For most configurations, you can undo the configuration simply by running the **delete** command with the same configuration file you deployed with. So let’s clean up both **mysite** and **mydog**. + + +``` +kubectl delete -f mysite.yaml +kubectl delete -f mydog.yaml +``` + +Since we manually created the config maps, we’ll need to delete those manually as well. + + +``` +kubectl delete configmap mysite-html +kubectl delete configmap mydog-html +``` + +Now if we do a **kubectl get pods**, we should see that our nginx pods are no longer around. + + +``` +$ kubectl get pods +No resources found in default namespace. +``` + +Everything is cleaned up. + +Tell me what thoughts you have on this project in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/kubernetes-traefik + +作者:[Lee Carpenter][a] +选题:[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/carpie +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://opensource.com/article/20/3/kubernetes-raspberry-pi +[3]: https://gitlab.com/carpie/ingressing_with_k3s/-/archive/master/ingressing_with_k3s-master.zip +[4]: https://kubernetes.io/docs/ +[5]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment +[6]: https://opensource.com/sites/default/files/uploads/mysite.jpg +[7]: https://opensource.com/sites/default/files/uploads/mydog.jpg From c4f1999199125e01e0406d227116d542d8b98f6e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Mar 2020 01:03:51 +0800 Subject: [PATCH 197/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200311=20Settin?= =?UTF-8?q?g=20yourself=20up=20for=20success=20while=20working=20remotely?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200311 Setting yourself up for success while working remotely.md --- ...f up for success while working remotely.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/tech/20200311 Setting yourself up for success while working remotely.md diff --git a/sources/tech/20200311 Setting yourself up for success while working remotely.md b/sources/tech/20200311 Setting yourself up for success while working remotely.md new file mode 100644 index 0000000000..bbe6b3f513 --- /dev/null +++ b/sources/tech/20200311 Setting yourself up for success while working remotely.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Setting yourself up for success while working remotely) +[#]: via: (https://opensource.com/article/20/3/remote-work) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +Setting yourself up for success while working remotely +====== +Whether you are new to working remotely or are a seasoned veteran, here +are tips to improve the experience. +![Woman sitting in front of her computer][1] + +Remote work is not easy. While there are perks to being remote, it is a mind-shift and takes some getting used to. Talk to anybody that works remotely, and they will likely tell you some of the biggest challenges of remote work are _**feeling disconnected**_ and _**a loss of regime**_. Here are my tips gathered from 10 years as a remote worker on how to set yourself and your team up to work remotely successfully. + +### Environment and regime + + 1. **"Commute" to and from work**. I'm not saying go to the extremes in this [_Audible commercial_][2], but I suggest leaving your home to go for a walk or a bike ride before you begin working. Do the same at the end of the day. I take my dog, Barley (pictured here), for a walk at the start and end of most days.![Here's my dog, Barley, who gets regular walks during my morning "commute"][3] + 2. **Get dressed.** Don't be tempted to work in your PJs, because this blurs the line between work and home. People sometimes say that being able to work in your pajamas is a perk of remote work, but studies show this isn't great advice. You don't need to put on a suit and tie, but do change out of your pajamas; otherwise, before you know it, you will have gone three days without changing your clothes. For more reasons why check out this article from [_Fast Company_][4]. + 3. **Eat lunch away from your desk**. This is good advice even if you aren't working remotely. + 4. **Stick to a schedule**. It's easy to start working as soon as you wake up and continue late into the evening. Set a start time and an end time for your day and stick to it. When I stop work for the day, I try to close my office door. Configure your working hours in every app you use so others know when you are available. Don't use your work computer outside of working hours if you can. + 5. **Set up a dedicated work environment**, if possible. Try not to work from the kitchen table. This blurs the lines between home and work. My office (picture below) also has space for comfortable seating and desk seating to switch between the two. + 6. **Check-in with your team** or friends in the morning. Don't mistake this for a daily stand-up; this is more like saying _hi_ when you're getting coffee. + 7. **Sign-off at the end of the day**. This means both letting your team members know you are leaving and actually walking away from where you are working. Close the laptop. Turn off Slack notifications, etc. + 8. **Keep people posted** if you are leaving early or unavailable. It helps build trust. + 9. **Invest in a headset** if you will be doing a lot of calls. If there is more than one person in your household that is working remotely, they will thank you for this. It is no fun listening to somebody else's conference call. + 10. **Turn on your video** when on a video call to help you feel connected and stay engaged. When your video is disabled, it is easy to wander off and get distracted by Slack (or its [open source alternatives][5]), Twitter, or any other number of distractions. + 11. **Set up a weekly, casual remote chat**. At my company, we meet on Friday mornings via Zoom (or the open source alternative, [Jitsi][6]). This chat is open to remote and non-remote staff. It is an open call to talk about whatever is on our minds. Topics have ranged from music preferences to parenting challenges to what people are doing over the weekend. + 12. **Set-up chat-roulette **if one-on-one interaction is more your thing. There are applications on most chat platforms that randomly pairs two employees to chat and get to know one another. + 13. **Ask for help**. Chat with your colleagues if you're stuck, need encouragement, or need to vent. You are not alone. You are a member of a team. You can still grab a coffee or go for a walk with a teammate remotely. + + + +![Here’s my home office set up][7] + +Everybody is different. These tips work for me, I’d love to hear you share your advice below! + +Not all work-from-home gigs are created equal. There is a vast ocean between being a member of a... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/remote-work + +作者:[Dawn Parzych][a] +选题:[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/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_2.png?itok=JPlR5aCA (Woman sitting in front of her computer) +[2]: https://www.youtube.com/watch?v=oVCJhZhrJ04 +[3]: https://opensource.com/sites/default/files/resize/pictures/barleywalking_0-300x379.png (Here's my dog, Barley, who gets regular walks during my morning "commute") +[4]: https://www.fastcompany.com/3064295/what-happened-when-i-dressed-up-to-work-from-home-for-a-week +[5]: https://opensource.com/alternatives/slack +[6]: https://meet.jit.si/ +[7]: https://opensource.com/sites/default/files/pictures/6151f75e-bbeb-4e64-a5ca-0bbe4e981054.jpeg (Here’s my home office set up) From 197015eccbd4c3ee304e58e0e9049025dda6b153 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Mar 2020 01:04:50 +0800 Subject: [PATCH 198/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200311=20What?= =?UTF-8?q?=20you=20need=20to=20know=20about=20variables=20in=20Emacs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200311 What you need to know about variables in Emacs.md --- ...u need to know about variables in Emacs.md | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 sources/tech/20200311 What you need to know about variables in Emacs.md diff --git a/sources/tech/20200311 What you need to know about variables in Emacs.md b/sources/tech/20200311 What you need to know about variables in Emacs.md new file mode 100644 index 0000000000..d66ba374f4 --- /dev/null +++ b/sources/tech/20200311 What you need to know about variables in Emacs.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: 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) ;; => (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/ From b0e1f4a666477e9f946a9e230073b9e18e198a5a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Mar 2020 01:05:30 +0800 Subject: [PATCH 199/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200311=20How=20?= =?UTF-8?q?to=20install=20pip=20to=20manage=20PyPI=20packages=20easily?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200311 How to install pip to manage PyPI packages easily.md --- ...tall pip to manage PyPI packages easily.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/tech/20200311 How to install pip to manage PyPI packages easily.md diff --git a/sources/tech/20200311 How to install pip to manage PyPI packages easily.md b/sources/tech/20200311 How to install pip to manage PyPI packages easily.md new file mode 100644 index 0000000000..88f5eb072b --- /dev/null +++ b/sources/tech/20200311 How to install pip to manage PyPI packages easily.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to install pip to manage PyPI packages easily) +[#]: via: (https://opensource.com/article/20/3/pip-linux-mac-windows) +[#]: author: (Vijay Singh Khatri https://opensource.com/users/vijaytechnicalauthor) + +How to install pip to manage PyPI packages easily +====== +Install the pip package manager on older versions of Python on Linux, +Mac, and Windows that don't come preinstalled with pip. +![Person typing on a 1980's computer][1] + +Python is a powerful and popular programming language with many packages that are useful for general programming, data science, and many other things. These packages are not included with the Python installation, so you have to download, install, and manage them separately. All of these packages (libraries and frameworks) are stored in a central repository called the Python Package Index, or [PyPI][2] for short. This is where pip (short for Preferred Installer Program), Python's package manager, comes into the picture. + +Installing Python pip on your system allows you to manage PyPI packages easily. Many of these packages can be installed just by typing **python -m pip install <package-name>** into a terminal or command-line. + +Newer versions of Python 3 (3.4 and higher) and Python 2 (2.7.9 and higher) come preloaded with pip. Older versions of Python didn't include pip, but it can be installed retroactively. + +In this article, I explain how to install pip on Linux, Mac, and Windows computers. You can also check the [pip.pypa][3] documentation for more information. + +### Make sure Python is installed + +If you don't already have Python installed on your system, do that first; otherwise, the pip installer won't understand any commands. To check whether you have Python, enter **python** in your command line, Bash, or terminal window and see what happens. If the command is not recognized, then you need to [download Python][4]. If you have Python installed, you will see a lot of commands and other stuff that will indicate you can install pip. + +### Install Python pip on Linux + +The command you use to install pip on Linux depends on the distribution you use. + +On Fedora, RHEL, and CentOS: + + +``` +`$ sudo dnf install python3` +``` + +For Debian or Ubuntu, use the Apt package: + + +``` +`$ sudo apt install python3-pip` +``` + +Other distributions may have their own package manager. For example, Arch Linux uses pacman: + + +``` +`$ sudo pacman -S python-pip` +``` + +To find out whether pip is installed properly, check the version using the **\--version** option. + +That's all you need. You can skip down to the [using pip][5] section of this article. + +### Install Python pip on Mac + +MacOS comes with Python installed by default, but the version provided by Apple is almost always outdated, even right an OS release. If you're working with Python, you should [use a custom install of Python 3][6]. + +To install Python 3 on a Mac, use [homebrew][7]: + + +``` +`$ brew update && brew upgrade python` +``` + +Because you've installed a recent version of Python3, pip is also installed. ****You can verify it with: + + +``` +`$ python3 -m pip --version` +``` + +That's all you need. You can skip down to the [using pip][5] section of this article. + +### Install Python pip on Windows + +To install pip, you must have Windows 8 or 10. The screenshots below are from Windows 10 (but the same commands work for Windows 8). + +Once you confirm you have [Python installed][8]. + +If you want the same luxuries as Linux users have with a package manager, you can use the [Chocolatey][9] package manager for Windows. This provides easy access to Python but also easy updates. You can use it in the open source PowerShell application to make amazing things happen in just a few commands. + + +``` +`PS> choco install python` +``` + +That's it! You can now use pip to install any package you need. + +### Using Python pip + +Python pip works exactly the same way on each platform: Linux, BSD, Windows, Mac, and so on. + +To install the imaginary library **foo**, use: + + +``` +`python3 -m pip install foo --user` +``` + +To uninstall it: + + +``` +`python3 -m pip uninstall foo` +``` + +To search for a package: + + +``` +`python3 -m pip search foo` +``` + +To upgrade to a new version of pip: + + +``` +`$ sudo pip install --upgrade pip` +``` + +On Windows, omit the **sudo** command (Windows has its own method of privilege management, so you may need to [create an exception to your execution policy][10]). + + +``` +`python -m pip install --upgrade pip` +``` + +I hope you tried the installation methods described in this article and that they helped you. Please share your experience in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/3/pip-linux-mac-windows + +作者:[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/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://pypi.org/ +[3]: https://pip.pypa.io/en/stable/installing/ +[4]: https://www.python.org/downloads/ +[5]: tmp.u1JOYd3gs9#usage +[6]: https://opensource.com/article/19/5/python-3-default-mac +[7]: https://brew.sh +[8]: https://opensource.com/article/19/8/how-install-python-windows +[9]: https://opensource.com/article/20/3/chocolatey +[10]: https://opensource.com/article/20/3/chocolatey#admin From 1b8092966ad41b4da0e66ded6151f8556360fc94 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Mar 2020 01:07:35 +0800 Subject: [PATCH 200/207] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200311=20Data-c?= =?UTF-8?q?enter=20power=20consumption=20holds=20steady?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200311 Data-center power consumption holds steady.md --- ...a-center power consumption holds steady.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/talk/20200311 Data-center power consumption holds steady.md diff --git a/sources/talk/20200311 Data-center power consumption holds steady.md b/sources/talk/20200311 Data-center power consumption holds steady.md new file mode 100644 index 0000000000..cfa6ba9fba --- /dev/null +++ b/sources/talk/20200311 Data-center power consumption holds steady.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data-center power consumption holds steady) +[#]: via: (https://www.networkworld.com/article/3531316/data-center-power-consumption-holds-steady.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Data-center power consumption holds steady +====== +While computing capacity has exploded in recent years, power consumption is growing more slowly thanks to greater energy efficiency. +Google + +A predicted explosion in power consumption by data centers has not manifested thanks to advances in power efficiency and, ironically enough, the move to the cloud, according to a new report. + +The [study][1], published in the journal _Science_ last week, notes that while there has been an increase in global data-center energy consumption over the past decade, this growth is negligible compared with the rise of workloads and deployed hardware during that time. + +Data centers accounted for about 205 terawatt-hours of electricity usage in 2018, which is roughly 1% of all electricity consumption worldwide, according to the report. (That's well below the often-cited stat that data centers consume 2% of the world's electricity). The 205 terawatt-hours represent a 6% increase in total power consumption since 2010, but global data center compute instances rose by 550% over that same time period. + +**[ Now read: [What is quantum computing (and why enterprises should care)][2] ]** + +To drive that point home: Considerably more compute is being deployed, yet the amount of power consumed is holding steady. + +The paper cites a number of reasons for this. For starters, hardware power efficiency is vastly improved. The move to server virtualization has meant a six-fold increase in compute instances with only a 25% increase in server energy use. And a shift to faster and more energy-efficient port technologies has brought about a 10-fold increase in data center IP traffic with only a modest increase in the energy use of network devices. + +Even more interesting, the report claims the rise of and migration to hyperscalers has helped curtail power consumption.  + +Hyperscale data centers and cloud data centers are generally more energy efficient than company-owned data centers because there is greater incentive for energy efficiency. The less power Amazon, Microsoft, Google, etc., have to buy, the more their bottom line grows. And hyperscalers are big on cheap, renewable energy, such as hydro and wind. + +[][3] + +So if a company trades its own old, inefficient data center for AWS or Google Cloud, they're reducing the overall power draw of data centers as a whole. + +"Total power consumption held steady as computing output has risen because of improvement efficiency of both IT and infrastructure equipment, and a shift from corporate data centers to more efficient cloud data centers (especially hyper scale)," said Jonathan Koomey, a Stanford professor and one of the authors of the research, in an email to me. He has spent years researching data center power and is an authority on the subject. + +"As always, the IT equipment progresses most quickly. In this article, we show that the peak output efficiency of computing doubled every 2.6 years after 2000. This doesn’t include the reduced idle power factored into the changes for servers we document," he added. + +Koomey notes that there is additional room for efficiency improvements to cover the next doubling of computing output over the next few years but was reluctant to make projections out too far. "We avoid projecting the future of IT because it changes so fast, and we are skeptical of those who think they can project IT electricity use 10-15 years hence," he said. + +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/3531316/data-center-power-consumption-holds-steady.html + +作者:[Andy Patrizio][a] +选题:[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/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://science.sciencemag.org/content/367/6481/984 +[2]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[3]: 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) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 6da84379065945d83e179bd09b4f921f6af1b19a Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 12 Mar 2020 08:22:56 +0800 Subject: [PATCH 201/207] translated --- ...113 How to setup a DNS server with bind.md | 113 +++++++++--------- 1 file changed, 57 insertions(+), 56 deletions(-) rename {sources => translated}/tech/20200113 How to setup a DNS server with bind.md (58%) diff --git a/sources/tech/20200113 How to setup a DNS server with bind.md b/translated/tech/20200113 How to setup a DNS server with bind.md similarity index 58% rename from sources/tech/20200113 How to setup a DNS server with bind.md rename to translated/tech/20200113 How to setup a DNS server with bind.md index 22ca80e554..c659d90dbb 100644 --- a/sources/tech/20200113 How to setup a DNS server with bind.md +++ b/translated/tech/20200113 How to setup a DNS server with bind.md @@ -7,69 +7,69 @@ [#]: via: (https://fedoramagazine.org/how-to-setup-a-dns-server-with-bind/) [#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) -How to setup a DNS server with bind +如何使用 bind 设置 DNS 服务器 ====== ![][1] -The Domain Name System, or DNS, as it’s more commonly known, translates or converts domain names into the IP addresses associated with that domain. DNS is the reason you are able to find your favorite website by name instead of typing an IP address into your browser. This guide shows you how to configure a Master DNS system and one client. +域名系统或 DNS(通常称为 DNS)将域名翻译或转换为与该域关联的 IP 地址。DNS 是能够让你通过名称找到自己喜欢的网站而不是在浏览器中输入 IP 地址的原因。本指南将向你展示如何配置一个主 DNS 系统以及客户端。 -Here are system details for the example used in this article: +以下是本文示例中使用的系统细节: ``` -dns01.fedora.local (192.168.1.160 ) - Master DNS server -client.fedora.local (192.168.1.136 ) - Client +dns01.fedora.local (192.168.1.160)- 主 DNS 服务器 +client.fedora.local (192.168.1.136)- 客户端 ``` -### DNS server configuration +### DNS 服务器配置 -Install the bind packages using sudo: +使用 sudo 安装 bind 包: ``` $ sudo dnf install bind bind-utils -y ``` -The _/etc/named.conf_ configuration file is provided by the _bind_ package to allow you to configure the DNS server. +_bind_ 包提供了_/etc/named.conf_ 配置文件,来供你配置 DNS 服务器。 -Edit the _/etc/named.conf_ file: +编辑 _/etc/named.conf_ 文件: ``` sudo vi /etc/named.conf ``` -Look for the following line: +查找以下行: ``` listen-on port 53 { 127.0.0.1; }; ``` -Add the IP address of your Master DNS server as follows: +添加主 DNS 服务器的 IP 地址,如下所示: ``` listen-on port 53 { 127.0.0.1; 192.168.1.160; }; ``` -Look for the next line: +查找以下行: ``` allow-query { localhost; }; ``` -Add your local network range. The example system uses IP addresses in the 192.168.1.X range. This is specified as follows: +添加本地网络范围。该示例系统使用的 IP 地址在 192.168.1.X 的范围内。指定如下: ``` allow-query { localhost; 192.168.1.0/24; }; ``` -Specify a forward and reverse zone. Zone files are simply text files that have the DNS information, such as IP addresses and host-names, on your system. The forward zone file makes it possible for the translation of a host-name to its IP address. The reverse zone file does the opposite. It allows a remote system to translate an IP address to the host name. +指定转发和反向区域。区域文件只是具有系统上 DNS 信息(例如 IP 地址和主机名)的文本文件。转发区域文件使得将主机名转换为 IP 地址成为可能。反向区域文件则相反。它允许远程系统将 IP 地址转换为主机名。 -Look for the following line at the bottom of the /etc/named.conf file: +在 /etc/named.conf 文件的底部查找以下行: ``` include "/etc/named.rfc1912.zones"; ``` -Here, you’ll specify the zone file information _**directly above that line**_ as follows: +在此处,你将在_**该行的正上方**_指定区域文件信息,如下所示: ``` zone "dns01.fedora.local" IN { @@ -85,19 +85,19 @@ allow-update { none; }; }; ``` -The _forward.fedora.local_ and the file _reverse.fedora.local_ are just the names of the zone files you will be creating. They can be called anything you like. +_forward.fedora.local_ 和 _reverse.fedora.local_ 文件是要创建的区域文件的名称。它们可以是任意名字。 -Save and exit. +保存并退出。 -#### Create the zone files +#### 创建区域文件 -Create the forward and reverse zone files you specified in the /etc/named.conf file: +创建你在 /etc/named.conf 文件中指定的转发和反向区域文件: ``` $ sudo vi /var/named/forward.fedora.local ``` -Add the following lines: +添加以下行: ``` $TTL 86400 @@ -114,13 +114,13 @@ dns01 IN A 192.168.1.160 client IN A 192.168.1.136 ``` -Everything in _**bold**_ is specific to your environment. Save the file and exit. Next, edit the _reverse.fedora.local_ file: +所有_**粗体**_内容都特定于你的环境。保存文件并退出。接下来,编辑 _reverse.fedora.local_ 文件: ``` $ sudo vi /var/named/reverse.fedora.local ``` -Add the following lines: +添加以下行: ``` $TTL 86400 @@ -139,9 +139,10 @@ client IN A 192.168.1.136 136 IN PTR client.fedora.local. ``` -Everything in _**bold**_ is also specific to your environment. Save the file and exit. +所有_**粗体**_内容都特定于你的环境。保存文件并退出。 + +你还需要配置 SELinux 并为配置文件添加正确的所有权。 -You’ll also need to configure SELinux and add the correct ownership for the configuration files. ``` sudo chgrp named -R /var/named @@ -150,22 +151,22 @@ sudo restorecon -rv /var/named sudo restorecon /etc/named.conf ``` -Configure the firewall: +配置防火墙: ``` sudo firewall-cmd --add-service=dns --perm sudo firewall-cmd --reload ``` -#### Check the configuration for any syntax errors +#### 检查配置是否存在语法错误 ``` sudo named-checkconf /etc/named.conf ``` -Your configuration is valid if no output or errors are returned. +如果没有输出或返回错误,那么你的配置有效。 -Check the forward and reverse zone files. +检查转发和反向区域文件。 ``` $ sudo named-checkzone forward.fedora.local /var/named/forward.fedora.local @@ -173,7 +174,7 @@ $ sudo named-checkzone forward.fedora.local /var/named/forward.fedora.local $ sudo named-checkzone reverse.fedora.local /var/named/reverse.fedora.local ``` -You should see a response of OK: +你应该看到 OK 的响应: ``` zone forward.fedora.local/IN: loaded serial 2011071001 @@ -183,50 +184,50 @@ zone reverse.fedora.local/IN: loaded serial 2011071001 OK ``` -#### Enable and start the DNS service +#### 启用并启动 DNS 服务 ``` $ sudo systemctl enable named $ sudo systemctl start named ``` -#### Configuring the resolv.conf file +#### 配置 resolv.conf 文件 -Edit the _/etc/resolv.conf_ file: +编辑 _/etc/resolv.conf_ 文件: ``` $ sudo vi /etc/resolv.conf ``` -Look for your current name server line or lines. On the example system, a cable modem/router is serving as the name server and so it currently looks like this: +查找你当前的 nameserver 行。在示例系统上,调制解调器/路由器充当名称服务器,因此当前看起来像这样: ``` nameserver 192.168.1.1 ``` -This needs to be changed to the IP address of the Master DNS server: +这需要更改为主 DNS 服务器的 IP 地址: ``` nameserver 192.168.1.160 ``` -Save your changes and exit. +保存更改并退出。 -Unfortunately there is one caveat to be aware of. NetworkManager overwrites the _/etc/resolv.conf_ file if the system is rebooted or networking gets restarted. This means you will lose all of the changes that you made. +不幸的是需要注意一点。如果系统重启或网络重启,那么 NetworkManager 会覆盖 _/etc/resolv.conf_ 文件。这意味着你将丢失所做的所有更改。 -To prevent this from happening, make _/etc/resolv.conf_ immutable: +为了防止这种情况发生,请将 _/etc/resolv.conf_ 设为不可变: ``` $ sudo chattr +i /etc/resolv.conf ``` -If you want to set it back and allow it to be overwritten again: +如果要重新设置并允许其再次被覆盖: ``` $ sudo chattr -i /etc/resolv.conf ``` -#### Testing the DNS server +#### 测试 DNS 服务器 ``` $ dig fedoramagazine.org @@ -266,27 +267,27 @@ $ dig fedoramagazine.org ;; MSG SIZE rcvd: 266 ``` -There are a few things to look at to verify that the DNS server is working correctly. Obviously getting the results back are important, but that by itself doesn’t mean the DNS server is actually doing the work. +有几件事需要检查以验证 DNS 服务器是否正常运行。显然,取得结果很重要,但这本身并不意味着 DNS 服务器实际上正常工作。 -The QUERY, ANSWER, and AUTHORITY fields at the top should show non-zero as it in does in our example: +顶部的 QUERY、ANSWER 和 AUTHORITY 字段应显示为非零,如我们的示例所示: ``` ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 6 ``` -And the SERVER field should have the IP address of your DNS server: +并且 SERVER 字段应有你的 DNS 服务器的 IP 地址: ``` ;; SERVER: 192.168.1.160#53(192.168.1.160) ``` -In case this is the first time you’ve run the _dig_ command, notice how it took 830 milliseconds for the query to complete: +如果这是你第一次运行 _dig_ 命令,请注意完成查询要花费 830 毫秒的时间: ``` ;; Query time: 830 msec ``` -If you run it again, the query will run much quicker: +如果再次运行它,查询将会更快: ``` $ dig fedoramagazine.org @@ -297,37 +298,37 @@ $ dig fedoramagazine.org ;; SERVER: 192.168.1.160#53(192.168.1.160) ``` -### Client configuration +### 客户端配置 -The client configuration will be a lot simpler. +客户端配置将简单得多。 -Install the bind utilities: +安装 bind 程序: ``` $ sudo dnf install bind-utils -y ``` -Edit the /etc/resolv.conf file and configure the Master DNS as the only name server: +编辑 /etc/resolv.conf 文件,并将主 DNS 配置为唯一的名称服务器: ``` $ sudo vi /etc/resolv.conf ``` -This is how it should look: +它看起来像这样: ``` nameserver 192.168.1.160 ``` -Save your changes and exit. Then, make the _/etc/resolv.conf_ file immutable to prevent it from be overwritten and going back to its default settings: +保存更改并退出。然后,使 _/etc/resolv.conf_ 文件不可变,防止其被覆盖并变回默认设置: ``` $ sudo chattr +i /etc/resolv.conf ``` -#### Testing the client +#### 测试客户端 -You should get the same results as you did from the DNS server: +你应该获得与 DNS 服务器相同的结果: ``` $ dig fedoramagazine.org @@ -367,9 +368,9 @@ $ dig fedoramagazine.org ;; MSG SIZE rcvd: 266 ``` -Make sure the SERVER output has the IP Address of your DNS server. +确保 SERVER 输出的是你 DNS 服务器的 IP 地址。 -Your DNS server is now ready to use and all requests from the client should be going through your DNS server now! +你的 DNS 服务器设置完成了,现在所有来自客户端的请求都会经过你的 DNS 服务器了! -------------------------------------------------------------------------------- @@ -377,7 +378,7 @@ via: https://fedoramagazine.org/how-to-setup-a-dns-server-with-bind/ 作者:[Curt Warfield][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ecba50e99bcd54bb19729c8235ebadaea6be9ad3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 12 Mar 2020 08:28:34 +0800 Subject: [PATCH 202/207] translating --- ...Firefox Fork For The Classic Looks and Classic Extensions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md b/sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md index d2b1ce5d4c..ba0d8766a6 100644 --- a/sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md +++ b/sources/tech/20200310 Basilisk- A Firefox Fork For The Classic Looks and Classic Extensions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0bdd6f6fdc66e60309c8c153041ebec04b139329 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 12 Mar 2020 09:13:49 +0800 Subject: [PATCH 203/207] Rename sources/tech/20200311 Setting yourself up for success while working remotely.md to sources/talk/20200311 Setting yourself up for success while working remotely.md --- ...0311 Setting yourself up for success while working remotely.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200311 Setting yourself up for success while working remotely.md (100%) diff --git a/sources/tech/20200311 Setting yourself up for success while working remotely.md b/sources/talk/20200311 Setting yourself up for success while working remotely.md similarity index 100% rename from sources/tech/20200311 Setting yourself up for success while working remotely.md rename to sources/talk/20200311 Setting yourself up for success while working remotely.md From 6dc5daa844944682f1c830307205ad1a91fedbc2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 12 Mar 2020 10:47:10 +0800 Subject: [PATCH 204/207] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @caiichenr 恭喜你,完成了第一篇翻译贡献! --- ...reaking breakpoint for Python debugging.md | 94 +++++++------------ 1 file changed, 36 insertions(+), 58 deletions(-) diff --git a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md b/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md index ed94d222e6..94cfdbb949 100644 --- a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md +++ b/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (caiichenr) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Building a non-breaking breakpoint for Python debugging) @@ -9,8 +9,10 @@ 在 Python 调试过程中设置不中断的断点 ====== -你对如何让调试器变得更快产生过兴趣吗?本文将分享我们在为 Python 构建调试器时得到的一些经验。 -![Real python in the graphic jungle][1] + +> 你对如何让调试器变得更快产生过兴趣吗?本文将分享我们在为 Python 构建调试器时得到的一些经验。 + +![](https://img.linux.net.cn/data/attachment/album/202003/12/104433hq3qx2k81w1wamwm.jpg) 整段故事讲的是我们在 [Rookout][2] 公司的团队为 Python 调试器开发不中断断点的经历,以及开发过程中得到的经验。我将在本月于旧金山举办的 [PyBay 2019][3] 上介绍有关 Python 调试过程的更多细节,但现在就让我们立刻开始这段故事。 @@ -18,28 +20,23 @@ 在诸多可选的 Python 调试器中,使用最广泛的三个是: - * **pdb**,它是 Python 标准库的一部分 - * **PyDev**,它是内嵌在 Eclipse 和 Pycharm 等 IDE 中的调试器 - * **ipdb**,它是IPython的调试器 +* pdb,它是 Python 标准库的一部分 +* PyDev,它是内嵌在 Eclipse 和 Pycharm 等 IDE 中的调试器 +* ipdb,它是 IPython 的调试器 - - -Python 调试器的选择虽多,但它们几乎都基于同一个函数:**sys.set_trace**。 值得一提的是, **[sys.settrace][4]** 可能也是 Python 标准库中最复杂的函数。 +Python 调试器的选择虽多,但它们几乎都基于同一个函数:`sys.settrace`。 值得一提的是, [sys.settrace][4] 可能也是 Python 标准库中最复杂的函数。 ![set_trace Python 2 docs page][5] -简单来讲,**settrace** 的作用是为解释器注册一个跟踪函数,它在下列四种情形发生时被调用: - - * 函数调用 (Function call) - * 语句执行 (Line execution) - * 函数返回 (Function return) - * 异常抛出 (Exception raised) - +简单来讲,`settrace` 的作用是为解释器注册一个跟踪函数,它在下列四种情形发生时被调用: +* 函数调用 +* 语句执行 +* 函数返回 +* 异常抛出 一个简单的跟踪函数看上去大概是这样: - ``` def simple_tracer(frame, event, arg):   co = frame.f_code @@ -52,27 +49,22 @@ e=event, f=func_name, l=line_no)) 在分析函数时我们首先关注的是参数和返回值,该跟踪函数的参数分别是: - * **frame**,当前堆栈帧,它是包含当前函数执行时解释器里完整状态的对象 - * **event**,它是一个值可能为 **"call"**, **"line"**, **"return"**, 或 **"exception"** 的字符串 - * **arg**,它的取值基于 event 的类型,是一个可选项 - - +* `frame`,当前堆栈帧,它是包含当前函数执行时解释器里完整状态的对象 +* `event`,事件,它是一个值可能为 `call`、`line`、`return` 或 `exception` 的字符串 +* `arg`,参数,它的取值基于 `event` 的类型,是一个可选项 该跟踪函数的返回值是它自身,这是由于解释器需要持续跟踪两类跟踪函数: - * **全局跟踪函数(每线程):** 该跟踪函数由当前线程调用 **sys.settrace** 来设置,并在解释器创建一个新 **frame** 时被调用(即代码中发生函数调用时)。虽然没有现成的方式来为不同的线程设置跟踪函数,但你可以调用 **threading.settrace** 来为所有新创建的 **threading** 模块线程设置跟踪函数。 - * **局部跟踪函数(每一帧):** 解释器将该跟踪函数的值设置为全局跟踪函数创建帧时的返回值。同样也没有现成的方法能够在帧被创建时自动设置局部跟踪函数。 - - +* **全局跟踪函数(每线程)**:该跟踪函数由当前线程调用 `sys.settrace` 来设置,并在解释器创建一个新的堆栈帧时被调用(即代码中发生函数调用时)。虽然没有现成的方式来为不同的线程设置跟踪函数,但你可以调用 `threading.settrace` 来为所有新创建的 `threading` 模块线程设置跟踪函数。 +* **局部跟踪函数(每一帧)**:解释器将该跟踪函数的值设置为全局跟踪函数创建帧时的返回值。同样也没有现成的方法能够在帧被创建时自动设置局部跟踪函数。 该机制的目的是让调试器对被跟踪的帧有更精确的把握,以减少对性能的影响。 ### 简单三步构建调试器 (我们最初的设想) -仅仅依靠上文提到的内容,用自制的跟踪函数来构建一个真正的调试器似乎有些不切实际。幸运的是,Python 的标准调试器 **pdb** 是基于 **Bdb** 构建的,后者是 Python 标准库中专门用于构建调试器的基类。 - -基于 **Bdb** 的简易断点调试器看上去是这样的: +仅仅依靠上文提到的内容,用自制的跟踪函数来构建一个真正的调试器似乎有些不切实际。幸运的是,Python 的标准调试器 pdb 是基于 Bdb 构建的,后者是 Python 标准库中专门用于构建调试器的基类。 +基于 Bdb 的简易断点调试器看上去是这样的: ``` import bdb @@ -105,11 +97,9 @@ def user_line(self, frame): 这个调试器类的全部构成是: - 1. 继承 **Bdb**,定义一个简单的构造函数来初始化基类,并开始跟踪。 - 2. 添加 **set_breakpoint** 方法,它使用 **Bdb** 来设置断点,并跟踪这些断点。 - 3. 重载 **Bdb** 在当前用户行调用的 **user_line** 方法,该方法一定被一个断点调用,之后获取该断点的源位置,并调用已注册的断点。 - - +1. 继承 `Bdb`,定义一个简单的构造函数来初始化基类,并开始跟踪。 +2. 添加 `set_breakpoint` 方法,它使用 `Bdb` 来设置断点,并跟踪这些断点。 +3. 重载 `Bdb` 在当前用户行调用的 `user_line` 方法,该方法一定被一个断点调用,之后获取该断点的源位置,并调用已注册的断点。 ### 这个简易的 Bdb 调试器效率如何呢? @@ -117,7 +107,6 @@ Rookout 的目标是在生产级性能的使用场景下提供接近普通调试 为了衡量调试器的整体性能开销,我们使用如下两个简单的函数来进行测试,它们分别在不同的情景下执行了 1600 万次。请注意,在所有情景下断点都不会被执行。 - ``` def empty_method():    pass @@ -135,7 +124,7 @@ def simple_method():    j = 10 ``` -在使用调试器的情况下需要大量的时间才能完成测试。糟糕的结果指明了,这个简陋 **Bdb** 调试器的性能还远不足以在生产环境中使用。 +在使用调试器的情况下需要大量的时间才能完成测试。糟糕的结果指明了,这个简陋 `Bdb` 调试器的性能还远不足以在生产环境中使用。 ![First Bdb debugger results][6] @@ -143,13 +132,11 @@ def simple_method(): 降低调试器的额外开销主要有三种方法: - 1. **尽可能的限制局部跟踪:** 由于每一行代码都可能包含大量事务,局部跟踪比全局跟踪的开销要大得多。 - 2. **优化 "call" 事务并尽快将控制权还给解释器:** 在 **call** 事务发生时调试器的主要工作是判断是否需要对该事务进行跟踪。 - 3. **优化 "line" 事务并尽快将控制权还给解释器:** 在 **line** 事务发生时调试器的主要工作是判断我们在此处是否需要设置一个断点。 +1. **尽可能的限制局部跟踪**:由于每一行代码都可能包含大量事件,局部跟踪比全局跟踪的开销要大得多。 +2. **优化 `call` 事件并尽快将控制权还给解释器**:在 `call` 事件发生时调试器的主要工作是判断是否需要对该事件进行跟踪。 +3. **优化 `line` 事件并尽快将控制权还给解释器**:在 `line` 事件发生时调试器的主要工作是判断我们在此处是否需要设置一个断点。 - - -于是我们克隆了 **Bdb** 项目,精简特征,简化代码,针对使用场景进行优化。这些工作虽然得到了一些效果,但仍无法满足我们的需求。因此我们又继续进行了其它的尝试,将代码优化并迁移至 **.pyx** 使用 [Cython][7] 进行编译,可惜结果(如下图所示)依旧不够理想。最终,我们在深入了解 CPython 源码之后意识到,让跟踪过程快到满足生产需求是不可能的。 +于是我们复刻了 `Bdb` 项目,精简特征、简化代码,针对使用场景进行优化。这些工作虽然得到了一些效果,但仍无法满足我们的需求。因此我们又继续进行了其它的尝试,将代码优化并迁移至 `.pyx` 使用 [Cython][7] 进行编译,可惜结果(如下图所示)依旧不够理想。最终,我们在深入了解 CPython 源码之后意识到,让跟踪过程快到满足生产需求是不可能的。 ![Second Bdb debugger results][8] @@ -159,10 +146,8 @@ def simple_method(): Python 解释器的工作主要分为两个阶段: - 1. **将 Python 源码编译成 Python 字节码:** 这种不可读(对人类而言)的格式专为执行的效率而优化,它们通常缓存在我们熟知的 **.pyc** 文件当中。 - 2. **遍历 _interpreter loop_ 中的字节码:** 在这一步中解释器会逐条的执行指令 - - +1. **将 Python 源码编译成 Python 字节码**:这种(对人类而言)不可读的格式专为执行的效率而优化,它们通常缓存在我们熟知的 `.pyc` 文件当中。 +2. **遍历 解释器循环中的字节码**: 在这一步中解释器会逐条的执行指令。 我们选择的模式是:使用**字节码操作**来设置没有全局额外开销的**不中断断点**。这种方式的实现首先需要在内存中的字节码里找到我们感兴趣的部分,然后在该部分的相关机器指令前插入一个函数调用。如此一来,解释器无需任何额外的工作即可实现我们的不中断断点。 @@ -170,22 +155,19 @@ Python 解释器的工作主要分为两个阶段: 首先定义一个简单的函数: - ``` def multiply(a, b):    result = a * b    return result ``` -在 **[inspect][9]** 模块(其包含了许多实用的单元)的文档里,我们得知可以通过访问 **multiply.func_code.co_code** 来获取函数的字节码: - +在 [inspect][9] 模块(其包含了许多实用的单元)的文档里,我们得知可以通过访问 `multiply.func_code.co_code` 来获取函数的字节码: ``` -`'|\x00\x00|\x01\x00\x14}\x02\x00|\x02\x00S'` +'|\x00\x00|\x01\x00\x14}\x02\x00|\x02\x00S' ``` -使用 Python 标准库中的 **[dis][10]** 模块可以翻译这些不可读的字符串。调用 **dis.dis(multiply.func_code.co_code)** 之后,我们就可以得到: - +使用 Python 标准库中的 [dis][10] 模块可以翻译这些不可读的字符串。调用 `dis.dis(multiply.func_code.co_code)` 之后,我们就可以得到: ```   4          0 LOAD_FAST               0 (a) @@ -203,11 +185,7 @@ def multiply(a, b): 在构建一个新工具时,总会学到许多事情的工作原理。这种刨根问底的过程能够使你的思路跳出桎梏,从而得到意料之外的解决方案。 -在 Rookout 团队中构建不中断断点的这段时间里,我学到了许多有关编译器、调试器、服务器框架、并发模型等等领域的知识。如果你希望更深入的了解字节码操作,谷歌的开源项目 **[cloud-debug-python][11]** 为编辑字节码提供了一些工具。 - -* * * - -_Liran Haimovitch 将于 2019 年八月 17-18 日在旧金山举办的 [PyBay][3] 中发表题为 "[Understanding Python’s Debugging Internals][12]" 的演说,使用 [OpenSource35][13] 可以获得购票优惠,并使他们得知您是在我们的社区得知此事。_ +在 Rookout 团队中构建不中断断点的这段时间里,我学到了许多有关编译器、调试器、服务器框架、并发模型等等领域的知识。如果你希望更深入的了解字节码操作,谷歌的开源项目 [cloud-debug-python][11] 为编辑字节码提供了一些工具。 -------------------------------------------------------------------------------- @@ -216,7 +194,7 @@ via: https://opensource.com/article/19/8/debug-python 作者:[Liran Haimovitch][a] 选题:[lujun9972][b] 译者:[caiichenr](https://github.com/caiichenr) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From de9d5031e970f2a4a8683b73692dbe8d5877b46d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 12 Mar 2020 10:48:30 +0800 Subject: [PATCH 205/207] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @caiichenr 本文首发地址:https://linux.cn/article-11986-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/caiichenr 请注册以领取 LCCN: https://lctt.linux.cn/ --- ...Building a non-breaking breakpoint for Python debugging.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190813 Building a non-breaking breakpoint for Python debugging.md (99%) diff --git a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md b/published/20190813 Building a non-breaking breakpoint for Python debugging.md similarity index 99% rename from translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md rename to published/20190813 Building a non-breaking breakpoint for Python debugging.md index 94cfdbb949..0ad21ebeab 100644 --- a/translated/tech/20190813 Building a non-breaking breakpoint for Python debugging.md +++ b/published/20190813 Building a non-breaking breakpoint for Python debugging.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (caiichenr) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11986-1.html) [#]: subject: (Building a non-breaking breakpoint for Python debugging) [#]: via: (https://opensource.com/article/19/8/debug-python) [#]: author: (Liran Haimovitch https://opensource.com/users/liranhaimovitch) From c9abae3f9db12b9698e9050cc547ebd63dd3b24a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 12 Mar 2020 11:55:44 +0800 Subject: [PATCH 206/207] PRF @qianmingtian --- ...stall and Use Wireshark on Ubuntu Linux.md | 77 ++++++++++--------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md index 637c1a4c3d..0f3a6e2b37 100644 --- a/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md +++ b/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Install and Use Wireshark on Ubuntu Linux) @@ -10,22 +10,24 @@ Ubuntu 上 Wireshark 的安装与使用 ====== -_**简介:在本教程中,你将学习如何在 Ubuntu 和其他基于 Ubuntu 的发行版上安装最新的 Wireshark。同时你也将学习如何在没有 sudo 的情况下来运行 Wireshark ,以及如何设置它来进行数据包嗅探。**_ +> 在本教程中,你将学习如何在 Ubuntu 和其它基于 Ubuntu 的发行版上安装最新的 Wireshark。同时你也将学习如何在没有 sudo 的情况下来运行 Wireshark,以及如何设置它来进行数据包嗅探。 -[Wireshark][1] 是一款免费开源网络协议分析器,它在全球被广泛使用。 +[Wireshark][1] 是一款自由开源的网络协议分析器,它在全球被广泛使用。 -通过使用 Wireshark ,你可以实时捕获网络的传入和传出数据包,并将其用于网络故障排除、数据包分析、软件和通信协议开发等。 +通过使用 Wireshark,你可以实时捕获网络的传入和传出数据包,并将其用于网络故障排除、数据包分析、软件和通信协议开发等。 -它适用于所有主流的桌面操作系统,如 Windows 、 Linux 、 macOS 、 BSD 等。 +它适用于所有主流的桌面操作系统,如 Windows、Linux、macOS、BSD 等。 在本教程中,我将指导你在 Ubuntu 和其他基于 Ubuntu 的发行版上安装 Wireshark 。我还将介绍如何设置和配置 Wireshark 来捕获数据包。 ### 在基于 Ubuntu 的 Linux 发行版上安装 Wireshark + ![][2] Wireshark 适用于所有主流 Linux 发行版。你应该查看[官方安装说明][3]。因为在本教程中,我将着重在仅基于 Ubuntu 的发行版上安装最新版本的 Wireshark 。 Wireshark 可以在 Ubuntu 的 Universe 存储库中找到。你可以[启用 universe 存储库][4],然后按如下方式安装: + ``` sudo add-apt-repository universe sudo apt install wireshark @@ -36,20 +38,20 @@ sudo apt install wireshark 例如,在 Ubuntu 18.04 中,如果你使用 [apt][5] 命令检查 Wireshark 的可用版本,可用版本会显示是 2.6 。 ``` -[email protected]:~$ apt show wireshark +abhishek@nuc:~$ apt show wireshark Package: wireshark Version: 2.6.10-1~ubuntu18.04.0 Priority: optional Section: universe/net Origin: Ubuntu -Maintainer: Balint Reczey <[email protected]> +Maintainer: Balint Reczey ``` 然而, [Wireshark 3.2 稳定版][6]已经在几个月前发布了。当然,新版本拥有新的特性。 那么在这种情况下,你应该怎么办呢?谢天谢地, Wireshark 开发者提供了一种官方 PPA 方式,你可以使用它在 Ubuntu 和其它基于 Ubuntu 的发行版上安装最新稳定版本的 Wireshark. -我希望你熟悉 PPA 。如果没有,请[阅读我们关于 PPA 的优秀指南,以便完全理解它][7]。 +我希望你熟悉 PPA。如果没有,请[阅读我们关于 PPA 的优秀指南,以便完全理解它][7]。 打开终端并逐个使用以下命令: @@ -58,21 +60,24 @@ sudo add-apt-repository ppa:wireshark-dev/stable sudo apt update sudo apt install wireshark ``` + 即使安装了旧版本的 Wireshark ,它也将更新为新版本。 -安装时,系统将询问你是否允许非超级用户捕获数据包。选择“是”允许,选择“否”限制非超级用户捕获数据包,最后完成安装。 +安装时,系统将询问你是否允许非超级用户捕获数据包。选择“Yes”允许,选择“No”限制非超级用户捕获数据包,最后完成安装。 ### 不使用 sudo 运行 Wireshark -如果在上一次安装中选择了**否**,则以root用户身份运行以下命令: +如果在上一次安装中选择了“No”,则以 root 用户身份运行以下命令: + ``` sudo dpkg-reconfigure wireshark-common ``` -然后按 tab 键并使用回车键选择**是**: +然后按 `tab` 键并使用回车键选择“No”: + ![][8] -由于你允许非超级用户捕获数据包,因此你必须将该用户添加到 wireshark 组。使用[ usermod ][9]命令将自己添加到 wireshark 组。 +由于你允许非超级用户捕获数据包,因此你必须将该用户添加到 `wireshark` 组。使用 [usermod][9] 命令将自己添加到 `wireshark` 组。 ``` sudo usermod -aG wireshark $(whoami) @@ -80,19 +85,20 @@ sudo usermod -aG wireshark $(whoami) 最后,[重启你的 Ubuntu 系统][10]对你的系统进行必要的修改。 -冷知识 - -Wireshark 于 1998 年首次发布,最初被称为 Ethereal 。2006 年,由于商标问题,开发商不得不将其名称改为 Wireshark 。 +> 冷知识 +> +> Wireshark 于 1998 年首次发布,最初被称为 Ethereal 。2006 年,由于商标问题,开发商不得不将其名称改为 Wireshark 。 ### 启动 Wireshark 你可以从应用程序启动器或者命令行启动 Wireshark 应用。 -如果从命令行启动,只需要在你的控制台中输入 **wireshark** : +如果从命令行启动,只需要在你的控制台中输入 `wireshark`: ``` wireshark ``` + 要是从**图形化界面**启动,需要在搜索栏搜索 Wireshark 应用,并按回车键。 ![][11] @@ -107,18 +113,19 @@ wireshark ![Select interface][12] - 例如,我只列出了**有线**网络接口。 + ![][13] -接下来,要开始捕获数据包,你必须选择接口(在我的示例中是 ens33 ),然后单击**开始捕获数据包**图标,如下图所示。 +接下来,要开始捕获数据包,你必须选择接口(在我的示例中是 `ens33` ),然后单击“Start capturing packets”图标,如下图所示。 + ![Start capturing packets with Wireshark][14] +你还可以同时从多个接口捕获数据包。只需按住 `CTRL` 按钮,同时单击要捕获的接口,然后点击“Start capturing packets”图标,如下图所示。 -你还可以同时从多个接口捕获数据包。只需按住 **CTRL** 按钮,同时单击要捕获的接口,然后点击**开始捕获数据包**图标,如下图所示。 ![][15] -接下来,我尝试在终端中使用 **ping google.com** 命令,如你所见,捕获了许多数据包。 +接下来,我尝试在终端中使用 `ping google.com` 命令,如你所见,捕获了许多数据包。 ![Captured packets][16] @@ -130,11 +137,11 @@ wireshark ![Check RAW data in the captured packets][18] -这就是为什么端到端加密很重要。 - -假设你正在登录一个不使用 HTTPS 的网站。与你在同一网络上的任何人都可以嗅探数据包,并在原始数据中看到用户名和密码。 - -这就是为什么现在大多数聊天应用程序使用端到端加密,而大多数网站使用 https (而不是 http )。 +> 这就是为什么端到端加密很重要。 +> +> 假设你正在登录一个不使用 HTTPS 的网站。与你在同一网络上的任何人都可以嗅探数据包,并在原始数据中看到用户名和密码。 +> +> 这就是为什么现在大多数聊天应用程序使用端到端加密,而大多数网站使用 https (而不是 http)。 #### 在 Wireshark 中停止数据包捕获 @@ -149,38 +156,34 @@ wireshark ![Save captured packets by Wireshark][20] -**注意**:_输出可以导出为 XML 、 PostScript 、 CSV 或纯文本_ +**注意**:输出可以导出为 XML、PostScript、CSV 或纯文本。 -接下来,选择一个目标文件夹,键入文件名并单击**保存**。 +接下来,选择一个目标文件夹,键入文件名并单击“Save”。 -然后选择文件并单击**打开**。 +然后选择文件并单击“Open”。 ![][21] -现在你可以随时打开和分析保存的数据包。要打开文件,请按 **\+o** -或从Wireshark转到**文件 > 打开**。 + +现在你可以随时打开和分析保存的数据包。要打开文件,请按 `\+o`,或从 Wireshark 转到 “File > Open”。 捕获的数据包将从文件中加载。 ![][22] ### 结语 + Wireshark 支持许多不同的通信协议。有许多选项和功能,使你能够以独特的方式捕获和分析网络数据包。你可以从 Wireshark 的[官方文档][23]了解更多关于 Wireshark 的信息。 我希望这个教程能帮助你在 Ubuntu 上安装 Wireshark 。请让我知道你的问题和建议。 -![][24] -### Kushal Rai - -计算机科学专业的学生、Linux 和开源爱好者。他喜欢分享知识,因为他相信技术塑造了对现代世界的感知。 Kushal 也喜欢音乐和摄影。 - -------------------------------------------------------------------------------- via: https://itsfoss.com/install-wireshark-ubuntu/ -作者:[Community][a] +作者:[Kushal Rai][a] 选题:[lujun9972][b] 译者:[qianmigntian][c] -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 24bc4739ca77a493c102b7b58b2ee2e5df7515b7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 12 Mar 2020 11:57:45 +0800 Subject: [PATCH 207/207] PUB @qianmingtian https://linux.cn/article-11987-1.html --- .../20200305 Install and Use Wireshark on Ubuntu Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20200305 Install and Use Wireshark on Ubuntu Linux.md (98%) diff --git a/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md b/published/20200305 Install and Use Wireshark on Ubuntu Linux.md similarity index 98% rename from translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md rename to published/20200305 Install and Use Wireshark on Ubuntu Linux.md index 0f3a6e2b37..ec70ef40a8 100644 --- a/translated/tech/20200305 Install and Use Wireshark on Ubuntu Linux.md +++ b/published/20200305 Install and Use Wireshark on Ubuntu Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11987-1.html) [#]: subject: (Install and Use Wireshark on Ubuntu Linux) [#]: via: (https://itsfoss.com/install-wireshark-ubuntu/) [#]: author: (Community https://itsfoss.com/author/itsfoss/) @@ -182,14 +182,14 @@ via: https://itsfoss.com/install-wireshark-ubuntu/ 作者:[Kushal Rai][a] 选题:[lujun9972][b] -译者:[qianmigntian][c] +译者:[qianmingtian][c] 校对:[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 -[c]: https://github.com/qianmigntian +[c]: https://github.com/qianmingtian [1]: https://www.wireshark.org/ [2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/wireshark_ubuntu.png?ssl=1 [3]: https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallUnixInstallBins.html