diff --git a/translated/tech/20200611 Stop debugging Go with Println and use Delve instead.md b/published/20200611 Stop debugging Go with Println and use Delve instead.md similarity index 73% rename from translated/tech/20200611 Stop debugging Go with Println and use Delve instead.md rename to published/20200611 Stop debugging Go with Println and use Delve instead.md index 157e326047..ed93db45b4 100644 --- a/translated/tech/20200611 Stop debugging Go with Println and use Delve instead.md +++ b/published/20200611 Stop debugging Go with Println and use Delve instead.md @@ -1,24 +1,26 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12400-1.html) [#]: subject: (Stop debugging Go with Println and use Delve instead) [#]: via: (https://opensource.com/article/20/6/debug-go-delve) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) 使用 Delve 代替 Println 来调试 Go 程序 ====== -Delve 是能让调试变成轻而易举的事的万能工具包。 -![Bug tracking magnifying glass on computer screen][1] -你上次尝试去学习一种新的编程语言时什么时候?你有没有持之以恒,或者你是那些在新事物发布的第一时间就勇敢地去尝试的一员吗?不管怎样,学习一种新的语言也许非常有用,也会有很多乐趣。 +> Delve 是能让调试变成轻而易举的事的万能工具包。 -你尝试着写简单的 “Hello, world!”,然后写一些实例代码,运行它,继续做一些小的修改,之后继续做一些改动。我敢保证我们都有过这个经历,不论我们使用哪种技术。假如你尝试一直用一种语言,并且你希望能称为技术专家,有一些事物能在你的进取之路上帮助你。 +![](https://img.linux.net.cn/data/attachment/album/202007/09/234357pavw88sbxab0makj.jpg) + +你上次尝试去学习一种新的编程语言时什么时候?你有没有持之以恒,你是那些在新事物发布的第一时间就勇敢地去尝试的一员吗?不管怎样,学习一种新的语言也许非常有用,也会有很多乐趣。 + +你尝试着写简单的 “Hello, world!”,然后写一些示例代码并执行,继续做一些小的修改,之后继续前进。我敢保证我们都有过这个经历,不论我们使用哪种技术。假如你尝试用一段时间一种语言,并且你希望能够精通它,那么有一些事物能在你的进取之路上帮助你。 其中之一就是调试器。有些人喜欢在代码中用简单的 “print” 语句进行调试,这种方式很适合代码量少的简单程序;然而,如果你处理的是有多个开发者和几千行代码的大型项目,你应该使用调试器。 -最近我开始学习 Go 编程语言了,在本文中,我们将探讨 Delve 调试器。Delve 是专门用来调试 Go 程序的工具,我们会借助一些 Go 示例代码来了解下它的一些功能。不要担心这里展示的 Go 示例代码;即使你之前没有写过 Go 代码也能看懂。Go 的目标之一是简单,因此代码是始终如一的,理解和解释起来都很容易。 +最近我开始学习 Go 编程语言了,在本文中,我们将探讨一种名为 Delve 的调试器。Delve 是专门用来调试 Go 程序的工具,我们会借助一些 Go 示例代码来了解下它的一些功能。不要担心这里展示的 Go 示例代码;即使你之前没有写过 Go 代码也能看懂。Go 的目标之一是简单,因此代码是始终如一的,理解和解释起来都很容易。 ### Delve 介绍 @@ -26,13 +28,12 @@ Delve 是托管在 [GitHub][2] 上的一个开源项目。 它自己的文档中写道: -*Delve 是 Go 编程语言的调试器。该项目的目标是为 Go 提供一个简单、全功能的调试工具。Delve 的引入和使用都很简单。当你使用调试器时,事情可能不会按你的思路运行。如果你这样想,那么你不适合用 Delve。* +> Delve 是 Go 编程语言的调试器。该项目的目标是为 Go 提供一个简单、全功能的调试工具。Delve 应该是易于调用和易于使用的。当你使用调试器时,事情可能不会按你的思路运行。如果你这样想,那么你不适合用 Delve。 让我们来近距离看一下。 我的测试系统是运行着 Fedora Linux 的笔记本电脑,Go 编译器版本如下: - ``` $ cat /etc/fedora-release Fedora release 30 (Thirty) @@ -46,15 +47,13 @@ $ 如果你没有安装 Go,你可以运行下面的命令,很轻松地就可以从配置的仓库中获取。 - ``` -`$ dnf install golang.x86_64` +$ dnf install golang.x86_64 ``` 或者,你可以在[安装页面][3]找到适合你的操作系统的其他安装版本。 -在开始之前,请先确认已经设置好了 Go tool 依赖的下列各个 PATH。如果这些路径没有设置,有些示例可能不能正常运行。你可以在 SHELL 的 RC 文件中轻松设置这些环境变量,我的机器上是在 `$HOME/bashrc` 文件中设置的。 - +在开始之前,请先确认已经设置好了 Go 工具依赖的下列各个路径。如果这些路径没有设置,有些示例可能不能正常运行。你可以在 SHELL 的 RC 文件中轻松设置这些环境变量,我的机器上是在 `$HOME/bashrc` 文件中设置的。 ``` $ go env | grep GOPATH @@ -67,18 +66,16 @@ $ ### Delve 安装 -你可以像下面那样,通过运行一个简单的 `go get` 命令来安装 Delve。`go get` 是 Golang 从外部源下载和安装需要的包的方式。如果你安装过程中遇到了问题,可以查看[Delve 安装教程][4] - +你可以像下面那样,通过运行一个简单的 `go get` 命令来安装 Delve。`go get` 是 Golang 从外部源下载和安装需要的包的方式。如果你安装过程中遇到了问题,可以查看 [Delve 安装教程][4]。 ``` $ go get -u github.com/go-delve/delve/cmd/dlv $ ``` -运行上面的命令,就会把 Delve 下载到你的 \$GOPATH 的位置,如果你没有把 \$GOPATH 设置成其他值,那么默认情况下 \$GOPATH 和 \$HOME/go 是同一个路径。 - -你可以进入 go/ 目录,你可以在 bin/ 目录下看到 `dlv`。 +运行上面的命令,就会把 Delve 下载到你的 `$GOPATH` 的位置,如果你没有把 `$GOPATH` 设置成其他值,那么默认情况下 `$GOPATH` 和 `$HOME/go` 是同一个路径。 +你可以进入 `go/` 目录,你可以在 `bin/` 目录下看到 `dlv`。 ``` $ ls -l $HOME/go @@ -92,8 +89,7 @@ total 19596 $ ``` -因为你把 Delve 安装到了 \$GOPATH,所以你可以像运行普通的 shell 命令一样运行它,即每次运行时你不必先进入它所在的目录。你可以通过 `version` 选项来验证 `dlv` 是否正确安装。示例中安装的版本是 1.4.1。 - +因为你把 Delve 安装到了 `$GOPATH`,所以你可以像运行普通的 shell 命令一样运行它,即每次运行时你不必先进入它所在的目录。你可以通过 `version` 选项来验证 `dlv` 是否正确安装。示例中安装的版本是 1.4.1。 ``` $ which dlv @@ -106,10 +102,9 @@ Build: $Id: bda606147ff48b58bde39e20b9e11378eaa4db46 $ $ ``` -现在,我们一起在 Go 程序中使用 Delve 来理解下它的功能以及如何使用它们。我们先来写一个 `hello.go`,简单地打印一条 "Hello, world!" 信息。 - -记着,我把这些示例程序放到了 \$GOBIN 目录下。 +现在,我们一起在 Go 程序中使用 Delve 来理解下它的功能以及如何使用它们。我们先来写一个 `hello.go`,简单地打印一条 `Hello, world!` 信息。 +记着,我把这些示例程序放到了 `$GOBIN` 目录下。 ``` $ pwd @@ -126,8 +121,7 @@ func main() { $ ``` -运行 `build` 命令来编译一个 Go 程序,它的输入是 `.go` 后缀的文件。如果程序没有语法错误,Go 编译器把它编译成一个二进制或可执行文件。这个文件可以被直接运行,运行后我们会在屏幕上看到 "Hello, world!" 信息。 - +运行 `build` 命令来编译一个 Go 程序,它的输入是 `.go` 后缀的文件。如果程序没有语法错误,Go 编译器把它编译成一个二进制可执行文件。这个文件可以被直接运行,运行后我们会在屏幕上看到 `Hello, world!` 信息。 ``` $ go build hello.go @@ -144,12 +138,11 @@ $ 把一个程序加载进 Delve 调试器有两种方式。 -**在源码编译成二进制文件之前使用 debug 参数。** +#### 在源码编译成二进制文件之前使用 debug 参数 -第一种方式是在需要时对源码使用 **debug** 命令。Delve 会为你编译出一个名为 **_debug_bin** 的二进制文件,并把它加载进调试器。 - -在这个例子中,你可以进入 **hello.go** 所在的目录,然后运行 **dlv debug** 命令。如果目录中有多个源文件且每个文件都有自己的主函数,Delve 则可能抛出错误,它期望的是单个程序或从单个项目构建成单个二进制文件。如果出现了这种错误,那么你就应该用下面展示的第二种方式。 +第一种方式是在需要时对源码使用 `debug` 命令。Delve 会为你编译出一个名为 `__debug_bin` 的二进制文件,并把它加载进调试器。 +在这个例子中,你可以进入 `hello.go` 所在的目录,然后运行 `dlv debug` 命令。如果目录中有多个源文件且每个文件都有自己的主函数,Delve 则可能抛出错误,它期望的是单个程序或从单个项目构建成单个二进制文件。如果出现了这种错误,那么你就应该用下面展示的第二种方式。 ``` $ ls -l @@ -161,9 +154,7 @@ Type 'help' for list of commands. (dlv) ``` -现在打开另一个终端,列出目录下的文件。你可以看到一个多出的 **__debug_bin** 二进制文件,这个文件是由源码编译生成的,并会加载进调试器。你现在可以回到 **dlv** 提示框继续使用 Delve。 - - +现在打开另一个终端,列出目录下的文件。你可以看到一个多出来的 `__debug_bin` 二进制文件,这个文件是由源码编译生成的,并会加载进调试器。你现在可以回到 `dlv` 提示框继续使用 Delve。 ``` $ ls -l @@ -173,9 +164,9 @@ total 2036 $ ``` -**使用 exec 参数** -如果你已经有提前编译好的 Go 程序或者已经用 **go build** 命令编译完成了,不想再用 Delve 编译出 `__debug_bin` 二进制文件,那么第二种把程序加载进 Delve 的方法在这些情况下会很有用。在上述情况下,你可以使用 **exec** 参数来把整个目录加载进 Delve 调试器。 +#### 使用 exec 参数 +如果你已经有提前编译好的 Go 程序或者已经用 `go build` 命令编译完成了,不想再用 Delve 编译出 `__debug_bin` 二进制文件,那么第二种把程序加载进 Delve 的方法在这些情况下会很有用。在上述情况下,你可以使用 `exec` 命令来把整个目录加载进 Delve 调试器。 ``` $ ls -l @@ -196,8 +187,7 @@ Type 'help' for list of commands. ### 查看 delve 帮助信息 -在 **dlv** 提示框中,你可以运行 help 来查看 Delve 提供的多种帮助选项。命令列表相当长,这里我们只列举一些重要的功能。下面是 Delve 的功能概览。 - +在 `dlv` 提示符中,你可以运行 `help` 来查看 Delve 提供的多种帮助选项。命令列表相当长,这里我们只列举一些重要的功能。下面是 Delve 的功能概览。 ``` (dlv) help @@ -221,11 +211,10 @@ Type help followed by a command for full documentation. #### 设置断点 -现在我们已经把 hello.go 程序加载进了 Delve 调试器,我们在主函数处设置断点,稍后来确认它。在 Go 中,主程序从 `main.main` 处开始执行,因此你需要把这个名字提供个 `break` 命令。之后,我们可以用 `breakpoints` 命令来检查断点是否正确设置了。 +现在我们已经把 hello.go 程序加载进了 Delve 调试器,我们在主函数处设置断点,稍后来确认它。在 Go 中,主程序从 `main.main` 处开始执行,因此你需要给这个名字提供个 `break` 命令。之后,我们可以用 `breakpoints` 命令来检查断点是否正确设置了。 不要忘了你还可以用命令简写,因此你可以用 `b main.main` 来代替 `break main.main`,两者效果相同,`bp` 和 `breakpoints` 同理。你可以通过运行 `help` 命令查看帮助信息来找到你想要的命令简写。 - ``` (dlv) break main.main Breakpoint 1 set at 0x4a228f for main.main() ./hello.go:5 @@ -241,7 +230,6 @@ Breakpoint 1 at 0x4a228f for main.main() ./hello.go:5 (0) 现在,我们用 `continue` 来继续运行程序。它会运行到断点处中止,在我们的例子中,会运行到主函数的 `main.main` 处中止。从这里开始,我们可以用 `next` 命令来逐行执行程序。请注意,当我们运行到 `fmt.Println("Hello, world!")` 处时,即使我们还在调试器里,我们也能看到打印到屏幕的 `Hello, world!`。 - ``` (dlv) continue > main.main() ./hello.go:5 (hits goroutine(1):1 total:1) (PC: 0x4a228f) @@ -275,19 +263,19 @@ Hello, world! #### 退出 Delve -你随时可以运行 `quit` 命令来退出调试器,退出之后你会回到 shell 提示框。相当简单,对吗? - +你随时可以运行 `quit` 命令来退出调试器,退出之后你会回到 shell 提示符。相当简单,对吗? ``` (dlv) quit $ ``` -我们用其他的 Go 程序来探索下 Delve 的其他功能。这次,我们从 [golang 教程][5] 中找了一个程序。如果你要学习 Go 语言,那么 Golang tour 应该是你的第一站。 +### Delve 的其他功能 + +我们用其他的 Go 程序来探索下 Delve 的其他功能。这次,我们从 [golang 教程][5] 中找了一个程序。如果你要学习 Go 语言,那么 Golang 教程应该是你的第一站。 下面的程序,`functions.go` 中简单展示了 Go 程序中是怎样定义和调用函数的。这里,我们有一个简单的把两数相加并返回和值的 `add()` 函数。你可以像下面那样构建程序并运行它。 - ``` $ cat functions.go package main @@ -306,7 +294,6 @@ $ 你可以像下面那样构建和运行程序。 - ``` $ go build functions.go  && ./functions 55 @@ -317,7 +304,6 @@ $ 跟前面展示的一样,我们用前面提到的一个选项来把二进制文件加载进 Delve 调试器,再一次在 `main.main` 处设置断点,继续运行程序直到断点处。然后执行 `next` 直到 `fmt.Println(add(42, 13))` 处;这里我们调用了 `add()` 函数。我们可以像下面展示的那样,用 Delve 的 `step` 命令从 `main` 函数进入 `add()` 函数。 - ``` $ dlv debug Type 'help' for list of commands. @@ -359,8 +345,7 @@ Breakpoint 1 set at 0x4a22b3 for main.main() ./functions.go:9 #### 使用`文件名:行号`来设置断点 -上面的例子中,我们经过 `main` 函数进入了 `add()` 函数,但是你也可以在你想加断点的地方直接使用`文件名:行号`的组合。下面是在 `add()` 函数开始处加断点的另一种方式。 - +上面的例子中,我们经过 `main` 函数进入了 `add()` 函数,但是你也可以在你想加断点的地方直接使用“文件名:行号”的组合。下面是在 `add()` 函数开始处加断点的另一种方式。 ``` (dlv) break functions.go:5 @@ -382,8 +367,7 @@ Breakpoint 1 set at 0x4a2280 for main.add() ./functions.go:5 #### 查看当前的栈信息 -现在我们运行到了 `add()` 函数,我们可以在 Delve 中用 `stack` 命令查看当前栈的内容。这里在 0 位置展示了栈顶的函数 `add()` ,紧接着在 1 位置展示了调用 `add()` 函数的 `main.main`。在`main.main` 下面的函数属于 Go 运行时,是用来处理加载和执行该程序的。 - +现在我们运行到了 `add()` 函数,我们可以在 Delve 中用 `stack` 命令查看当前栈的内容。这里在 `0` 位置展示了栈顶的函数 `add()` ,紧接着在 `1` 位置展示了调用 `add()` 函数的 `main.main`。在 `main.main` 下面的函数属于 Go 运行时,是用来处理加载和执行该程序的。 ``` (dlv) stack @@ -398,10 +382,9 @@ Breakpoint 1 set at 0x4a2280 for main.add() ./functions.go:5 (dlv) ``` -#### 在 frame 间跳转 - -在 Delve 中我们可以用 `frame` 命令实现 frame 间的跳转。在下面的例子中,我们用 `frame` 实现了从 `add()` frame 跳到 `main.main` frame,以此类推。 +#### 在帧之间跳转 +在 Delve 中我们可以用 `frame` 命令实现帧之间的跳转。在下面的例子中,我们用 `frame` 实现了从 `add()` 帧跳到 `main.main` 帧,以此类推。 ``` (dlv) frame 0 @@ -430,11 +413,10 @@ Frame 1: ./functions.go:10 (PC: 4a22d7) (dlv) ``` -**打印函数参数** +#### 打印函数参数 一个函数通常会接收多个参数。在 `add()` 函数中,它的入参是两个整型。Delve 有个便捷的 `args` 命令,它能打印出命令行传给函数的参数。 - ``` (dlv) args x = 42 @@ -447,7 +429,6 @@ y = 13 由于我们是调试编译出的二进制文件,因此如果我们能查看编译器生成的汇编语言指令将会非常有用。Delve 提供了一个 `disassemble` 命令来查看这些指令。在下面的例子中,我们用它来查看 `add()` 函数的汇编指令。 - ``` (dlv) step > main.add() ./functions.go:5 (PC: 0x4a2280) @@ -475,7 +456,6 @@ TEXT main.add(SB) /home/user/go/gobin/functions.go 另一个功能是 `stepout`,这个功能可以让我们跳回到函数被调用的地方。在我们的例子中,如果我们想回到 `main.main` 函数,我们只需要简单地运行 `stepout` 命令,它就会把我们带回去。在我们调试大型代码库时,这个功能会是一个非常便捷的工具。 - ``` (dlv) stepout > main.main() ./functions.go:10 (PC: 0x4a22d7) @@ -492,8 +472,9 @@ Values returned: (dlv) ``` -我们一起通过 [Go 教程][6] 的另一个示例程序来看下 Delve 是怎么处理 Go 中的变量的。下面的示例程序定义和初始化了一些不同类型的变量。你可以构建和运行程序。 +#### 打印变量信息 +我们一起通过 [Go 教程][6] 的另一个示例程序来看下 Delve 是怎么处理 Go 中的变量的。下面的示例程序定义和初始化了一些不同类型的变量。你可以构建和运行程序。 ``` $ cat variables.go @@ -514,11 +495,8 @@ $ go build variables.go &&; ./variables $ ``` -#### 打印变量信息 - 像前面说过的那样,用 `delve debug` 在调试器中加载程序。你可以在 Delve 中用 `print` 命令通过变量名来展示他们当前的值。 - ``` (dlv) print c true @@ -529,7 +507,6 @@ true 或者,你还可以用 `locals` 命令来打印函数内所有的局部变量。 - ``` (dlv) locals python = false @@ -540,7 +517,6 @@ java = "no!" 如果你不知道变量的类型,你可以用 `whatis` 命令来通过变量名来打印它的类型。 - ``` (dlv) whatis python bool @@ -553,7 +529,7 @@ string ### 总结 -现在我们只是了解了 Delve 所有功能的皮毛。你可以自己去查看 `help` 内容,尝试下其他的命令。你还可以把 Delve 绑定到运行中的 Go 程序上(守护进程!),如果你安装了 Go 源码库,你甚至可以用 Delve 导出 Golang 库内部的信息。勇敢去探索吧! +现在我们只是了解了 Delve 所有功能的皮毛。你可以自己去查看帮助内容,尝试下其它的命令。你还可以把 Delve 绑定到运行中的 Go 程序上(守护进程!),如果你安装了 Go 源码库,你甚至可以用 Delve 导出 Golang 库内部的信息。勇敢去探索吧! -------------------------------------------------------------------------------- @@ -562,7 +538,7 @@ via: https://opensource.com/article/20/6/debug-go-delve 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20200702 Ex-Solus Dev is Now Creating a Truly Modern Linux Distribution Called Serpent Linux.md b/published/20200702 Ex-Solus Dev is Now Creating a Truly Modern Linux Distribution Called Serpent Linux.md similarity index 69% rename from translated/tech/20200702 Ex-Solus Dev is Now Creating a Truly Modern Linux Distribution Called Serpent Linux.md rename to published/20200702 Ex-Solus Dev is Now Creating a Truly Modern Linux Distribution Called Serpent Linux.md index c2765f5028..a8c6507f06 100644 --- a/translated/tech/20200702 Ex-Solus Dev is Now Creating a Truly Modern Linux Distribution Called Serpent Linux.md +++ b/published/20200702 Ex-Solus Dev is Now Creating a Truly Modern Linux Distribution Called Serpent Linux.md @@ -1,28 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12401-1.html) [#]: subject: (Ex-Solus Dev is Now Creating a Truly Modern Linux Distribution Called Serpent Linux) [#]: via: (https://itsfoss.com/serpent-os-announcement/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -前 Solus 开发人员正创建一个名为 Serpent Linux 的真正现代的 Linux 发行版 +Solus Linux 创始人正在开发一个没有 GNU 的“真正现代”的 Linux 发行版 ====== 曾经创建独立 Linux 发行版 Solus 的开发人员 [Ikey Doherty][1] 宣布了他的新项目:Serpent OS。 -[Serpent OS][2]是一个不想被归类为“轻便、用户友好、注重隐私的 Linux 桌面发行版”。 +[Serpent OS][2] 是一个**不想**被归类为“轻量级、用户友好、注重隐私的 Linux 桌面发行版”。 相反,Serpent OS 具有“与主流产品不同的目标”。具体怎么样?请继续阅读。 -### Serpent OS:制作“真正现代的” Linux 发行版 +### Serpent OS:制作“真正现代”的 Linux 发行版 ![][3] -Serpent 采用发行优先,兼容靠后的方法。这使他们可以做出一些非常大胆的决定。 +Serpent 采用发行版优先,兼容靠后的方法。这使他们可以做出一些非常大胆的决定。 -Ikey 表示,这个项目不会对阻碍 Linux 的负面角色容忍。例如,不会容忍 NVIDIA 在其 GPU 上缺乏对 Wayland 加速支持的支持,并且 NVIDIA 专有驱动将加入发行版黑名单。 +Ikey 表示,这个项目不会对阻碍 Linux 的负面角色容忍。例如,不会容忍 NVIDIA 在其 GPU 上缺乏对 Wayland 加速的支持,并将 NVIDIA 专有驱动加入发行版黑名单。 这是 Serpent Linux 项目的拟议计划(摘自[其网站][4]): @@ -30,36 +30,34 @@ Ikey 表示,这个项目不会对阻碍 Linux 的负面角色容忍。例如 * 100% clang 构建(包括内核) * musl 作为 libc,依靠编译器优化而不是内联 asm * 使用 libc++ 而不是 libstdc++ - * LLVM的 binutils 变体(lld、as 等) - * 混合源/二进制分发 - * 从 x86_64 通用基线转移到更新的 CPU,包括针对 Intel 和 AMD 的优化 + * LLVM 的 binutils 变体(lld、as 等) + * 混合源代码/二进制分发 + * 从 x86\_64 通用基线转移到更新的 CPU,包括针对 Intel 和 AMD 的优化 * 包管理器中基于功能的订阅(硬件/用户选择等) - * 只支持 `UEFI`。不支持老式启动方式。 + * 只支持 UEFI。不支持老式启动方式 * 完全开源,包括引导程序/重建脚本 - * 针对高工作负载进行了认真的优化。 + * 针对高工作负载进行了认真的优化 * 第三方应用仅依赖于容器。没有兼容性修改 * 仅支持 Wayland。将调查通过容器的 X11 兼容性 * 完全无状态的管理工具和上游补丁 - - Ikey 大胆地宣称 Serpent Linux 不是 Serpent GNU/Linux,因为它不再依赖于 GNU 工具链或运行时。 Serpent OS 项目的开发将于 7 月底开始。没有确定最终稳定版本的时间表。 -### 要求过高?但是 Ikey 过去做过 +### 要求过高?但是 Ikey 过去做到了 你可能会怀疑 Serpent OS 是否会出现,是否能够兑现其所作的所有承诺。 -但是 Ikey Doherty 过去已经做过。如果我没记错的话,他首先基于 Debian 创建了 SolusOS。他于 2013 年停止了基于 [Debian 的 SolusOS][5] 的开发,甚至它还没有进入 Beta 阶段。 +但是 Ikey Doherty 过去已经做到了。如果我没记错的话,他首先基于 Debian 创建了 SolusOS。他于 2013 年停止了基于 [Debian 的 SolusOS][5] 的开发,甚至它还没有进入 Beta 阶段。 -然后,他从头开始创建 [evolve OS][6],而不是使用其他发行版作为基础。由于某些命名版权问题,项目名称已更改为 Solus(是的,相同的旧名称)。[Ikey 在 2018 年退出了 Solus项目][7],其他开发人员现在负责该项目。 +然后,他从头开始创建 [evolve OS][6],而不是使用其他发行版作为基础。由于某些命名版权问题,项目名称已更改为 Solus(是的,相同的旧名称)。[Ikey 在 2018 年退出了 Solus 项目][7],其他开发人员现在负责该项目。 Solus 是一个独立的 Linux 发行版,它为我们提供了漂亮的 Budgie 桌面环境。 Ikey 过去做到了(当然,在其他开发人员的帮助下)。他现在也应该能够做到。 -**看好还是不看好?** +### 看好还是不看好? 你如何看待这个 Serpent Linux?你是否认为是时候让开发人员采取大胆的立场,并着眼于未来开发操作系统,而不是坚持过去?请分享你的观点。 @@ -70,7 +68,7 @@ via: https://itsfoss.com/serpent-os-announcement/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20200626 Open source tools for translating British to American English.md b/sources/tech/20200626 Open source tools for translating British to American English.md deleted file mode 100644 index 66c0f53ece..0000000000 --- a/sources/tech/20200626 Open source tools for translating British to American English.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open source tools for translating British to American English) -[#]: via: (https://opensource.com/article/20/6/british-american-cli-translator) -[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) - -Open source tools for translating British to American English -====== -Convert British English to American English (and vice versa) with these -command-line translators. -![Red telephone booth on a street in England][1] - -Last Christmas, my wife and I traveled to my hometown of Ft. Pierce, Florida, and frequented a local establishment on the beach. There, we met a couple from The Midlands in the UK. The music was loud and so was the beer, so it was a bit hard to hear. Plus, even though it "seemed" they were speaking English, it was sometimes a challenge to understand what they were saying. I thought my time in Australia would have given me enough linguistic power, but, alas, a lot went over my head. There was more than the usual "soccer is football" or "trunk is a boot" sort of confusion. - -Fortunately, there are open source solutions to translate "British" into "American." We may speak the same language, but our shared speech takes more twists and turns than Zig Zag Hill in Shaftesbury, Dorset! - -If you happen to be at the bar with your Linux laptop, you can use a handy open source command-line program, cleverly called the [American British English Translator][2] (MIT license). - -I installed the Translator on my repurposed MacBook running Linux with: - - -``` -`$ npm install -g american-british-english-translator` -``` - -Which required me to [install Node.js][3] first. - -### I do declare! - -In addition to translating words and phrases, the American British English Translator will analyze, ummm, analyse, documents. I gave this a go with a popular document called _The Declaration of Independence_. (tl;dr). It analyzed the document and returned many results. One of the more interesting was: - - -``` -fall: -issue: Different meanings -details: -American English: autumn -British English: -""" -to become pregnant. (Either as in 'I fell pregnant' or as in 'She fell for a baby.'); -``` - -Not exactly "taken captive on the high seas" as the *Declaration's *authors accused: - -> "He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, or to fall themselves by their Hands." - -### Along comes MARY - -For simple word replacements, you can try [Common_Language][4], an open source (MIT license) Python script. - -Of course, if you're sharing a pint with your mates, you may need to actually speak to them in a voice and language they will understand. This would be a good time to bring MARY along with you. - -[MaryTTS][5] is an open source, multilingual text-to-speech synthesis platform written in Java (GNU license). The handy [browser-based interface][6] makes it easy to translate your American bar talk into right good English (or other languages) in either a male or female voice. - -So, now I am ready to meet my British friends (when it is safe to do so again), grab a few pints, and—Bob's your uncle—speak English like a native! Cheerio, y'all! - -Translating documentation takes time and effort, but not nearly as much as starting over from... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/6/british-american-cli-translator - -作者:[Jeff Macharyas][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jeffmacharyas -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/england-telephone-booth-street.jpg?itok=JQsc_piX (Red telephone booth on a street in England) -[2]: https://github.com/hyperreality/American-British-English-Translator -[3]: https://nodejs.org/en/download/ -[4]: https://github.com/willettk/common_language -[5]: https://github.com/marytts/marytts -[6]: http://mary.dfki.de:59125/ diff --git a/sources/tech/20200701 13 Things To Do After Installing Linux Mint 20.md b/sources/tech/20200701 13 Things To Do After Installing Linux Mint 20.md deleted file mode 100644 index 0378c29cde..0000000000 --- a/sources/tech/20200701 13 Things To Do After Installing Linux Mint 20.md +++ /dev/null @@ -1,210 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (13 Things To Do After Installing Linux Mint 20) -[#]: via: (https://itsfoss.com/things-to-do-after-installing-linux-mint-20/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -13 Things To Do After Installing Linux Mint 20 -====== - -Linux Mint is easily one of the [best Linux distributions][1] out there and especially considering the features of [Linux Mint 20][2], I’m sure you will agree with that. - -In case you missed our coverage, [Linux Mint 20 is finally available to download][3]. - -Of course, if you’ve been using Linux Mint for a while, you probably know what’s best for you. But, for new users, there are a few things that you need to do after installing Linux Mint 20 to make your experience better than ever. - -### Recommended things to do after installing Linux Mint 20 - -In this article, I’m going to list some of them for to help you improve your Linux Mint 20 experience. - -#### 1\. Perform a System Update - -![][4] - -The first thing you should check right after installation is — system updates using the update manager as shown in the image above. - -Why? Because you need to build the local cache of available software. It is also a good idea to update all the software updates. - -If you prefer to use the terminal, simply type the following command to perform a system update: - -``` -sudo apt update && sudo apt upgrade -y -``` - -#### 2\. Use Timeshift to Create System Snapshots - -![][5] - -It’s always useful have system snapshots if you want to quickly restore your system state after an accidental change or maybe after a bad update. - -Hence, it’s super important to configure and create system snapshots using Timeshift if you want the ability to have a backup of your system state from time to time. - -You can follow our detailed guide on [using Timeshift][6], if you didn’t know already. - -#### 3\. Install Useful Software - -Even though you have a bunch of useful pre-installed applications on Linux Mint 20, you probably need to install some essential apps that do not come baked in. - -You can simply utilize the software manager or the synaptic package manager to find and install software that you need. - -For starters, you can follow our list of [essential Linux apps][7] if you want to explore a variety of tools. - -Here’s a list of my favorite software that I’d want you to try: - - * [VLC media player][8] for video - * [FreeFileSync][9] to sync files - * [Flameshot][10] for screenshots - * [Stacer][11] to optimize and monitor system - * [ActivityWatch][12] to track your screen time and stay productive - - - -#### 4\. Customize the Themes and Icons - -![][13] - -Of course, this isn’t something technically essential unless you want to change the look and feel of Linux Mint 20. - -But, it’s very [easy to change the theme and icons in Linux Mint][14] 20 without installing anything extra. - -You get the option to customize the look in the welcome screen itself. In either case, you just need to head on to “**Themes**” and start customizing. - -![][15] - -To do that, you can search for it or find it inside the System Settings as shown in the screenshot above. - -Depending on what desktop environment you are on, you can also take a look at some of the [best icon themes][16] available. - -#### 5\. Enable Redshift to protect your eyes - -![][17] - -You can search for “[Redshift][18]” on Linux Mint and launch it to start protecting your eyes at night. As you can see in the screenshot above, it will automatically adjust the color temperature of the screen depending on the time. - -You may want to enable the autostart option so that it launches automatically when you restart the computer. It may not be the same as the night light feature on [Ubuntu 20.04 LTS][19] but it’s good enough if you don’t need custom schedules or the ability to the tweak the color temperature. - -#### 6\. Enable snap (if needed) - -Even though Ubuntu is pushing to use Snap more than ever, the Linux Mint team is against it. Hence, it forbids APT to use snapd. - -So, you won’t have the support for snap out-of-the-box. However, sooner or later, you’ll realize that some software is packaged only in Snap format. In such cases, you’ll have to enable snap support on Mint. - -``` -sudo apt install snapd -``` - -Once you do that, you can follow our guide to know more about [installing and using snaps on Linux][20]. - -#### 7\. Learn to use Flatpak - -By default, Linux Mint comes with the support for Flatpak. So, no matter whether you hate using snap or simply prefer to use Flatpak, it’s good to have it baked in. - -Now, all you have to do is follow our guide on [using Flatpak on Linux][21] to get started! - -#### 8\. Clean or Optimize Your System - -It’s always good to optimize or clean up your system to get rid of unnecessary junk files occupying storage space. - -You can quickly remove unwanted packages from your system by typing this in your terminal: - -``` -sudo apt autoremove -``` - -In addition to this, you can also follow some of our [tips to free up space on Linux Mint][22]. - -#### 9\. Using Warpinator to send/receive files across the network - -Warpinator is a new addition to Linux Mint 20 to give you the ability to share files across multiple computers connected to a network. Here’s how it looks: - -![][23] - -You can just search for it in the menu and get started! - -#### 10\. Using the driver manager - -![Driver Manager][24] - -The driver manager is an important place to look for if you’re using Wi-Fi devices that needs a driver, NVIDIA graphics, or AMD graphics, and drivers for other devices if applicable. - -You just need look for the driver manager and launch it. It should detect any proprietary drivers in use or you can also utilize a DVD to install the driver using the driver manager. - -#### 11\. Set up a Firewall - -![][25] - -For the most part, you might have already secured your home connection. But, if you want to have some specific firewall settings on Linux Mint, you can do that by searching for “Firewall” in the menu. - -As you can observe the screenshot above, you get the ability to have different profiles for home, business, and public. You just need to add the rules and define what is allowed and what’s not allowed to access the Internet. - -You may read our detailed guide on [using UFW for configuring a firewall][26]. - -#### 12\. Learn to Manage Startup Apps - -If you’re an experienced user, you probably know this already. But, new users often forget to manage their startup applications and eventually, the system boot time gets affected. - -You just need to search for “**Startup Applications**” from the menu and you can launch it find something like this: - -![][27] - -You can simply toggle the ones that you want to disable, add a delay timer, or remove it completely from the list of startup applications. - -#### 13\. Install Essential Apps For Gaming - -Of course, if you’re into gaming, you might want to read our article for [Gaming on Linux][28] to explore all the options. - -But, for starters, you can try installing [GameHub][29], [Steam][30], and [Lutris][31] to play some games. - -**Wrapping Up** - -That’s it folks! For the most part, you should be good to go if you follow the points above after installing Linux Mint 20 to make the best out of it. - -I’m sure there are more things you can do. I’d like to know what you prefer to do right after installing Linux Mint 20. Let me know your thoughts in the comments below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/things-to-do-after-installing-linux-mint-20/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-linux-distributions/ -[2]: https://itsfoss.com/linux-mint-20/ -[3]: https://itsfoss.com/linux-mint-20-download/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-system-update.png?ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/07/snapshot-linux-mint-timeshift.jpeg?ssl=1 -[6]: https://itsfoss.com/backup-restore-linux-timeshift/ -[7]: https://itsfoss.com/essential-linux-applications/ -[8]: https://www.videolan.org/vlc/ -[9]: https://itsfoss.com/freefilesync/ -[10]: https://itsfoss.com/flameshot/ -[11]: https://itsfoss.com/optimize-ubuntu-stacer/ -[12]: https://itsfoss.com/activitywatch/ -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-theme.png?ssl=1 -[14]: https://itsfoss.com/install-icon-linux-mint/ -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-system-settings.png?ssl=1 -[16]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ -[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-redshift-1.png?ssl=1 -[18]: https://itsfoss.com/install-redshift-linux-mint/ -[19]: https://itsfoss.com/ubuntu-20-04-release-features/ -[20]: https://itsfoss.com/install-snap-linux/ -[21]: https://itsfoss.com/flatpak-guide/ -[22]: https://itsfoss.com/free-up-space-ubuntu-linux/ -[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mint-20-warpinator-1.png?ssl=1 -[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2013/12/Additional-Driver-Linux-Mint-16.png?ssl=1 -[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-firewall.png?ssl=1 -[26]: https://itsfoss.com/set-up-firewall-gufw/ -[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-startup-applications.png?ssl=1 -[28]: https://itsfoss.com/linux-gaming-guide/ -[29]: https://itsfoss.com/gamehub/ -[30]: https://store.steampowered.com -[31]: https://lutris.net diff --git a/sources/tech/20200708 How to decipher Linux release info.md b/sources/tech/20200708 How to decipher Linux release info.md index f1b924433a..3988d82a2b 100644 --- a/sources/tech/20200708 How to decipher Linux release info.md +++ b/sources/tech/20200708 How to decipher Linux release info.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200709 Expand your Raspberry Pi with Arduino ports.md b/sources/tech/20200709 Expand your Raspberry Pi with Arduino ports.md new file mode 100644 index 0000000000..611b965f5b --- /dev/null +++ b/sources/tech/20200709 Expand your Raspberry Pi with Arduino ports.md @@ -0,0 +1,602 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Expand your Raspberry Pi with Arduino ports) +[#]: via: (https://opensource.com/article/20/7/arduino-raspberry-pi) +[#]: author: (Patrick Martins de Lima https://opensource.com/users/pattrickx) + +Expand your Raspberry Pi with Arduino ports +====== +For this project, explore Raspberry Pi port expansions using Java, +serial, and Arduino. +![Parts, modules, containers for software][1] + +As members of the maker community, we are always looking for creative ways to use hardware and software. This time, [Patrick Lima][2] and I decided we wanted to expand the Raspberry Pi's ports using an Arduino board, so we could access more functionality and ports and add a layer of protection to the device. There are a lot of ways to use this setup, such as building a solar panel that follows the sun, a home weather station, joystick interaction, and more. + +We decided to start by building a dashboard that allows the following serial port interactions: + + * Control three LEDs to turn them on and off + * Control three LEDs to adjust their light intensity + * Identify which ports are being used + * Show input movements on a joystick + * Measure temperature + + + +We also want to show all the interactions between ports, hardware, and sensors in a nice user interface (UI) like this: + +![UI dashboard][3] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +You can use the concepts in this article to build many different projects that use many different components. Your imagination is the limit! + +### 1\. Get started + +![Raspberry Pi and Arduino logos][5] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +The first step is to expand the Raspberry Pi's ports to also use Arduino ports. This is possible using Linux ARM's native serial communication implementation that enables you to use an Arduino's digital, analogical, and Pulse Width Modulation (PWM) ports to run an application on the Raspberry Pi. + +This project uses [TotalCross][6], an open source software development kit for building UIs for embedded devices, to execute external applications through the terminal and use the native serial communication. There are two classes you can use to achieve this: [Runtime.exec][7] and [PortConnector][8]. They represent different ways to execute these actions, so we will show how to use both in this tutorial, and you can decide which way is best for you. + +To start this project, you need: + + * 1 Raspberry Pi 3 + * 1 Arduino Uno + * 3 LEDs + * 2 resistors between 1K and 2.2K ohms + * 1 push button + * 1 potentiometer between 1K and 50K ohms + * 1 protoboard (aka breadboard) + * Jumpers + + + +### 2\. Set up the Arduino + +Create a communication protocol to receive messages, process them, execute the request, and send a response between the Raspberry Pi and the Arduino. This is done on the Arduino. + +#### 2.1 Define the message format + +Every message received will have the following format: + + * Indication of the function called + * Port used + * A char separator, if needed + * A value to be sent, if needed + * Indication of the message's end + + + +The following table presents the list of characters with their respective functions, example values, and descriptions of the example. The choice of characters used in this example is arbitrary and can be changed anytime. + +Characters | Function | Example | Description of the example +---|---|---|--- +* | End of the instruction | - | - +, | Separator | - | - +# | Set mode | #8,0* | Pin 8 input mode +< | Set digital value | <1,0* | Set pin 1 low +> | Get digital value | >13* | Get value pin 13 ++ | Get PWM value | +6,250* | Set pin 6 value 250 +- | Get analogic value | -14* | Get value pin A0 + +#### 2.2 Source code + +The following source code implements the communication protocol specified above. It must be sent to the Arduino, so it can interpret and execute messages' commands: + + +``` +void setup() { + Serial.begin(9600); + Serial.println("Connected"); + Serial.println("Waiting command..."); +} + +void loop() { +String text=""; +char character; +String pin=""; +String value="0"; +char separator='.'; +char inst='.'; + + while(Serial.available()){ // verify RX is getting data +   delay(10); +   character= Serial.read(); +   if(character=='*'){ +     action(inst,pin,value); +     break; +    } +    else { +     text.concat(character);} + +   if(character==',') { +     separator=character; +    +   if(inst=='.'){ +     inst = character;} +   else if(separator!=',' && character!=inst ){ +     pin.concat(character);} +   else if (character!=separator && character!=inst ){ +     value.concat(character);} + } +} + +void action(char instruction, String pin, String value){ + if (instruction=='#'){//pinMode +   pinMode(pin.toInt(),value.toInt()); + } + + if (instruction=='<'){//digitalWrite +   digitalWrite(pin.toInt(),value.toInt()); + } + + if (instruction=='>'){ //digitalRead +   String aux= pin+':'+String(digitalRead(pin.toInt())); +   Serial.println(aux); + } + + if (instruction=='+'){ // analogWrite = PWM +   analogWrite(pin.toInt(),value.toInt()); + } + + if (instruction=='-'){ // analogRead +   String aux= pin+':'+String(analogRead(pin.toInt())); +   Serial.println(aux); + } +} +``` + +#### 2.3 Build the electronics + +Define what you need to test to check communication with the Arduino and ensure the inputs and outputs are responding as expected: + + * LEDs are connected with positive logic. Connect to the GND pin through a resistor and activate it with the digital port I/O 2 and PWM 3. + * The button has a pull-down resistor connected to the digital port I/O 4, which sends a signal of 0 if not pressed and 1 if pressed. + * The potentiometer is connected with the central pin to the analog input A0 with one of the side pins on the positive and the other on the negative. + + + +![Connecting the hardware][9] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +#### 2.4 Test communications + +Send the code in section 2.2 to the Arduino. Open the serial monitor and check the communication protocol by sending the commands below: + + +``` +#2,1*<2,1*>2* +#3,1*+3,10* +#4,0*>4* +#14,0*-14* +``` + +This should be the result in the serial monitor: + +![Testing communications in Arduino][10] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +One LED on the device should be on at maximum intensity and the other at a lower intensity. + +![LEDs lit on board][11] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +Pressing the button and changing the position of the potentiometer when sending reading commands will display different values. For example, turn the potentiometer to the positive side and press the button. With the button still pressed, send the commands: + + +``` +>4* +-14* +``` + +Two lines should appear: + +![Testing communications in Arduino][12] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +### 3\. Set up the Raspberry Pi + +Use a Raspberry Pi to access the serial port via the terminal using the `cat` command to read the entries and the `echo` command to send the message. + +#### 3.1 Do a serial test + +Connect the Arduino to one of the USB ports on the Raspberry Pi, open the terminal, and execute this command: + + +``` +`cat /dev/ttyUSB0 9600` +``` + +This will initiate the connection with the Arduino and display what is returned to the serial. + +![Testing serial on Arduino][13] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +To test sending commands, open a new terminal window (keeping the previous one open), and send this command: + + +``` +`echo "command" > /dev/ttyUSB0 9600` +``` + +You can send the same commands used in section 2.4. + +You should see feedback in the first terminal along with the same result you got in section 2.4: + +![Testing serial on Arduino][14] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +### 4\. Create the graphical user interface + +The UI for this project will be simple, as the objective is just to show the ports expansion using the serial. Another article will use TotalCross to create a high-quality GUI for this project and start the application backend (working with sensors), as shown in the dashboard image at the top of this article. + +This first part uses two UI components: a Listbox and an Edit. These build a connection between the Raspberry Pi and the Arduino and test that everything is working as expected. + +Simulate the terminal where you put the commands and watch for answers: + + * Edit is used to send messages. Place it at the bottom with a FILL width that extends the component to the entire width of the screen. + * Listbox is used to show results, e.g., in the terminal. Add it at the TOP position, starting at the LEFT side, with a width equal to Edit and a FIT height to vertically occupy all space not filled by Edit. + + + + +``` +package com.totalcross.sample.serial; + +import totalcross.sys.Settings; +import totalcross.ui.Edit; +import totalcross.ui.ListBox; +import totalcross.ui.MainWindow; +import totalcross.ui.gfx.Color; + +public class SerialSample extends MainWindow { +   ListBox Output; +   Edit Input; +   public SerialSample() { +       setUIStyle(Settings.MATERIAL_UI); +   } + +   @Override +   public void initUI() { +       Input = new Edit(); +       add(Input, LEFT, BOTTOM, FILL, PREFERRED); +       Output = new ListBox(); +       Output.setBackForeColors([Color][15].BLACK, [Color][15].WHITE); +       add(Output, LEFT, TOP, FILL, FIT); +   } +} +``` + +It should look like this: + +![UI][16] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +### 5\. Set up serial communication + +As stated above, there are two ways to set up serial communication: Runtime.exec and PortConnector. + +#### 5.1 Option 1: Use Runtime.exec + +The `java.lang.Runtime` class allows the application to create a connection interface with the environment where it is running. It allows the program to use the Raspberry Pi's native serial communication. + +Use the same commands you used in section 3.1, but now use the Edit component on the UI to send the commands to the device. + +##### Read the serial + +The application must constantly read the serial, and if a value is returned, add it to the Listbox using threads. Threads are a great way to work with processes in the background without blocking user interaction. + +The following code creates a new process on this thread that executes the `cat` command, tests the serial, and starts an infinite loop to check if something new is received. If something is received, the value is added to the next line of the Listbox component. This process will continue to run as long as the application is running: + + +``` +new [Thread][17] () { +   @Override +   public void run() { +       try { +           [Process][18] Runexec2 = [Runtime][19].getRuntime().exec("cat /dev/ttyUSB0 9600\n"); +           LineReader lineReader = new LineReader(Stream.asStream(Runexec2.getInputStream())); +           [String][20] input; +          +           while (true) { +               if ((input = lineReader.readLine()) != null) { +                   Output.add(input); +                   Output.selectLast(); +                   Output.repaintNow(); +               } +           } +         } catch ([IOException][21] ioe) { +            ioe.printStackTrace(); +         } +       } +   }.start(); +} +``` + +##### Send commands + +Sending commands is a simpler process. It happens whenever you press **Enter** on the Edit component. + +To forward the commands to the device, as shown in section 3.1, you must instantiate a new terminal. For that, the Runtime class must execute a `sh` command on Linux: + + +``` +try{ +   Runexec = [Runtime][19].getRuntime().exec("sh").getOutputStream()        }catch ([IOException][21] ioe) { +   ioe.printStackTrace(); +} +``` + +After the user writes the command in Edit and presses **Enter**, the application triggers an event that executes the `echo` command with the value indicated in Edit: + + +``` +Input.addKeyListener(new [KeyListener][22]() { + +   @Override +   public void specialkeyPressed([KeyEvent][23] e) { +       if (e.key == SpecialKeys.ENTER) { +           [String][20] s = Input.getText(); +           Input.clear(); +           try { +               Runexec.write(("echo \"" + s + "\" > /dev/ttyUSB0 9600\n").getBytes()); +           } catch ([IOException][21] ioe) { +           ioe.printStackTrace(); +           } +       } +   } + +   @Override +   public void keyPressed([KeyEvent][23] e) {} //auto-generate code +   @Override +   public void actionkeyPressed([KeyEvent][23] e) {} //auto-generate code +}); +``` + +Run the application on the Raspberry Pi with the Arduino connected and send the commands for testing. The result should be: + +![Testing application running on Raspberry Pi][24] + +(Bruno Muniz, [CC BY-SA 4.0][4]) + +##### Runtime.exec source code + +Following is the source code with all parts explained. It includes the thread that will read the serial on line 31 and the `KeyListener` that will send the commands on line 55: + + +``` +package com.totalcross.sample.serial; +import totalcross.ui.MainWindow; +import totalcross.ui.event.KeyEvent; +import totalcross.ui.event.KeyListener; +import totalcross.ui.gfx.Color; +import totalcross.ui.Edit; +import totalcross.ui.ListBox; +import java.io.IOException; +import java.io.OutputStream; +import totalcross.io.LineReader; +import totalcross.io.Stream; +import totalcross.sys.Settings; +import totalcross.sys.SpecialKeys; + +public class SerialSample extends MainWindow { +   [OutputStream][25] Runexec; +   ListBox Output; + +   public SerialSample() { +       setUIStyle(Settings.MATERIAL_UI); +   } + +   @Override +   public void initUI() { +       Edit Input = new Edit(); +       add(Input, LEFT, BOTTOM, FILL, PREFERRED); +       Output = new ListBox(); +       Output.setBackForeColors([Color][15].BLACK, [Color][15].WHITE); +       add(Output, LEFT, TOP, FILL, FIT); +       new [Thread][17]() { +           @Override +           public void run() { +               try { +                   [Process][18] Runexec2 = [Runtime][19].getRuntime().exec("cat /dev/ttyUSB0 9600\n"); +                   LineReader lineReader = new +                   LineReader(Stream.asStream(Runexec2.getInputStream())); +                   [String][20] input; + +                   while (true) { +                       if ((input = lineReader.readLine()) != null) { +                           Output.add(input); +                           Output.selectLast(); +                           Output.repaintNow(); +                       } +                   } + +               } catch ([IOException][21] ioe) { +                   ioe.printStackTrace(); +               } +           } +       }.start(); + +       try { +           Runexec = [Runtime][19].getRuntime().exec("sh").getOutputStream(); +       } catch ([IOException][21] ioe) { +           ioe.printStackTrace(); +       } + +       Input.addKeyListener(new [KeyListener][22]() { +           @Override +           public void specialkeyPressed([KeyEvent][23] e) { +               if (e.key == SpecialKeys.ENTER) { +                   [String][20] s = Input.getText(); +                   Input.clear(); +                   try { +                       Runexec.write(("echo \"" + s + "\" > /dev/ttyUSB0 9600\n").getBytes()); +                   } catch ([IOException][21] ioe) { +                       ioe.printStackTrace(); +                   } +               } +           } + +           @Override +           public void keyPressed([KeyEvent][23] e) { +           } +           @Override +           public void actionkeyPressed([KeyEvent][23] e) { +           } +      }); +   } +} +``` + +#### 5.2 Option 2: Use PortConnector + +PortConnector is specifically for working with serial communication. If you want to follow the original example, you can skip this section, as the intention here is to show another, easier way to work with serial. + +Change the original source code to work with PortConnector: + + +``` +package com.totalcross.sample.serial; +import totalcross.io.LineReader; +import totalcross.io.device.PortConnector; +import totalcross.sys.Settings; +import totalcross.sys.SpecialKeys; +import totalcross.ui.Edit; +import totalcross.ui.ListBox; +import totalcross.ui.MainWindow; +import totalcross.ui.event.KeyEvent; +import totalcross.ui.event.KeyListener; +import totalcross.ui.gfx.Color; + +public class SerialSample extends MainWindow { +   PortConnector pc; +   ListBox Output; + +   public SerialSample() { +       setUIStyle(Settings.MATERIAL_UI); +   } + +   @Override +   public void initUI() { +       Edit Input = new Edit(); +       add(Input, LEFT, BOTTOM, FILL, PREFERRED); +       Output = new ListBox(); +       Output.setBackForeColors([Color][15].BLACK, [Color][15].WHITE); +       add(Output, LEFT, TOP, FILL, FIT); +       new [Thread][17]() { +           @Override +           public void run() { +               try { +                   pc = new PortConnector(PortConnector.USB, 9600); +                   LineReader lineReader = new LineReader(pc); +                   [String][20] input; +                   while (true) { +                       if ((input = lineReader.readLine()) != null) { +                           Output.add(input); +                           Output.selectLast(); +                           Output.repaintNow(); +                       } +                   } +               } catch (totalcross.io.[IOException][21] ioe) { +                   ioe.printStackTrace(); +               } +           } +       }.start(); +       Input.addKeyListener(new [KeyListener][22]() { +           @Override +           public void specialkeyPressed([KeyEvent][23] e) { +               if (e.key == SpecialKeys.ENTER) { +                   [String][20] s = Input.getText(); +                   Input.clear(); +                   try { +                       pc.writeBytes(s); +                   } catch (totalcross.io.[IOException][21] ioe) { +                       ioe.printStackTrace(); +                   } +               } +           } + +           @Override +           public void keyPressed([KeyEvent][23] e) { +           } + +           @Override +           public void actionkeyPressed([KeyEvent][23] e) { +           } +      }); +  } +} +``` + +You can find all the code in the [project's repository][26]. + +### 6\. Next steps + +This article shows how to use Raspberry Pi serial ports with Java by using either the Runtime or PortConnector classes. You can also call external files in other languages and create countless other projects—like a water quality monitoring system for an aquarium with temperature measurement via the analog inputs, or a chicken brooder with temperature and humidity regulation and a servo motor to rotate the eggs. + +A future article will use the PortConnector implementation (because it is focused on serial connection) to finish the communications with all sensors. It will also add a digital input and complete the UI. + +Here are some references for more reading: + + * [Get started with TotalCross][27] + * [TotalCross PortConnector class][8] + * [Running C++ applications with TotalCross][7] + * [VSCode TotalCross Project Extension plugin][28] + + + +After you connect your Arduino and Raspberry Pi, please leave comments below with your results. We'd love to read them! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/7/arduino-raspberry-pi + +作者:[Patrick Martins de Lima][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/pattrickx +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_modules_networking_hardware_parts.png?itok=rPpVj92- (Parts, modules, containers for software) +[2]: https://github.com/pattrickx +[3]: https://opensource.com/sites/default/files/uploads/gui-dashboard.png (UI dashboard) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/raspberrypi_arduino.png (Raspberry Pi and Arduino logos) +[6]: https://totalcross.com/ +[7]: https://learn.totalcross.com/documentation/guides/running-c++-applications-with-totalcross +[8]: https://rs.totalcross.com/doc/totalcross/io/device/PortConnector.html +[9]: https://opensource.com/sites/default/files/uploads/connecting-electronics.png (Connecting the hardware) +[10]: https://opensource.com/sites/default/files/uploads/communication-test-result.png (Testing communications in Arduino) +[11]: https://opensource.com/sites/default/files/uploads/leds.jpg (LEDs lit on board) +[12]: https://opensource.com/sites/default/files/uploads/communication-test-result2.png (Testing communications in Arduino) +[13]: https://opensource.com/sites/default/files/uploads/serial-test.png (Testing serial on Arduino) +[14]: https://opensource.com/sites/default/files/uploads/serial-test2.png (Testing serial on Arduino) +[15]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+color +[16]: https://opensource.com/sites/default/files/uploads/ui_0.png (UI) +[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+thread +[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+process +[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+runtime +[20]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[21]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception +[22]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+keylistener +[23]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+keyevent +[24]: https://opensource.com/sites/default/files/uploads/test-commands.png (Testing application running on Raspberry Pi) +[25]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+outputstream +[26]: https://github.com/pattrickx/TotalCrossSerialCommunication +[27]: https://learn.totalcross.com/documentation/get-started/ +[28]: https://marketplace.visualstudio.com/items?itemName=Italo.totalcross diff --git a/sources/tech/20200709 Making compliance scalable in a container world.md b/sources/tech/20200709 Making compliance scalable in a container world.md new file mode 100644 index 0000000000..a32bf4e86e --- /dev/null +++ b/sources/tech/20200709 Making compliance scalable in a container world.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Making compliance scalable in a container world) +[#]: via: (https://opensource.com/article/20/7/compliance-containers) +[#]: author: (Scott K Peterson https://opensource.com/users/skpeterson) + +Making compliance scalable in a container world +====== +When software is distributed via container images, source code should be +made available in order to ensure seamless compliance with licensing. +![Shipping containers stacked in a yard][1] + +Software is increasingly being distributed as container images. Container images include the many software components needed to support the featured software in the container. Thus, distribution of a container image involves distribution of many software components, which typically include GPL-licensed components. We can't expect every company that distributes container images to become an open source compliance expert, so we need to build compliance into container technology. + +We should design source code availability into container tools and processes to facilitate open source license compliance that is efficient and portable: + + * Efficient—Address compliance once when a container image is created. Avoid depending on later actions, especially actions external to existing container distribution tooling. + * Portable—When an image is moved to another registry, it should be straightforward to move compliance along with it. + + + +This can be done with a registry-native approach to source code availability. This doesn't require updating all container registries to include source-code-specific features. It is possible to exploit features that registries already have. For software distributed through container registries, we can use those same registries to facilitate compliance. + +### Container technology + +Container technology helps manage the challenges of deploying and operating complex software systems. + +The word "container" refers to a runtime experience—a program, together with its dependencies, can execute in an environment that provides certain isolation from other executing programs; this is running in a container. + +The set of files that are used to provision such a container is called a "container image." While the purpose of a particular container image might be to run one application program, the container image includes much more: that application and its dependencies—the files necessary to run that application, except for the operating system kernel. A container image is a form of those files that can be stored and transferred, enabling the application to be reliably deployed again and again, and run independently of the many other programs that may be running and changing in other containers in the system. + +Distribution of software in the form of container images, which are distributed from services known as "container registries," is growing. Once one invests in organizing computing around containers, it becomes valuable to package and distribute software in container images. Those who use containers to run their software find it is useful to be able to obtain software as pre-built container images, rather than doing all of the container assembly themselves. Even when container images are customized, it is often valuable to start from a pre-built image. + +### Container images are different + +In the past, it has been common to obtain each software component separately. In contrast, a container image includes a heterogeneous collection of software–often hundreds of software components. The unit of software delivery is changing from one driven by how the software is **built** to one driven by how the software is **used**. (See [What's in a container image: Meeting the legal challenges][2].) + +Package maintainers and package management tools have played an underappreciated role in source availability for over two decades. The focused nature of a package, the role of a package maintainer, and the tooling that has been built to support package management systems results in the expectation that someone (the package maintainer) will take responsibility for seeing that the sources are available. Tools that build binaries also collect the corresponding sources into an archive that can be delivered alongside the binaries. The result is that most people don't need to think about source code availability. The sources are available in the same unit as the delivery of the executable software and via the same distribution mechanism; for software delivered as an RPM, the corresponding source is available in a source RPM. + +In contrast, there is no convention for providing the source code that corresponds to a container image. + +The many software components in a container image often include GPL-licensed software. Companies that may not have much experience with distribution of FOSS software may begin distributing GPL-licensed software when they start offering their software in the form of container images. Let's make it straightforward for everyone, including companies who may be new to FOSS, to provide source code in a consistent way. + +### Identification of the corresponding source code + +Identifying the corresponding source code is more challenging for container images than it is for packages. For packages, the source is available to the person building the package (although there can be some challenges with the source for dependencies if a package is built to include dependencies, not merely refer to them). In contrast, container images are conventionally built using, mostly, previously compiled components. When the container image is built, the source for those software components may be readily at hand or not, depending on how the binaries were acquired and how they were built. + +When we build a container image, we should collect the corresponding source code for each of the components used to build the image. If not when the image is built, then when? That collected source code should then become a logical part of the corresponding container image. + +Making the corresponding source code available as a logical part of a container image, of course, facilitates compliance in the distribution of that image. But, also, that practice supports a compliant ecosystem. If someone builds on a base image, how do they know what source code might need to be made available? If container images have corresponding source images, then the solution is straightforward. It is not necessary to start by figuring out what is in the base. Rather, start source availability for the overall image by using the source image for the base. + +Here is an opportunity to build compliance into the tools—when someone builds on a base image, the tools should make it easy for them to make the corresponding source available for the base, as well as what is built on top. Tools should create a source image corresponding to the final combined image by starting with the source image for the base and adding whatever source is appropriate for the software that is built on top of that base. + +### Delivery + +Suppose one has a list of the source code artifacts that correspond to a container image. Where is that list going to be hosted? Where are the source artifacts going to be hosted? If the container image is hosted on various registries, how is source code going to be made available for each of those distribution points? Is there work to be done in each registry or in each of the catalogs associated with the registries? How is someone pulling a container image from each of a number of different registries going to know where these materials are? How does this work at scale? How many mechanisms are needed? + +We should build a container ecosystem with compliance that is portable across registries. One shouldn't need to get a new guidebook from each registry. + +As mentioned above, the supporting software components in a container image often include software licensed under the GPL. Consider the various alternatives for meeting the source code availability requirement for commercial distribution of software via download: binaries accompanied by the source code; binaries accompanied by a written offer; or, equivalent access to copy. As to equivalent access option, let's look at [GPLv2, section 3][3], last paragraph: "If distribution of executable or object code is made by offering access to copy from a designated place, then **offering equivalent access to copy the source code from the same place** counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code." + +Why deliver the source code through a container registry? Equivalent access, efficiency, and portability. + + * **Equivalent access**—A registry-native approach to source availability (making source for container images available as container images) is a good way of providing equivalent access to the source. + * **Efficient compliance**—Creating a source availability "package" (a source image) when the executable image is built and then using the same tooling for making the source available avoids inefficiencies of maintaining additional processes and mechanisms for making the source available. + * **Portability of compliance**—The same tooling that moves the executable images can be used to move, store, and serve the source images—on all hosting registries. + + + +### A registry-native approach to source code availability + +Delivering source through container registries exploits the design of the container image format and certain related characteristics of container registries. + +A container image includes (see container image details in the two examples linked below): + + * an image manifest, which identifies the other elements of the image; + * config data, which includes metadata about the image, including information used to configure the image for execution in a container; + * a number of "layers" (each of which is a tar archive) that store the file system with which to provision a container. + + + +Consider the challenge of making the corresponding source code available—a collection of source code artifacts (RPMs, zip files, tarballs, etc.) that we would like a server to make available. A container image is a list of components that a registry makes available. If the list of source artifacts is arranged as an image manifest, then a container registry can serve the source code artifacts like it serves other container image parts. And, tools for moving container images can be directly applied to move that compliance package (manifest plus the referenced source artifacts). + +A source image (aka a source container) is simply a container image. Instead of the layers in the image being tarballs of files to provision a container for execution, each layer is a source artifact. + +This concept of delivering non-file-system content from a container registry is of interest to container registries for other purposes, too, not just for source code. An example of non-layer content being served by container registries is Helm charts (used to describe a set of Kubernetes resources). The delivery of non-layer content via a container registry is the subject of the [Open Container Initiative's artifacts project][4]. + +### Deduplication + +Container registries store and deliver an image as parts, rather than as a single digital object. This is valuable because container images are extremely redundant. Many images differ in a small fraction of their content. A container image can simplify data center operations by packaging together all of the components needed to run a particular program; as a result, container images are large, and each contains much content that is identical to other images in the registry. There can be 100-300 software components in an image, most of which are present in many other container images. Also, images are immutable. When an image needs to be updated, a new image is created that is almost identical to the prior version. This size challenge is mitigated by breaking archives for container file systems into multiple layers and using content-addressable storage. + +That deduplication capability is advantageous in source code, too. The key to taking advantage of this registry feature is to not store all of the corresponding sources for an image in a single blob. More than 100:1 deduplication can be readily achieved if the source code is stored with the granularity of a separate source artifact for each of the hundred or more software components from which the image is built. + +### Implementation + +Red Hat has started the first of a two-stage approach to implementing registry-native delivery of source code. + +In the first stage, Red Hat has started by producing source images that can be hosted on existing registries and will not confuse tools that expect all images to be executable. In this approach, source artifacts masquerade as regular layers—each source artifact is wrapped in a tar archive; the media types for the layers are the same as for a regular executable image. The source image is associated with the corresponding executable image by a naming convention. + +The second stage involves taking advantage of certain OCI image format features. + +Container images should be linked to the corresponding executable image(s) via the image index, rather than with a tag naming convention. The container image format makes it possible for a source image to literally be a part of the overall image of which the executable image is a part. Unrelated to source code, it is useful to be able to have images that are built for different processor architectures be part of a single overall image. That overall image can be managed as a single object, and a consumer of the image can select which version(s) and/or part(s) of the image to download (e.g., amd64, or arm64, or source). Thus, rather than associating the source with the corresponding executable image via a labeling convention, the source image manifest should be listed in the image index. + +In addition, in the future, source artifacts should not masquerade as executable layer tar files; the extra wrapping of source artifacts in a tar archive should be eliminated, and the source artifacts should be identified with appropriate media types. Successful deduplication requires careful, consistent tar archives. Simply storing the source artifact directly (and marking it with an appropriate media type) reduces this potential deduplication loss from inconsistent tarball wrappers. + +Finally, source artifacts in a registry should be consistent with the approach for other non-layer content in registries (such as Helm charts). Providing a consistent way to serve such content is the subject of the "artifacts" project within the Open Container Initiative. Registry-native distribution of source can be a beneficiary of that project. + +#### In summary + +The current approach (see the [current approach example][5]): + + * Source artifacts masquerade as regular layers—wrap each source artifact in a tarball and mark it with a regular layer media type. + * Identify the name of a source artifact inside the tar wrapper. + * Associate the source and executable images using a tag name convention—tag the source image manifest with the tag for the corresponding executable image extended with "-source." + + + +The future approach (see the [future approach example][6]): + + * No masquerade—store source artifacts directly in the registry (named, as other registry content, by a hash digest) and give them non-layer media type(s). + * Identify the name of a source artifact with a layer annotation in the manifest. + * Associate the source and executable images using the image index—list the source manifest in the image index, along with manifests for each machine architecture. + * Use a distinctive config. media type in source manifests (as proposed in the OCI artifacts project). + + + +#### Where are we now? + +Source "containers," which are actually images, for UBI images are in the Red Hat registry now. These source images have been built using production tools. The next step is to roll this out to other images. + +#### Where are we going? + +We need an industry-wide, consistent approach to making source code available for container images. Let's work together in the OCI's artifacts project and agree on the details of the no-masquerade approach. + +### Opportunities + +Including source code leads to opportunities. Making the full corresponding source code available as a corresponding source image can address more than merely GPL source availability: + + * The exact license for open source software can be complicated (see [Is open source software licensing broken?][7]). But, with the full source code, one can determine whatever details are important to them (see [The source code is the license][8]). + * How about license notices? You could attempt to extract all of them. Or, you could make the notices available directly via the source code (see [An economically efficient model for open source software license compliance][9]). + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/7/compliance-containers + +作者:[Scott K Peterson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/skpeterson +[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://opensource.com/article/18/7/whats-container-image-meeting-legal-challenges +[3]: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html#section3 +[4]: https://github.com/opencontainers/artifacts +[5]: https://blockchain-forensics.com/containers/current.svg +[6]: https://blockchain-forensics.com/containers/future.svg +[7]: https://opensource.com/article/20/2/open-source-licensing +[8]: https://opensource.com/article/17/12/source-code-license +[9]: https://opensource.com/article/17/9/economically-efficient-model diff --git a/sources/tech/20200709 What you need to know about automation testing in CI-CD.md b/sources/tech/20200709 What you need to know about automation testing in CI-CD.md new file mode 100644 index 0000000000..488b843a1f --- /dev/null +++ b/sources/tech/20200709 What you need to know about automation testing in CI-CD.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What you need to know about automation testing in CI/CD) +[#]: via: (https://opensource.com/article/20/7/automation-testing-cicd) +[#]: author: (Taz Brown https://opensource.com/users/heronthecli) + +What you need to know about automation testing in CI/CD +====== +Continuous integration and continuous delivery is powered by testing. +Here's how. +![Net catching 1s and 0s or data in the clouds][1] + +> "If things seem under control, you're just not going fast enough." —Mario Andretti + +Test automation means focusing continuously on detecting defects, errors, and bugs as early and quickly as possible in the software development process. This is done using tools that pursue quality as the highest value and are put in place to _ensure_ quality—not just pursue it. + +One of the most compelling features of a continuous integration/continuous delivery (CI/CD) solution (also called a DevOps pipeline) is the opportunity to test more frequently without burdening developers or operators with more manual work. Let's talk about why that's important. + +### Why automate testing in CI/CD? + +Agile teams iterate faster to deliver software and customer satisfaction at higher rates, and these pressures can jeopardize quality. Global competition has created _low tolerance_ for defects while increasing pressure on agile teams for _faster iterations_ of software delivery. What's the industry solution to alleviate this pressure? [DevOps][2]. + +DevOps is a big idea with many definitions, but one technology that is consistently essential to DevOps success is CI/CD. Designing a continuous cycle of improvement through a pipeline of software development can lead to new opportunities for testing. + +### What does this mean for testers? + +For testers, this generally means they must: + + * Test earlier and more often (with automation) + * Continue to test "real-world" workflows (automated and manual) + + + +To be more specific, the role of testing in any form, whether it's run by the developers who write the code or designed by a team of quality assurance engineers, is to take advantage of the CI/CD infrastructure to increase quality while moving fast. + +### What else do testers need to do? + +To get more specific, testers are responsible for: + + * Testing new and existing software applications + * Verifying and validating functionality by evaluating software against system requirements + * Utilizing automated-testing tools to develop and maintain reusable automated tests + * Collaborating with all members of the scrum team to understand the functionality being developed and the implementation's technical design to design and develop accurate, high-quality automated tests + * Analyzing documented user requirements and creating or assisting in designing test plans for moderately to highly complex software or IT systems + * Developing automated tests and working with the functional team to review and evaluate test scenarios + * Collaborating with the technical team to identify the proper approach to automating tests within the development environment + * Working with the team to understand and resolve software problems with automated tests, and responding to suggestions for modifications or enhancements + * Participating in backlog grooming, estimation, and other agile scrum ceremonies + * Assisting in defining standards and procedures to support testing activities and materials (e.g., scripts, configurations, utilities, tools, plans, and results) + + + +Testing is a great deal of work, but it's an essential part of building software effectively. + +### What kind of continuous testing is important? + +There are many types of tests you can use. The different types aren't firm lines between disciplines; instead, they are different ways of expressing how to test. It is less important to compare the types of tests and more important to have coverage for each test type. + + * **Functional testing:** Ensures that the software has the functionality in its requirements + * **Unit testing:** Independently tests smaller units/components of a software application to check their functionality + * **Load testing:** Tests the performance of the software application during heavy load or usage + * **Stress testing:** Determines the software application's breakpoint when under stress (maximum load) + * **Integration testing:** Tests a group of components that are combined or integrated to produce an output + * **Regression testing:** Tests the entire application's functionality when any component (no matter how small) has been modified + + + +### Conclusion + +Any software development process that includes continuous testing is on its way toward establishing a critical feedback loop to go fast and build effective software. Most importantly, the practice builds quality into the CI/CD pipeline and implies an understanding of the connection between increasing speed while reducing risk and waste in the software development lifecycle. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/7/automation-testing-cicd + +作者:[Taz Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/heronthecli +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_analytics_cloud.png?itok=eE4uIoaB (Net catching 1s and 0s or data in the clouds) +[2]: https://opensource.com/resources/devops diff --git a/sources/tech/20200710 Use DNS over TLS.md b/sources/tech/20200710 Use DNS over TLS.md new file mode 100644 index 0000000000..481bd7b44a --- /dev/null +++ b/sources/tech/20200710 Use DNS over TLS.md @@ -0,0 +1,175 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use DNS over TLS) +[#]: via: (https://fedoramagazine.org/use-dns-over-tls/) +[#]: author: (Thomas Bianchi https://fedoramagazine.org/author/thobianchi/) + +Use DNS over TLS +====== + +![][1] + +The [Domain Name System (DNS)][2] that modern computers use to find resources on the internet was designed [35 years ago][3] without consideration for user privacy. It is exposed to security risks and attacks like [DNS Hijacking][4]. It also allows [ISPs][5] to intercept the queries. + +Luckily, [DNS over TLS][6] and [DNSSEC][7] are available. DNS over TLS and DNSSEC allow safe and encrypted end-to-end tunnels to be created from a computer to its configured DNS servers. On Fedora, the steps to implement these technologies are easy and all the necessary tools are readily available. + +This guide will demonstrate how to configure DNS over TLS on Fedora using systemd-resolved. Refer to the [documentation][8] for further information about the systemd-resolved service. + +### Step 1 : Set-up systemd-resolved + +Modify _/etc/systemd/resolved.conf_ so that it is similar to what is shown below. Be sure to enable DNS over TLS and to configure the IP addresses of the DNS servers you want to use. + +``` +$ cat /etc/systemd/resolved.conf +[Resolve] +DNS=1.1.1.1 9.9.9.9 +DNSOverTLS=yes +DNSSEC=yes +FallbackDNS=8.8.8.8 1.0.0.1 8.8.4.4 +#Domains=~. +#LLMNR=yes +#MulticastDNS=yes +#Cache=yes +#DNSStubListener=yes +#ReadEtcHosts=yes +``` + +A quick note about the options: + + * **DNS**: A space-separated list of IPv4 and IPv6 addresses to use as system DNS servers + * **FallbackDNS**: A space-separated list of IPv4 and IPv6 addresses to use as the fallback DNS servers. + * **Domains**: These domains are used as search suffixes when resolving single-label host names, _~._ stand for use the system DNS server defined with DNS= preferably for all domains. + * **DNSOverTLS:** If true all connections to the server will be encrypted. Note that this mode requires a DNS server that supports DNS-over-TLS and has a valid certificate for it’s IP. + + + +> _NOTE: The DNS servers listed in the above example are my personal choices. You should decide which DNS servers you want to use; being mindful of whom you are asking IPs for internet navigation_. + +### Step 2 : Tell NetworkManager to push info to systemd-resolved + +Create a file in _/etc/NetworkManager/conf.d_ named _10-dns-systemd-resolved.conf_. + +``` +$ cat /etc/NetworkManager/conf.d/10-dns-systemd-resolved.conf +[main] +dns=systemd-resolved +``` + +The setting shown above (_dns=systemd-resolved_) will cause NetworkManager to push DNS information acquired from DHCP to the systemd-resolved service. This will override the DNS settings configured in _Step 1_. This is fine on a trusted network, but feel free to set _dns=none_ instead to use the DNS servers configured in _/etc/systemd/resolved.conf_. + +### Step 3 : start & restart services + +To make the settings configured in the previous steps take effect, start and enable _systemd-resolved_. Then restart _NetworkManager_. + +**CAUTION**: This will lead to a loss of connection for a few seconds while NetworkManager is restarting. + +``` +$ sudo systemctl start systemd-resolved +$ sudo systemctl enable systemd-resolved +$ sudo systemctl restart NetworkManager +``` + +> _NOTE: Currently, the systemd-resolved service is disabled by default and its use is opt-in. [There are plans][9] to enable systemd-resolved by default in Fedora 33._ + +### Step 4 : Check if everything is fine + +Now you should be using DNS over TLS. Confirm this by checking DNS resolution status with: + +``` +$ resolvectl status +MulticastDNS setting: yes + DNSOverTLS setting: yes + DNSSEC setting: yes + DNSSEC supported: yes + Current DNS Server: 1.1.1.1 + DNS Servers: 1.1.1.1 + 9.9.9.9 +Fallback DNS Servers: 8.8.8.8 + 1.0.0.1 + 8.8.4.4 +``` + +/etc/resolv.conf should point to 127.0.0.53 + +``` +$ cat /etc/resolv.conf +# Generated by NetworkManager +search lan +nameserver 127.0.0.53 +``` + +To see the address and port that systemd-resolved is sending and receiving secure queries on, run: + +``` +$ sudo ss -lntp | grep '\(State\|:53 \)' +State Recv-Q Send-Q Local Address:Port Peer Address:Port Process +LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=10410,fd=18)) +``` + +To make a secure query, run: + +``` +$ resolvectl query fedoraproject.org +fedoraproject.org: 8.43.85.67 -- link: wlp58s0 + 8.43.85.73 -- link: wlp58s0 + +[..] + +-- Information acquired via protocol DNS in 36.3ms. +-- Data is authenticated: yes +``` + +### BONUS Step 5 : Use Wireshark to verify the configuration + +First, install and run [Wireshark][10]: + +``` +$ sudo dnf install wireshark +$ sudo wireshark +``` + +It will ask you which link device it have to begin capturing packets on. In my case, because I use a wireless interface, I will go ahead with _wlp58s0_. Set up a filter in Wireshark like _tcp.port == 853_ (853 is the DNS over TLS protocol port). You need to flush the local DNS caches before you can capture a DNS query: + +``` +$ sudo resolvectl flush-caches +``` + +Now run: + +``` +$ nslookup fedoramagazine.org +``` + +You should see a TLS-encryped exchange between your computer and your configured DNS server: + +![][11] + +— _Poster in Cover Image Approved for Release by NSA on 04-17-2018, FOIA Case # 83661_ — + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-dns-over-tls/ + +作者:[Thomas Bianchi][a] +选题:[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/thobianchi/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/06/use-dns-over-tls-816x345.jpg +[2]: https://en.wikipedia.org/wiki/Domain_Name_System +[3]: https://tools.ietf.org/html/rfc1035 +[4]: https://en.wikipedia.org/wiki/DNS_hijacking +[5]: https://en.wikipedia.org/wiki/Internet_service_provider +[6]: https://en.wikipedia.org/wiki/DNS_over_TLS +[7]: https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions +[8]: https://www.freedesktop.org/wiki/Software/systemd/resolved/ +[9]: https://fedoraproject.org/wiki/Changes/systemd-resolved +[10]: https://www.wireshark.org/ +[11]: https://fedoramagazine.org/wp-content/uploads/2020/06/1-1024x651.png diff --git a/translated/tech/20200626 Open source tools for translating British to American English.md b/translated/tech/20200626 Open source tools for translating British to American English.md new file mode 100644 index 0000000000..1d562bf13b --- /dev/null +++ b/translated/tech/20200626 Open source tools for translating British to American English.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source tools for translating British to American English) +[#]: via: (https://opensource.com/article/20/6/british-american-cli-translator) +[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) + +将英式英语翻译成美式英语的开源工具 +====== +使用这些命令行翻译器将英式英语转换为美式英语(反之亦然)。 +![Red telephone booth on a street in England][1] + +去年圣诞节,我和我的妻子去了家乡佛罗里达的皮尔斯堡,并且经常光顾海滩上的一家当地人店。在那儿,我们遇到了一对来自英国米德兰的夫妇。音乐很响,啤酒也是,所以很难听清楚。另外,即使他们“似乎”在说英语,但有时理解他们在说什么仍然是一个挑战。我以为我在澳大利亚的时光会给我足够的语言能力,但是,可惜,忘记了很多。还有比通常的 “soccer 是 football” 或 “trunk是 boot” 更多的混乱。 + +幸运的是,有开源方案可以将“英式”翻译成“美式”。我们可能使用相同的语言,但是我们共同的讲话比多塞特郡沙夫茨伯里的之字形山要曲折得多! + +如果你碰巧在酒吧有 Linux 笔记本,那么你可以使用方便的开源命令行程序,它名为 [American British English Translator][2](MIT 许可证)。 + +我在运行 Linux 的改版 MacBook 上安装 Translator: + + +``` +`$ npm install -g american-british-english-translator` +``` + +这需要我首先[安装 Node.js][3]。 + +### 声明! + +除了翻译单词和短语,American British English Translator 还能分析文档。我给了它要给流行文档,名为_独立宣言_ 。它分析并返回了许多结果。其中一个比较有趣的是: + + +``` +fall: +issue: Different meanings +details: +American English: autumn +British English: +""" +to become pregnant. (Either as in 'I fell pregnant' or as in 'She fell for a baby.'); +``` + +*宣言*的作者指责的并非完全是”在公海俘虏“(taken captive on the high seas): + +> ”他在公海上俘虏我们的同胞,强迫他们拿起武器来反对自己的国家,成为残杀自己亲人和朋友的刽子手,或是死于自己的亲人和朋友的手下。“(He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, or to fall themselves by their Hands.) + +### 还有一个 + +对于简单的单词替换,你可以尝试 [Common_Language][4],这是一个开源(MIT 许可)Python 脚本。 + +当然,要与同伴一起喝几杯,你也许需要实际交流,并能理解他们。这就是需要用到 MARY 了。 + +[MaryTTS][5] 是一个使用 Java(GNU 许可)编写的开源多语言文本到语音合成平台。方便的[基于浏览器的界面][6]使你可以轻松地将美国酒吧谈话内容转换为正确的英语(或其他语言)的男性或女性声音。 + +现在我可以和我的英国朋友们见面了(可以安全地再来一次),喝几杯,完成!像当地人一样讲英语! 干杯! + +翻译文档需要时间和精力,但不及从头开始... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/6/british-american-cli-translator + +作者:[Jeff Macharyas][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/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/england-telephone-booth-street.jpg?itok=JQsc_piX (Red telephone booth on a street in England) +[2]: https://github.com/hyperreality/American-British-English-Translator +[3]: https://nodejs.org/en/download/ +[4]: https://github.com/willettk/common_language +[5]: https://github.com/marytts/marytts +[6]: http://mary.dfki.de:59125/ diff --git a/translated/tech/20200701 13 Things To Do After Installing Linux Mint 20.md b/translated/tech/20200701 13 Things To Do After Installing Linux Mint 20.md new file mode 100644 index 0000000000..4168e1ca6e --- /dev/null +++ b/translated/tech/20200701 13 Things To Do After Installing Linux Mint 20.md @@ -0,0 +1,210 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (13 Things To Do After Installing Linux Mint 20) +[#]: via: (https://itsfoss.com/things-to-do-after-installing-linux-mint-20/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +安装 Linux Mint 20 后需要做的 13 件事 +====== + +Linux Mint 很容易成为 [最佳 Linux 发行版][1] 之一,特别是考虑到 [Linux Mint 20][2] 的特色,我确信你也会同意这一说法。 + +假设你错过了我们的新闻报道,[可以下载Linux Mint 20 了][3]。 + +当然,如果你使用 Linux Mint 有一段时间了,你可能知道最好做一些什么。但是,对于新用户来说,在安装 Linux Mint 20 后,你需要做的一些事来使你的体验更比以往任何时候都好。 + +### 在安装 Linux Mint 20 后建议做的事 + +在这篇文章中,我将列出其中一些要做的事来帮助你改善 Linux Mint 20 的用户体验。 + +#### 1\. 执行一次系统更新 + +![][4] + +如上图所示,在安装后,你应该立刻地用更新管理器检查 — 系统更新。 + +为什么?因为你需要构建可用软件的本地缓存。更新所有软件包的更新也是一个好注意。 + +如果你喜欢使用终端,简单地输入下面的命令来执行一些系统更新: + +``` +sudo apt update && sudo apt upgrade -y +``` + +#### 2\. 使用 Timeshift 来创建系统快照 + +![][5] + +如果你想在意外更改或错误更新后快速地恢复系统状态,有一个系统快照总是很有用的。 + +因此,如果你希望能够随时备份你的系统状态,那么使用 Timeshift 配置和创建系统快照是超级重要的。 + +你可以遵循我们 [使用 Timeshift][6] 的详细指南,如果你还不知道如何使用它的话。 + +#### 3\. 安装有用的软件 + +尽管在 Linux Mint 20 中已经安装有一些有用的预安装应用程序,你可能需要安装一些没有随之一起出炉的必不可少的应用程序。 + +你可以简单地使用软件包管理器或 synaptic 软件包管理器来查找和安装所需要的软件。 + +对于初学者来说,如果你想探索各种各样的工具,那么你可以遵循我们的 [必不可少的 Linux 应用程序][7] 的列表。 + +这里是一个我最喜欢的软件包列表,我希望你也来尝试一下: + + * [VLC 多媒体播放器][8] 用于视频播放 + * [FreeFileSync][9] 用来同步文件 + * [Flameshot][10] 用于截图 + * [Stacer][11] 用来优化和监控系统 + * [ActivityWatch][12] 用来跟踪你的屏幕时间并保持高效唤醒 + + + +#### 4\. 自定义主题和图标 + +![][13] + +当然,这在技术上不是必不可少的事,除非你想更改 Linux Mint 20 的外观和感觉。 + +但是,[在 Linux Mint 中更改主题和图标是非常容易的][14] ,而不需要安装任何额外的东西。 + +你会在欢迎屏幕中获得优化外观的选项。在任何情况下,你只需要进入 **主题**”,并开始自定义主题。 + +![][15] + +为此,,你可以搜索它或在系统设置中如上图所示的找到它。 + +根据你正在使用的桌面环境,你也可以看看可用的 [最佳图标主题][16]。 + +#### 5\. 启用 Redshift 来保护你的眼睛 + +![][17] + +你可以在 Linux Mint 上搜索“[Redshift][18]”,并在晚上启动它以保护你的眼睛。如你在上面的截图所见,它将根据时间自动地调整屏幕的色温。 + +你可能想启用自动启动选项,以便它在你重新启动计算机时自动启动。它不可能与 [Ubuntu 20.04 LTS][19] 的夜光特色相同,但是如果你不需要自定义时间表或微调色温的能力,那么它就足够好了。 + +#### 6\. 启用 snap (如果需要的话) + +尽管 Ubuntu 比因为任何时候都更倾向于推动使用 Snap ,但是 Linux Mint 团队反对使用它。因此,它禁止 APT 使用 snapd 。 + +因此,你将没有 snap 开箱即用的支持。然而,你迟早会意识到一些软件包只以 Snap 的格式打包。在这种情况下,你将不得不在 Mint 上启用对 snap 的支持。 + +``` +sudo apt install snapd +``` + +在你完成后,你可以遵循我们的指南来了解更多关于 [在 Linux 上安装和使用 snaps][20] 的信息。 + +#### 7\. 学习使用 Flatpak + +默认情况下,Linux Mint 带有对 Flatpak 的支持。所以,不管你是讨厌使用 snap 或只是更喜欢使用 Flatpak,在系统中保留它是极好的主意。 + +现在,你只需要遵循我们关于 [在 Linux 上使用 Flatpak][21] 的指南来开始吧! + +#### 8\. 清理或优化你的系统 + +优化或清理系统以清除无价值的占用存储空间的垃圾文件总是很好的。 + +你可以从你的系统中快速移除不想要的软件包,通过在你的终端中输入这个命令: + +``` +sudo apt autoremove +``` + +除此之外,你也可以遵循我们 [在 Linux Mint 上释放空间的一些建议][22] 。 + +#### 9\. 使用 Warpinator 通过网络发送/接收文件 + +Warpinator 是 Linux Mint 20 的一个新特色,给予你在连接同一个网络的多台计算机上共享文件的能力。这里是它看起来的样子: + +![][23] + +你只需要在菜单中搜索它就可以开始了! + +#### 10\. 使用驱动器管理器 + +![驱动器管理器][24] + +如果你正在使用需要一个驱动程序的 Wi-Fi 设备,NVIDIA 显卡, 或 AMD 显卡,和其它设备(如果可应用的话)的驱动程序时,驱动器管理器是一个重要的查找位置。 + +你只需要找到驱动器管理器并启动它。它应该可以侦察出在使用的一些专有驱动程序,或者你也可以使用驱动器管理器来利用 DVD 碟片来安装驱动程序。 + +#### 11\. 设置防火墙 + +![][25] + +在大多数情况下,你可能已经实现了你的家庭联网。但是,如果你想在 Linux Mint 上有一些特殊的防火墙设置,你可以通过在菜单中搜索 “Firewall” 来实现。 + +正如你在上述截图中所看到的,你有能力为家庭,商业和公众做出不同的概述。你只需要添加是否被允许访问互联网的规则和定义。 + +你可以阅读我们关于 [使用 UFW 配置防火墙][26] 的详细指南。 + +#### 12\. 学习管理 Startup 应用程序 + +如果你是一个有经验的用户,你可能已经知道这一点了。但是,新用户经常忘记管理他们的 startup 应用程序,最终,系统的启动时间将会受到影响。 + +你只需要从菜单中搜索 “**Startup Applications**” ,你可以启动它来查找像这样的东西: + +![][27] + +你可以简单地切换你想要禁用的那些 Startup 应用程序,添加一个延迟计时器,或从 startup 应用程序的列表中完全地移除。 + +#### 13\. 安装必不可少的游戏应用程序 + +当然,如果你对游戏感兴趣,你可能想去阅读我们关于 [在 Linux 上的游戏][28] 的文章来探索所有的选项。 + +但是,对于初学者来说,你可以尝试安装 [GameHub][29], [Steam][30],和 [Lutris][31] 来玩一些游戏。 + +**总结** + +就是这样,各位!在大多数情况下,如果你在安装 Linux Mint 20 后遵循上面的几点,你应该可以很好地使用它。 + +我确信你还能够做更多的事。现在,我想知道,你在安装 Linux Mint 20 后,更喜欢去做的事。让我在评论区知道你的想法! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/things-to-do-after-installing-linux-mint-20/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-linux-distributions/ +[2]: https://itsfoss.com/linux-mint-20/ +[3]: https://itsfoss.com/linux-mint-20-download/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-system-update.png?ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/07/snapshot-linux-mint-timeshift.jpeg?ssl=1 +[6]: https://itsfoss.com/backup-restore-linux-timeshift/ +[7]: https://itsfoss.com/essential-linux-applications/ +[8]: https://www.videolan.org/vlc/ +[9]: https://itsfoss.com/freefilesync/ +[10]: https://itsfoss.com/flameshot/ +[11]: https://itsfoss.com/optimize-ubuntu-stacer/ +[12]: https://itsfoss.com/activitywatch/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-theme.png?ssl=1 +[14]: https://itsfoss.com/install-icon-linux-mint/ +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-system-settings.png?ssl=1 +[16]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-redshift-1.png?ssl=1 +[18]: https://itsfoss.com/install-redshift-linux-mint/ +[19]: https://itsfoss.com/ubuntu-20-04-release-features/ +[20]: https://itsfoss.com/install-snap-linux/ +[21]: https://itsfoss.com/flatpak-guide/ +[22]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mint-20-warpinator-1.png?ssl=1 +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2013/12/Additional-Driver-Linux-Mint-16.png?ssl=1 +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-firewall.png?ssl=1 +[26]: https://itsfoss.com/set-up-firewall-gufw/ +[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/linux-mint-20-startup-applications.png?ssl=1 +[28]: https://itsfoss.com/linux-gaming-guide/ +[29]: https://itsfoss.com/gamehub/ +[30]: https://store.steampowered.com +[31]: https://lutris.net