From 2f2a41eec6058ae8eac40b970bbf56a47944042b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Wed, 2 Jun 2021 20:18:42 +0800 Subject: [PATCH 001/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index a2b7e388cb..03dcfe6069 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -7,7 +7,7 @@ [#]: publisher: ( ) [#]: url: ( ) -3 reasons to learn Java in 2021 +2021年学习Java的三个理由 ====== Java is powerful, diverse, scalable, and fun. Here's why—and how—you should be using it. From b97eaae9f0a2962faeb0f57ad4fea9d40bdc6581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Wed, 2 Jun 2021 20:23:25 +0800 Subject: [PATCH 002/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 03dcfe6069..6a2cc5a909 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -9,8 +9,8 @@ 2021年学习Java的三个理由 ====== -Java is powerful, diverse, scalable, and fun. Here's why—and how—you -should be using it. +Java具有功能强大、多样化、可拓展、有趣的特点。这就是你应该使用它的原因和方式。 + ![Learning and studying technology is the key to success][1] Java was released in 1995, making it 26 years old as I'm writing this. It was proprietary at first, but in 2007, Java was released as open source under the GPL. To understand what makes Java important, you have to understand the problem it claims to solve. Then you can understand why and how it benefits developers and users. From ba1e39a41a8f131cd37e74f8306ab12bbea6e4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Wed, 2 Jun 2021 20:25:39 +0800 Subject: [PATCH 003/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 6a2cc5a909..81e0ea7f94 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -13,7 +13,7 @@ Java具有功能强大、多样化、可拓展、有趣的特点。这就是你 ![Learning and studying technology is the key to success][1] -Java was released in 1995, making it 26 years old as I'm writing this. It was proprietary at first, but in 2007, Java was released as open source under the GPL. To understand what makes Java important, you have to understand the problem it claims to solve. Then you can understand why and how it benefits developers and users. +Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了。起初它是闭源的,但在2007年,Java基于GPL协议被开源发布了。 To understand what makes Java important, you have to understand the problem it claims to solve. Then you can understand why and how it benefits developers and users. The best way to understand what Java solves is to develop software, but just using software is a good start, too. As a developer, your troubles are likely to begin when you send software that works perfectly on your own computer to some other computer; it probably won't work. It _should_ work, but as any programmer knows, something always gets overlooked. This is compounded when you try the software on another operating system (OS). It's why there are so many download buttons on any given software site: a button for Windows, for macOS, for Linux, for mobiles, and sometimes even more. From 7d22a949f92b8daaf5e8c71a9f7dc9bd19a761a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Wed, 2 Jun 2021 20:37:36 +0800 Subject: [PATCH 004/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 81e0ea7f94..c2c9b40a6e 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -13,9 +13,9 @@ Java具有功能强大、多样化、可拓展、有趣的特点。这就是你 ![Learning and studying technology is the key to success][1] -Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了。起初它是闭源的,但在2007年,Java基于GPL协议被开源发布了。 To understand what makes Java important, you have to understand the problem it claims to solve. Then you can understand why and how it benefits developers and users. +Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了。起初它是闭源的,但在2007年,Java基于GPL协议被开源发布了。如果想要理解是什么使得Java变得如此重要,您必须理解它声称要解决的问题。然后你就能理解它让开发者和用户受益的原因和方式。 -The best way to understand what Java solves is to develop software, but just using software is a good start, too. As a developer, your troubles are likely to begin when you send software that works perfectly on your own computer to some other computer; it probably won't work. It _should_ work, but as any programmer knows, something always gets overlooked. This is compounded when you try the software on another operating system (OS). It's why there are so many download buttons on any given software site: a button for Windows, for macOS, for Linux, for mobiles, and sometimes even more. +理解Java解决问题的最好方式就是开发软件,当然啦,如果不做开发,仅仅只是使用软件也会是一个很好的开始。 作为一名开发人员,当您将在自己的本地计算机上运行良好的软件部署到其他计算机上运行时,麻烦可能就开始了。它可能无妨正常运行。它本应正常工作,但正如每个程序员都知道的,总有一些问题会被忽视。而当您在另一个操作系统(OS)上尝试运行该软件时,情况就变得更加复杂了。这就是为什么在每一个软件的获取页面上都会有大量的下载按钮的原因:一个Windows的、macOS的、Linux的、移动端的、甚至许多其他的下载按钮。 As a user, a typical scenario is you want to download some great software but find it's not available for your platform. It seems a pity that such a thing still happens on computers so advanced that they can run virtualized computers within computers, keep old video games alive through emulation, and even fit in your pocket, but software delivery is actually pretty difficult. From f4356495283a80c6b0fd4679c5ce55665b208f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Wed, 2 Jun 2021 23:45:20 +0800 Subject: [PATCH 005/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index c2c9b40a6e..97f265bb55 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -17,11 +17,11 @@ Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了 理解Java解决问题的最好方式就是开发软件,当然啦,如果不做开发,仅仅只是使用软件也会是一个很好的开始。 作为一名开发人员,当您将在自己的本地计算机上运行良好的软件部署到其他计算机上运行时,麻烦可能就开始了。它可能无妨正常运行。它本应正常工作,但正如每个程序员都知道的,总有一些问题会被忽视。而当您在另一个操作系统(OS)上尝试运行该软件时,情况就变得更加复杂了。这就是为什么在每一个软件的获取页面上都会有大量的下载按钮的原因:一个Windows的、macOS的、Linux的、移动端的、甚至许多其他的下载按钮。 -As a user, a typical scenario is you want to download some great software but find it's not available for your platform. It seems a pity that such a thing still happens on computers so advanced that they can run virtualized computers within computers, keep old video games alive through emulation, and even fit in your pocket, but software delivery is actually pretty difficult. +作为一名用户,一个典型的场景是您想下载一些优秀的软件,但它却不适用于您的平台。遗憾的是,这样的情况仍然发生在非常先进的计算机上,它们可以在计算机中运行虚拟机,通过仿真使旧视频游戏保持活力,甚至可以放在你的口袋里,但软件交付实际上相当困难。 -Is there a better way? Probably. +有没有更好的办法?可能会有吧。 -### 1\. Write once, run everywhere +### 1\. 一次编码, 任意环境都能跑通 Code is surprisingly, maybe even disappointingly, specific to OS and architecture. Code has to be _compiled_ from a human-friendly programming language into machine language, a series of binary instructions derived from what a CPU is designed to respond to. It feels arcane in the world of advanced computers that we can't just write code and send it to anyone who wants to run it without worrying about what platform they're on. From e6f58af88b624364cbe7be1f83465681f0f5820a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 3 Jun 2021 11:02:32 +0800 Subject: [PATCH 006/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 97f265bb55..05f47c1a3f 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -23,7 +23,7 @@ Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了 ### 1\. 一次编码, 任意环境都能跑通 -Code is surprisingly, maybe even disappointingly, specific to OS and architecture. Code has to be _compiled_ from a human-friendly programming language into machine language, a series of binary instructions derived from what a CPU is designed to respond to. It feels arcane in the world of advanced computers that we can't just write code and send it to anyone who wants to run it without worrying about what platform they're on. +如果代码只能在特定的操作系统和环境下运行,但这是很令人惊讶甚至是失望的。代码必须从一种对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。 It feels arcane in the world of advanced computers that we can't just write code and send it to anyone who wants to run it without worrying about what platform they're on. Java is the solution to this incongruity. It's the realization of cross-platform code that works the same across any system you run it on. Java's approach to achieving this feat is counterintuitive at first. In a way, Java isn't compatible with anything but one computer. Stranger still, this computer doesn't actually exist. The computer that Java code targets is the Java Virtual Machine (JVM). This is a program written by Java's creators and distributed for practically any computing device you can think of. As long as you have it installed, any Java code you run is handled by this "imaginary" computer living inside your computer. Java code is executed by the JVM, which sends appropriate platform-specific instructions to your computer, so everything works the same on every OS and architecture. From 9d44e79950f1cd07d277c1217aba9ba50a14f7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 3 Jun 2021 12:16:55 +0800 Subject: [PATCH 007/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 05f47c1a3f..bf972bc363 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -13,17 +13,17 @@ Java具有功能强大、多样化、可拓展、有趣的特点。这就是你 ![Learning and studying technology is the key to success][1] -Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了。起初它是闭源的,但在2007年,Java基于GPL协议被开源发布了。如果想要理解是什么使得Java变得如此重要,您必须理解它声称要解决的问题。然后你就能理解它让开发者和用户受益的原因和方式。 +Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了。起初它是闭源的,但在2007年,Java基于GPL协议被开源发布了。如果想要理解是什么使得Java变得非常重要,你就必须理解它声称要解决的是什么样的问题,从而你就能理解它让开发者和用户受益的原因和方式。 -理解Java解决问题的最好方式就是开发软件,当然啦,如果不做开发,仅仅只是使用软件也会是一个很好的开始。 作为一名开发人员,当您将在自己的本地计算机上运行良好的软件部署到其他计算机上运行时,麻烦可能就开始了。它可能无妨正常运行。它本应正常工作,但正如每个程序员都知道的,总有一些问题会被忽视。而当您在另一个操作系统(OS)上尝试运行该软件时,情况就变得更加复杂了。这就是为什么在每一个软件的获取页面上都会有大量的下载按钮的原因:一个Windows的、macOS的、Linux的、移动端的、甚至许多其他的下载按钮。 +理解Java解决问题的最好方式就是进行软件开发,当然啦,如果不做开发,仅仅只是使用软件也会是一个很好的开始。作为一名开发人员,当你将在自己的本地计算机上运行良好的软件部署到其他计算机上运行时,一些稀奇古怪的麻烦可能就出现了,从而导致软件可能无妨正常运行。软件本应正常工作,但每个程序员都明白,一些问题总是会被忽视。当你在另一个操作系统(OS)上尝试运行该软件时,情况就变得更加复杂了。这也是为什么在每一个软件的获取页面上都会有针对不同的操作系统有对应下载按钮的原因:Windows的、macOS的、Linux的、移动端的、甚至许多其他操作系统环境的下载选项。 -作为一名用户,一个典型的场景是您想下载一些优秀的软件,但它却不适用于您的平台。遗憾的是,这样的情况仍然发生在非常先进的计算机上,它们可以在计算机中运行虚拟机,通过仿真使旧视频游戏保持活力,甚至可以放在你的口袋里,但软件交付实际上相当困难。 +作为一名用户,一个典型的场景是你想下载一些优秀的软件,但它却不适用于你的平台。遗憾的是这样的情况仍然发生在当下非常先进的计算机上,它们可以在计算机中运行虚拟机,通过仿真使旧视频游戏保持活力,甚至可以放在你的口袋里,但软件交付实际上相当困难。 有没有更好的办法?可能会有吧。 ### 1\. 一次编码, 任意环境都能跑通 -如果代码只能在特定的操作系统和环境下运行,但这是很令人惊讶甚至是失望的。代码必须从一种对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。 It feels arcane in the world of advanced computers that we can't just write code and send it to anyone who wants to run it without worrying about what platform they're on. +如果代码只能在特定的操作系统和环境下运行,那这会很令人惊讶甚至是失望的。代码必须从一种对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。It feels arcane in the world of advanced computers that we can't just write code and send it to anyone who wants to run it without worrying about what platform they're on. Java is the solution to this incongruity. It's the realization of cross-platform code that works the same across any system you run it on. Java's approach to achieving this feat is counterintuitive at first. In a way, Java isn't compatible with anything but one computer. Stranger still, this computer doesn't actually exist. The computer that Java code targets is the Java Virtual Machine (JVM). This is a program written by Java's creators and distributed for practically any computing device you can think of. As long as you have it installed, any Java code you run is handled by this "imaginary" computer living inside your computer. Java code is executed by the JVM, which sends appropriate platform-specific instructions to your computer, so everything works the same on every OS and architecture. From f6e8d4062a4a7320941b8912e66ae2c80c52331c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 3 Jun 2021 12:17:16 +0800 Subject: [PATCH 008/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index bf972bc363..10887394b0 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -65,7 +65,7 @@ via: https://opensource.com/article/21/5/java 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[PearFL](https://github.com/PearFL) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7c958e72e78c818f117aab6667c85ecf47f9116c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sat, 5 Jun 2021 19:23:16 +0800 Subject: [PATCH 009/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 10887394b0..ac8754329a 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -47,17 +47,17 @@ You can even choose what to use when approaching the Java language itself. [Open There's a lot more, but suffice it to say that Java is a complete package regardless of what you're looking for. -### Bonus: Easy to learn +### 优点:简单易学 -Java has proven to be a sensible solution for me and many developers in various industries. Here are some of the reasons I love to use Java. +事实证明,Java 对我和各行各业的许多开发人员来说是一个明智的解决方案。以下是我喜欢使用 Java 的一些原因。 -You may have heard or inferred that Java is a "professional" language for clunky government sites and reserved for "real" developers. Don't be fooled by the many different reputations Java has garnered over its 25+ years! It's only half as terrifying as its reputation, meaning no more than any other language. +您可能听说过或推断出 Java 是一种“专业”语言,只适用于笨重的政府网站,专供“真正的”开发人员使用。不要被 Java 超过25年以来赢得的不同声誉所迷惑! It's only half as terrifying as its reputation, meaning no more than any other language. Programming is hard; there's no getting away from that. It requires you to think logically, it forces you to learn a new language with fewer expressive options than your native tongue, and it demands that you figure out how to solve problems that are difficult enough that they've driven you to programmatic automation. No language alleviates these issues. However, learning curves for programming languages can differ in surprising ways. Some are easy to start but get complex when you start exploring the fine details. In other words, it might take just one line of code to print "hello world," but once you learn about classes or functions, you get to learn the language (or at least its data model) all over again. Java is Java from the beginning, but once you learn it, you have access to all of its many tricks and conveniences. -In short: Go learn Java! It's powerful, diverse, scalable, and fun. To help you on your way, [download our Java cheat sheet][14], which contains all the basic syntax you'll need as you work on your first dozen projects. After that, you won't need it anymore because Java is wonderfully consistent and predictable. Enjoy! +简而言之: Go learn Java! It's powerful, diverse, scalable, and fun. To help you on your way, [download our Java cheat sheet][14], which contains all the basic syntax you'll need as you work on your first dozen projects. After that, you won't need it anymore because Java is wonderfully consistent and predictable. Enjoy! -------------------------------------------------------------------------------- From 96ddf535c31e50d81e763b01019f6f54142ebf45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sat, 5 Jun 2021 19:24:51 +0800 Subject: [PATCH 010/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index ac8754329a..8c1f9c9fa0 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -57,7 +57,7 @@ Programming is hard; there's no getting away from that. It requires you to think However, learning curves for programming languages can differ in surprising ways. Some are easy to start but get complex when you start exploring the fine details. In other words, it might take just one line of code to print "hello world," but once you learn about classes or functions, you get to learn the language (or at least its data model) all over again. Java is Java from the beginning, but once you learn it, you have access to all of its many tricks and conveniences. -简而言之: Go learn Java! It's powerful, diverse, scalable, and fun. To help you on your way, [download our Java cheat sheet][14], which contains all the basic syntax you'll need as you work on your first dozen projects. After that, you won't need it anymore because Java is wonderfully consistent and predictable. Enjoy! +简而言之: 去学习Java吧!它具有功能强大、多样化、可拓展、有趣的特点。为了给您提供帮助, [download our Java cheat sheet][14], which contains all the basic syntax you'll need as you work on your first dozen projects. After that, you won't need it anymore because Java is wonderfully consistent and predictable. Enjoy! -------------------------------------------------------------------------------- From 86ec4c6f14f0f68eb158b5b06e66f65edb254900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sat, 5 Jun 2021 19:26:29 +0800 Subject: [PATCH 011/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 8c1f9c9fa0..75ab11ec99 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -57,7 +57,7 @@ Programming is hard; there's no getting away from that. It requires you to think However, learning curves for programming languages can differ in surprising ways. Some are easy to start but get complex when you start exploring the fine details. In other words, it might take just one line of code to print "hello world," but once you learn about classes or functions, you get to learn the language (or at least its data model) all over again. Java is Java from the beginning, but once you learn it, you have access to all of its many tricks and conveniences. -简而言之: 去学习Java吧!它具有功能强大、多样化、可拓展、有趣的特点。为了给您提供帮助, [download our Java cheat sheet][14], which contains all the basic syntax you'll need as you work on your first dozen projects. After that, you won't need it anymore because Java is wonderfully consistent and predictable. Enjoy! +简而言之: 去学习 Java 吧!它具有功能强大、多样化、可拓展、有趣的特点。为了给您提供帮助, [下载我们的 Java 备忘单][14], 它包含您在处理前十个项目时需要的所有基本语法。在那之后,您就不再需要它了,因为Java具有完美的一致性和可预测性。来享受它吧! -------------------------------------------------------------------------------- From 3aadf5881ff512876c26f3b02eed17c4ef99c481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sat, 5 Jun 2021 22:28:47 +0800 Subject: [PATCH 012/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 75ab11ec99..1f0125b629 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -51,11 +51,11 @@ There's a lot more, but suffice it to say that Java is a complete package regard 事实证明,Java 对我和各行各业的许多开发人员来说是一个明智的解决方案。以下是我喜欢使用 Java 的一些原因。 -您可能听说过或推断出 Java 是一种“专业”语言,只适用于笨重的政府网站,专供“真正的”开发人员使用。不要被 Java 超过25年以来赢得的不同声誉所迷惑! It's only half as terrifying as its reputation, meaning no more than any other language. +您可能听说过或推断出 Java 是一种“专业”语言,只适用于笨重的政府网站,专供“真正的”开发人员使用。千万不要被 Java 超过25年以来的各种名声所迷惑!它的可怕程度只有它名声的一半,并不比其他任何语言更可怕。 -Programming is hard; there's no getting away from that. It requires you to think logically, it forces you to learn a new language with fewer expressive options than your native tongue, and it demands that you figure out how to solve problems that are difficult enough that they've driven you to programmatic automation. No language alleviates these issues. +编程很困难的这件事是无法逃避的,它要求您基于逻辑进行思考,学习一种比母语表达选方式更少的新语言,要您弄清楚如何解决困难的问题,使它们可以使用您的程序完成自动化的执行,没有语言可以避免这些问题。 -However, learning curves for programming languages can differ in surprising ways. Some are easy to start but get complex when you start exploring the fine details. In other words, it might take just one line of code to print "hello world," but once you learn about classes or functions, you get to learn the language (or at least its data model) all over again. Java is Java from the beginning, but once you learn it, you have access to all of its many tricks and conveniences. +然而,编程语言的学习曲线的差异令人惊讶。有些一开始很容易,但当您开始探索细节时就会变得复杂。换句话说,打印“hello world”可能只需要一行代码,但当您学习到了类和函数, 您相当于开始重新学习这门语言(或者至少是它的数据模型)。Java 从一开始就是 Java,一旦您学会了它,就可以使用它的许多技巧和便利。 简而言之: 去学习 Java 吧!它具有功能强大、多样化、可拓展、有趣的特点。为了给您提供帮助, [下载我们的 Java 备忘单][14], 它包含您在处理前十个项目时需要的所有基本语法。在那之后,您就不再需要它了,因为Java具有完美的一致性和可预测性。来享受它吧! From a38d2aeb743c85fc91c63306e73ee720d3c89a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sat, 5 Jun 2021 23:36:26 +0800 Subject: [PATCH 013/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 1f0125b629..160cdf751b 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -37,7 +37,7 @@ I've found that learning Java often encourages self-taught programmers using les ### 3\. Scaffolding and support -All the popular programming languages have great support systems in place. It's what makes popular languages popular. They all have lots of libraries; there are integrated development environments (IDEs) or IDE extensions for them, example code, free and paid training, and communities of developers. On the other hand, no programming language seems to have quite enough support when you get stuck trying to make something work. +所有流行的编程语言都有很好的支持系统。这也是使得其变成流行语言的原因。 They all have lots of libraries; there are integrated development environments (IDEs) or IDE extensions for them, example code, free and paid training, and communities of developers. On the other hand, no programming language seems to have quite enough support when you get stuck trying to make something work. I can't claim that Java can differentiate itself from these two universal but contradictory truths. Still, I have found that when I need a library for Java, I inevitably find not just one but several options for a given task. Often I don't want to use a library because I don't like how its developer chose to implement the functions I need, its license is a little different from what I prefer, or any other trivial point of contention. When there's bountiful support for a language, I have the luxury of being very selective. I get to choose one—among many perfectly suitable solutions—that will best achieve any requirement, however trivial. From 7926929010d608a388a12df448736a588f4449a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sat, 5 Jun 2021 23:36:57 +0800 Subject: [PATCH 014/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 160cdf751b..1705a4495b 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -37,7 +37,7 @@ I've found that learning Java often encourages self-taught programmers using les ### 3\. Scaffolding and support -所有流行的编程语言都有很好的支持系统。这也是使得其变成流行语言的原因。 They all have lots of libraries; there are integrated development environments (IDEs) or IDE extensions for them, example code, free and paid training, and communities of developers. On the other hand, no programming language seems to have quite enough support when you get stuck trying to make something work. +所有流行的编程语言都有很好的支持系统。这也是使得其变成流行语言的原因。They all have lots of libraries; there are integrated development environments (IDEs) or IDE extensions for them, example code, free and paid training, and communities of developers. On the other hand, no programming language seems to have quite enough support when you get stuck trying to make something work. I can't claim that Java can differentiate itself from these two universal but contradictory truths. Still, I have found that when I need a library for Java, I inevitably find not just one but several options for a given task. Often I don't want to use a library because I don't like how its developer chose to implement the functions I need, its license is a little different from what I prefer, or any other trivial point of contention. When there's bountiful support for a language, I have the luxury of being very selective. I get to choose one—among many perfectly suitable solutions—that will best achieve any requirement, however trivial. From 25cc578d8a9e7d0d1a55938dc4dc3d3c39fc9229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sun, 6 Jun 2021 00:22:06 +0800 Subject: [PATCH 015/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 1705a4495b..903bbfe071 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -37,9 +37,9 @@ I've found that learning Java often encourages self-taught programmers using les ### 3\. Scaffolding and support -所有流行的编程语言都有很好的支持系统。这也是使得其变成流行语言的原因。They all have lots of libraries; there are integrated development environments (IDEs) or IDE extensions for them, example code, free and paid training, and communities of developers. On the other hand, no programming language seems to have quite enough support when you get stuck trying to make something work. +所有流行的编程语言都有很好的支持系统。这也是使得其变成流行语言的原因。他们都有很多文档资料。有针对它们的集成开发环境 (IDE) 或 IDE 扩展、示例代码、免费和付费培训和开发者社区。在另一方面,当您在尝试做某事遇到困难时,似乎没有任何编程语言有足够的支持。 -I can't claim that Java can differentiate itself from these two universal but contradictory truths. Still, I have found that when I need a library for Java, I inevitably find not just one but several options for a given task. Often I don't want to use a library because I don't like how its developer chose to implement the functions I need, its license is a little different from what I prefer, or any other trivial point of contention. When there's bountiful support for a language, I have the luxury of being very selective. I get to choose one—among many perfectly suitable solutions—that will best achieve any requirement, however trivial. +我不能说 Java 与这两个普遍但又相互矛盾的真理隔开。 Still, I have found that when I need a library for Java, I inevitably find not just one but several options for a given task. Often I don't want to use a library because I don't like how its developer chose to implement the functions I need, its license is a little different from what I prefer, or any other trivial point of contention. When there's bountiful support for a language, I have the luxury of being very selective. I get to choose one—among many perfectly suitable solutions—that will best achieve any requirement, however trivial. Better yet, there's a healthy infrastructure around Java. Tools like [Apache Ant][3], [Gradle][4], and [Maven][5] help you manage your build and delivery process. Services like [Sonatype Nexus][6] help you monitor security. [Spring][7] and [Grails][8] make it easy to develop for the web, while [Quarkus][9] and [Eclipse Che][10] help with cloud development. From 9021b6a3ed7a7f78d181ac8cbf30d5ee426f6e2a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 9 Jun 2021 05:03:04 +0800 Subject: [PATCH 016/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210609=20?= =?UTF-8?q?Helix:=20A=20Terminal=20Based=20Text=20Editor=20for=20Power=20L?= =?UTF-8?q?inux=20Users?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md --- ...Based Text Editor for Power Linux Users.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md diff --git a/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md b/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md new file mode 100644 index 0000000000..b4b50f0fdc --- /dev/null +++ b/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md @@ -0,0 +1,104 @@ +[#]: subject: (Helix: A Terminal Based Text Editor for Power Linux Users) +[#]: via: (https://itsfoss.com/helix-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Helix: A Terminal Based Text Editor for Power Linux Users +====== + +When it comes to [terminal based text editors][1], it is usually Vim, Emacs and Nano that get the limelight. + +That doesn’t mean there are not other such text editors. [Neovim][2], a modern enhancement to Vim, is one of many such examples. + +Along the same line, I would like to introduce yet another terminal based text editor called Helix Editor. + +### Helix, a modern text editor written in Rust + +![][3] + +[Helix][4] is written in Rust and uses Tree-sitter for syntax highlighting. The developer claims that it is faster than regex highlighting because Tree-sitter parses code into syntax trees like a compiler and thus giving a lot more information about code structure. + +You can track local variables, calculate indentations and manipulate selection to select syntax nodes. It is robust enough to produce results even with syntax error. + +The main focus of Helix is on ‘multiple selection’. This is based on [Kakoune][5]. + +The built-in language server support provides context aware completion, diagnostics and code actions. + +### Installing Helix on Linux + +For Arch and Manjaro users, Helix is available in the AUR in two packages: + + * [helix-bin][6]: contains prebuilt binary from GitHub releases + * [helix-git][7]: builds the master branch of this repository + + + +As an Arch user, you probably already know [how to install applications using AUR][8], I believe. + +For other Linux distributions, you have to use Cargo. Cargo is Rust package manager. With this, you can install Rust packages. Consider it Rust equivalent to PIP of Python. + +You should be able to install Cargo using your distribution’s package manager. On Ubuntu based distributions, install cargo like this: + +``` +sudo apt install cargo +``` + +Next, you clone the Helix repository: + +``` +git clone --recurse-submodules --shallow-submodules -j8 https://github.com/helix-editor/helix +``` + +Move to the cloned directory: + +``` +cd helix +``` + +And now use cargo to install Helix: + +``` +cargo install --path helix-term --features "embed_runtime" +``` + +One last step is to add the hx binary to the PATH variable so that you can run it from anywhere. This should be added to your bashrc or bash profile. + +``` +export PATH=”$HOME/.cargo/bin:$PATH” +``` + +Now that everything is set, you should be able to use the editor by typing `hx` in the terminal. + +You can find the keyboard shortcuts for using Helix on its [documentation page][9]: + +[Helix Keyboard Shortcuts][10] + +How does it compare with Vim or Neovim? I cannot say. I can use Vim for basic editing but I am not a Vim ninja. If you are someone who swears and live by Vim (or Emacs), I let you try Helix and judge it yourself. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/helix-editor/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/command-line-text-editors-linux/ +[2]: https://neovim.io/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/helix-editor-screenshot.png?resize=800%2C515&ssl=1 +[4]: https://helix-editor.com/ +[5]: http://kakoune.org/ +[6]: https://aur.archlinux.org/packages/helix-bin/ +[7]: https://aur.archlinux.org/packages/helix-git/ +[8]: https://itsfoss.com/aur-arch-linux/ +[9]: https://docs.helix-editor.com/ +[10]: https://docs.helix-editor.com/keymap.html From 7cf72c0e35f0372596926ee1337262aff18eab9f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 9 Jun 2021 05:03:37 +0800 Subject: [PATCH 017/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210608=20?= =?UTF-8?q?Play=20Doom=20on=20Kubernetes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210608 Play Doom on Kubernetes.md --- .../tech/20210608 Play Doom on Kubernetes.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20210608 Play Doom on Kubernetes.md diff --git a/sources/tech/20210608 Play Doom on Kubernetes.md b/sources/tech/20210608 Play Doom on Kubernetes.md new file mode 100644 index 0000000000..38f85bc387 --- /dev/null +++ b/sources/tech/20210608 Play Doom on Kubernetes.md @@ -0,0 +1,232 @@ +[#]: subject: (Play Doom on Kubernetes) +[#]: via: (https://opensource.com/article/21/6/kube-doom) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Play Doom on Kubernetes +====== +Terminate pods while having fun by playing Kube DOOM. +![A cat under a keyboard.][1] + +Do you ever feel nostalgic for Doom and other blocky video games, the ones that didn't require much more than a mouse and the hope that you could survive on a LAN with your friends? You know what I'm talking about; the days when your weekends were consumed with figuring out how you could travel with your desktop and how many Mountain Dews you could fit in your cargo pants pockets? If this memory puts a warm feeling in your heart, well, this article is for you. + +Get ready to play Doom again, only this time you'll be playing for a legitimate work reason: doing chaos engineering. I'll be using my [fork of Kube DOOM][2] (with a new Helm chart because that's how I sometimes spend my weekends). I also have a pull request with the [original Kube DOOM][3] creator that I'm waiting to hear about. + +The first article in this series explained [what chaos engineering is][4], and the second demonstrated how to get your [system's steady state][5] so that you can compare it against a chaos state. In the next few articles, I introduced some chaos engineering tools you can use: [Litmus for testing][6] arbitrary failures and experiments in your Kubernetes cluster; [Chaos Mesh][7], an open source chaos orchestrator with a web user interface; and [Kube-monkey][8] for stress-testing your systems by scheduling random termination pods in your cluster. + +In this sixth article, I'll use Pop!_OS 20.04, Helm 3, Minikube 1.14.2, a VNC viewer, and Kubernetes 1.19. + +### Configure Minikube + +If you haven't already, [install Minikube][9] in whatever way that makes sense for your environment. If you have enough resources, I recommend giving your virtual machine a bit more than the default memory and CPU power: + + +``` +$ minikube config set memory 8192 +❗  These changes will take effect upon a minikube delete and then a minikube start +$ minikube config set cpus 6 +❗  These changes will take effect upon a minikube delete and then a minikube start +``` + +Then start and check the status of your system: + + +``` +$ minikube start +😄  minikube v1.14.2 on Debian bullseye/sid +🎉  minikube 1.19.0 is available! Download it: +💡  To disable this notice, run: 'minikube config set WantUpdateNotification false' + +✨  Using the docker driver based on user configuration +👍  Starting control plane node minikube in cluster minikube +🔥  Creating docker container (CPUs=6, Memory=8192MB) ... +🐳  Preparing Kubernetes v1.19.0 on Docker 19.03.8 ... +🔎  Verifying Kubernetes components... +🌟  Enabled addons: storage-provisioner, default-storageclass +🏄  Done! kubectl is now configured to use "minikube" by default +$ minikube status +minikube +type: Control Plane +host: Running +kubelet: Running +apiserver: Running +kubeconfig: Configured +``` + +### Preinstall pods with Helm + +Before moving forward, you'll need to deploy some pods into your cluster. To do this, I generated a simple Helm chart and changed the replicas in my values file from 1 to 8. + +If you need to generate a Helm chart, you can read my article on [creating a Helm chart][10] for guidance. I created a Helm chart named `nginx` and created a namespace to install my chart into using the commands below. + +Create a namespace: + + +``` +`$ kubectl create ns nginx` +``` + +Install the chart in your new namespace with a name: + + +``` +$ helm install chaos-pods nginx -n nginx + +NAME: chaos-pods +LAST DEPLOYED: Sun May 23 10:15:52 2021 +NAMESPACE: nginx +STATUS: deployed +REVISION: 1 +NOTES: +1\. Get the application URL by running these commands: +  export POD_NAME=$(kubectl get pods --namespace nginx -l "app.kubernetes.io/name=nginx,app.kubernetes.io/instance=chaos-pods" -o jsonpath="{.items[0].metadata.name}") +  export CONTAINER_PORT=$(kubectl get pod --namespace nginx $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") +  echo "Visit to use your application" +  kubectl --namespace nginx port-forward $POD_NAME 8080:$CONTAINER_PORT +``` + +### Install Kube DOOM + +You can use any [Virtual Network Computer][11] (VNC) viewer you want; I installed [TigerVNC][12] on my Linux box. There are several ways you can set up Kube DOOM. Before I generated my Helm chart, you could set it up with [kind][13] or use it locally with Docker, and the [README][14] contains instructions for those uses. + +Get started with a `git clone`: + + +``` +$ git clone [git@github.com][15]:Alynder/kubedoom.git +Cloning into 'kubedoom'... +``` + +Then change directory into the `kubedoom/helm` folder: + + +``` +`$ cd kubedoom/helm/` +``` + +Since the base values file is already set up correctly, you just need to run a single install command: + + +``` +$ helm install kubedoom kubedoom/ -n kubedoom +NAME: kubedoom +LAST DEPLOYED: Mon May 31 11:16:58 2021 +NAMESPACE: kubedoom +STATUS: deployed +REVISION: 1 +NOTES: +1\. Get the application URL by running these commands: +  export NODE_PORT=$(kubectl get --namespace kubedoom -o jsonpath="{.spec.ports[0].nodePort}" services kubedoom-kubedoom-chart) +  export NODE_IP=$(kubectl get nodes --namespace kubedoom -o jsonpath="{.items[0].status.addresses[0].address}") +  echo http://$NODE_IP:$NODE_PORT +``` + +Everything should be installed, set up, and ready to go. + +### Play with Kube DOOM + +Now you just need to get in there, run a few commands, and start playing your new chaos video game. The first command is a port forward, followed by the VNC viewer connection command. The VNC viewer connection needs a password, which is `idbehold`. + +Find your pod for the port forward: + + +``` +$ kubectl get pods -n kubedoom +NAME                                       READY   STATUS    RESTARTS   AGE +kubedoom-kubedoom-chart-676bcc5c9c-xkwpp   1/1     Running   0          68m +``` + +Run the `port-forward` command using your pod name: + + +``` +$  kubectl port-forward  kubedoom-kubedoom-chart-676bcc5c9c-xkwpp 5900:5900 -n kubedoom +Forwarding from 127.0.0.1:5900 -> 5900 +Forwarding from [::1]:5900 -> 5900 +``` + +Everything is ready to play, so you just need to run the VNC viewer command (shown below with output): + + +``` +$  vncviewer viewer localhost:5900 + +TigerVNC Viewer 64-bit v1.10.1 +Built on: 2020-04-09 06:49 +Copyright (C) 1999-2019 TigerVNC Team and many others (see README.rst) +See for information on TigerVNC. + +Mon May 31 11:33:23 2021 + DecodeManager: Detected 64 CPU core(s) + DecodeManager: Creating 4 decoder thread(s) + CConn:       Connected to host localhost port 5900 +``` + +Next, you'll see the password request, so enter it (`idbehold`, as given above). + +![VNC authentication][16] + +(Jess Cherry, [CC BY-SA 4.0][17]) + +Once you are logged in, you should be able to walk around and see your enemies with pod names. + +![Kube Doom pods][18] + +(Jess Cherry, [CC BY-SA 4.0][17]) + +I'm terrible at this game, so I use some cheats to have a little more fun: + + * Type `idspispopd` to walk straight through a wall to get to your army of pods. + * Can't handle the gun? That's cool; I'm bad at it, too. If you type `idkfa` and press the number **5**, you'll get a better weapon. + + + +This is what it looks like when you kill something (I used [k9s][19] for this view). + +![Killing pods in Kube DOOM][20] + +(Jess Cherry, [CC BY-SA 4.0][17]) + +### Final notes + +Because this application requires a cluster-admin role, you have to really pay attention to the names of the pods—you might run into a kube-system pod, and you'd better run away. If you kill one of those pods, you will kill an important part of the system. + +I love this application because it's the quickest gamified way to do chaos engineering. It did remind me of how bad I was at this video game, but it was hilarious to try it. Happy hunting! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/kube-doom + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cherrybomb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead_cat-keyboard.png?itok=fuNmiGV- (A cat under a keyboard.) +[2]: https://github.com/Alynder/kubedoom +[3]: https://github.com/storax/kubedoom +[4]: https://opensource.com/article/21/5/11-years-kubernetes-and-chaos +[5]: https://opensource.com/article/21/5/get-your-steady-state-chaos-grafana-and-prometheus +[6]: https://opensource.com/article/21/5/total-chaos-litmus +[7]: https://opensource.com/article/21/5/get-meshy-chaos-mesh +[8]: https://opensource.com/article/21/6/chaos-kubernetes-kube-monkey +[9]: https://minikube.sigs.k8s.io/docs/start/ +[10]: https://opensource.com/article/20/5/helm-charts +[11]: https://en.wikipedia.org/wiki/Virtual_Network_Computing +[12]: https://tigervnc.org/ +[13]: https://kind.sigs.k8s.io/ +[14]: https://github.com/Alynder/kubedoom/blob/master/README.md +[15]: mailto:git@github.com +[16]: https://opensource.com/sites/default/files/uploads/vnc-password.png (VNC authentication) +[17]: https://creativecommons.org/licenses/by-sa/4.0/ +[18]: https://opensource.com/sites/default/files/uploads/doom-pods.png (Kube Doom pods) +[19]: https://opensource.com/article/20/5/kubernetes-administration +[20]: https://opensource.com/sites/default/files/uploads/doom-pods_kill.png (Killing pods in Kube DOOM) From 5887dd711e4651c507868c45bbc5e61324667971 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 9 Jun 2021 05:03:50 +0800 Subject: [PATCH 018/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210608=20?= =?UTF-8?q?Tune=20your=20MySQL=20queries=20like=20a=20pro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210608 Tune your MySQL queries like a pro.md --- ...0608 Tune your MySQL queries like a pro.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20210608 Tune your MySQL queries like a pro.md diff --git a/sources/tech/20210608 Tune your MySQL queries like a pro.md b/sources/tech/20210608 Tune your MySQL queries like a pro.md new file mode 100644 index 0000000000..10cf4a15c0 --- /dev/null +++ b/sources/tech/20210608 Tune your MySQL queries like a pro.md @@ -0,0 +1,108 @@ +[#]: subject: (Tune your MySQL queries like a pro) +[#]: via: (https://opensource.com/article/21/5/mysql-query-tuning) +[#]: author: (Dave Stokes https://opensource.com/users/davidmstokes) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Tune your MySQL queries like a pro +====== +Optimizing your queries isn't a dark art; it's just simple engineering. +![woman on laptop sitting at the window][1] + +Many people consider tuning database queries to be some mysterious "dark art" out of a Harry Potter novel; with the wrong incantation, your data turns from a valuable resource into a pile of mush. + +In reality, tuning queries for a relational database system is simple engineering and follows easy-to-understand rules or heuristics. The query optimizer translates the query you send to a [MySQL][2] instance, and then it determines the best way to get the requested data using those heuristics combined with what it knows about your data. Reread the last part of that: _"what it knows about your data_." The less the query optimizer has to guess about where your data is located, the better it can create a plan to deliver your data. + +To give the optimizer better insight about the data, you can use indexes and histograms. Used properly, they can greatly increase the speed of a database query. If you follow the recipe, you will get something you will like. But if you add your own ingredients to that recipe, you may not get what you want. + +### Cost-based optimizer + +Most modern relational databases use a cost-based optimizer to determine how to retrieve your data out of the database. That cost is based on reducing very expensive disk reads as much as possible. The query optimizer code inside the database server keeps statistics on getting that data as it is encountered, and it builds a historical model of what it took to get the data. + +But historical data can be out of date. It's like going to the store to buy your favorite snack and being shocked at a sudden price increase or that the store closed. Your server's optimization process may make a bad assumption based on old information, and that will produce a poor query plan. + +A query's complexity can work against optimization. The optimizer wants to deliver the lowest-cost query of the available options. Joining five different tables means that there are five-factorial or 120 possible combinations about which to join to what. Heuristics are built into the code to try to shortcut evaluating all the possible options. MySQL wants to generate a new query plan every time it sees a query, while other databases such as Oracle can have a query plan locked down. This is why giving detailed information on your data to the optimizer is vital. For consistent performance, it really helps to have up-to-date information for the query optimizer to use when making query plans. + +Also, rules are built into the optimizer with assumptions that probably do not match the reality of your data. The query optimizer will assume all the data in a column is evenly distributed among all the rows unless it has other information. And it will default to the smaller of two possible indexes if it sees no alternative. While the cost-based model for an optimizer can make a lot of good decisions, you can smack into cases where you will not get an optimal query plan. + +### A query plan? + +A query plan is what the optimizer will generate for the server to execute from the query. The way to see the query plan is to prepend the word `EXPLAIN` to your query. For example, the following query asks for the name of a city from the city table and the name of the corresponding country table, and the two tables are linked by the country's unique code. This case is interested only in the top five cities alphabetically from the United Kingdom: + + +``` +SELECT city.name AS 'City', +               country.name AS 'Country' +FROM city +JOIN country ON (city.countrycode = country.code) +WHERE country.code = 'GBR' +LIMIT 5; +``` + +Prepending `EXPLAIN` in front of this query will give the query plan generated by the optimizer. Skipping over all but the end of the output, it is easy to see the optimized query: + + +``` +SELECT `world`.`city`.`Name` AS `City`, +                'United Kingdom' AS `Country` +FROM `world`.`city` +JOIN `world`.`country` +WHERE (`world`.`city`.`CountryCode` = 'GBR') +LIMIT 5; +``` + +The big changes are that `country.name as 'Country'` was changed to `'United Kingdom' AS 'Country'` and the `WHERE` clause went from looking in the country table to the city table. The optimizer determined that these two changes will provide a faster result than the original query. + +### Indexes + +You will hear indexes and keys used interchangeably in the MySQL-verse. However, indexes are made up of keys, and keys are a way to identify a record, hopefully uniquely. If a column is designed as a key, the optimizer can search a list of those keys to find the desired record without having to read the entire table. Without an index, the server has to start at the first row of the first column and read through every row of data. If the column was created as a unique index, then the server can go to that one row of data and ignore the rest. The more unique the value of the index (also known as its cardinality), the better. Remember, we are looking for faster ways of getting to the data. + +The MySQL default InnoDB storage engine wants your table to have a primary key and will store your data in a B+ tree by that key. A recently added MySQL feature is invisible columns—columns that do not return data unless the column is explicitly named in the query. For example, `SELECT * FROM foo;` doesn't provide any columns that are designated as hidden. This feature provides a way to add a  primary key to older tables without recoding all the queries to include that new column. + +To make this even more complicated, there are many types of indexes, such as functional, spatial, and composite. There are even cases where you can create an index that will provide all the requested information for a query so that there is no need to access the data table. + +Describing the various indexes is beyond the scope of this article, so just think of an index as a shortcut to the record or records you desire. You can create an index on one or more columns or part of those columns. My physician's system can look up my records by the first three letters of my last name and birthdate. Using multiple columns requires using the most unique field first, then the second most unique, and so forth. An index on year-month-day works for year-month-day, year-month, and year searches, but it doesn't work for day, month-day, or year-day searches. It helps to design your indexes around how you want to use your data. + +### Histograms + +A histogram is a distribution of your data. If you were alphabetizing people by their last name, you could use a "logical bucket" for the folks with last names starting with the letters A to F, then another for G to J, and so forth. The optimizer assumes that the data is evenly distributed within the column, but this is rarely the case in practical use. + +MySQL provides two types of histograms: equal height, where all the data is divided equally among the buckets, and singleton, where a single value is in a bucket. You can have up to 1,024 buckets. The amount of buckets to choose for your data column depends on many factors, including how many distinct values you have, how skewed your data is, and how high your accuracy really needs to be. After a certain amount of buckets, there are diminishing returns. + +This command will create a histogram of 10 buckets on column c1 of table t: + + +``` +`ANALYZE TABLE t UPDATE HISTOGRAM ON c1 WITH 10 BUCKETS;` +``` + +Imagine you sell small, medium, and large socks, and each size has its own bin for storage. To find the size you need, you go to the bin for that size. MySQL has had histograms since MySQL 8.0 was released three years ago, yet they are not as well-known as indexes. Unlike indexes, there is no overhead for inserting, updating, or deleting a record. To update an index, an `ANALYZE TABLE` command must be updated. This is a good approach when the data does not churn very much and frequent changes to the data will reduce the efficiency. + +### Indexes or histograms? + +Use indexes for unique items where you need to access the data directly. There is overhead for updates, deletes, and inserts, but you get speedy access if your data is properly architected. Use histograms for data that does not get updated frequently, such as quarterly results for the last dozen years. + +### Parting thoughts + +This article grew out of a recent presentation at the [Open Source 101 conference][3]. And that presentation grew out of a workshop at a [PHP UK Conference][4]. Query tuning is a complex subject, and each time I present on indexes and histograms, I find ways to refine my presentation. But each presentation also shows that many folks in the software world are not well-versed on indexes and tend to use them incorrectly. Histograms have not been around long enough (I hope) to have been misused similarly. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/mysql-query-tuning + +作者:[Dave Stokes][a] +选题:[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/davidmstokes +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://www.mysql.com/ +[3]: https://opensource101.com/ +[4]: https://www.phpconference.co.uk/ From f3cde3f9c8ccab94be89c63e120b7733dfb71389 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 9 Jun 2021 05:04:03 +0800 Subject: [PATCH 019/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210608=20?= =?UTF-8?q?How=20FreeDOS=20boots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210608 How FreeDOS boots.md --- sources/tech/20210608 How FreeDOS boots.md | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20210608 How FreeDOS boots.md diff --git a/sources/tech/20210608 How FreeDOS boots.md b/sources/tech/20210608 How FreeDOS boots.md new file mode 100644 index 0000000000..ce9d4cd66c --- /dev/null +++ b/sources/tech/20210608 How FreeDOS boots.md @@ -0,0 +1,76 @@ +[#]: subject: (How FreeDOS boots) +[#]: via: (https://opensource.com/article/21/6/freedos-boots) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How FreeDOS boots +====== +An overview of how your computer boots up and starts a simple operating +system like FreeDOS. +![Code going into a computer.][1] + +One thing I appreciate from growing up with DOS computers is that the boot process is relatively easy to understand. There aren't a lot of moving parts in DOS. And today, I'd like to share an overview of how your computer boots up and starts a simple operating system like FreeDOS. + +### Initial bootstrapping + +When you turn on the power to your computer, the system performs several self-checks, such as verifying the memory and other components. This is called the **Power On Self Test** or "POST." After the POST, the computer uses a hard-coded instruction that tells it where to find its instructions to load the operating system. This is the "boot loader," and usually it will try to locate a Master Boot Record or (MBR) on the hard drive. The MBR then loads the primary operating system; in this case, that's FreeDOS. + +This process of locating one piece of information so the computer can load the next part of the operating system is called "bootstrapping," from the old expression of "picking yourself up by your bootstraps." It is from this usage that we adopted the term "boot" to mean starting up your computer. + +### The kernel + +When the computer loads the FreeDOS kernel, one of the first things the kernel does is identify any parameters the user has indicated to use. This is stored in a file called `FDCONFIG.SYS`, stored in the same root directory as the kernel. If `FDCONFIG.SYS` does not exist, then the FreeDOS kernel looks for an alternate file called `CONFIG.SYS`. + +If you used DOS in the 1980s or 1990s, you may be familiar with the `CONFIG.SYS` file. Since 1999, FreeDOS looks for `FDCONFIG.SYS` first in case you have a DOS system that is _dual booting_ FreeDOS with some other DOS, such as MS-DOS. Note that MS-DOS only uses the `CONFIG.SYS` file. So if you use the same hard drive to boot both FreeDOS and MS-DOS, MS-DOS uses `CONFIG.SYS` to configure itself, and FreeDOS uses `FDCONFIG.SYS` instead. That way, each can use its own configuration. + +`FDCONFIG.SYS` can contain a number of configuration settings, one of which is `SHELL=` or `SHELLHIGH=`. Either one will instruct the kernel to load this program as the interactive shell for the user. + +If neither `FDCONFIG.SYS` nor `CONFIG.SYS` exist, then the kernel assumes several default values, including where to find the shell. If you see the message "Bad or missing Command Interpreter" when you boot your FreeDOS system, that means `SHELL=` or `SHELLHIGH=` is pointing to a shell program that doesn't exist on your system. + +![Bad or missing Command Interpreter][2] + +Jim Hall, CC-BY SA 4.0 + +You might debug this by looking at the `SHELL=` or `SHELLHIGH=` lines. Failing that, make sure you have a program called `COMMAND.COM` in the root directory of your FreeDOS system. This is the _shell_, which I'll talk about next. + +### The shell + +The term "shell" on a DOS system usually means a command-line interpreter; an interactive program that reads instructions from the user, then executes them. In this way, the FreeDOS shell is similar to the Bash shell on Linux. + +Unless you've asked the kernel to load a different shell using `SHELL=` or `SHELLHIGH=`, the standard command-line shell on DOS is called `COMMAND.COM`. And as `COMMAND.COM` starts up, it also looks for a file to configure itself. By default, `COMMAND.COM` will look for a file called `AUTOEXEC.BAT` in the root directory. `AUTOEXEC.BAT` is a "batch file" that contains a set of instructions that run at startup, and is roughly analogous to the `~/.bashrc` "resource file" that Bash reads when it starts up on Linux. + +You can change the shell, and the startup file for the shell, in the `FDCONFIG.SYS` file, with `SHELL=` or `SHELLHIGH=`. The FreeDOS 1.3 RC4 installer sets up the system to read `FDAUTO.BAT` instead of `AUTOEXEC.BAT`. This is for the same reason that the kernel reads an alternate configuration file; you can dual-boot FreeDOS on a hard drive with another DOS. FreeDOS will use `FDAUTO.BAT` while MS-DOS will use `AUTOEXEC.BAT`.. + +Without a startup file like `AUTOEXEC.BAT`, the shell will simply prompt the user to enter the date and time. + +![Without AUTOEXEC.BAT, the shell will prompt for date and time][3] + +Jim Hall, CC-BY SA 4.0 + +And that's it. Once FreeDOS has loaded the kernel, and the kernel has loaded the shell, FreeDOS is ready for the user to type commands. + +![FreeDOS is ready for you to enter your first command][4] + +Jim Hall, CC-BY SA 4.0 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-boots + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) +[2]: https://opensource.com/sites/default/files/uploads/bad-missing-command.png (Bad or missing Command Interpreter) +[3]: https://opensource.com/sites/default/files/uploads/no-autoexec.png (Without AUTOEXEC.BAT, the shell will prompt for date and time) +[4]: https://opensource.com/sites/default/files/uploads/freedos-boot.png (FreeDOS is ready for you to enter your first command) From 5dcb1e7ac0253e87ef3fed41eb53405dbf921241 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 9 Jun 2021 05:04:17 +0800 Subject: [PATCH 020/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210608=20?= =?UTF-8?q?Analyze=20community=20health=20metrics=20with=20this=20open=20s?= =?UTF-8?q?ource=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210608 Analyze community health metrics with this open source tool.md --- ...alth metrics with this open source tool.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210608 Analyze community health metrics with this open source tool.md diff --git a/sources/tech/20210608 Analyze community health metrics with this open source tool.md b/sources/tech/20210608 Analyze community health metrics with this open source tool.md new file mode 100644 index 0000000000..6c2aa41b70 --- /dev/null +++ b/sources/tech/20210608 Analyze community health metrics with this open source tool.md @@ -0,0 +1,83 @@ +[#]: subject: (Analyze community health metrics with this open source tool) +[#]: via: (https://opensource.com/article/21/6/health-metrics-cauldron) +[#]: author: (Georg Link https://opensource.com/users/georglink) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Analyze community health metrics with this open source tool +====== +Cauldron makes it easier for anyone to use GrimoireLab to learn more +about open source communities. +![Open source doctor.][1] + +Community managers, maintainers, and foundations seek metrics and insights about open source communities. Because each open source project works differently, its data needs to be analyzed differently. Yet, all projects share common challenges with getting data and creating visualizations. This presents an ideal use case for an open source project to solve this problem generically with the capability to customize it to users' needs. + +The open source GrimoireLab project has been working on ways to [measure the health of open source communities][2]. In addition to powering large-scale open source metrics solutions, it also serves as the backbone of the new [Cauldron][3] platform. + +GrimoireLab solves some hard problems related to retrieving and curating data. It was designed to be a flexible metrics solution for analyzing open source communities. [LibreOffice][4] and [Mautic][5] are among the communities using GrimoireLab's open source tools to generate community health metrics. + +![LibreOffice's GrimoireLab dashboard][6] + +LibreOffice's GrimoireLab dashboard (Georg Link, [CC BY-SA 4.0][7]) + +GrimoireLab satisfies the need for metrics, but two challenges have prevented wider adoption. First, it is difficult to deploy and secure. Its setup is more difficult than many expect, especially those who just want to have metrics without manually editing configuration files. Second, it does not scale well if you have many users trying to analyze different projects; every user must deploy their own GrimoireLab instance. + +Two platforms have solved these challenges to offer community metrics as a service, with GrimoireLab working under the hood. First, the Linux Foundation leveraged GrimoireLab to bootstrap its [LFX Insights platform][8]. It gives the foundation's open source projects a great deal of insight into their communities, some of which goes beyond GrimoireLab's core features. LFX Insights is not available as open source and only available from the Linux Foundation. + +![LFX Insights dashboard][9] + +LFX Insights dashboard showing metrics about the Kubernetes project (Georg Link, [CC BY-SA 4.0][7]) + +The other choice is [Cauldron][10], which is open source. It's designed to abstract the difficulty of using GrimoireLab's metrics and create a smooth user experience. Anyone can use Cauldron for their open source communities for free at [Cauldron.io][3]. Cauldron provides metrics without having to deploy software, which resolves the challenge of deploying and securing GrimoireLab. + +![Cauldron dashboard][11] + +Cauldron dashboard showing metrics about the Kubernetes project (Georg Link, [CC BY-SA 4.0][7]) + +Cauldron solves the scalability challenge by collecting data about an open source community centrally and making it available to all platform users. This reduces the time needed for new reports if the data was previously collected. It also minimizes the issue of API rate limits that could restrict collecting data at scale. + +To mitigate privacy concerns, Cauldron anonymizes all data by default. Should you want to know who your contributors (or companies in your communities) are, you will need a private Cauldron instance, either by deploying it yourself or using [Cauldron Cloud service][12]. + +These design choices enable a new way of working with this data. Instead of limiting analysis to individual projects, anyone can define reports and include anything from a single project's repository to hundreds of repositories from a group of projects. This makes it possible to analyze trends, like the rise in blockchain projects, by looking at data across many projects. + +Many people want to be able to compare data about multiple open source projects. In Cauldron, a user can create a report for each project then use the Comparison feature to show the data for each project side-by-side with graphs. + +![A Cauldron dashboard comparing Ansible, Ethereum, and Kubernetes][13] + +Cauldron dashboard comparing Ansible, Ethereum, and Kubernetes (Georg Link, [CC BY-SA 4.0][7]) + +The high demand for open source within the enterprise and increasing interest in community health and metrics are leading solution providers to improve usability. GrimoireLab continues to focus on retrieving data about open source communities. Downstream projects like LFX Insights and Cauldron leverage GrimoireLab to provide easy-to-use metrics. + +On a related note, the CHAOSS Project offers a Community Health Report. The report is created using the two CHAOSS projects, Augur and GrimoireLab. You can [request your Community Health Report][14] on the CHAOSS website or see the same metrics and visualizations under the [CHAOSS tab][15] in Cauldron. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/health-metrics-cauldron + +作者:[Georg Link][a] +选题:[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/georglink +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcedoctor.png?itok=fk79NwpC (Open source doctor.) +[2]: https://opensource.com/article/20/3/grimoirelab +[3]: https://cauldron.io/ +[4]: https://dashboard.documentfoundation.org/ +[5]: https://dashboard.mautic.org/ +[6]: https://opensource.com/sites/default/files/uploads/libreoffice_grimoirelab-dashboard.png (LibreOffice's GrimoireLab dashboard) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://lfx.linuxfoundation.org/tools/insights +[9]: https://opensource.com/sites/default/files/uploads/lfx-insights.png (LFX Insights dashboard) +[10]: https://gitlab.com/cauldronio/cauldron/ +[11]: https://opensource.com/sites/default/files/uploads/cauldron-dashboard.png (Cauldron dashboard) +[12]: http://cloud.cauldron.io/ +[13]: https://opensource.com/sites/default/files/uploads/compare-projects.png (A Cauldron dashboard comparing Ansible, Ethereum, and Kubernetes) +[14]: https://chaoss.community/community-reports/ +[15]: https://cauldron.io/project/372?tab=chaoss From f48cb41c8c7669486897129b3d77ec2177995bf1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 9 Jun 2021 05:05:05 +0800 Subject: [PATCH 021/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210608=20?= =?UTF-8?q?You=20Can=20Still=20Use=20the=20Old=20Firefox=20Interface=20(bu?= =?UTF-8?q?t=20not=20for=20long)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md --- ...ld Firefox Interface (but not for long).md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md diff --git a/sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md b/sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md new file mode 100644 index 0000000000..ea821b8f12 --- /dev/null +++ b/sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md @@ -0,0 +1,76 @@ +[#]: subject: (You Can Still Use the Old Firefox Interface (but not for long)) +[#]: via: (https://news.itsfoss.com/firefox-old-design-switch/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +You Can Still Use the Old Firefox Interface (but not for long) +====== + +[Firefox 89][1] is finally available to download with a major redesign. While some like what they are trying to do, as a competitive alternative to Google Chrome in terms of user experience, many do not seem to like the modern design. + +Of course, the design choices will always have distinct perspective for all kinds of users. But is there a way to go back to the old Firefox design? + +Well, for now, it seems like a yes. But you may not be able to revert the design after the next Firefox update. + +Here, let me briefly highlight what it is all about. + +### How to Switch Back to the Old Firefox Design? + +Just like how [we enabled the proton design to take an early look before the final release][2], you need to disable the proton UI elements to get back to the old design. + +To get started, just type in “**about:config**” in the address bar and proceed by ignoring the warning. + +![][3] + +Once you click on “**Accept the Risk and Continue**“, you will notice a search field with no options to choose/select. + +Now, you just need to type in “**Proton**” to list all the options related to the new redesign, as shown below: + +![][3] + +Here, you need to click on the toggle button at the right-side as highlighted in this screenshot to disable all those options. + +You should already see it in action after disabling the options, but you may want to restart the browser if it does not seem right. + +I should mention that even with all the options disabled, it does not necessarily look exactly like the old Firefox design, but yes — for most of the part. + +In the same way, you just have to enable the options back to switch to the new design. + +### Wrapping Up + +Now that you can easily go back and forth between the new and old Firefox design, you may not be able to go back again after the next Firefox update. + +As originally spotted by [UbuntuHanbook][4], the options that you disabled above will no longer be available with the next Firefox update as per a [bug report][5]. + +What do you think about the new Firefox design? Would you be willing go back to the old design using the method mentioned? + +Feel free to let me know what you think in the comments below. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/firefox-old-design-switch/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/firefox-89-release/ +[2]: https://news.itsfoss.com/firefox-proton-redesign/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://ubuntuhandbook.org/index.php/2021/06/revert-old-user-interface-firefox-89/ +[5]: https://bugzilla.mozilla.org/show_bug.cgi?id=1709425 From 712bc22b684b0481d920d811a458c3d4672b1edc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 9 Jun 2021 20:46:03 +0800 Subject: [PATCH 022/870] PUB @wxy https://linux.cn/article-13472-1.html --- ...nux PC hardware-using open source tools.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) rename {translated/tech => published}/20210427 Upgrade your Linux PC hardware-using open source tools.md (87%) diff --git a/translated/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md b/published/20210427 Upgrade your Linux PC hardware-using open source tools.md similarity index 87% rename from translated/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md rename to published/20210427 Upgrade your Linux PC hardware-using open source tools.md index 76de1b87ae..7ddd890346 100644 --- a/translated/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md +++ b/published/20210427 Upgrade your Linux PC hardware-using open source tools.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13472-1.html) 使用开源工具升级你的 Linux PC 硬件 ====== > 升级你的电脑硬件来提升性能,以获得最大的回报。 -![笔记本电脑上的商务女性坐在窗前][1] +![](https://img.linux.net.cn/data/attachment/album/202106/09/204443k8dz09dddhd7xu65.jpg) 在我的文章《[使用开源工具识别 Linux 性能瓶颈][2]》中,我解释了一些使用开源的图形用户界面(GUI)工具监测 Linux 性能的简单方法。我的重点是识别 _性能瓶颈_,即硬件资源达到极限并阻碍你的 PC 性能的情况。 @@ -22,33 +22,33 @@ 开源工具是关键。GUI 工具可以帮助你监控你的系统,预测哪些硬件改进会有效。否则,你可能买了硬件后发现它并没有提高性能。在升级之后,这些工具也有助于验证升级是否产生了你预期的好处。 -这篇文章概述了一种简单的 PC 硬件升级的方法。其“秘诀”是开源的 GUI 工具。 +这篇文章概述了一种简单的 PC 硬件升级的方法,其“秘诀”是开源的 GUI 工具。 ### 如何升级内存 几年前,升级内存是不用多想的。增加内存几乎总是能提高性能。 -今天,情况不再是这样了。个人电脑配备了更多的内存,而且 Linux 能非常有效地使用它。如果你买了系统用不完的内存,你就浪费了钱。 +今天,情况不再是这样了。个人电脑配备了更多的内存,而且 Linux 能非常有效地使用它。如果你购买了系统用不完的内存,就浪费了钱。 因此,你要花一些时间来监测你的电脑,看看内存升级是否会有助于提升它的性能。例如,在你进行典型的一天工作时观察内存的使用情况。而且一定要检查在内存密集型工作负载中发生了什么。 -各种各样的开源工具可以帮助你进行这种监测,不过我用的是 [GNOME系统监视器][3]。它在大多数 Linux 软件库中都有。 +各种各样的开源工具可以帮助你进行这种监测,不过我用的是 [GNOME 系统监视器][3]。它在大多数 Linux 软件库中都有。 -当你启动系统监视器时,它的**资源**面板会显示这样的输出: +当你启动系统监视器时,它的“资源”面板会显示这样的输出: ![用 GNOME 系统监控器监控内存][4] *图 1. 用 GNOME 系统监视器监控内存 (Howard Fosdick, [CC BY-SA 4.0][5])* -屏幕中间显示内存的使用情况。[交换空间][6] 是 Linux 在内存不足时使用的磁盘空间。Linux 通过使用交换空间作为内存的一个较慢的扩展来有效地增加内存。 +屏幕中间显示了内存的使用情况。[交换空间][6] 是 Linux 在内存不足时使用的磁盘空间。Linux 通过使用交换空间作为内存的一个较慢的扩展来有效地增加内存。 由于交换空间比内存慢,如果内存交换活动变得显著,增加内存将改善你的计算机的性能。你会得到多大的改善取决于交换活动的数量和交换空间所在的设备的速度。 -如果使用了大量的交换空间,你通过增加内存得到的性能改善会比只使用了少量交换空间的情况大。 +如果使用了大量的交换空间,你通过增加内存会得到比只使用了少量交换空间更多的性能改善。 -如果交换空间位于慢速的机械硬盘上,你会发现增加内存比交换空间位于最快的固态硬盘上有更大的改善。 +如果交换空间位于慢速的机械硬盘上,你会发现增加内存比将交换空间放在最快的固态硬盘上改善更多。 -下面是一个关于何时增加内存的例子。这台电脑在内存利用率达到 80% 后显示出交换活动在增加。当内存利用率超过 90% 时,它就变得没有反应了。 +下面是一个关于何时增加内存的例子。这台电脑在内存利用率达到 80% 后显示交换活动在增加。当内存利用率超过 90% 时,它就变得失去反应了。 ![系统监控 - 内存不足的情况][7] @@ -70,15 +70,15 @@ 升级后,启动系统监视器。运行之前使你的内存超载的相同程序。 -系统监控器应该显示出你扩展的内存,而且你应该看到更好的性能。 +系统监控器应该显示出你扩充的内存,而且你应该发现性能更好了。 ### 如何升级存储 -我们正处在一个存储快速改进的时代。即使是只有几年历史的计算机也可以从磁盘升级中受益。但首先,你要确保升级对你的计算机和工作负载是有意义的。 +我们正处在一个存储快速改进的时代。即使是只用了几年的计算机也可以从磁盘升级中受益。但首先,你要确保升级对你的计算机和工作负载是有意义的。 首先,要找出你有什么磁盘。许多开源工具会告诉你。[Hardinfo][8] 或 [GNOME 磁盘][9] 是不错的选择,因为它们都是广泛可用的,而且它们的输出很容易理解。这些应用程序会告诉你磁盘的品牌、型号和其他细节。 -接下来,通过基准测试来确定你的磁盘性能。GNOME 磁盘让这一切变得简单。只要启动该工具并点击它的**磁盘基准测试**选项。这会给出你磁盘的读写率和平均磁盘访问时间。 +接下来,通过基准测试来确定你的磁盘性能。GNOME 磁盘让这一切变得简单。只要启动该工具并点击它的“磁盘基准测试”选项。这会给出你磁盘的读写率和平均磁盘访问时间。 ![GNOME 磁盘基准测试][10] @@ -104,7 +104,7 @@ 很明显,你可以用一个更快的磁盘来提高性能。 -你也会想知道是哪个程序使用了磁盘。只要启动系统监视器并点击其**进程**标签。 +你也会想知道是哪个程序使用了磁盘。只要启动系统监视器并点击其“进程”标签。 现在你知道了你的磁盘有多忙,以及哪些程序在使用它,所以你可以做出一个有根据的判断,是否值得花钱买一个更快的磁盘。 @@ -126,7 +126,7 @@ * **绿色柱形图:** 固态硬盘比机械硬盘快。但如果固态硬盘使用 SATA 接口,就会限制其性能。这是因为 SATA 接口是十多年前为机械硬盘设计的。 * **蓝色柱形图:** 最快的内置磁盘技术是新的 [PCIe 接口的 NVMe 固态盘][19]。这些可以比 SATA 连接的固态硬盘大约快 5 倍,比机械硬盘快 20 倍。 -对于外置 SSD,你会发现 [最新的雷电和 USB 接口][20] 是最快的。 +对于外置 SSD,你会发现 [最新的雷电接口和 USB 接口][20] 是最快的。 #### 如何安装一个内置磁盘 @@ -152,7 +152,7 @@ *图 7. USB 速度差别很大(Howard Fosdick,[CC BY-SA 4.0][5],基于 [Tripplite][23] 和 [维基][24] 的数据* -要查看你得到的实际 USB 速度,请启动 GNOME 磁盘。GNOME 磁盘可以对 USB 连接的设备进行基准测试,就像对内部磁盘一样。选择其**基准磁盘**选项。 +要查看你得到的实际 USB 速度,请启动 GNOME 磁盘。GNOME 磁盘可以对 USB 连接的设备进行基准测试,就像对内部磁盘一样。选择其“磁盘基准测试”选项。 你插入的设备和 USB 端口共同决定了你将得到的速度。如果端口和设备不匹配,你将体验到两者中较慢的速度。 @@ -170,7 +170,7 @@ USB 3.0 卡的价格只有 25 美元左右。较新、较贵的卡提供 USB 3.1 升级你的互联网带宽很容易。只要给你的 ISP 写一张支票即可。 -问题是:应该升级吗? +问题是,应该升级吗? 系统监控器显示了你的带宽使用情况(见图 1)。如果你经常遇到你从 ISP 购买的带宽限额,你会从购买更高的限额中受益。 @@ -192,13 +192,13 @@ USB 3.0 卡的价格只有 25 美元左右。较新、较贵的卡提供 USB 3.1 大多数台式机主板支持一系列的 CPU,并且是可以升级的 —— 假设你还没有使用该系列中最顶级的处理器。 -使用系统监视器观察你的 CPU,并确定升级是否有帮助。它的**资源**面板将显示你的 CPU 负载。如果你的所有逻辑处理器始终保持在 80% 或 90% 以上,你可以从更多的 CPU 功率中受益。 +使用系统监视器观察你的 CPU,并确定升级是否有帮助。它的“资源”面板将显示你的 CPU 负载。如果你的所有逻辑处理器始终保持在 80% 或 90% 以上,你可以从更多的 CPU 功率中受益。 这是一个升级 CPU 的有趣项目。只要小心谨慎,任何人都可以做到这一点。 不幸的是,这几乎没有成本效益。大多数卖家对单个 CPU 芯片收取溢价,比他们卖给你的新系统要高。因此,对许多人来说,升级 CPU 并不具有经济意义。 -如果你将显示器直接插入台式机的主板,你可能会通过升级图形处理而受益。只需添加一块显卡。 +如果你将显示器直接插入台式机的主板,你可能会通过升级图形处理器而受益。只需添加一块显卡。 诀窍是在新显卡和你的 CPU 之间实现平衡的工作负荷。这个 [在线工具][27] 能准确识别哪些显卡能与你的 CPU 最好地配合。[这篇文章][28] 详细解释了如何去升级你的图形处理。 @@ -222,7 +222,7 @@ via: https://opensource.com/article/21/4/upgrade-linux-hardware [a]: https://opensource.com/users/howtech [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) -[2]: https://opensource.com/article/21/3/linux-performance-bottlenecks +[2]: https://linux.cn/article-13462-1.html [3]: https://vitux.com/how-to-install-and-use-task-manager-system-monitor-in-ubuntu/ [4]: https://opensource.com/sites/default/files/uploads/system_monitor_-_resources_panel_0.jpg (Monitoring memory with GNOME System Monitor) [5]: https://creativecommons.org/licenses/by-sa/4.0/ From 0696365877bec4dcff14e7f363785477562975c2 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Wed, 9 Jun 2021 21:26:30 +0800 Subject: [PATCH 023/870] translated 20210518 manage your raspberry Pi --- ...8 Manage your Raspberry Pi with Cockpit.md | 164 ----------------- ...8 Manage your Raspberry Pi with Cockpit.md | 166 ++++++++++++++++++ 2 files changed, 166 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md create mode 100644 translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md diff --git a/sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md b/sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md deleted file mode 100644 index cfcdf7fee9..0000000000 --- a/sources/tech/20210518 Manage your Raspberry Pi with Cockpit.md +++ /dev/null @@ -1,164 +0,0 @@ -[#]: subject: (Manage your Raspberry Pi with Cockpit) -[#]: via: (https://opensource.com/article/21/5/raspberry-pi-cockpit) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) -[#]: collector: (lujun9972) -[#]: translator: (ShuyRoy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Manage your Raspberry Pi with Cockpit -====== -Establish central control over your Raspberry Pis with Cockpit. -![Neon colorized Raspberry Pi cluster with LEGOs][1] - -Last year, I wrote about using [Cockpit to manage my Linux servers][2]. It is a web-based tool that gives you a clean, powerful interface for managing multiple servers and their associated services and applications. It also eases regular day-to-day administrative tasks. - -In this article, I'll describe how to install the Cockpit web console for Linux servers on the Raspberry Pi operating system (OS), the standard OS provided by the Raspberry Pi Foundation. I'll also provide brief descriptions of its features. - -### Installing Cockpit on Raspberry Pi OS - -Log into your Raspberry Pi system using secure shell (SSH) using an account with sudo privileges. Set up an account if you haven't already done so: - - -``` -$ ssh pibox -alan@pibox's password: -Linux pibox.someplace.org 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l - -The programs included with the Debian GNU/Linux system are free software; -the exact distribution terms for each program are described in the -individual files in /usr/share/doc/*/copyright. - -Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent -permitted by applicable law. -Last login: Tue May  4 09:55:57 2021 from 172.1.4.5 -alan@pibox:~ $ -``` - -The command to install the Cockpit web console is as simple on Raspberry Pi OS as it is on Linux servers: - - -``` -`$ sudo apt install cockpit` -``` - -Cockpit only requires 60.4 kB of disk space. Together with its several package dependencies, total usage is 115MB. - -The installation process will take care of setting up and starting the services. You can verify the status by using the `systemctl` command: - - -``` -$ systemctl status cockpit.socket -● cockpit.socket - Cockpit Web Service Socket -   Loaded: loaded (/lib/systemd/system/cockpit.socket; enabled; vendor preset: enabled) -   Active: active (listening) since Tue 2021-05-04 10:24:43 EDT; 35s ago -     Docs: man:cockpit-ws(8) -   Listen: 0.0.0.0:9090 (Stream) -  Process: 6563 ExecStartPost=/usr/share/cockpit/motd/update-motd  localhost (code=exited, status=0/SUCCESS) -  Process: 6570 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=exited, status=0/SUCCESS) -    Tasks: 0 (limit: 2181) -   CGroup: /system.slice/cockpit.socket -``` - -### Using Cockpit - -#### Connecting - -The default listening port is 9090. Open your favorite web browser and enter the address, e.g., `https://pibox:9090`. - -![Cockpit home page][3] - -(Alan Formy-Duval, [CC BY-SA 4.0][4]) - -You can now log in with your regular user account. Again, it is helpful to have sudo privileges on this account—most likely the same one you use to SSH and run Apt. Be sure to check the box for "Reuse my password for privileged tasks". - -#### Managing your Pi - -Cockpit's initial screen starts with **System** and will provide details and graphs of current CPU and memory usage. - -![Initial Cockpit screen][5] - -(Alan Formy-Duval, [CC BY-SA 4.0][4]) - -You can view hardware details from this screen. - -![Cockpit hardware details][6] - -(Alan Formy-Duval, [CC BY-SA 4.0][4]) - -Explore the column on the left by clicking each item (e.g., Logs, Storage, Services, etc.). These are the standard Cockpit sections and are fairly self explanatory. Let me quickly describe each. - -#### Logs - -This section shows the logs. They can be filtered by date and severity. - -#### Storage - -The storage section shows the physical drives and RAID devices that are installed. Details such as size and serial number are shown. Graphs for read/write activity and actual space usage are displayed. Storage specific logs are presented at the bottom. - -#### Networking - -This section displays send and recieve activity, IP addresses, and network specific logs. You can also add more networking devices; such as bonds, bridges, and VLANs using the respective buttons. - -#### Accounts - -Existing accounts are shown here. Click each to manage or use the _Create New Account_ button to add users. Accounts can be deleted here also. - -#### Services - -This section allows the administrator to view the status of all of the system services. Clicking any service takes you to a screen with the standard tasks of start, restart, and disable. - -#### Applications - -Normally, this screen provides various applications for managing functions such as the 389 Directory Server or creation of Podman containers. On my Raspberry OS though, this screen only displayed the message, "No applications installed or available". At the time of writing, perhaps this has not yet been implemented. Although, you do have to wonder whether these types of processes would be too heavy for the Raspberry PI hardware. - -#### Software Updates - -Keeping software up to date is one of the most important tasks for any system administrator. Cockpit's Software Updates section checks and applies updates. - -![Software updates in Cockpit][7] - -(Alan Formy-Duval, [CC BY-SA 4.0][4]) - -#### Terminal - -One of Cockpit's neatest features is the terminal. You can use it instead of opening a separate terminal emulator and using SSH. I used the terminal to install [ScreenFetch][8]: - - -``` -`$ sudo apt install screenfetch` -``` - -And I used ScreenFetch to produce this screenshot: - -![Terminal in Cockpit][9] - -(Alan Formy-Duval, [CC BY-SA 4.0][4]) - -### Centralized control with Cockpit - -Cockpit behaves on Raspberry Pi just like it does on any other Linux system. You can add it to a dashboard for centralized control. It allows organizations to integrate Raspberry Pi-based services and systems into their overall Linux infrastructure anywhere Cockpit is used as a management dashboard solution. This is highly convenient, given that Pis are often run headless in high-density racked data centers that generally lack KVM access. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/raspberry-pi-cockpit - -作者:[Alan Formy-Duval][a] -选题:[lujun9972][b] -译者:[RiaXu](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi_kuberenetes_cluster_lead2_0.jpeg?itok=kx0Zc0NK (Neon colorized Raspberry Pi cluster with LEGOs) -[2]: https://opensource.com/article/20/11/cockpit-server-management -[3]: https://opensource.com/sites/default/files/uploads/cockpit_homepage.png (Cockpit home page) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/uploads/cockpit_initialscreen.png (Initial Cockpit screen) -[6]: https://opensource.com/sites/default/files/uploads/hardware_details.png (Cockpit hardware details) -[7]: https://opensource.com/sites/default/files/uploads/software_updates.png (Software updates in Cockpit) -[8]: https://opensource.com/article/20/1/screenfetch-neofetch -[9]: https://opensource.com/sites/default/files/uploads/pi_cockpit_terminal.png (Terminal in Cockpit) diff --git a/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md b/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md new file mode 100644 index 0000000000..1b40fa9c15 --- /dev/null +++ b/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md @@ -0,0 +1,166 @@ +[#]: subject: (Manage your Raspberry Pi with Cockpit) +[#]: via: (https://opensource.com/article/21/5/raspberry-pi-cockpit) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) +[#]: collector: (lujun9972) +[#]: translator: (ShuyRoy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用Cockpit管理你的树莓派 +====== +用Cockpit建立你的树莓派的控制中心。 +![Neon colorized Raspberry Pi cluster with LEGOs][1] + +去年,我写了关于使用[Cockpit管理我的Linux服务器的文章][2]。它是一个基于web的工具,为管理多个服务器及其相关的服务和应用提供了一个干净、强大的接口。它还简化了日常的管理任务。 + +在这篇文章中,我将会介绍如何在树莓派基金会提供的标准操作系统(OS)上安装Linux服务器的Cockpit web控制台。我还会简要介绍它的特性。 + + +### 在树莓派OS上安装Cockpit + +在sudo权限下使用一个账户通过SSH登录你的树莓派系统。如果你还没有建立一个账户: + + +``` +$ ssh pibox +alan@pibox's password: +Linux pibox.someplace.org 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l + +The programs included with the Debian GNU/Linux system are free software; +the exact distribution terms for each program are described in the +individual files in /usr/share/doc/*/copyright. + +Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent +permitted by applicable law. +Last login: Tue May  4 09:55:57 2021 from 172.1.4.5 +alan@pibox:~ $ +``` + +在树莓派OS上安装Cockpit web控制台和在Linux服务器上一样简单: + + +``` +`$ sudo apt install cockpit` +``` + +Cockpit只需要60.4 KB的磁盘空间。加上它的几个包依赖项,总使用量是115MB。 + +安装过程将负责设置和启动服务。你可以使用 `systemctl` 命令来验证状态。 + + +``` +$ systemctl status cockpit.socket +● cockpit.socket - Cockpit Web Service Socket +   Loaded: loaded (/lib/systemd/system/cockpit.socket; enabled; vendor preset: enabled) +   Active: active (listening) since Tue 2021-05-04 10:24:43 EDT; 35s ago +     Docs: man:cockpit-ws(8) +   Listen: 0.0.0.0:9090 (Stream) +  Process: 6563 ExecStartPost=/usr/share/cockpit/motd/update-motd  localhost (code=exited, status=0/SUCCESS) +  Process: 6570 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=exited, status=0/SUCCESS) +    Tasks: 0 (limit: 2181) +   CGroup: /system.slice/cockpit.socket +``` + +### 使用Cockpit + +#### 连接 + +默认的监听端口号是9090。打开你最喜欢的web浏览器并输入地址,例如: `https://pibox:9090`. + +![Cockpit home page][3] + +(Alan Formy-Duval, [CC BY-SA 4.0][4]) + +你现在可以使用你的常规账户登录。同样,在这个账户上使用sudo权限是很有帮助的——使用SSH和运行Apt很像。一定要勾选“为特权任务重用我的密码”。 + +#### 管理你的派 + +Cockpit的初始屏幕以 **System** 开始,将提供当前CPU和内存使用的详细信息和图。 + + +![Initial Cockpit screen][5] + +(Alan Formy-Duval, [CC BY-SA 4.0][4]) + +你可以从这个屏幕看到硬件细节。 + +![Cockpit hardware details][6] + +(Alan Formy-Duval, [CC BY-SA 4.0][4]) + +通过点击每一项来展开左边的列(例如,日志、存储、服务等)。这些是标准的Cockpit部分,而且非常明显。 + +#### 日志 + +这部分展示了日志。它们可以根据日期和严重程度来过滤。 + +#### 存储 + +存储部分展示了已经安装的物理驱动器和RAID设备。例如大小、序列号等细节都被展示了出来。还展示了读/写活动和真实的空间使用的图。专门存储日志的在底部展示。 + +#### 网络 + +这部分展示了发送和接收活动、IP地址以及网络的日志。你也可以添加更多的网络设备,例如使用各自按钮的bonds、桥以及VLAN。 + +#### 账户 + +这里展示了已有的账户。点击每个账户来管理或使用创建新账户按钮来添加用户。账户也可以被删除。 + +#### 服务 + +这部分可以让管理员查看系统所有服务的状态。点击任何服务都会转到一个包含启动、重启和禁用的标准任务的屏幕。 + +#### 应用程序 + +通常,这个屏幕提供了各种用于管理功能的应用程序,例如389目录服务器或Podman同期的创建。但在我的树莓派OS上,这个屏幕只显示“没有安装或可用的应用程序”。在写应用程序的时候,这个或许还没有实现。尽管如此,你得不得怀疑这类型的过程对于树莓派硬件来说是否太沉重。 + +#### 软件更新 + +对任何系统管理员来说,保持软件最新是最重要的任务之一。Cockpit的软件更新部分检查并进行更新。 + +![Software updates in Cockpit][7] + +(Alan Formy-Duval, [CC BY-SA 4.0][4]) + +#### 终端 + +Cockpit最整洁的特点之一是终端。你可以使用它,而不是打开一个单独的终端模拟器并使用SSH。我使用中断来安装[ScreenFetch][8]: + + +``` +`$ sudo apt install screenfetch` +``` + +我使用ScreenFetch生成了这张截图: + +![Terminal in Cockpit][9] + +(Alan Formy-Duval, [CC BY-SA 4.0][4]) + +### 使用Cockpit的中心控制 + +Cockpit在树莓派上的行为就像它在任何其他Linux系统上一样。你可以将它添加到控制面板上进行集中控制。它允许组织将基于树莓派的服务和系统集成到他们的整个Linux基础设施中,无论Cockpit在哪里被用来作为管理控制面板的解决方案。这是非常方便的,因为派经常在无领导者的高密度机架数据中心运行,而这些数据中心通常会缺乏KVM访问。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/raspberry-pi-cockpit + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[RiaXu](https://github.com/ShuyRoy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi_kuberenetes_cluster_lead2_0.jpeg?itok=kx0Zc0NK (Neon colorized Raspberry Pi cluster with LEGOs) +[2]: https://opensource.com/article/20/11/cockpit-server-management +[3]: https://opensource.com/sites/default/files/uploads/cockpit_homepage.png (Cockpit home page) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/cockpit_initialscreen.png (Initial Cockpit screen) +[6]: https://opensource.com/sites/default/files/uploads/hardware_details.png (Cockpit hardware details) +[7]: https://opensource.com/sites/default/files/uploads/software_updates.png (Software updates in Cockpit) +[8]: https://opensource.com/article/20/1/screenfetch-neofetch +[9]: https://opensource.com/sites/default/files/uploads/pi_cockpit_terminal.png (Terminal in Cockpit) From 1d5b816d347f85124ae5b6c04a2618142514a66b Mon Sep 17 00:00:00 2001 From: ywxgod Date: Thu, 10 Jun 2021 01:38:21 +0800 Subject: [PATCH 024/870] =?UTF-8?q?=E5=8E=9F=E6=96=87=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...l Studio Code Keyboard Shortcuts to Increase Productivity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md b/sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md index 99d2b4f246..caa31862c3 100644 --- a/sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md +++ b/sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/vs-code-shortcuts/) [#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ywxgod) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3c180678012982b7fab86ebc6373765d96b5b9d6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 10 Jun 2021 05:03:53 +0800 Subject: [PATCH 025/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210609=20?= =?UTF-8?q?What=20happens=20when=20you=20terminate=20Kubernetes=20containe?= =?UTF-8?q?rs=20on=20purpose=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210609 What happens when you terminate Kubernetes containers on purpose.md --- ...minate Kubernetes containers on purpose.md | 289 ++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100644 sources/tech/20210609 What happens when you terminate Kubernetes containers on purpose.md diff --git a/sources/tech/20210609 What happens when you terminate Kubernetes containers on purpose.md b/sources/tech/20210609 What happens when you terminate Kubernetes containers on purpose.md new file mode 100644 index 0000000000..08199ae5a0 --- /dev/null +++ b/sources/tech/20210609 What happens when you terminate Kubernetes containers on purpose.md @@ -0,0 +1,289 @@ +[#]: subject: (What happens when you terminate Kubernetes containers on purpose?) +[#]: via: (https://opensource.com/article/21/6/terminate-kubernetes-containers) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What happens when you terminate Kubernetes containers on purpose? +====== +In the final article in this series about chaos engineering, do some +experiments to learn how changes affect your infrastructure's state. +![x sign ][1] + +In this series celebrating Kubernetes' 11th birthday, I've introduced some great tools for chaos engineering. In the first article, I explained [what chaos engineering is][2], and in the second, I demonstrated how to get your [system's steady state][3] so that you can compare it against a chaos state. In the next four articles, I introduced some chaos engineering tools: [Litmus for testing][4] arbitrary failures and experiments in your Kubernetes cluster; [Chaos Mesh][5], an open source chaos orchestrator with a web user interface; [Kube-monkey][6] for stress-testing your systems by scheduling random termination pods in your cluster; and [Kube DOOM][7] for killing pods while having fun. + +Now I'll wrap up this birthday present by putting it all together. Along with Grafana and Prometheus for monitoring for a steady state on your local cluster, I'll use Chaos Mesh and a small deployment and two experiments to see the difference between steady and not steady, as well as Pop!_OS 20.04, Helm 3, Minikube 1.14.2, and Kubernetes 1.19. + +### Configure Minikube + +If you haven't already, [install Minikube][8] in whatever way that makes sense for your environment. If you have enough resources, I recommend giving your virtual machine a bit more than the default memory and CPU power: + + +``` +$ minikube config set memory 8192 +❗  These changes will take effect upon a minikube delete and then a minikube start +$ minikube config set cpus 6 +❗  These changes will take effect upon a minikube delete and then a minikube start +``` + +Then start and check the status of your system: + + +``` +$ minikube start +😄  minikube v1.14.2 on Debian bullseye/sid +🎉  minikube 1.19.0 is available! Download it: +💡  To disable this notice, run: 'minikube config set WantUpdateNotification false' + +✨  Using the docker driver based on user configuration +👍  Starting control plane node minikube in cluster minikube +🔥  Creating docker container (CPUs=6, Memory=8192MB) ... +🐳  Preparing Kubernetes v1.19.0 on Docker 19.03.8 ... +🔎  Verifying Kubernetes components... +🌟  Enabled addons: storage-provisioner, default-storageclass +🏄  Done! kubectl is now configured to use "minikube" by default +$ minikube status +minikube +type: Control Plane +host: Running +kubelet: Running +apiserver: Running +kubeconfig: Configured +``` + +### Preinstall pods with Helm + +Before moving forward, you'll need to deploy some pods into your cluster. To do this, I generated a simple Helm chart and changed the replicas in my values file from 1 to 8. + +If you need to generate a Helm chart, you can read my article on [creating a Helm chart][9] for guidance. I created a Helm chart named `nginx` and created a namespace to install my chart into using the commands below. + +Create a namespace: + + +``` +`$ kubectl create ns nginx` +``` + +Install the chart in your new namespace with a name: + + +``` +$ helm install chaos-pods nginx -n nginx + +NAME: chaos-pods +LAST DEPLOYED: Sun May 23 10:15:52 2021 +NAMESPACE: nginx +STATUS: deployed +REVISION: 1 +NOTES: +1\. Get the application URL by running these commands: +  export POD_NAME=$(kubectl get pods --namespace nginx -l "app.kubernetes.io/name=nginx,app.kubernetes.io/instance=chaos-pods" -o jsonpath="{.items[0].metadata.name}") +  export CONTAINER_PORT=$(kubectl get pod --namespace nginx $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") +  echo "Visit to use your application" +  kubectl --namespace nginx port-forward $POD_NAME 8080:$CONTAINER_PORT +``` + +### Monitoring and marinating + +Next, install and set up Prometheus and Grafana [following the steps][10] in the second article in this series. However, you'll need to make make the following changes in the installation: + + +``` +$ kubectl create ns monitoring + +$ helm install prometheus prometheus-community/prometheus -n monitoring + +$ helm install grafana bitnami/grafana -n monitoring +``` + +Now that everything is installed in separate namespaces, set up your dashboards and let Grafana marinate for a couple of hours to catch a nice steady state. If you're in a staging or dev cluster at work, it would be even better to let everything sit for a week or so. + +For this walkthrough, I will use the [K8 Cluster Detail Dashboard][11] (dashboard 10856), which provides various drop-downs with details about your cluster. + +![K8 Cluster Detail Dashboard][12] + +(Jess Cherry, [CC BY-SA 4.0][13]) + +### Test #1: Container killing with Grafana and Chaos Mesh + +Install and configure Chaos Mesh using the [steps][5] in my previous article. Once that is set up, you can add some new experiments to test and observe with Grafana. + +Start by setting up an experiment to kill containers. First, look at your steady state. + +![K8 Cluster Detail Dashboard][14] + +(Jess Cherry, [CC BY-SA 4.0][13]) + +Next, make a kill-container experiment pointed at your Nginx containers. I created an `experiments` directory and then the `container-kill.yaml` file: + + +``` +$ mkdir experiments +$ cd experiments/ +$ touch container-kill.yaml +``` + +The file will look like this: + + +``` +apiVersion: chaos-mesh.org/v1alpha1 +kind: PodChaos +metadata: +  name: container-kill-example +  namespace: nginx +spec: +  action: container-kill +  mode: one +  containerName: 'nginx' +  selector: +    labelSelectors: +      'app.kubernetes.io/instance': 'nginx' +  scheduler: +    cron: '@every 60s' +``` + +Once it starts, this experiment will kill an `nginx` container every minute. + +Apply your file: + + +``` +$ kubectl apply -f container-kill.yaml +podchaos.chaos-mesh.org/container-kill-example created +``` + +Now that the experiment is in place, watch it running in Chaos Mesh. + +![Chaos Mesh Dashboard][15] + +(Jess Cherry, [CC BY-SA 4.0][13]) + +You can also look into Grafana and see a notable change in the state of the pods and containers. + +![Grafana][16] + +(Jess Cherry, [CC BY-SA 4.0][13]) + +If you change the kill time and reapply the experiment, you will see even more going on in Grafana. For example, change `@every 60s` to `@every 30s` and reapply the file: + + +``` +$ kubectl apply -f container-kill.yaml +podchaos.chaos-mesh.org/container-kill-example configured +$ +``` + +You can see the disruption in Grafana with two containers sitting in waiting status. + +![Grafana][17] + +(Jess Cherry, [CC BY-SA 4.0][13]) + +Now that you know how the containers reacted, go into the Chaos Mesh user interface and pause the experiment. + +### Test #2: Networking with Grafana and Chaos Mesh + +The next test will work with network delays to see what happens if there are issues between pods. First, grab your steady state from Grafana. + +![Grafana][18] + +(Jess Cherry, [CC BY-SA 4.0][13]) + +Create a `networkdelay.yaml` file for your experiment: + + +``` +`$ touch networkdelay.yaml` +``` + +Then add some network delay details. This example runs a delay in the `nginx` namespace against your namespace instances. The packet-sending delay will be 90ms, the jitter will be 90ms, and the jitter correlation will be 25%: + + +``` +apiVersion: chaos-mesh.org/v1alpha1 +kind: NetworkChaos +metadata: +  name: network-delay-example +  namespace: nginx +spec: +  action: delay +  mode: one +  selector: +    labelSelectors: +      'app.kubernetes.io/instance': 'nginx' +  delay: +    latency: "90ms" +    correlation: "25" +    jitter: "90ms" +  duration: "45s" +  scheduler: +    cron: "@every 1s" +``` + +Save and apply the file: + + +``` +$ kubectl apply -f  networkdelay.yaml +networkchaos.chaos-mesh.org/network-delay-example created +``` + +It should show up in Chaos Mesh as an experiment. + +![Chaos Mesh Dashboard][19] + +(Jess Cherry, [CC BY-SA 4.0][13]) + +Now that it is running pretty extensively using your configuration, you should see an interesting, noticeable change in Grafana. + +![Grafana][20] + +(Jess Cherry, [CC BY-SA 4.0][13]) + +In the graphs, you can see the pods are experiencing a delay. + +Congratulations! You have a more detailed way to keep track of and test networking issues. + +### Chaos engineering final thoughts + +My gift to celebrate Kubernetes' birthday is sharing a handful of chaos engineering tools. Chaos engineering has a lot of evolving yet to do, but the more people involved, the better the testing and tools will get. Chaos engineering can be fun and easy to set up, which means everyone—from your dev team to your administration—can do it. This will make your infrastructure and the apps it hosts more dependable. + +Happy birthday, Kubernetes! I hope this series was a good gift for 11 years of being a cool project. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/terminate-kubernetes-containers + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cherrybomb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/x_stop_terminate_program_kill.jpg?itok=9rM8i9x8 (x sign ) +[2]: https://opensource.com/article/21/5/11-years-kubernetes-and-chaos +[3]: https://opensource.com/article/21/5/get-your-steady-state-chaos-grafana-and-prometheus +[4]: https://opensource.com/article/21/5/total-chaos-litmus +[5]: https://opensource.com/article/21/5/get-meshy-chaos-mesh +[6]: https://opensource.com/article/21/6/chaos-kubernetes-kube-monkey +[7]: https://opensource.com/article/21/6/chaos-engineering-kubedoom +[8]: https://minikube.sigs.k8s.io/docs/start/ +[9]: https://opensource.com/article/20/5/helm-charts +[10]: https://opensource.com/article/21/6/chaos-grafana-prometheus +[11]: https://grafana.com/grafana/dashboards/10856 +[12]: https://opensource.com/sites/default/files/uploads/k8-cluster-detail-dashboard.png (K8 Cluster Detail Dashboard) +[13]: https://creativecommons.org/licenses/by-sa/4.0/ +[14]: https://opensource.com/sites/default/files/uploads/dashboard-steadystate.png (K8 Cluster Detail Dashboard) +[15]: https://opensource.com/sites/default/files/uploads/chaosmesh-experiment.png (Chaos Mesh Dashboard) +[16]: https://opensource.com/sites/default/files/uploads/grafana-state.png (Grafana) +[17]: https://opensource.com/sites/default/files/uploads/waitingcontainers.png (Grafana) +[18]: https://opensource.com/sites/default/files/uploads/grafana-state2.png (Grafana) +[19]: https://opensource.com/sites/default/files/uploads/chaosmesh-experiment2.png (Chaos Mesh Dashboard) +[20]: https://opensource.com/sites/default/files/uploads/grafana-change.png (Grafana) From 0affbb8651a8f36a41cdbccf346c8f32a87f099a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 10 Jun 2021 05:04:04 +0800 Subject: [PATCH 026/870] add done: 20210609 What happens when you terminate Kubernetes containers on purpose.md --- sources/tech/20210610 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210610 .md diff --git a/sources/tech/20210610 .md b/sources/tech/20210610 .md new file mode 100644 index 0000000000..eea1031861 --- /dev/null +++ b/sources/tech/20210610 .md @@ -0,0 +1,25 @@ +[#]: subject: () +[#]: via: (https://www.2daygeek.com/linux-systemctl-command-manage-systemd-units-service/) +[#]: author: ( ) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-systemctl-command-manage-systemd-units-service/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From d9ec0fbaa975239d383e45e694a74ac9aae51d91 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 10 Jun 2021 05:04:17 +0800 Subject: [PATCH 027/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210609=20?= =?UTF-8?q?Making=20portable=20functions=20across=20serverless=20platforms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210609 Making portable functions across serverless platforms.md --- ...e functions across serverless platforms.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 sources/tech/20210609 Making portable functions across serverless platforms.md diff --git a/sources/tech/20210609 Making portable functions across serverless platforms.md b/sources/tech/20210609 Making portable functions across serverless platforms.md new file mode 100644 index 0000000000..ff96b42b67 --- /dev/null +++ b/sources/tech/20210609 Making portable functions across serverless platforms.md @@ -0,0 +1,218 @@ +[#]: subject: (Making portable functions across serverless platforms) +[#]: via: (https://opensource.com/article/21/6/quarkus-funqy) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Making portable functions across serverless platforms +====== +Quarkus Funqy brings portability to serverless functions. +![Parts, modules, containers for software][1] + +The rising popularity of serverless development alongside the increased adoption of multi- and hybrid-cloud architectures has created a lot of competition among platforms. This gives developers many choices about where they can run functions on serverless platforms—from public managed services to on-premises [Kubernetes][2]. + +If you've read my previous articles about [Java serverless][3], you learned how to get started [developing Java serverless functions][4] with Quarkus and how those serverless functions can be [optimized][5] to run on Kubernetes. So what should you do next to make your serverless functions fit better with the many choices available to you? + +As a clue, think about why the Linux container (Docker, [LXC][6], cri-o) has become so popular: Portability. It's what made containers the de facto packaging technology for moving things from a developer's local machine to Kubernetes environments at scale. It means developers and operators don't need to worry about incompatibility and inconsistency between development and production environments. + +For adopting multi- and hybrid cloud architectures, these container portability benefits should also be considered for serverless function development. Without portability, developers would likely have to learn and use different APIs, command-line interface (CLI) tools, and software development kits (SDKs) for each serverless platform when developing and deploying the same serverless functions across multiple serverless runtimes. Developers, who have limited resources (e.g., time, effort, cost, and human resources), would be so overwhelmed by the options that they would find it difficult to choose the best one. + +![Many serverless runtime options][7] + +(Daniel Oh, [CC BY-SA 4.0][8]) + +### Get Funqy the next time you hit a serverless dance floor + +The [Quarkus Funqy][9] extension supports a portable Java API for developers to write serverless functions and deploy them to heterogeneous serverless runtimes, including AWS Lambda, Azure Functions, Google Cloud, and Knative. It is also usable as a standalone service. Funqy helps developers dance on the serverless floor without making code changes. + +Here is a quick example of how to build a portable serverless function with Quarkus Funqy. + +### 1\. Create a Quarkus Funqy Maven project + +Generate a Quarkus project (`quarkus-serverless-func`) to create a simple function with Funqy extensions: + + +``` +$ mvn io.quarkus:quarkus-maven-plugin:1.13.6.Final:create \ +       -DprojectGroupId=org.acme \ +       -DprojectArtifactId=quarkus-serverless-func \ +       -Dextensions="funqy-http" \ +       -DclassName="org.acme.getting.started.GreetingResource" +``` + +### 2\. Run the serverless function locally + +Open the `Funqy.java` file in the `src/main/java/org/acme/getting/started` directory: + + +``` +public class Funqy { + +    private static final [String][10] CHARM_QUARK_SYMBOL = "c"; + +    @Funq (1) +    public [String][10] charm(Answer answer) { (2) +        return CHARM_QUARK_SYMBOL.equalsIgnoreCase(answer.value) ? "You Quark!" : "👻 Wrong answer"; +    } + +    public static class Answer { +        public [String][10] value; (3) +    } +} +``` + +In the code above: + +(1) Annotation makes the method an exposable function based on the Funqy API. The function name is equivalent to the method name (`charm`) by default. +(2) Indicates a Java class (`Answer`) as an input parameter and `String` type for the output. +(3) `value` should be parameterized when the function is invoked. + +**Note**: Funqy does type introspection at build time to speed boot time, so the Funqy marshaling layer won't notice any derived types at runtime. + +Run the function via Quarkus Dev Mode: + + +``` +`$ ./mvnw quarkus:dev` +``` + +The output should look like: + + +``` +__  ____  __  _____   ___  __ ____  ______ + --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ + -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   +\--\\___\\_\\____/_/ |_/_/|_/_/|_|\\____/___/   +INFO  [io.quarkus] (Quarkus Main Thread) quarkus-serverless-func 1.0.0-SNAPSHOT on JVM (powered by Quarkus x.x.x.) started in 2.908s. Listening on: +INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated. +INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, funqy-http, kubernetes] +``` + +Now the function is running in your local development environment. Access the function with a RESTful API: + + +``` +`$ http://localhost:8080/charm?value=s` +``` + +The output should be: + + +``` +`👻 Wrong answer` +``` + +If you pass `value=c` down as a parameter, you will see: + + +``` +`You Quark!` +``` + +### 3\. Choose a serverless platform to deploy the Funqy function + +Now you can deploy the portable function to your preferred serverless platform when you add one of the Quarkus Funqy extensions in the figure below. The advantage is that you will not need to change the code; you should need only to adjust a few configurations, such as function export and target serverless platform. + +![Quarkus Funqy Extensions][11] + +(Daniel Oh, [CC BY-SA 4.0][8]) + +Try to deploy the function using [Knative Serving][12] (if you have installed it in your Kubernetes cluster). Add the following extensions to the Quarkus Funqy project: + + +``` +`$ ./mvnw quarkus:add-extension -Dextensions="kubernetes,container-image-docker"` +``` + +Open the `application.properties` file in the `src/main/resources/` directory. Then add the following variables to configure Knative and Kubernetes resources—make sure to replace `changeit` with your container registry's group name (username in DockerHub): + + +``` +quarkus.container-image.build=true +quarkus.container-image.group=changeit +quarkus.container-image.push=true +quarkus.container-image.builder=docker +quarkus.kubernetes.deployment-target=knative +``` + +Containerize the function, then push it to the external container registry: + + +``` +`$ ./mvnw clean package` +``` + +The output should end with `BUILD SUCCESS`. Then a `knative.yml` file will be generated in the `target/kubernetes` directory. Now you should be ready to create a Knative service with the function using the following command (be sure to log into the Kubernetes cluster and change the namespace where you want to create the Knative service): + + +``` +`$ kubectl create -f target/kubernetes/knative.yml` +``` + +The output should be like this: + + +``` +`service.serving.knative.dev/quarkus-serverless-func created` +``` + +### 4\. Test the Funqy function in Kubernetes + +Get the function's REST API and note its output: + + +``` +$ kubectl get rt +NAME URL READY REASON +quarkus-serverless-func     True +``` + +Access the function quickly using a `curl` command: + + +``` +`$ http://http://quarkus-serverless-func-YOUR_HOST_DOMAIN/charm?value=c` +``` + +You see the same output as you saw locally: + + +``` +`You Quark!` +``` + +**Note**: The function will scale down to zero in 30 seconds because of Knative Serving's default behavior. In this case, the pod will scale up automatically when the REST API is invoked. + +### What's next? + +You've learned how developers can make portable Java serverless functions with Quarkus and deploy them across serverless platforms (e.g., Knative with Kubernetes). Quarkus enables developers to avoid redundancy when creating the same function and deploying it to multiple serverless platforms. My next article in this series will explain how to enable CloudEvents Bind with Java and Knative. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/quarkus-funqy + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_modules_networking_hardware_parts.png?itok=rPpVj92- (Parts, modules, containers for software) +[2]: https://opensource.com/article/19/6/reasons-kubernetes +[3]: https://opensource.com/article/21/5/what-serverless-java +[4]: https://opensource.com/article/21/6/java-serverless-functions +[5]: https://opensource.com/article/21/6/java-serverless-functions-kubernetes +[6]: https://www.redhat.com/sysadmin/exploring-containers-lxc +[7]: https://opensource.com/sites/default/files/uploads/choices.png (Many serverless runtime options) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://quarkus.io/guides/funqy +[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[11]: https://opensource.com/sites/default/files/uploads/funqyextensions.png (Quarkus Funqy Extensions) +[12]: https://knative.dev/docs/serving/ From 1709e5cbf66019660d3dfa197c66694b5612b2f2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 10 Jun 2021 05:04:31 +0800 Subject: [PATCH 028/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210609=20?= =?UTF-8?q?Configure=20FreeDOS=20in=20plain=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210609 Configure FreeDOS in plain text.md --- ...0210609 Configure FreeDOS in plain text.md | 213 ++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 sources/tech/20210609 Configure FreeDOS in plain text.md diff --git a/sources/tech/20210609 Configure FreeDOS in plain text.md b/sources/tech/20210609 Configure FreeDOS in plain text.md new file mode 100644 index 0000000000..b54016ae8a --- /dev/null +++ b/sources/tech/20210609 Configure FreeDOS in plain text.md @@ -0,0 +1,213 @@ +[#]: subject: (Configure FreeDOS in plain text) +[#]: via: (https://opensource.com/article/21/6/freedos-fdconfigsys) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Configure FreeDOS in plain text +====== +Learn how to configure FreeDOS with FDCONFIG.SYS. +![Person using a laptop][1] + +The main configuration file for FreeDOS is a file in the root directory called `FDCONFIG.SYS`. This file contains a series of lines, each setting a value such as `LASTDRIVE=Z` or `FILES=40`. For example, the default `FDCONFIG.SYS` in FreeDOS 1.3 RC4 looks like this: + + +``` +SET DOSDIR=C:\FDOS + +!COUNTRY=001,858,C:\FDOS\BIN\COUNTRY.SYS +!LASTDRIVE=Z +!BUFFERS=20 +!FILES=40 +!MENUCOLOR=7,0 + +MENUDEFAULT=1,5 +MENU 1 - Load FreeDOS with JEMMEX, no EMS (most UMBs), max RAM free +MENU 2 - Load FreeDOS with JEMM386 (Expanded Memory) +MENU 3 - Load FreeDOS low with some drivers (Safe Mode) +MENU 4 - Load FreeDOS without drivers (Emergency Mode) + +12?DOS=HIGH +12?DOS=UMB +12?DOSDATA=UMB +1?DEVICE=C:\FDOS\BIN\JEMMEX.EXE NOEMS X=TEST I=TEST NOVME NOINVLPG +234?DEVICE=C:\FDOS\BIN\HIMEMX.EXE +2?DEVICE=C:\FDOS\BIN\JEMM386.EXE X=TEST I=TEST I=B000-B7FF NOVME NOINVLPG +34?SHELL=C:\FDOS\BIN\COMMAND.COM C:\FDOS\BIN /E:1024 /P=C:\FDAUTO.BAT +12?SHELLHIGH=C:\FDOS\BIN\COMMAND.COM C:\FDOS\BIN /E:1024 /P=C:\FDAUTO.BAT +``` + +But what do all those lines mean? Why do some have a question mark (`?`) or an exclamation point (`!`), while other lines do not? + +### A simple configuration + +Let's start with a simple configuration, so we can see what does what. Assume this very brief `FDCONFIG.SYS` file: + + +``` +LASTDRIVE=Z +BUFFERS=20 +FILES=40 +DEVICE=C:\FDOS\BIN\HIMEMX.EXE +SHELL=C:\FDOS\BIN\COMMAND.COM C:\FDOS\BIN /E:1024 /P=C:\FDAUTO.BAT +``` + +This configuration file contains only a few instructions: + + 1. `LASTDRIVE=Z` + 2. `BUFFERS=20` + 3. `FILES=40` + 4. `DEVICE=C:\FDOS\BIN\HIMEMX.EXE` + 5. `SHELL=C:\FDOS\BIN\COMMAND.COM C:\FDOS\BIN /E:1024 /P=C:\FDAUTO.BAT` + + + +The first instruction tells FreeDOS how many drive letters to reserve in memory. (DOS uses letters to represent each drive attached to the system, and `LASTDRIVE=Z` says to reserve drive letters from "A" to "Z."). `LASTDRIVE` affects the number of _logical drives_ that your system can recognize. You probably don't have any logical drives; the FreeDOS installer doesn't set these up by default. In any case, it is safe to set `LASTDRIVE=Z` on any FreeDOS system. + +The `BUFFERS` line reserves memory for file buffers. A _buffer_ helps to speed up certain processes that require storage, such as copying files. If you set a larger value for `BUFFERS`, FreeDOS will reserve more memory—and vice versa for smaller values. Most users will set this to `BUFFERS=20` or `BUFFERS=40`, depending on how often they need to read and write files on the system. + +The `FILES` setting determines how many files DOS allows you to open at one time. If you run an application that needs to open many files at once, such as a Genealogy database, you may need to set `FILES` to a larger value. For most users, `FILES=40` is a reasonable value. + +`DEVICE` is a special instruction that loads a _device driver_. DOS requires device drivers for certain hardware or configurations. The line `DEVICE=C:\FDOS\BIN\HIMEMX.EXE` loads the _HimemX_ device driver, so DOS can take advantage of expanded memory beyond the first 640 kilobytes. + +The last line tells the FreeDOS kernel where to find the command-line shell. By default, the kernel will look for the shell as `COMMAND.COM`, but you can change it with the `SHELL` instruction. In this example, `SHELL=C:\FDOS\BIN\COMMAND.COM` says the shell is the `COMMAND.COM` program, located in the `\FDOS\BIN` directory on the `C` drive. + +The other text at the end of the `SHELL` indicate the options to the `COMMAND.COM` shell. The FreeDOS `COMMAND.COM` supports several startup options to modify its behavior, including: + + * **`C:\FDOS\BIN`** \- The full path to the `COMMAND.COM` program + * `/E:1024 -` The environment (E) size, in bytes. `/E:1024` tells `COMMAND.COM` to reserve 1024 bytes, or 1 kilobyte, to store its environment variables. + * **`/P=C:\FDAUTO.BAT`** \- The `/P` option indicates that the shell is a permanent (P) shell, so the user cannot quit the shell by typing `EXIT` (the extra text `=C:\FDAUTO.BAT` tells `COMMAND.COM` to execute the `C:\FDAUTO.BAT` file at startup, instead of the default `AUTOEXEC.BAT` file) + + + +With that simple configuration, you should be able to interpret some of the `FDCONFIG.SYS` file that's installed by FreeDOS 1.3 RC4. + +### Boot menu + +FreeDOS supports a neat feature—multiple configurations on one system, using a "boot menu" to select the configuration you want. The `FDCONFIG.SYS` file contains several lines that define the menu: + + +``` +!MENUCOLOR=7,0 + +MENUDEFAULT=1,5 +MENU 1 - Load FreeDOS with JEMMEX, no EMS (most UMBs), max RAM free +MENU 2 - Load FreeDOS with JEMM386 (Expanded Memory) +MENU 3 - Load FreeDOS low with some drivers (Safe Mode) +MENU 4 - Load FreeDOS without drivers (Emergency Mode) +``` + +The `MENUCOLOR` instruction defines the text color and background color of the boot menu. These values are typically in the range 0 to 7, and represent these colors: + + * 0 Black + * 1 Blue + * 2 Green + * 3 Cyan + * 4 Red + * 5 Magenta + * 6 Brown + * 7 White + + + +So the `MENUCOLOR=7,0` definition means to display the menu with white (7) text on a black (0) background. If you instead wanted to use white text on a blue background, you could define this as `MENUCOLOR=7,1`. + +The exclamation point (`!`) at the start of the line means that this instruction will always be executed, no matter what menu option you choose. + +The `MENUDEFAULT=1,5` line tells the kernel how long to wait for the user to select a boot menu entry, or what default menu entry to use if the user did not select one. `MENUDEFAULT=1,5` indicates the system will wait for 5 seconds; if the user did not attempt to select a menu item within that time, the kernel will assume boot menu "1" instead. + +![boot menu][2] + +Jim Hall, CC-BY SA 4.0 + +The `MENU` lines after that are labels for the different boot menu configurations. These are presented in order, so menu item "1" is first, then "2," and so on. + +![menu select 4][3] + +Jim Hall, CC-BY SA 4.0 + +In the lines that follow in `FDCONFIG.SYS`, you will see numbers before a question mark (`?`). These indicate "for this boot menu entry, use this line." For example, this line with `234?` will only load the HimemX device driver if the user selects boot menu entries "2," "3," or "4." + + +``` +`234?DEVICE=C:\FDOS\BIN\HIMEMX.EXE` +``` + +There are lots of ways to use `FDCONFIG.SYS` to configure your FreeDOS system. We've only covered the basics here, the most common ways to define your FreeDOS kernel settings. For more information, explore the FreeDOS Help system (type `HELP` at the command line) to learn how to use all of the FreeDOS `FDCONFIG.SYS` options: + + * **SWITCHES** + * Boot time processing behavior + * **REM** and **;** + * Comments (ignored in FDCONFIG.SYS) + * **MENUCOLOR** + * Boot menu text color and background color + * **MENUDEFAULT** + * Boot menu default value + * **MENU** + * Boot menu entry + * **ECHO** and **EECHO** + * Display messages + * **BREAK** + * Sets extended **Ctrl+C** checking on or off + * **BUFFERS** or **BUFFERSHIGH** + * How many disk buffers to allocate + * **COUNTRY** + * Sets international behavior + * **DOS** + * Tell the FreeDOS kernel how to load itself into memory + * **DOSDATA** + * Tell FreeDOS to load kernel data into upper memory + * **FCBS** + * Set the number of file control blocks (FCBs) + * **KEYBUF** + * Reassign the keyboard buffer in memory + * **FILES** or **FILESHIGH** + * How many files to have open at once + * **LASTDRIVE** or **LASTDRIVEHIGH** + * Set the last drive letter that can be used + * **NUMLOCK** + * Set the keyboard number pad lock on or off + * **SHELL**, **SHELLHIGH**, or **COMMAND** + * Set the command line shell + * **STACKS** or **STACKSHIGH** + * Add stacks to handle hardware interrupts + * **SWITCHAR** + * Redefines the command line option switch character + * **SCREEN** + * Set the number of lines on the screen + * **VERSION** + * Set what DOS version to report to programs + * **IDLEHALT** + * Activates energy saving features, useful on certain systems + * **DEVICE** and **DEVICEHIGH** + * Load a driver into memory + * **INSTALL** and **INSTALLHIGH** + * Load a "terminate and stay resident" (TSR) program + * **SET** + * Set a DOS environment variable + + + +### Configuring in plain text + +Like Linux and BSD, FreeDOS configuration happens in plain text. No special tools for editing are required, so dive in and see what options suit you best. It's easy but powerful! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-fdconfigsys + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/sites/default/files/uploads/boot-menu.png (The boot menu waits for 5 seconds before assuming menu item 1) +[3]: https://opensource.com/sites/default/files/uploads/menu-select4.png (Use the arrow keys to select a boot menu configuration) From bdbf71a6cbb1055d31d2ed93fa22110aa6896698 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 10 Jun 2021 05:04:52 +0800 Subject: [PATCH 029/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210609=20?= =?UTF-8?q?KDE=20Plasma=205.22=20Features=20Eye=20Candy=20Visuals=20with?= =?UTF-8?q?=20Usability=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md --- ...ndy Visuals with Usability Improvements.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md diff --git a/sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md b/sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md new file mode 100644 index 0000000000..d835c04a09 --- /dev/null +++ b/sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md @@ -0,0 +1,86 @@ +[#]: subject: (KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements) +[#]: via: (https://news.itsfoss.com/kde-plasma-5-22-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements +====== + +KDE Plasma 5.22 is finally here. + +While we previously covered the [exciting changes coming to KDE Plasma 5.22][1] before the release, everyone can now get to experience it. + +The announcement mentions that the release focuses on usability, stability, and flexibility improvements. + +Here, let me highlight the key changes in this release. + +### KDE Plasma 5.22: What’s New? + +The major differences would include the visual improvements that come with the release. + +**Adaptive Transparency** is a big feature addition that lets you have a translucent panel but if you have a maximized window active, it will automatically turn opaque get rid of visual distractions. + +With this change, you also get the ability to have your taskbar panel always translucent or always opaque, if that is what you prefer. You can watch the video shared by a developer while it was a work in progress: + +![][2] + +You can also find an improved Wayland support that now includes the **Activities** feature to properly work, which is a favorite feature for a lot of Plasma users. + +Overall, KDE Plasma 5.22 involves a lot of visual tweaks ranging from app previews from the task bar (when you hover your mouse) to widgets. + +**System Settings** now feature a new speed dial section where it gives you quick access to commonly used settings or your most used settings. + +![][3] + +You also get a choice to disable offline updates that normally requires you to reboot in order to apply the changes. + +The **System Tray** also gets a visual touch with a consistent look along with a brand new digital clock which displays more information. + +Also, another major improvement is the ability to change the audio device (or access the audio widget) right from the System Tray area, which was not the case earlier. + +In addition to all these key changes, other improvements include: + + * Clipboard can now be accessed with the help of a keyboard shortcut (Meta + V) + * Improvements to KRunner to provide better search results + * Improved Notification widget that does not get in your way when you are recording your screen or on a video call for your work/studies (only for Wayland sessions) + * KWin window manager now supports variable refresh rate and FreeSync on Wayland + * Other KWin Wayland improvements for better visuals and performance + + + +To learn more about the release, you can refer to the [official announcement][4]. + +### Wrapping Up + +If you are using [KDE Neon][5], you should get it soon enough. For other Linux distributions, you may have to wait a little longer for them to include it an update or the next upgrade. + +What do you think about the visual improvements with KDE Plasma 5.22 update? Let me know in the comments down below. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kde-plasma-5-22-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/kde-plasma-5-22-dev/ +[2]: https://i2.wp.com/i.ytimg.com/vi/4exHfb8Qjl0/hqdefault.jpg?w=780&ssl=1 +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://kde.org/announcements/plasma/5/5.22.0/ +[5]: https://neon.kde.org From c094f25dd85684d7621c8deb2df7fb06276824ed Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 10 Jun 2021 08:38:01 +0800 Subject: [PATCH 030/870] translated --- .../tech/20210601 Get started with FreeDOS.md | 103 ------------------ .../tech/20210601 Get started with FreeDOS.md | 102 +++++++++++++++++ 2 files changed, 102 insertions(+), 103 deletions(-) delete mode 100644 sources/tech/20210601 Get started with FreeDOS.md create mode 100644 translated/tech/20210601 Get started with FreeDOS.md diff --git a/sources/tech/20210601 Get started with FreeDOS.md b/sources/tech/20210601 Get started with FreeDOS.md deleted file mode 100644 index 8e366ac791..0000000000 --- a/sources/tech/20210601 Get started with FreeDOS.md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: subject: (Get started with FreeDOS) -[#]: via: (https://opensource.com/article/21/6/get-started-freedos) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Get started with FreeDOS -====== -It looks like retro computing, but it's a modern OS you can use to get -stuff done. -![Old UNIX computer][1] - -Throughout the 1980s and into the 1990s, I was primarily a DOS user. I loved the command line environment offered in DOS, which became more powerful with each successive release. I even learned how to write my own DOS programs in the C programming language so I could extend the DOS command line, and write more powerful replacements for the standard DOS commands. I'd experimented with Microsoft's Windows—but if you remember Windows 3 from that time, you know it was slow and tended to crash. But I preferred the command line anyway, so I stuck to DOS. - -That all changed in 1994. Popular tech magazines talked about an upcoming version of Windows that would completely do away with DOS. I didn't want to be forced to Windows. On the discussion boards I visited on Usenet, others felt the same. So [on 29 June 1994][2], I decided that if we wanted to keep DOS, we needed to write our own. So on June 29, I announced a small project that would become [The FreeDOS Project][3]. - -Since then, we've released several full distributions of FreeDOS. We started with the alpha series from 1994 to 1997, the beta series from 1998 to 2005, before finally releasing the FreeDOS 1.0 distribution in 2006. Progress has been slow but steady since then. We haven't really been rushed to release each new version after 1.0, because DOS stopped being a moving target in 1995. - -Each FreeDOS distribution since 1.0 has been a continual re-imagining of what a modern DOS might look like. We've included lots of compilers, assemblers for developers to write software. We also provide lots of "power tools" so you can do real work. And we offer a variety of editors because everyone has their favorite. - -We recently released the FreeDOS 1.3 RC4 distribution. This is technically a release candidate towards our upcoming FreeDOS 1.3 distribution, but it's a full-featured distribution. I'm very excited about all the great features in FreeDOS 1.3 RC4. - -### Run FreeDOS without installing FreeDOS - -In all our previous FreeDOS distributions, we focused on _installing_ FreeDOS to a computer. But we recognize that most users don't actually run FreeDOS on actual hardware anymore—they run FreeDOS in [a virtual machine like QEMU or VirtualBox][4]. So in FreeDOS 1.3 RC4, we improved the "LiveCD" environment. - -With FreeDOS 1.3 RC4, you can just boot the LiveCD image in your favorite virtual machine, and start using FreeDOS right away. That's how I run FreeDOS now; I have a small virtual hard drive image where I store all my files, but I boot and run FreeDOS from the LiveCD. - -![Booting the FreeDOS 1.3 RC4 LiveCD on QEMU][5] - -Booting the FreeDOS 1.3 RC4 LiveCD (Jim Hall, [CC-BY SA 4.0][6]) - -### Installing is really easy - -If you don't want to run FreeDOS from the LiveCD, you can also install it on your hard drive. We updated the installer in FreeDOS so it's not really a "program" per se, but instead is a very smart DOS "batch" file that detects all sorts of things and takes the appropriate action, like creating a new disk partition for FreeDOS if none exist already. - -Older FreeDOS distributions used to prompt you for everything, even selecting individual programs to install. The new installer is very streamlined. It asks you a few questions to get started, then does everything else on its own. Installing FreeDOS on an empty virtual machine takes only a few minutes. - -![Installing FreeDOS 1.3 RC4][7] - -Installing FreeDOS 1.3 RC4 (Jim Hall, [CC-BY SA 4.0][6]) - -### You can install it from floppy - -Not everyone prefers to run FreeDOS in a virtual machine. There's a retrocomputing community out there that collects and lovingly restores classic PC hardware like Pentium or '486 systems. You can even find some XT (8088) or AT (80286) systems out there, kept running by a dedicated user community. - -And while we consider FreeDOS a _modern_ DOS, we wouldn't be "DOS" if we didn't also run on the older PC hardware too. So with FreeDOS 1.3, we include a Floppy-Only Edition! This edition should run on any hardware that can run FreeDOS and has EGA or better graphics. - -Are you running a '286 or another classic system without a CD-ROM drive? Install from these floppies to install FreeDOS. Do you have just one hard drive and no CD or floppy drive? Just copy the contents of the floppies to a temporary directory and run the installer from there. Want to perform a "headless" install to a different DOS directory? It's easy with the command-line options. - -The Floppy-Only Edition uses a completely different installer and contains a limited FreeDOS set of programs that are more useful on classic PC hardware. - -![Installing the FreeDOS Floppy-Only Edition][8] - -Installing the FreeDOS Floppy-Only Edition (Jim Hall, [CC-BY SA 4.0][6]) - -### Filled with open source apps and games - -FreeDOS isn't a _free_ DOS if it's a closed source DOS. We want everyone to be able to use and study FreeDOS, including its source code. As we planned the FreeDOS 1.3 distribution, we took a close look at every license in every package and focused on including only _open source_ programs. (A few programs in previous FreeDOS distributions were not quite "open source," and one or two programs didn't include source code but were otherwise "free to use and distribute." In this release, everything is open source, using the Open Source Definition as our model.) - -And what a great collection of open source apps and games. The games are my favorite addition to FreeDOS 1.3 RC4. Many people use FreeDOS to play classic DOS games, but we wanted to provide our own open source games for people to play. - -You can find two games already installed in the LiveCD: Simple Senet (a board game dating to ancient Egypt) and Floppy Bird (a version of the Flappy Bird game). If you install FreeDOS, you'll also find lots of other games to try, including Sudoku86 (a sudoku game), Wing (a space shooter), and Bolitaire (solitaire card game). - -![Playing the Floppy Bird game][9] - -Playing the Floppy Bird game (Jim Hall, [CC-BY SA 4.0][6]) - -![The ancient game of Senet][10] - -The ancient game of Senet (Jim Hall, [CC-BY SA 4.0][6]) - -### Try FreeDOS 1.3 RC4 now - -You can find the new FreeDOS 1.3 RC4 from the FreeDOS website, on our [Downloads][11] page. To install FreeDOS, you'll need at least 20MB of free disk space: 20MB to install a plain FreeDOS system, or 250MB to install everything, including applications and games. To install the source code too, you'll need up to 450MB of free space. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/get-started-freedos - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/retro_old_unix_computer.png?itok=SYAb2xoW (Old UNIX computer) -[2]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ -[3]: https://www.freedos.org/ -[4]: https://opensource.com/article/20/8/virt-tools -[5]: https://opensource.com/sites/default/files/freedos-livecd.png (Booting the FreeDOS 1.3 RC4 LiveCD) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://opensource.com/sites/default/files/install6.png (Installing FreeDOS 1.3 RC4) -[8]: https://opensource.com/sites/default/files/freedos-floppy.png (Installing the FreeDOS Floppy-Only Edition) -[9]: https://opensource.com/sites/default/files/floppy-bird.png (Playing the Floppy Bird game) -[10]: https://opensource.com/sites/default/files/simple-senet.png (The ancient game of Senet) -[11]: https://www.freedos.org/download/ diff --git a/translated/tech/20210601 Get started with FreeDOS.md b/translated/tech/20210601 Get started with FreeDOS.md new file mode 100644 index 0000000000..63eca9cb9d --- /dev/null +++ b/translated/tech/20210601 Get started with FreeDOS.md @@ -0,0 +1,102 @@ +[#]: subject: (Get started with FreeDOS) +[#]: via: (https://opensource.com/article/21/6/get-started-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +开始使用 FreeDOS +====== +它看起来像复古计算,但它是一个现代的操作系统,你可以用它来完成任务。 +![Old UNIX computer][1] + +在整个 1980 年代和 1990 年代,我主要是一个 DOS 用户。我喜欢 DOS 提供的命令行环境,它随着每一个连续的版本变得更加强大。我甚至学会了如何用 C 语言编写自己的 DOS 程序,这样我就可以扩展 DOS 命令行,并为标准的 DOS 命令编写更强大的替代程序。我曾经试验过微软的 Windows,但如果你记得当时的 Windows 3,你就会知道它很慢,而且容易崩溃。但无论如何我更喜欢命令行,所以我坚持使用 DOS。 + +这一切在 1994 年发生了变化。流行的技术杂志谈到了即将到来的 Windows 版本,它将完全废除 DOS。我不想被迫使用 Windows。在我访问的 Usenet 讨论区中,其他人也有同样的感觉。所以在 [1994 年 6 月 29 日][2],我决定如果我们想保留 DOS,我们需要自己编写。所以在 6 月 29 日,我宣布了一个小项目,这个项目后来成为 [FreeDOS 项目][3]。 + +从那时起,我们已经发布了几个完整的 FreeDOS 发行版。我们从 1994 年到 1997 年的 alpha 系列开始,再到 1998 年到 2005 年的 beta 系列,最后在 2006 年发布了 FreeDOS 1.0 版本。从那时起,进展是缓慢但稳定的。在 1.0 之后,我们并没有真正急于发布每个新版本,因为 DOS 在 1995 年不再是一个变动的目标。 + +从 1.0 开始的每一个 FreeDOS 发行版都是对现代 DOS 的不断重新想象。我们已经包括了很多编译器和汇编器,供开发人员编写软件。我们还提供了许多“强大工具”,以便你可以做真正的工作。我们还提供了各种编辑器,因为每个人都有自己的最爱。 + +我们最近发布了 FreeDOS 1.3 RC4 发行版。从技术上讲,这是我们即将推出的 FreeDOS 1.3 发行版的候选版本,但它是一个全功能的发行版。我对 FreeDOS 1.3 RC4 的所有功能感到非常兴奋。 + +### 无需安装 FreeDOS 即可运行 FreeDOS + +在我们以前所有的 FreeDOS 发行版中,我们把重点放在_安装_ FreeDOS 到电脑上。但我们认识到,大多数用户实际上已经不在实际硬件上运行 FreeDOS 了。他们在[像 QEMU 或 VirtualBox 这样的虚拟机][4]中运行 FreeDOS。所以在 FreeDOS 1.3 RC4 中,我们改进了 “LiveCD” 环境。 + +通过 FreeDOS 1.3 RC4,你可以在你喜欢的虚拟机中启动 LiveCD 镜像,并立即开始使用 FreeDOS。这就是我现在运行 FreeDOS 的方式。我有一个小的虚拟硬盘镜像,我把所有的文件都放在那里,但我从 LiveCD 启动并运行 FreeDOS。 + +![Booting the FreeDOS 1.3 RC4 LiveCD on QEMU][5] + +启动 FreeDOS 1.3 RC4 LiveCD (Jim Hall, [CC-BY SA 4.0][6]) + +### 安装真的很简单 + +如果你不想从 LiveCD 上运行 FreeDOS,你也可以在你的硬盘上安装它。我们更新了 FreeDOS 的安装程序,所以它本身并不是一个真正的“程序”,而是一个非常聪明的 DOS “批处理”文件,它可以检测到各种情况并采取适当的行动,例如在没有 FreeDOS 分区的情况下为其创建一个新的磁盘分区。 + +旧的 FreeDOS 发行版曾经提示你一切,甚至选择个别程序来安装。新的安装程序非常精简。它只问你几个问题就开始了,然后就自己做其他事情。在一个空的虚拟机上安装 FreeDOS 只需要几分钟时间。 + +![Installing FreeDOS 1.3 RC4][7] + +安装FreeDOS 1.3 RC4 (Jim Hall, [CC-BY SA 4.0][6]) + +### 你可以从软盘安装它 + +不是每个人都喜欢在虚拟机中运行 FreeDOS。现在有一个复古计算社区,他们收集并精心修复经典的 PC 硬件,如 Pentium 或 486 系统。你甚至可以在那里找到一些 XT(8088)或 AT(80286)系统,它由一个专门的用户社区运营。 + +虽然我们认为 FreeDOS 是一个现代的 DOS,但如果我们不在旧的 PC 硬件上运行,我们就不是 “DOS”。因此,在 FreeDOS 1.3 中,我们包含了一个纯软盘版!这个版本可以运行在任何硬件上。这个版本应该可以在任何可以运行 FreeDOS 的硬件上运行,并且有 EGA 或更好的图形。 + +你在运行 286 或其他没有 CD-ROM 驱动器的经典系统吗?从这些软盘安装 FreeDOS。你是否只有一个硬盘而没有 CD 或软盘驱动器?只要把软盘的内容复制到一个临时目录,然后从那里运行安装程序。想执行“无头”安装到不同的 DOS 目录吗?用命令行选项就可以了。 + +纯软盘版使用一个完全不同的安装程序,并包含一套有限的 FreeDOS 程序,它们在经典的 PC 硬件上更有用。 + +![Installing the FreeDOS Floppy-Only Edition][8] + +安装FreeDOS纯软盘版 (Jim Hall, [CC-BY SA 4.0][6]) + +### 充满了开源应用和游戏 + +如果 FreeDOS 是一个闭源的 DOS,它就不是一个_自由_的 DOS。我们希望每个人都能使用和研究 FreeDOS,包括其源代码。当我们计划 FreeDOS 1.3 发行版时,我们仔细检查了每个软件包中的每一个许可证,并专注于只包括_开源_程序。(在以前的 FreeDOS 发行版中,有几个程序并不完全是 "开源",还有一两个程序没有包括源码,但是可以“自由使用和发布”。在这个版本中,所有的东西都是开源的,以开源定义作为我们的模型。) + +而且,这是一个多么棒的开源应用和游戏的集合。游戏是 FreeDOS 1.3 RC4 中我最喜欢的内容。许多人使用 FreeDOS 来玩经典的 DOS 游戏,但我们想提供我们自己的开源游戏给人们玩。 + +你可以发现 LiveCD 中已经安装了两个游戏:Simple Senet(可以追溯到古埃及的棋盘游戏)和 Floppy Bird(Flappy Bird 游戏的一个版本)。如果你安装了 FreeDOS,你还会发现很多其他游戏可以尝试,包括 Sudoku86(一个数独游戏)、Wing(一个太空射击游戏)和 Bolitaire(单人纸牌游戏)。 + +![Playing the Floppy Bird game][9] + +玩 Floppy Bird 游戏 (Jim Hall, [CC-BY SA 4.0][6]) + +![The ancient game of Senet][10] + +古老的 Senet 游戏 (Jim Hall, [CC-BY SA 4.0][6]) + +### 现在就试试 FreeDOS 1.3 RC4 + +你可以在 FreeDOS 的[下载][11]页面上找到新的 FreeDOS 1.3 RC4,。要安装 FreeDOS,你需要至少 20MB 的可用磁盘空间:20MB 用来安装一个普通的 FreeDOS 系统,或者 250MB 用来安装所有,包括应用和游戏。要安装源码,你将需要高达 450MB 的可用空间。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/get-started-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/retro_old_unix_computer.png?itok=SYAb2xoW (Old UNIX computer) +[2]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ +[3]: https://www.freedos.org/ +[4]: https://opensource.com/article/20/8/virt-tools +[5]: https://opensource.com/sites/default/files/freedos-livecd.png (Booting the FreeDOS 1.3 RC4 LiveCD) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/install6.png (Installing FreeDOS 1.3 RC4) +[8]: https://opensource.com/sites/default/files/freedos-floppy.png (Installing the FreeDOS Floppy-Only Edition) +[9]: https://opensource.com/sites/default/files/floppy-bird.png (Playing the Floppy Bird game) +[10]: https://opensource.com/sites/default/files/simple-senet.png (The ancient game of Senet) +[11]: https://www.freedos.org/download/ From 779958f54c4902c4ecf0126839526d7526e77f84 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 10 Jun 2021 08:41:24 +0800 Subject: [PATCH 031/870] translating --- ...Helix- A Terminal Based Text Editor for Power Linux Users.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md b/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md index b4b50f0fdc..b71d2aa4b5 100644 --- a/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md +++ b/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/helix-editor/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From cb54eb2cbb1134226afe3012ebbde0dbfbf7a5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 10 Jun 2021 21:04:31 +0800 Subject: [PATCH 032/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 903bbfe071..b485c6705d 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -23,9 +23,9 @@ Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了 ### 1\. 一次编码, 任意环境都能跑通 -如果代码只能在特定的操作系统和环境下运行,那这会很令人惊讶甚至是失望的。代码必须从一种对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。It feels arcane in the world of advanced computers that we can't just write code and send it to anyone who wants to run it without worrying about what platform they're on. +如果代码只能在特定的操作系统和环境下运行,那这会很令人惊讶甚至是失望的。代码必须从一种对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。在先进的计算机世界中,我们很难理解为什么不能仅仅编写代码后,就能将它发送给任何一个想要稳定运行它的平台,而且无需担忧它们处在什么样的平台中。 -Java is the solution to this incongruity. It's the realization of cross-platform code that works the same across any system you run it on. Java's approach to achieving this feat is counterintuitive at first. In a way, Java isn't compatible with anything but one computer. Stranger still, this computer doesn't actually exist. The computer that Java code targets is the Java Virtual Machine (JVM). This is a program written by Java's creators and distributed for practically any computing device you can think of. As long as you have it installed, any Java code you run is handled by this "imaginary" computer living inside your computer. Java code is executed by the JVM, which sends appropriate platform-specific instructions to your computer, so everything works the same on every OS and architecture. +Java 是解决这种不协调的方法。它的代码是可以跨平台进行工作的,在任何运行它的系统上都可以执行相同的工作。Java 实现这一壮举的方法起初是有驳常理的。在某种程度上,Java 只与一台计算机兼容。更奇怪的是,这台电脑实际上并不存在。Java 代码的目标计算机是 Java 虚拟机 (JVM)。这是一个由Java的创建者编写的程序,实际上可用于您能想到的任何计算设备。只要您安装了它,您运行的任何 Java 代码都会由位于您计算机中的这台“虚拟”计算机进行处理。 Java code is executed by the JVM, which sends appropriate platform-specific instructions to your computer, so everything works the same on every OS and architecture. Of course, the method used by Java isn't really the selling point here. Most users and many developers don't care how software compatibility is achieved, only that it happens. Many languages promise cross-platform functionality, and usually, that promise is ultimately true, but the journey isn't always easy. Programming languages must be compiled for their target platforms, scripting languages require platform-specific interpreters, and it's rare that either can ensure consistent access to low-level system resources. Cross-platform support is getting better and better, with libraries to help with translating paths and environment variables and settings, and some frameworks (notably [Qt][2]) do much to bridge the gap for peripheral access. But Java has it and delivers it consistently and reliably. From b1c8ba02042fbabfc84509167ac547aa7f996275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 10 Jun 2021 21:21:01 +0800 Subject: [PATCH 033/870] Update 20210523 3 reasons to learn Java in 2021.md --- .../tech/20210523 3 reasons to learn Java in 2021.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index b485c6705d..8a65678416 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -25,15 +25,15 @@ Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了 如果代码只能在特定的操作系统和环境下运行,那这会很令人惊讶甚至是失望的。代码必须从一种对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。在先进的计算机世界中,我们很难理解为什么不能仅仅编写代码后,就能将它发送给任何一个想要稳定运行它的平台,而且无需担忧它们处在什么样的平台中。 -Java 是解决这种不协调的方法。它的代码是可以跨平台进行工作的,在任何运行它的系统上都可以执行相同的工作。Java 实现这一壮举的方法起初是有驳常理的。在某种程度上,Java 只与一台计算机兼容。更奇怪的是,这台电脑实际上并不存在。Java 代码的目标计算机是 Java 虚拟机 (JVM)。这是一个由Java的创建者编写的程序,实际上可用于您能想到的任何计算设备。只要您安装了它,您运行的任何 Java 代码都会由位于您计算机中的这台“虚拟”计算机进行处理。 Java code is executed by the JVM, which sends appropriate platform-specific instructions to your computer, so everything works the same on every OS and architecture. +Java 是解决这种不协调的方法。它的代码是可以跨平台进行工作的,在任何运行它的系统上都可以执行相同的工作。Java 实现这一壮举的方法起初是有驳常理的。在某种程度上,Java 只与一台计算机兼容。更奇怪的是,这台电脑实际上并不存在。Java 代码的目标计算机是 Java 虚拟机 (JVM)。这是一个由Java的创建者编写的程序,实际上可用于您能想到的任何计算设备。只要您安装了它,您运行的任何 Java 代码都会由位于您计算机中的这台“虚拟”计算机进行处理。Java 代码由 JVM 执行,VM向您的计算机发送适当的特定于平台的指令,因此所有内容在每个操作系统和架构上都相同。 -Of course, the method used by Java isn't really the selling point here. Most users and many developers don't care how software compatibility is achieved, only that it happens. Many languages promise cross-platform functionality, and usually, that promise is ultimately true, but the journey isn't always easy. Programming languages must be compiled for their target platforms, scripting languages require platform-specific interpreters, and it's rare that either can ensure consistent access to low-level system resources. Cross-platform support is getting better and better, with libraries to help with translating paths and environment variables and settings, and some frameworks (notably [Qt][2]) do much to bridge the gap for peripheral access. But Java has it and delivers it consistently and reliably. +当然,Java 使用的方法并不是真正的卖点。大多数用户和许多开发人员并不关心软件兼容性是如何实现的,只关心它是否具备兼容性。许多语言都承诺提供跨平台的功能,而且通常情况下,这个承诺最终都是真的,但是这个过程并不总是容易的。编程语言必须针对其目标平台进行编译,脚本语言需要特定于平台的解释器,而且两者都很难确保对底层系统资源的一致访问。跨平台支持越来越好,库可以帮助转换路径、环境变量和设置,并且一些框架(特别是 [Qt][2])在弥补外设访问的差距方面做了很多工作。但是 Java 拥有兼容性,并始终可靠地提供它。 -### 2\. Sensible code +### 2\. 明智的代码 -Java's syntax is boring in the best of ways. If you took all the popular programming languages and put them in a rock tumbler, Java is what you'd get. Looking at source code written in Java, you more or less see the average of all the unique expressions of programming. Brackets indicate the scope of functions and flow control, variables are clearly declared and instantiated before being used, and there's a clear and consistent structure to expressions. +Java 的语法即使是在最好的方面都很无聊。如果你把所有流行的编程语言都放在一个摇滚杯中,那么你会得到 Java。 看看用Java编写的源代码,您或多或少会看到编程中所有唯一表达式的平均值。括号表示函数和流程控制的范围,变量在使用前被清楚地声明和实例化,并且表达式具有清晰一致的结构。 -I've found that learning Java often encourages self-taught programmers using less structured languages to write smarter code. There are lots of "basic" programming lessons you can't learn by gleaning techniques from source code you study online, such as keeping global variable declarations together in the style of Java's public fields, properly anticipating and handling exceptions, using classes and functions, and more. Little touches borrowed from Java can make a big difference. +我发现Java学习过程中通常会鼓励自学的程序员使用结构较少的语言编写更精炼的代码。有许多“基本”编程课程是无法通过从在线学习的源代码中收集技术来学习的,比如将全局变量声明保持在Java公共字段的风格中、正确地预测和处理异常、使用类和函数、和许多其他的技术。从Java借鉴的一点小改动可以产生很大的不同。 ### 3\. Scaffolding and support From 4b56da1a88192552a8c4c320189e1aae5faced63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 10 Jun 2021 21:27:50 +0800 Subject: [PATCH 034/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 8a65678416..86c58079a7 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -39,13 +39,13 @@ Java 的语法即使是在最好的方面都很无聊。如果你把所有流行 所有流行的编程语言都有很好的支持系统。这也是使得其变成流行语言的原因。他们都有很多文档资料。有针对它们的集成开发环境 (IDE) 或 IDE 扩展、示例代码、免费和付费培训和开发者社区。在另一方面,当您在尝试做某事遇到困难时,似乎没有任何编程语言有足够的支持。 -我不能说 Java 与这两个普遍但又相互矛盾的真理隔开。 Still, I have found that when I need a library for Java, I inevitably find not just one but several options for a given task. Often I don't want to use a library because I don't like how its developer chose to implement the functions I need, its license is a little different from what I prefer, or any other trivial point of contention. When there's bountiful support for a language, I have the luxury of being very selective. I get to choose one—among many perfectly suitable solutions—that will best achieve any requirement, however trivial. +我不能说 Java 与这两个普遍但又相互矛盾的真理隔开。尽管如此,我发现当我需要一个 Java 库时,我不可避免地会为给定的任务找到多个选项。通常我不想使用一个库,因为我不喜欢它的开发人员实现我需要的功能时,它的许可证与我喜欢的略有不同,或者有其他琐碎的争论点。当一门语言得到大量支持时,我就会非常有选择性。我可以从许多非常合适的解决方案中选择一个最能满足我需求的方案,不论我的这些需求多么微不足道都能被最好得满足。 Better yet, there's a healthy infrastructure around Java. Tools like [Apache Ant][3], [Gradle][4], and [Maven][5] help you manage your build and delivery process. Services like [Sonatype Nexus][6] help you monitor security. [Spring][7] and [Grails][8] make it easy to develop for the web, while [Quarkus][9] and [Eclipse Che][10] help with cloud development. You can even choose what to use when approaching the Java language itself. [OpenJDK][11] provides classic, official Java, while [Groovy][12] is a simplified approach that resembles a scripting language (you might compare it to Python), and [Quarkus][13] provides a framework for container-first development. -There's a lot more, but suffice it to say that Java is a complete package regardless of what you're looking for. +还有很多论点,但现在已经足以说明 Java 是一个完整的包了,无论您想在其中寻找什么。 ### 优点:简单易学 From daaf3c27e6ef615f2641eb93cebe6131e595d872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 10 Jun 2021 21:33:04 +0800 Subject: [PATCH 035/870] Update 20210523 3 reasons to learn Java in 2021.md --- sources/tech/20210523 3 reasons to learn Java in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 86c58079a7..a225491610 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -41,9 +41,9 @@ Java 的语法即使是在最好的方面都很无聊。如果你把所有流行 我不能说 Java 与这两个普遍但又相互矛盾的真理隔开。尽管如此,我发现当我需要一个 Java 库时,我不可避免地会为给定的任务找到多个选项。通常我不想使用一个库,因为我不喜欢它的开发人员实现我需要的功能时,它的许可证与我喜欢的略有不同,或者有其他琐碎的争论点。当一门语言得到大量支持时,我就会非常有选择性。我可以从许多非常合适的解决方案中选择一个最能满足我需求的方案,不论我的这些需求多么微不足道都能被最好得满足。 -Better yet, there's a healthy infrastructure around Java. Tools like [Apache Ant][3], [Gradle][4], and [Maven][5] help you manage your build and delivery process. Services like [Sonatype Nexus][6] help you monitor security. [Spring][7] and [Grails][8] make it easy to develop for the web, while [Quarkus][9] and [Eclipse Che][10] help with cloud development. +更好的是,有一个围绕 Java 的健壮的基础设施。像[Apache Ant][3]、[Gradle][4]、和[Maven][5]等工具 帮助您管理构建和交付的过程。像[Sonatype Nexus][6]等服务帮助您实现监控的安全性。[Spring][7]和[Grails][8]使网络开发变得更加容易, 而[Quarkus][9]和[Eclipse Che][10]有助于云上的开发。 -You can even choose what to use when approaching the Java language itself. [OpenJDK][11] provides classic, official Java, while [Groovy][12] is a simplified approach that resembles a scripting language (you might compare it to Python), and [Quarkus][13] provides a framework for container-first development. +在接触 Java 语言本身时,您甚至可以选择使用什么样的版本。[OpenJDK][11] 提供经典的官方 Java,而 [Groovy][12] 是一种类似于脚本语言的简化方法 (你可以将它与 Python 进行比较), 并且[Quarkus][13]为容器优先开发提供了一个框架。 还有很多论点,但现在已经足以说明 Java 是一个完整的包了,无论您想在其中寻找什么。 From 344cdda96c2aec9f7be9a6246c67a134fa8f6e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 10 Jun 2021 21:35:54 +0800 Subject: [PATCH 036/870] Update 20210523 3 reasons to learn Java in 2021.md --- .../tech/20210523 3 reasons to learn Java in 2021.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index a225491610..9531ff8227 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -9,15 +9,15 @@ 2021年学习Java的三个理由 ====== -Java具有功能强大、多样化、可拓展、有趣的特点。这就是你应该使用它的原因和方式。 +Java具有功能强大、多样化、可拓展、有趣的特点。这就是您应该使用它的原因和方式。 ![Learning and studying technology is the key to success][1] -Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了。起初它是闭源的,但在2007年,Java基于GPL协议被开源发布了。如果想要理解是什么使得Java变得非常重要,你就必须理解它声称要解决的是什么样的问题,从而你就能理解它让开发者和用户受益的原因和方式。 +Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了。起初它是闭源的,但在2007年,Java基于GPL协议被开源发布了。如果想要理解是什么使得Java变得非常重要,您就必须理解它声称要解决的是什么样的问题,从而您就能理解它让开发者和用户受益的原因和方式。 -理解Java解决问题的最好方式就是进行软件开发,当然啦,如果不做开发,仅仅只是使用软件也会是一个很好的开始。作为一名开发人员,当你将在自己的本地计算机上运行良好的软件部署到其他计算机上运行时,一些稀奇古怪的麻烦可能就出现了,从而导致软件可能无妨正常运行。软件本应正常工作,但每个程序员都明白,一些问题总是会被忽视。当你在另一个操作系统(OS)上尝试运行该软件时,情况就变得更加复杂了。这也是为什么在每一个软件的获取页面上都会有针对不同的操作系统有对应下载按钮的原因:Windows的、macOS的、Linux的、移动端的、甚至许多其他操作系统环境的下载选项。 +理解Java解决问题的最好方式就是进行软件开发,当然啦,如果不做开发,仅仅只是使用软件也会是一个很好的开始。作为一名开发人员,当您将在自己的本地计算机上运行良好的软件部署到其他计算机上运行时,一些稀奇古怪的麻烦可能就出现了,从而导致软件可能无妨正常运行。软件本应正常工作,但每个程序员都明白,一些问题总是会被忽视。当您在另一个操作系统(OS)上尝试运行该软件时,情况就变得更加复杂了。这也是为什么在每一个软件的获取页面上都会有针对不同的操作系统有对应下载按钮的原因:Windows的、macOS的、Linux的、移动端的、甚至许多其他操作系统环境的下载选项。 -作为一名用户,一个典型的场景是你想下载一些优秀的软件,但它却不适用于你的平台。遗憾的是这样的情况仍然发生在当下非常先进的计算机上,它们可以在计算机中运行虚拟机,通过仿真使旧视频游戏保持活力,甚至可以放在你的口袋里,但软件交付实际上相当困难。 +作为一名用户,一个典型的场景是您想下载一些优秀的软件,但它却不适用于您的平台。遗憾的是这样的情况仍然发生在当下非常先进的计算机上,它们可以在计算机中运行虚拟机,通过仿真使旧视频游戏保持活力,甚至可以放在您的口袋里,但软件交付实际上相当困难。 有没有更好的办法?可能会有吧。 @@ -31,7 +31,7 @@ Java 是解决这种不协调的方法。它的代码是可以跨平台进行工 ### 2\. 明智的代码 -Java 的语法即使是在最好的方面都很无聊。如果你把所有流行的编程语言都放在一个摇滚杯中,那么你会得到 Java。 看看用Java编写的源代码,您或多或少会看到编程中所有唯一表达式的平均值。括号表示函数和流程控制的范围,变量在使用前被清楚地声明和实例化,并且表达式具有清晰一致的结构。 +Java 的语法即使是在最好的方面都很无聊。如果您把所有流行的编程语言都放在一个摇滚杯中,那么您会得到 Java。 看看用Java编写的源代码,您或多或少会看到编程中所有唯一表达式的平均值。括号表示函数和流程控制的范围,变量在使用前被清楚地声明和实例化,并且表达式具有清晰一致的结构。 我发现Java学习过程中通常会鼓励自学的程序员使用结构较少的语言编写更精炼的代码。有许多“基本”编程课程是无法通过从在线学习的源代码中收集技术来学习的,比如将全局变量声明保持在Java公共字段的风格中、正确地预测和处理异常、使用类和函数、和许多其他的技术。从Java借鉴的一点小改动可以产生很大的不同。 @@ -43,7 +43,7 @@ Java 的语法即使是在最好的方面都很无聊。如果你把所有流行 更好的是,有一个围绕 Java 的健壮的基础设施。像[Apache Ant][3]、[Gradle][4]、和[Maven][5]等工具 帮助您管理构建和交付的过程。像[Sonatype Nexus][6]等服务帮助您实现监控的安全性。[Spring][7]和[Grails][8]使网络开发变得更加容易, 而[Quarkus][9]和[Eclipse Che][10]有助于云上的开发。 -在接触 Java 语言本身时,您甚至可以选择使用什么样的版本。[OpenJDK][11] 提供经典的官方 Java,而 [Groovy][12] 是一种类似于脚本语言的简化方法 (你可以将它与 Python 进行比较), 并且[Quarkus][13]为容器优先开发提供了一个框架。 +在接触 Java 语言本身时,您甚至可以选择使用什么样的版本。[OpenJDK][11] 提供经典的官方 Java,而 [Groovy][12] 是一种类似于脚本语言的简化方法 (您可以将它与 Python 进行比较), 并且[Quarkus][13]为容器优先开发提供了一个框架。 还有很多论点,但现在已经足以说明 Java 是一个完整的包了,无论您想在其中寻找什么。 From a16a035210c16fd2d36a11964c0801f6fbfe95eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 10 Jun 2021 22:12:47 +0800 Subject: [PATCH 037/870] Update 20210523 3 reasons to learn Java in 2021.md --- ...0210523 3 reasons to learn Java in 2021.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 9531ff8227..62fef67c6e 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -9,7 +9,7 @@ 2021年学习Java的三个理由 ====== -Java具有功能强大、多样化、可拓展、有趣的特点。这就是您应该使用它的原因和方式。 +Java具有功能强大、多样化、可拓展、有趣的特点。这就是Java为什么被我们广泛使用,也是我们应当找到正确使用它的方式。 ![Learning and studying technology is the key to success][1] @@ -23,27 +23,27 @@ Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了 ### 1\. 一次编码, 任意环境都能跑通 -如果代码只能在特定的操作系统和环境下运行,那这会很令人惊讶甚至是失望的。代码必须从一种对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。在先进的计算机世界中,我们很难理解为什么不能仅仅编写代码后,就能将它发送给任何一个想要稳定运行它的平台,而且无需担忧它们处在什么样的平台中。 +如果代码只能在特定的操作系统和环境下运行,那这会很令人惊讶甚至是失望的。代码需要从对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。在先进的计算机世界中,我们很难理解为什么不能仅仅只要编写代码,就能将它发送给任何一个想要稳定运行它的平台,无需担忧它们正处在什么样的平台中。 -Java 是解决这种不协调的方法。它的代码是可以跨平台进行工作的,在任何运行它的系统上都可以执行相同的工作。Java 实现这一壮举的方法起初是有驳常理的。在某种程度上,Java 只与一台计算机兼容。更奇怪的是,这台电脑实际上并不存在。Java 代码的目标计算机是 Java 虚拟机 (JVM)。这是一个由Java的创建者编写的程序,实际上可用于您能想到的任何计算设备。只要您安装了它,您运行的任何 Java 代码都会由位于您计算机中的这台“虚拟”计算机进行处理。Java 代码由 JVM 执行,VM向您的计算机发送适当的特定于平台的指令,因此所有内容在每个操作系统和架构上都相同。 +Java可以解决这种不协调的问题。它的代码是可以跨平台进行工作的,在任何运行它的系统上都执行相同的工作。Java 实现这一壮举的方法起初是有驳常理的。在某种程度上,Java只与一台计算机兼容。奇怪的是,这台电脑实际上并不存在。Java代码的目标计算机是Java虚拟机 (JVM)。这是一个由Java的创建者编写的程序,可用于您能想到的任何计算机设备。只要您安装了它,您运行的任何 Java 代码都会由您计算机中的这台“虚拟”计算机进行处理。Java代码会由JVM执行,JVM向您的计算机发送适当的特定于平台的指令,因此所有内容在每个操作系统和架构上都相同。 -当然,Java 使用的方法并不是真正的卖点。大多数用户和许多开发人员并不关心软件兼容性是如何实现的,只关心它是否具备兼容性。许多语言都承诺提供跨平台的功能,而且通常情况下,这个承诺最终都是真的,但是这个过程并不总是容易的。编程语言必须针对其目标平台进行编译,脚本语言需要特定于平台的解释器,而且两者都很难确保对底层系统资源的一致访问。跨平台支持越来越好,库可以帮助转换路径、环境变量和设置,并且一些框架(特别是 [Qt][2])在弥补外设访问的差距方面做了很多工作。但是 Java 拥有兼容性,并始终可靠地提供它。 +当然,Java 使用的方法并不是真正的卖点。大多数用户和许多开发人员并不关心软件兼容性是如何实现的,只关心它是否具备兼容性。许多语言都承诺提供跨平台的功能,通常情况下,这个承诺最终都是真的,但是这个过程并不总是容易实现的。编程语言必须针对其目标平台进行编译,脚本语言需要特定于平台的解释器,而且两者都很难确保对底层系统资源的一致访问。跨平台支持变得越来越好,库可以帮助转换路径、环境变量和设置,并且一些框架(特别是 [Qt][2])在弥补外设访问的差距方面做了很多工作。Java始终可靠地提供它的兼容性。 ### 2\. 明智的代码 -Java 的语法即使是在最好的方面都很无聊。如果您把所有流行的编程语言都放在一个摇滚杯中,那么您会得到 Java。 看看用Java编写的源代码,您或多或少会看到编程中所有唯一表达式的平均值。括号表示函数和流程控制的范围,变量在使用前被清楚地声明和实例化,并且表达式具有清晰一致的结构。 +Java 的语法即使是在最好的方面也很无聊。如果您把所有流行的编程语言都放在一个摇滚杯中,那么您会得到 Java。 通过观察Java编写的源代码,您或多或少会看到编程中所有特定表达式的平均值。括号表示函数和流程控制的范围,变量在使用前被清楚地声明和实例化,并且表达式具有清晰一致的结构。 我发现Java学习过程中通常会鼓励自学的程序员使用结构较少的语言编写更精炼的代码。有许多“基本”编程课程是无法通过从在线学习的源代码中收集技术来学习的,比如将全局变量声明保持在Java公共字段的风格中、正确地预测和处理异常、使用类和函数、和许多其他的技术。从Java借鉴的一点小改动可以产生很大的不同。 -### 3\. Scaffolding and support +### 3\. 基础设施和支持 -所有流行的编程语言都有很好的支持系统。这也是使得其变成流行语言的原因。他们都有很多文档资料。有针对它们的集成开发环境 (IDE) 或 IDE 扩展、示例代码、免费和付费培训和开发者社区。在另一方面,当您在尝试做某事遇到困难时,似乎没有任何编程语言有足够的支持。 +所有流行的编程语言都有很好的支持系统,这也是使得其变成流行语言的原因。他们都有很多文档资料,有针对它们的集成开发环境 (IDE) 或 IDE 扩展、示例代码、免费和付费培训和开发者社区。在另一方面,当您在尝试做某事遇到困难时,似乎没有任何编程语言有足够的支持。 -我不能说 Java 与这两个普遍但又相互矛盾的真理隔开。尽管如此,我发现当我需要一个 Java 库时,我不可避免地会为给定的任务找到多个选项。通常我不想使用一个库,因为我不喜欢它的开发人员实现我需要的功能时,它的许可证与我喜欢的略有不同,或者有其他琐碎的争论点。当一门语言得到大量支持时,我就会非常有选择性。我可以从许多非常合适的解决方案中选择一个最能满足我需求的方案,不论我的这些需求多么微不足道都能被最好得满足。 +我不能认为Java与这两个普遍但又相互矛盾的真理能够区分开。尽管如此,我发现当我需要一个Java库时,我不可避免地会为给定的任务找到多个选项。通常我不想使用一个库的原因是我不喜欢它的开发人员在实现我需要的功能时,对应的许可证与我喜欢的有所不同或者有其他琐碎的争论点。当一门语言得到大量支持时,我就会很多的选择性。我可以从许多合适的解决方案中选择一个最能满足我需求的,不论我的需求多么微不足道都能被最好得满足。 -更好的是,有一个围绕 Java 的健壮的基础设施。像[Apache Ant][3]、[Gradle][4]、和[Maven][5]等工具 帮助您管理构建和交付的过程。像[Sonatype Nexus][6]等服务帮助您实现监控的安全性。[Spring][7]和[Grails][8]使网络开发变得更加容易, 而[Quarkus][9]和[Eclipse Che][10]有助于云上的开发。 +更好的是,有一个围绕Java的健康的基础设施。像[Apache Ant][3]、[Gradle][4]、和[Maven][5]等工具 帮助您管理构建和交付的过程。像[Sonatype Nexus][6]等服务帮助您实现监控的安全性。[Spring][7]和[Grails][8]使网络开发变得更加容易, 而[Quarkus][9]和[Eclipse Che][10]有助于云上的开发。 -在接触 Java 语言本身时,您甚至可以选择使用什么样的版本。[OpenJDK][11] 提供经典的官方 Java,而 [Groovy][12] 是一种类似于脚本语言的简化方法 (您可以将它与 Python 进行比较), 并且[Quarkus][13]为容器优先开发提供了一个框架。 +在接触Java语言本身时,您甚至可以选择使用什么样的版本。[OpenJDK][11]提供经典的官方Java,而[Groovy][12]是一种类似于脚本语言的简化方法 (您可以将它与Python进行比较), 并且[Quarkus][13]为容器优先开发提供了一个框架。 还有很多论点,但现在已经足以说明 Java 是一个完整的包了,无论您想在其中寻找什么。 From b12bbdc42aeaecd39dc39f582e3655dbabd88b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Thu, 10 Jun 2021 22:16:49 +0800 Subject: [PATCH 038/870] Update 20210523 3 reasons to learn Java in 2021.md --- .../tech/20210523 3 reasons to learn Java in 2021.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/sources/tech/20210523 3 reasons to learn Java in 2021.md index 62fef67c6e..81a1f3be6b 100644 --- a/sources/tech/20210523 3 reasons to learn Java in 2021.md +++ b/sources/tech/20210523 3 reasons to learn Java in 2021.md @@ -45,19 +45,19 @@ Java 的语法即使是在最好的方面也很无聊。如果您把所有流行 在接触Java语言本身时,您甚至可以选择使用什么样的版本。[OpenJDK][11]提供经典的官方Java,而[Groovy][12]是一种类似于脚本语言的简化方法 (您可以将它与Python进行比较), 并且[Quarkus][13]为容器优先开发提供了一个框架。 -还有很多论点,但现在已经足以说明 Java 是一个完整的包了,无论您想在其中寻找什么。 +还有很多论点,但现在已经足以说明Java是一个完整的包了,无论您想在其中寻找什么。 ### 优点:简单易学 -事实证明,Java 对我和各行各业的许多开发人员来说是一个明智的解决方案。以下是我喜欢使用 Java 的一些原因。 +事实证明,Java对我和各行各业的许多开发人员来说是一个明智的解决方案。以下是我喜欢使用Java的一些原因。 -您可能听说过或推断出 Java 是一种“专业”语言,只适用于笨重的政府网站,专供“真正的”开发人员使用。千万不要被 Java 超过25年以来的各种名声所迷惑!它的可怕程度只有它名声的一半,并不比其他任何语言更可怕。 +您可能听说过或推断出Java是一种“专业”语言,只适用于笨重的政府网站,专供“真正的”开发人员使用。千万不要被 Java超过25年以来的各种名声所迷惑!它的可怕程度只有它名声的一半,并不比其他任何语言更可怕。 编程很困难的这件事是无法逃避的,它要求您基于逻辑进行思考,学习一种比母语表达选方式更少的新语言,要您弄清楚如何解决困难的问题,使它们可以使用您的程序完成自动化的执行,没有语言可以避免这些问题。 -然而,编程语言的学习曲线的差异令人惊讶。有些一开始很容易,但当您开始探索细节时就会变得复杂。换句话说,打印“hello world”可能只需要一行代码,但当您学习到了类和函数, 您相当于开始重新学习这门语言(或者至少是它的数据模型)。Java 从一开始就是 Java,一旦您学会了它,就可以使用它的许多技巧和便利。 +然而,编程语言的学习曲线的差异令人惊讶。有些一开始很容易,但当您开始探索细节时就会变得复杂。换句话说,打印“hello world”可能只需要一行代码,但当您学习到了类和函数, 您相当于开始重新学习这门语言(或者至少是它的数据模型)。Java从一开始就是Java,一旦您学会了它,就可以使用它的许多技巧和便利。 -简而言之: 去学习 Java 吧!它具有功能强大、多样化、可拓展、有趣的特点。为了给您提供帮助, [下载我们的 Java 备忘单][14], 它包含您在处理前十个项目时需要的所有基本语法。在那之后,您就不再需要它了,因为Java具有完美的一致性和可预测性。来享受它吧! +简而言之: 去学习Java吧!它具有功能强大、多样化、可拓展、有趣的特点。为了给您提供帮助, [下载我们的Java 备忘单][14], 它包含您在处理前十个项目时需要的所有基本语法。在那之后,您就不再需要它了,因为Java具有完美的一致性和可预测性。来享受它吧! -------------------------------------------------------------------------------- From 9131c9b5c4d0b4edaa102b23009a5618535c9397 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 11 Jun 2021 05:03:10 +0800 Subject: [PATCH 039/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210610=20?= =?UTF-8?q?Use=20cpulimit=20to=20free=20up=20your=20CPU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210610 Use cpulimit to free up your CPU.md --- ...210610 Use cpulimit to free up your CPU.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20210610 Use cpulimit to free up your CPU.md diff --git a/sources/tech/20210610 Use cpulimit to free up your CPU.md b/sources/tech/20210610 Use cpulimit to free up your CPU.md new file mode 100644 index 0000000000..e07d69a1e1 --- /dev/null +++ b/sources/tech/20210610 Use cpulimit to free up your CPU.md @@ -0,0 +1,93 @@ +[#]: subject: (Use cpulimit to free up your CPU) +[#]: via: (https://fedoramagazine.org/use-cpulimit-to-free-up-your-cpu/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use cpulimit to free up your CPU +====== + +![][1] + +Photo by [Henning Witzel][2] on [Unsplash][3] + +The recommended tool for managing system resources on Linux systems is [cgroups][4]. While very powerful in terms of what sorts of limits can be tuned (CPU, memory, disk I/O, network, etc.), configuring cgroups is non-trivial. The [_nice_][5] command has been available since 1973. But it only adjusts the scheduling priority among processes that are competing for time on a processor. The _nice_ command will not limit the percentage of CPU cycles that a process can consume per unit of time. The _[cpulimit][6]_ command provides the best of both worlds. It limits the percentage of CPU cycles that a process can allocate per unit of time and it is relatively easy to invoke. + +The _cpulimit_ command is mainly useful for long-running and CPU-intensive processes. Compiling software and converting videos are common examples of long-running processes that can max out a computer’s CPU. Limiting the CPU usage of such processes will free up processor time for use by other tasks that may be running on the computer. Limiting CPU-intensive processes will also reduce the power consumption, heat output, and possibly the fan noise of the system. The trade-off for limiting a process’s CPU usage is that it will require more time to run to completion. + +### Install cpulimit + +The _cpulimit_ command is available in the default Fedora Linux repositories. Run the following command to install _cpulimit_ on a Fedora Linux system. + +``` +$ sudo dnf install cpulimit +``` + +### View the documentation for cpulimit + +The cpulimit package does not come with a man page. Use the following command to view cpulimit’s built-in documentation. The output is provided below. But you may want to run the command on your own system in case the options have changed since this article was written. + +``` +$ cpulimit --help +Usage: cpulimit [OPTIONS…] TARGET + OPTIONS + -l, --limit=N percentage of cpu allowed from 0 to 800 (required) + -v, --verbose show control statistics + -z, --lazy exit if there is no target process, or if it dies + -i, --include-children limit also the children processes + -h, --help display this help and exit + TARGET must be exactly one of these: + -p, --pid=N pid of the process (implies -z) + -e, --exe=FILE name of the executable program file or path name + COMMAND [ARGS] run this command and limit it (implies -z) +``` + +### A demonstration + +To demonstrate using the _cpulimit_ command, a contrived, computationally-intensive Python script is provided below. The script is run first with no limit and then with a limit of 50%. It computes the value of the 42nd [Fibonacci number][7]. The script is run as a child process of the _time_ command in both cases to show the total time that was required to compute the answer. + +``` +$ /bin/time -f '(computed in %e seconds)' /bin/python -c 'f = lambda n: n if n<2 else f(n-1)+f(n-2); print(f(42), end=" ")' +267914296 (computed in 51.80 seconds) +$ /bin/cpulimit -i -l 50 /bin/time -f '(computed in %e seconds)' /bin/python -c 'f = lambda n: n if n<2 else f(n-1)+f(n-2); print(f(42), end=" ")' +267914296 (computed in 127.38 seconds) +``` + +You might hear the CPU fan on your PC rev up when running the first version of the command. But you should not when running the second version. The first version of the command is not CPU limited but it should not cause your PC to become bogged down. It is written in such a way that it can only use at most one CPU. Most modern PCs have multiple CPUs and can simultaneously run other tasks without difficulty when one of the CPUs is 100% busy. To verify that the first command is maxing out one of your processors, run the _top_ command in a separate terminal window and press the **1** key. Press the **Q** key to quit the _top_ command. + +Setting a limit above 100% is only meaningful on a program that is capable of [task parallelism][8]. For such programs, each increment of 100% represents full utilization of a CPU (200% = 2 CPUs, 300% = 3 CPUs, etc.). + +Notice that the **-i** option has been passed to the _cpulimit_ command in the above example. This is necessary because the command to be limited is not a direct child process of the _cpulimit_ command. Rather it is a child process of the _time_ command which in turn is a child process of the _cpulimit_ command. Without the **-i** option, _cpulimit_ would only limit the _time_ command. + +### Final notes + +If you want to limit a graphical application that you start from a desktop icon, copy the application’s _.desktop_ file (often located under the _/usr/share/applications_ directory) to your _~/.local/share/applications_ directory and modify the _Exec_ line accordingly. Then run the following command to apply the changes. + +``` +$ update-desktop-database ~/.local/share/applications +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-cpulimit-to-free-up-your-cpu/ + +作者:[Gregory Bartholomew][a] +选题:[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/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/cpulimit-816x345.jpg +[2]: https://unsplash.com/@henning?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/speed-limit?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://en.wikipedia.org/wiki/Cgroups +[5]: https://en.wikipedia.org/wiki/Nice_(Unix) +[6]: https://github.com/opsengine/cpulimit +[7]: https://en.wikipedia.org/wiki/Fibonacci_number +[8]: https://en.wikipedia.org/wiki/Task_parallelism From f9d3b72b160341a2b81d640417a495527ed0f679 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 11 Jun 2021 05:03:37 +0800 Subject: [PATCH 040/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210611=20?= =?UTF-8?q?RTFM!=20How=20to=20Read=20(and=20Understand)=20the=20Fantastic?= =?UTF-8?q?=20Man=20Pages=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md --- ...stand) the Fantastic Man Pages in Linux.md | 353 ++++++++++++++++++ 1 file changed, 353 insertions(+) create mode 100644 sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md diff --git a/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md b/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md new file mode 100644 index 0000000000..001918163d --- /dev/null +++ b/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md @@ -0,0 +1,353 @@ +[#]: subject: (RTFM! How to Read (and Understand) the Fantastic Man Pages in Linux) +[#]: via: (https://itsfoss.com/linux-man-page-guide/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +RTFM! How to Read (and Understand) the Fantastic Man Pages in Linux +====== + +The _man pages_, short for _reference manual pages_, are your keys to Linux. Everything you want to know is there – take it all in an run with it. The collection of documents will never win a Pulitzer prize, but the set is quite accurate and complete. The man pages are _the_ primary source and that authority is well-known. + +While they are the “go to” source, they aren’t the most pleasant to read. Once, in a long past philosophy class, I was told that reading [Aristotle][1] was the most boring read around. I disagreed: when it comes to dry reading, Aristotle comes in at a distant second to man pages. + +At first glance, the pages may look incomplete but, believe it or not, the man pages aren’t designed to hide information from you – it’s just that there is so much information that the pages have to be structured and information is given in the most brief form possible. The explanations are rather spartan and they will take some getting used to, but once you get the hang of using them, you’ll see how useful they actually are. + +### Getting Started with the man Pages in Linux + +The pages are viewed through a utility called, `man`, and the command to use it is rather easy. In the simplest form, to use `man`, you type `man` on the command line, followed by a `space` and the command that you want to look up, such as `ls` or `cp`, like so: + +``` +man ls +``` + +man opens the manual page of the `ls` command. + +![][2] + +You can move up and down with the arrow keys and press `q` to quit viewing the man page. Usually, the man pages are opened with less so the keyboard shortcuts for less command work in man as well. + +For example, you can search for a specific text using /search_term and so on. + +There is an introduction to the man pages and it’s important that you read this one. It spells out, in great detail, how the man pages are laid out and organized. + +To see this page, open a terminal and type: + +``` +man man +``` + +![man page of man][3] + +### Section What? + +Before you begin to look at man pages much deeper, it will be helpful to know that man pages have a set page layout _and_ a filing scheme. This can be confusing to a newcomer since I can say: “Look at the NAME _section_ of the man page for `ls`.” I can also say, “Look at the man page for `passwd` in _section_ 5.” + +I italicized the word, _section_ to try to show a source of confusion. The word, _section_ is being used in two different ways, but the difference isn’t always explained to newcomers. + +I am not sure why this confusion sets in, but I have seen it happen a few times back when I trained new users and entry-level sysadmins. I think it might be tunnel vision. Focusing on one thing can make a person forget about another. It’s a lot like not being able to see the forest because the trees are in the way. + +To those who know the difference already, you can skip this sub-section. This part is directed to the people new to man pages. + +Here is the difference: + +#### The man page + +Individual man pages are made to show blocks of information. For example, every man page has a **NAME** section to show the name of the command along with a brief description. There will be another block of information, called **SYNOPSIS** to show how the command is used, and so on. + +![][4] + +Every man page will have these, and other headings. These sections, or headings, on individual man pages, helps keep things consistent and information compartmentalized. + +#### The Manual + +The use of _section_, as in “Look at the man page for `passwd` in _section_ 5” speaks of the manual as a whole. When we look at only one page, it can be easy to overlook that, but the man page for `passwd` is part of the same manual that has a man page for `ls`, `rm`, `date`, `cal`, and others. + +The entire Linux manual is huge; it has thousands of pages. Some of those pages have specialized information. Some pages have information that programmers need, while others have information unique to networking, and others that system administrators would be interested in. + +These pages are grouped according to their unique purpose. Think of splitting the entire manual into several chapters – each chapter having a specific topic. There are 9 or so chapters (very large ones at that). It just so happens that these chapters are called _sections_. + +To sum this up: + + * Sections of a single page of the manual (what we call the man page) are blocks of information defined by the headings and + * Sections of the manual-at-large (the collection of all of the pages) are chapters which happen to be called _sections_. + + + +Now you know the difference and, hopefully, the rest of this article will be easier to follow. + +### man Page Sections + +You will be looking at different man pages so let’s study the individual page layout first. + +Manual pages are split into several headings and they may vary from vendor to vendor, but they will be similar. The general breakdown is as follows: + + * NAME + * SYNOPSIS + * DESCRIPTION + * EXAMPLES + * DIAGNOSTICS + * FILES + * LIMITS + * PORTABILITY + * SEE ALSO + * HISTORY WARNING (or Bugs) + * NOTES + + + +**NAME** – Under this heading is the command name and a brief description of the command. + +**SYNOPSIS** – Shows how the command is used. For instance, here is a synopsis of the `cal` command: + +``` +cal [Month] [Year] +``` + +The synopsis begins with the name of the command, with a list of options following. The synopsis takes the general form of a command line; it shows what you can type and the order of the arguments. Arguments in square brackets (`[]`) are optional; you can leave these arguments out and the command will still work correctly. Items not in brackets must be used. + +Take note that brackets are for readability only. They should not be typed when you enter a command. + +**DESCRIPTION** – Describes the command or utility as to what it does and how you can use it. This section usually starts off with an explanation of the synopsis as well as telling what happens if you omit any of the optional arguments. This section may be subdivided for long or complex commands. + +**EXAMPLES** – Some man pages provide examples of how the command or utility can be used. If this section is present, the page tries to give a few simple usage examples, as well as more complex examples to show how complex tasks can be completed. + +**DIAGNOSTICS** – This section lists status or error messages returned by the command or utility. Self-explanatory error and status messages aren’t usually shown. Messages that may be hard to understand are usually listed. + +**FILES** This section contains a list of supplementary files used by UNIX to run this specific command. Here, _supplementary_ files are files not specified on the command line. For example, if you were looking at a man page for the `passwd` command, you may find `/etc/passwd` listed in this section since that is where UNIX stores password information. + +**LIMITS** – This section describes any limitations of a utility. Operating system and hardware limitations are usually not listed as they are outside of the utility’s control. + +**PORTABILITY** – Lists other systems where the utility is available, along with how other versions of the utility may differ. + +**SEE ALSO** – lists related man pages that contain relevant information. + +**HISTORY** – Gives a brief history of the command such as when it first appeared. + +**WARNING** – If this section is present, it contains important advice for users. + +**NOTES** – Not as severe as a warning, but important information. + +Again, not all man pages use the exact headings listed above, but they’re close enough to follow. + +### The Manual’s Sections + +The entire Linux manual collection of pages are traditionally divided into numbered sections: + + * **Section 1** : Shell commands and applications + * **Section 2** : Basic kernel services – system calls and error codes + * **Section 3** : Library information for programmers + * **Section 4** : Network services – if TCP/IP or NFS is installed Device drivers and network protocols + * **Section 5** : Standard file formats – for example: shows what a _tar_ archive looks like. + * **Section 6** : Games + * **Section 7** : Miscellaneous files and documents + * **Section 8** : System administration and maintenance commands + * **Section 9** : Obscure kernel specs and interfaces + + + +The grouping of pages into these groups makes for more efficient searching. I sometimes do a little programming where I work, so I spend a little time look at section 3 man pages. I also do a little work in networking, so I’ve been known to wade through the networking section, and as a system administrator of several experimental machines, I spend a good deal of time in section 8. + +Grouping pages into specific (chapters) sections make searching for information easier – both for the human needing it, and for the machine doing the searching. + +You can tell which page belongs to which section by the number next to the name. For example, if you’re looking at a man page for `ls` and the very top of the page says this: `LS(1)`, you are viewing the `ls` page in section 1, which contains the pages about shell commands and applications. + +Here is another example. If you’re looking at a man page for `passwd` and the top of the page shows: `PASSWD(1)`, you are reading the page from section 1 that describes how the `passwd` command changes passwords for user accounts. If you see `PASSWD(5)`, you are reading about the the password file and how it is made up. + +![][5] + +`passwd` happens to be be two different things: it is the name of a command and a name of a file. Again, section 1 describes the command, while section 5 covers file formats. + +The number in the parenthesis is the big clue – that number tells you what section that the page you’re reading, came from. + +### Searching for a Specific Section + +The basic command: + +``` +man name +``` + +will search for the man page identified by _name_ in every section, displaying them one at a time, in numerical order. To limit your search to a specific section, use an argument with the `man` command, like so: + +``` +man 1 name +``` + +This command will only search section 1, of the man pages, for _name_. Using our `passwd` example earlier, this means that we can keep the search targeted. If I want to read about the `passwd` command, I can type this in the terminal: + +``` +man 1 passwd +``` + +The `man` utility will only search through section 1 for `passwd` and display it. It will not look through any other section for `passwd`. + +An alternative method for this command is to type: `man passwd.1` + +### Using man -k to Search all man Pages Containing a Certain Keyword + +The _man_ command, with the _k_ option (often called a _flag_ or _switch_) can come in handy if you want a listing of man pages containing a certain keyword. For example, if you want to see a list of man pages that deal with, say, `ftp`, you can get this list by typing: + +``` +man -k ftp +``` + +From the listing that will follow, you’ll be able to pick a specific man page to read: + +![man k example][6] + +On some systems, before `man -k` will work, the system administrator will need to run a utility called `catman`. + +### Using whatis and whereis Commands to Know the Manual’s Sections + +There are two nifty utilities that can be helpful in your search for information: whatis and whereis. + +#### whatis + +There are times when we can quite get the information we need. Chances are great that the information we need is available – finding it can be a small problem. + +For example, if I want to look at the man page about the `passwd` file, and I type this on the terminal: + +``` +man passwd +``` + +I would see the page that tells me all about the `passwd` command, but nothing about the `passwd` file. I know that `passwd` is a command and there’s also a `passwd` file, but sometimes, I might forget that. It’s then that I realize that file structures are in a different section in the man pages, so I type: + +``` +man 4 passwd +``` + +and I get this reply: + +``` +No manual entry for passwd in section 4 +See 'man 7 undocumented' for help when manual pages are not available. +``` + +Another lapse of forgetfulness. File structures are in section 4 of System V UNIX pages. Years ago, when I built files, I used `man 4...` _a lot_; it’s still a habit with me. So where is it in the Linux manual? + +It’s time to call `whatis` to straighten me out. To do this, I type this in my terminal: + +``` +whatis passwd +``` + +and I see the following: + +``` +passwd (1) - change user password +passwd (1ssl) - compute password hashes +passwd (5) - the password file +``` + +Ah! the page for the `passwd` file is in section 5. Now I am set straight and can access the information I want: + +``` +man 5 passwd +``` + +and I am brought to the man page that has the information I need. + +`whatis` is handy utility that can tell you, in a brief one-liner, what a command does. Imagine that you want to know what `cal` does without having to view the man page. Just type this at the command prompt: + +``` +whatis cal +``` + +and you will see this in response: + +``` +cal (1) - displays a calendar and the date of Easter +``` + +Now that you know about the `whatis` command, I can let you in on a secret – there is a `man` command equivalent. To get this, we use the `-f` switch: `man -f ...` + +Try it out. Type: `whatis cal` at a terminal prompt. Once that executes, type: `man -f cal`. The output of both commands will be identical. + +![whatis cal and man f cal outputs are the same][7] + +#### whereis + +The very name of the `whereis` command explains itself – it tells you where a program is within the filesystem. It will also tell you where the man page is stored too. Using `cal` as an example again, I type this at the prompt: + +``` +whereis cal +``` + +I will see this: + +![whereis cal output][8] + +Look carefully at the reply. The answer is on one line, but it tells me two things: + +`/usr/bin/cal` is where the `cal` program is and + +`/usr/share/man/man1/cal.1.gz` is where the man page resides (I’m also clued into the fact that the man page is compressed, but not to worry – the man command knows how to decompress it on the fly) + +`whereis` is PATH dependent; it can only tell you where files are if they are in your PATH environment. + +You may be wondering if there is an equivalent `man` command for `whereis`. There isn’t one that will tell you where the executable file is, but there is a switch you can use that will tell you where the man page is. Using the `date` command in this example, if we type: + +``` +whereis date +``` + +at a terminal prompt, we will see: + +![whereis date output][9] + +We see that the `date` program is in the `/usr/bin/` directory and the name and location of its man page is: `/usr/share/man/man1/date.1.gz` + +The closest we can get man to act like `whereis` is to use the `-w` switch. We won’t get the location of the program, but we can at least get the location of the man page, like this: + +``` +man -w date +``` + +and we will see this returned: + +![][10] + +You know about `whatis` and `whereis` as well as a method to get the `man` command to do the same (or close) thing. I showed both ways for a couple of different reasons. + +For years, I used `whatis` and `whereis` since they were in my training manuals. I didn’t learn about `man -f ...` and `man -w ...` until fairly recently. I’m sure I looked at the man page for `man` hundreds of times, but I never noticed the `-f` and `-w` switches. I was always looking at the man page for something else (i.e. `man -k ...`). I concentrated only on what I needed to find and ignored the rest. Once I found the information I needed, I would leave the page and get the work done, not paying attention to some of the other gems the command had to offer. + +This is okay since this is partly what the man pages are for: to help you get work done. + +It wasn’t until I was recently showing someone how to use man pages, that I took the time to just read – “to see what else was possible” – and we took real notice of the information about what the `man` command’s `-f` and `-w` flags can do. + +No matter how long you have been using Linux, or how experienced, there is always something new to learn. + +The man pages will tell you what you may need to know to work through a certain task – but they also hold a lot more – enough to make you look like a magician – but only if you take the time to read. + +### Conclusion + +If you spend some time and effort with the man pages, you will come out on top. Your proficiency of the man pages, will play a huge part in your mastery over Linux. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-man-page-guide/ + +作者:[Bill Dyer][a] +选题:[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/bill/ +[b]: https://github.com/lujun9972 +[1]: https://www.britannica.com/biography/Aristotle +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-example-800x527.png?resize=800%2C527&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/man_man.png?resize=800%2C455&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-example-1.png?resize=800%2C527&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-passwd-command.png?resize=1026%2C676&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/man-k_example.png?resize=800%2C200&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/whatis_cal_man-f_cal.png?resize=800%2C135&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/whereis_cal.png?resize=800%2C100&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/whereis_date.png?resize=800%2C100&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/man-w_date-1.png?resize=800%2C100&ssl=1 From f96e4ff8b607ca8503aba2495d271b0831a8c926 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 11 Jun 2021 05:03:56 +0800 Subject: [PATCH 041/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210610=20?= =?UTF-8?q?Why=20choose=20open=20source=20for=20your=20home=20automation?= =?UTF-8?q?=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210610 Why choose open source for your home automation project.md --- ...source for your home automation project.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sources/tech/20210610 Why choose open source for your home automation project.md diff --git a/sources/tech/20210610 Why choose open source for your home automation project.md b/sources/tech/20210610 Why choose open source for your home automation project.md new file mode 100644 index 0000000000..ff339f798d --- /dev/null +++ b/sources/tech/20210610 Why choose open source for your home automation project.md @@ -0,0 +1,44 @@ +[#]: subject: (Why choose open source for your home automation project) +[#]: via: (https://opensource.com/article/21/6/home-automation-ebook) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why choose open source for your home automation project +====== +Home automation is an exciting and fun branch of tech. Start designing +your home automation solutions today with open source tools. +![Working from home at a laptop][1] + +Let's face it. The point of technology is to make life better. + +Of course, what qualifies as "better" varies for people, depending on what they need at any given moment. Still, technology has the unique ability to affect lives at many different stages. For some people, technology offers a relaxing afternoon of entertainment, while for others, it provides navigational assistance, improved health care, or more precise scientific research. + +Interestingly, technology developed for one purpose is rarely divorced from technology used for another. For example, progress made in sports cameras so one person can record their snowboard ride down a ski slope also enables bodycams to help prevent human rights violations by police. Progress made in 3D printing so one person can prototype superhero action figures also makes it possible for volunteers to create oxygen ventilators for the infirm. Technology matters, and it affects us all. + +It's part of the job of open source to ensure that technological advancements are available to everyone, regardless of ethnicity, gender, nationality, physical abilities, religion, or wealth. Sadly, there are companies out there that view technology as a tool to farm data about its customers (that's you and me!), even while those customers finance the research and development of that technology. That's not what open source is about, though. Open source protects its users. + +Yes, home automation is a modern convenience. It's getting better every day. But it's your home. Open source home automation can make life a little easier, a little more like the future promised in all the sci-fi books and movies. But it can also improve the lives of those with different physical abilities than what an appliance manufacturer planned for. A simple Python script written as a minor convenience for one user can be a life-changer for someone else. + +Home automation is an exciting and fun branch of tech. Start designing your home automation solutions today with the help of this **[ebook][2]**, and then share your innovation with others so everyone can benefit. + +That's just what open source is really all about: taking care of each other. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/home-automation-ebook + +作者:[Alan Smithee][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/downloads/home-automation-ebook From 50d29284bb94e60c1611a3ff876ce20f0f62a835 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 11 Jun 2021 05:04:10 +0800 Subject: [PATCH 042/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210610=20?= =?UTF-8?q?Install=20and=20remove=20software=20packages=20on=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210610 Install and remove software packages on FreeDOS.md --- ...and remove software packages on FreeDOS.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20210610 Install and remove software packages on FreeDOS.md diff --git a/sources/tech/20210610 Install and remove software packages on FreeDOS.md b/sources/tech/20210610 Install and remove software packages on FreeDOS.md new file mode 100644 index 0000000000..075308fb72 --- /dev/null +++ b/sources/tech/20210610 Install and remove software packages on FreeDOS.md @@ -0,0 +1,113 @@ +[#]: subject: (Install and remove software packages on FreeDOS) +[#]: via: (https://opensource.com/article/21/6/freedos-package-manager) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Install and remove software packages on FreeDOS +====== +Get familiar with FDIMPLES, the FreeDOS package manager. +![Package wrapped with brown paper and red bow][1] + +On Linux, you may have used a _package manager_ to install or remove packages. For example, the default package manager on Debian Linux is the `deb` command, and the default package manager on Fedora Linux is the `dnf` command. But did you know that FreeDOS has a package manager, too? + +### Installing packages + +The FreeDOS 1.3 RC4 distribution includes lots of great programs and applications you can use. However, we don't install all of them by default—we don't want to fill your hard drive space unnecessarily, especially on older systems that may have hard drive capacities of only a few hundred megabytes. And if you selected the "Plain DOS system" option when you installed FreeDOS, you will find your FreeDOS system is quite small (about 20 megabytes). + +However, it's easy to install new packages. From the command line, run the `FDIMPLES` program. Because DOS is _case insensitive_, you can type this command using uppercase or lowercase letters: `fdimples` is the same as `FDIMPLES` or `FDImples`. + +![fdimples][2] + +The FDIMPLES package manager on FreeDOS 1.3 RC4 (running in QEMU) +(Jim Hall, [CC-BY SA 4.0][3]) + +FDIMPLES is an acronym for "**F**ree**D**OS **I**nstaller - **M**y **P**ackage **L**ist **E**ditor **S**oftware," and is an interactive package manager. FDIMPLES reads the installation media to identify packages that it can install or remove. If you see a different menu that says "Installed" but does not let you install other software, check that the FreeDOS install CD-ROM is loaded on your system. On a physical machine, you'll need to insert the CD-ROM into the CD-ROM drive; on a virtual machine like QEMU or VirtualBox, you'll need to associate the install CD-ROM image with the virtal machine. + +![fdimples installed][4] + +If you only see an "Installed" message, check that the CD-ROM is loaded +(Jim Hall, [CC-BY SA 4.0][3]) + +Let's say you wanted to install software that lets you play music and other sound files. Use the Up and Down arrow keys to navigate to the **Sound Tools** entry in the menu. This is called a _package group_ for the sound and music programs. + +![fdimples sound][5] + +Highlighting the Sound package group in FDIMPLES +(Jim Hall, [CC-BY SA 4.0][3]) + +To select all of the packages in this group, press the spacebar on your keyboard. Should you decide to install individual packages in this group, press the Tab key to move into the _package list_ pane, then select each package with the spacebar. + +![fdimples sound select][6] + +Select all the packages in a group by pressing the spacebar +(Jim Hall, [CC-BY SA 4.0][3]) + +You can continue to select other packages or package groups that you want to install. When you have selected everything, use the Tab key to highlight the **OK** button, and press the spacebar. + +![fdimples sound select ok][7] + +Highlight the "Ok" button when you're ready to install +(Jim Hall, [CC-BY SA 4.0][3]) + +FDIMPLES then installs all of the packages you selected. This may only take a few moments if you selected only a couple of small packages, or it could take minutes if you asked to install many larger packages. As it installs each package, FDIMPLES prints the status. Afterward, FDIMPLES exits to the command line, so you can get back to work. + +![fdimples sound install done][8] + +FDIMPLES shows the progress as its installs packages, and automatically exits when done +(Jim Hall, [CC-BY SA 4.0][3]) + +### Removing packages + +What if you install a package, only to discover afterward that you don't want it? Removing packages is just as easy in FDIMPLES. + +Just as when installing packages, start FDIMPLES, and use the arrow keys to navigate to the group that contains the packages you want to remove. For example, if I wanted to uninstall a few of the music-player packages I installed earlier, I would navigate to the **Sound Tools** package group. + +![fdimples sound select][9] + +Navigate to the group with the packages you want to remove +(Jim Hall, [CC-BY SA 4.0][3]) + +To remove the entire package group at once, you can press the spacebar on the group you want to remove to unselect it. But let's say I only wanted to remove a few packages that I didn't need, like the **CDP** audio CD player. (I don't have any physical music CDs.) To remove CDP, hit the Tab key to move into the package list pane, then use the spacebar to unselect the CDP package. This removes the **X** on that package. + +![fdimples unselect cdp][10] + +Unselect a package to remove it +(Jim Hall, [CC-BY SA 4.0][3]) + +You can continue to unselect other packages or package groups that you want to remove. When you have selected everything, use the Tab key to highlight the **OK** button, and press the spacebar. FDIMPLES will remove the packages you unselected, then automatically returns you to the command line. + +![fdimples cdp removed][11] + +FDIMPLES removes the package, then returns to the command line +(Jim Hall, [CC-BY SA 4.0][3]) + +We include many packages in FreeDOS, across a variety of package groups. Use FDIMPLES to install the software you need. Feel free to experiment! If you decide you don't want to keep a package, you can remove it and free up your disk space for other things. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-package-manager + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brown-package-red-bow.jpg?itok=oxZYQzH- (Package wrapped with brown paper and red bow) +[2]: https://opensource.com/sites/default/files/uploads/fdimples.png (The FDIMPLES package manager on FreeDOS 1.3 RC4 (running in QEMU)) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/fdimples-installed.png (If you only see an "Installed" message, check that the CD-ROM is loaded) +[5]: https://opensource.com/sites/default/files/uploads/fdimples-sound.png (Highlighting the Sound package group in FDIMPLES) +[6]: https://opensource.com/sites/default/files/uploads/fdimples-sound-select.png (Select all the packages in a group by pressing the spacebar) +[7]: https://opensource.com/sites/default/files/uploads/fdimples-sound-select-ok.png (Highlight the "Ok" button when you're ready to install) +[8]: https://opensource.com/sites/default/files/uploads/fdimples-sound-select-ok-install4.png (FDIMPLES shows the progress as its installs packages, and automatically exits when done) +[9]: https://opensource.com/sites/default/files/uploads/fdimples-sound-select_0.png (Navigate to the group with the packages you want to remove) +[10]: https://opensource.com/sites/default/files/uploads/fdimples-unselect-cdp.png (Unselect a package to remove it) +[11]: https://opensource.com/sites/default/files/uploads/fdimples-unselect-cdp-removed.png (FDIMPLES removes the package, then returns to the command line) From 99dbf2f5efe8e2b1fb9f4b6731a52f811acf0968 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 11 Jun 2021 05:04:42 +0800 Subject: [PATCH 043/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210610=20?= =?UTF-8?q?Vivaldi=204.0=20Looks=20Like=20an=20All-in-One=20Browser=20for?= =?UTF-8?q?=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md --- ...ks Like an All-in-One Browser for Linux.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md diff --git a/sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md b/sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md new file mode 100644 index 0000000000..50d653af38 --- /dev/null +++ b/sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md @@ -0,0 +1,115 @@ +[#]: subject: (Vivaldi 4.0 Looks Like an All-in-One Browser for Linux) +[#]: via: (https://news.itsfoss.com/vivaldi-4-0-release/) +[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Vivaldi 4.0 Looks Like an All-in-One Browser for Linux +====== + +Vivaldi 4.0 is the latest version that introduces new functionalities for multitaskers and users who rely on web browsers for everything. + +It is worth noting that only the UI layer of Vivaldi is closed-source, more than 93% of its source code is open-source. Even though it is not completely FOSS, many users use it because of its anti-tracking policy, appealing interface, and active Linux support. + +In case you did not know, recently [Vivaldi made significant performance improvements][1] taking Linux (Ubuntu) into account for testing. So, it looks like they keep Linux users in mind, which is a good thing. + +If you thought [Firefox 89][2] release was exciting, Vivaldi is particularly interesting for its new additions. + +### Vivaldi 4.0: What’s New? + +The latest major release focuses to prove itself as a better alternative to popular web browsers like Google Chrome, and Microsoft Edge. + +#### Vivaldi Translate + +![][3] + +Powered by [Lingvanex][4], Vivaldi Translate delivers a concise translation for your text, removing the need to install a plugin or using a separate translator tool and providing a secure translation too. + +Have you ever had to access a website in a language you do not understand? If yes, then you know how painful it is to copy-paste the text into a translator to understand what the page is saying. + +But now that you have an integrated tool with Vivaldi that facilitates your browsing experience without compromising your privacy. You can access the translation feature using the icon in the address bar whenever you load a website with a different language. + +#### Vivaldi Mail (Beta) + +![][5] + +Using a browser is a good way of exchanging information, including emails. When you have multiple emails for different purposes, it can get quickly overwhelming managing them. + +Mail makes it easier by assembling your diverse emails into a single place in the web browser. Due to its support for IMAP and POP3, you can integrate most email providers. + +So, you do not have to install a 3rd party webmail client to keep things convenient to access. + +#### Vivaldi Feed Reader (Beta) + +![][6] + +RSS is the go-to online reading for many users. + +While we have [RSS readers for Linux][7] already. You can access Vivaldi Feed Reader right from Mail; thus, allowing you to filter feeds and apply certain properties on them. + +You can add articles, YouTube videos, podcasts, and more to the feed. When you load up a site for anything, a feed icon comes up in the right-side of the address bar. All you have to do is click on it to add things to your feed, it is that easy. + +#### Vivaldi Calendar (Beta) + +Vivaldi Calendar does all that you expect from a full-fledged calendar app without the trade-off of your privacy. And this is an extremely useful addition to Vivaldi. + +Accessing what you plan without launching a separate service or app and having the ability to quickly access it in your browser should save a lot of time. + +#### Other Changes + +While Vivaldi offers a lot of features, it also makes it easy to choose the experience you want right after you launch the browser + +There are three layouts you can select: + +![][3] + + * **Essentials**: Only Ad blocker and translations available. + * **Classic**: Everything in essentials, plus side panels and status bar. + * **Fully Loaded:** All the features offered ready for access in your layout including the Calendar, Mail, and Feed Reader. + + + +For more information on how it all works and details of the latest release, you may want to go through the [announcement post][8]. + +### Summing Up + +Vivaldi is a cross-platform web browser that does not neglect Linux users. With the latest Vivaldi 4.0 release, the browser offers an exciting experience with an arsenal of features that major web browsers do not offer. + +You can download the latest update from the official website (DEB/RPM files available). You can also choose to manually add the repositories for your distribution using the [official instructions][9]. + +[Download Vivaldi 4.0][10] + +_What do you think about using Vivaldi on Linux after this major upgrade?_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/vivaldi-4-0-release/ + +作者:[Omar Maarof][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/omar/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/vivaldi-browser-3-7-release/ +[2]: https://news.itsfoss.com/firefox-89-release/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://lingvanex.com +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUwNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEzMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://itsfoss.com/feed-reader-apps-linux/ +[8]: https://vivaldi.com/blog/vivaldi-4-0/ +[9]: https://help.vivaldi.com/desktop/install-update/manual-setup-vivaldi-linux-repositories/ +[10]: https://vivaldi.com/download/ From 66e2eeb206969257a8d549e5e2e3890a24a0280b Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 11 Jun 2021 08:39:11 +0800 Subject: [PATCH 044/870] translated --- ...ss-Platform Open-Source Subtitle Editor.md | 111 ------------------ ...ss-Platform Open-Source Subtitle Editor.md | 101 ++++++++++++++++ 2 files changed, 101 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md create mode 100644 translated/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md diff --git a/sources/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md b/sources/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md deleted file mode 100644 index 88b16f4f71..0000000000 --- a/sources/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: subject: (Subtitld: A Cross-Platform Open-Source Subtitle Editor) -[#]: via: (https://itsfoss.com/subtitld/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Subtitld: A Cross-Platform Open-Source Subtitle Editor -====== - -Subtitles make the experience of watching a video seamless. You do not need to necessarily understand the language of the video, the subtitle helps you figure out what’s happening with a text version of the audio in your preferred language. - -You get subtitles for most of the content in streaming platforms you might have to add subtitles for some videos that you have in your local collection. - -While you can do that by simply downloading SRT files and loading it up using the video player, how do you edit it, remove it, or transcribe a video? Subtitld is an open-source subtitle editor that comes to the rescue. - -### Subtitld: Create, Remove, Slice, and Transcribe Subtitles - -Subtitld is a free and open-source project that lets you make the most out of your subtitles. - -![][1] - -If you do not have a subtitle, create one, if you need to edit it, go ahead. With this open-source tool, you get many options to work with the subtitles. - -In other words, it is a full-fledged subtitle editor and one of its kind (as far as I’ve come across). - -Let me highlight some key features before you decide to try it. - -### Features of Subtitld - -![][2] - -It offers a great deal of functions, while not everyone needs all of them, but if you are someone who regularly creates, edits, and works with subtitles, it should come in pretty handy. - -Here’s a list of them: - - * Create subtitles - * Edit subtitles - * Move subtitles using a timeline to sync manually - * Zoom in/out function to help with a crowded timeline - * Supports saving to SRT file format - * Supports various other formats to import and export (SSA, TTML, SBV, DFXP, VTT, XML, SCC and SAMI) - * Easy to resize or adjust the duration of a subtitle from the timeline - * Merge with other subtitles or just slice a subtitle in a project - * Ability to enable grids to visualize by frames, scenes, or seconds - * Playback in the editor to check how the subtitles work - * Snap the subtitles in the timeline to avoid overlapping - * Add/remove among the subtitles - * Enable safety margins to ensure that the subtitles do not look improper - * Adjust the playback speed - * Keyboard shortcuts available - * Auto-transcribe - * Export videos with subtitles burned in - * Unlimited undo - - - -In addition to these features, the visual clues for the audio waveform also help in a way. - -![][3] - -Overall, you can do many things and use it professionally as well, if you are someone who transcribes videos and want to edit the video in one go. - -**Recommended Read:** - -![][4] - -#### [App Highlight: Penguin Subtitle Player for Adding Subtitles to Online Videos][5] - -With the free and open source application, Penguin subtitle player, you can add subtitles to any online videos. Learn more about this nifty app. - -### Installing Subtitld in Linux - -While it is also available for Windows, you can easily install it on Linux using the [snap package][6]. You will not find any binary packages or Flatpak available, but you should be able to install it on any Linux distribution [using snap on Linux][7]. - -[Subtitld][8] - -You can find the source code on [GitLab][9] if you want to explore. - -### Closing Thoughts - -With fine-grained settings available to sync or add subtitles for a video, I just tested a few basic functions to import, export, add or remove subtitles. - -The auto-transcribe feature is still something in beta (as of publishing this), but the user interface could use some improvements. For instance, when I hover over the buttons inside the editor, it does not tell me what it does. - -Overall, it is a useful tool to have available on Linux. What do you think about it? Please don’t hesitate to let me know your thoughts in the comments down below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/subtitld/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/subtitld-editor.png?resize=800%2C546&ssl=1 -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/subtitld-export.png?resize=800%2C469&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/subtitld-screenshot-1.png?resize=800%2C588&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/Add_subtitle_online_videos.png?fit=800%2C450&ssl=1 -[5]: https://itsfoss.com/penguin-subtitle-player/ -[6]: https://snapcraft.io/subtitld -[7]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ -[8]: https://subtitld.jonata.org -[9]: https://gitlab.com/jonata/subtitld diff --git a/translated/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md b/translated/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md new file mode 100644 index 0000000000..ef4ce7a8fb --- /dev/null +++ b/translated/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md @@ -0,0 +1,101 @@ +[#]: subject: (Subtitld: A Cross-Platform Open-Source Subtitle Editor) +[#]: via: (https://itsfoss.com/subtitld/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Subtitld: 一个跨平台的开源字幕编辑器 +====== + +字幕使观看视频的体验更加完美。你不需要一定理解视频的语言,字幕可以帮助你用你喜欢的文字来弄清楚正在发生什么。 + +你在流媒体平台上获得了大部分内容的字幕,你可能需要为一些你在本地收藏的视频添加字幕。 + +虽然你可以通过简单地下载 SRT 文件并使用视频播放器加载它来做到这一点,但你如何编辑它,删除它,或转录一个视频?Subtitld 是一个开源的字幕编辑器,它可以帮助你。 + +### Subtitld: 创建、删除、切分和转录字幕 + +Subtitld 是一个免费的开源项目,让你充分利用你的字幕。 + +![][1] + +如果你没有字幕,就创建一个,如果你需要编辑它,就去吧。有了这个开源工具,你会有许多选项来处理字幕。 + +换句话说,它是一个成熟的字幕编辑器,也是同类产品中的一个(就我所遇到的而言)。 + +在你决定试用它之前,让我强调一些关键功能。 + +### Subtitld 的特点 + +![][2] + +它提供了大量的功能,虽然不是每个人都需要所有的功能,但如果你是一个经常创建、编辑和处理字幕的人,它应该会很方便。 + +下面是它们的列表: + +* 创建字幕 +* 编辑字幕 +* 使用时间轴移动字幕,手动同步 +* 放大/缩小功能,帮助处理拥挤的时间线 +* 支持保存为SRT文件格式 +* 支持各种其他格式的导入和导出(SSA、TTML、SBV、DFXP、VTT、XML、SCC 和 SAMI) +* 易于调整大小或从时间轴上调整字幕的持续时间 +* 与其他字幕合并,或只是在项目中切分字幕 +* 能够启用网格,按帧、场景或秒进行可视化 +* 在编辑器中回放以检查字幕情况 +* 在时间轴上捕捉字幕以避免重叠 +* 在字幕中添加/删除 +* 启用安全间隙,以确保字幕不会看起来不妥当 +* 调整播放速度 +* 可用的键盘快捷键 +* 自动转录 +* 输出刻录了字幕的视频 +* 无限次撤消 + + + +除了这些功能外,音频波形的视觉线索也有一定的帮助。 + +![][3] + +总的来说,如果你是一个转录视频的人,想一次性地编辑视频,你可以做很多事情也可以专业地使用它, + +### 在 Linux 中安装 Subtitld + +虽然它也适用于 Windows,但你可以使用 [snap 包][6]轻松地在 Linux 上安装它。你不会发现有任何二进制包或 Flatpak 可用,但你应该能够在任何 Linux 发行版上[使用 snap][7] 安装它。 + +[Subtitld][8] + +如果你想探索,你可以在 [GitLab][9] 上找到源代码。 + +### 结尾的想法 + +它有视频同步或添加字幕的精细设置,我只是测试了一些导入、导出、添加或删除字幕的基本功能。 + +自动转录功能仍处于测试阶段(截至发布时),但用户界面可以有一些改进。例如,当我把鼠标悬停在编辑器内的按钮上时,它没有告诉我它是做什么的。 + +总的来说,它是一个在 Linux 上的有用工具。你对它有什么看法?请不要犹豫,在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/subtitld/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/subtitld-editor.png?resize=800%2C546&ssl=1 +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/subtitld-export.png?resize=800%2C469&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/subtitld-screenshot-1.png?resize=800%2C588&ssl=1 +[6]: https://snapcraft.io/subtitld +[7]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[8]: https://subtitld.jonata.org +[9]: https://gitlab.com/jonata/subtitld \ No newline at end of file From f82616ee7f2c6423b0ad54e5b9b84e53fddd8a70 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 11 Jun 2021 08:42:47 +0800 Subject: [PATCH 045/870] translating --- sources/tech/20210608 How FreeDOS boots.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210608 How FreeDOS boots.md b/sources/tech/20210608 How FreeDOS boots.md index ce9d4cd66c..e513d80d0b 100644 --- a/sources/tech/20210608 How FreeDOS boots.md +++ b/sources/tech/20210608 How FreeDOS boots.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/freedos-boots) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6a20a431d0cb6a46c24cee014d0b2e7b9a5f0605 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 11 Jun 2021 09:02:19 +0800 Subject: [PATCH 046/870] Rename sources/tech/20210610 Why choose open source for your home automation project.md to sources/talk/20210610 Why choose open source for your home automation project.md --- ...610 Why choose open source for your home automation project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210610 Why choose open source for your home automation project.md (100%) diff --git a/sources/tech/20210610 Why choose open source for your home automation project.md b/sources/talk/20210610 Why choose open source for your home automation project.md similarity index 100% rename from sources/tech/20210610 Why choose open source for your home automation project.md rename to sources/talk/20210610 Why choose open source for your home automation project.md From cd3129ab675e3f8acb11a0c5b49745b4e23f4557 Mon Sep 17 00:00:00 2001 From: Mo Date: Fri, 11 Jun 2021 07:42:10 +0000 Subject: [PATCH 047/870] [translated]How I monitor my greenhouse with CircuitPython and open source tools --- ...ith CircuitPython and open source tools.md | 287 ------------------ ...ith CircuitPython and open source tools.md | 280 +++++++++++++++++ 2 files changed, 280 insertions(+), 287 deletions(-) delete mode 100644 sources/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md create mode 100644 translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md diff --git a/sources/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md b/sources/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md deleted file mode 100644 index b493c6a2cf..0000000000 --- a/sources/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md +++ /dev/null @@ -1,287 +0,0 @@ -[#]: subject: (How I monitor my greenhouse with CircuitPython and open source tools) -[#]: via: (https://opensource.com/article/21/5/monitor-greenhouse-open-source) -[#]: author: (Darin London https://opensource.com/users/dmlond) -[#]: collector: (lujun9972) -[#]: translator: (alim0x) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How I monitor my greenhouse with CircuitPython and open source tools -====== -Keep track of your greenhouse's temperature, humidity, and ambient light -using a microcontroller, sensors, Python, and MQTT. -![Greenhouse garden with tomatoes][1] - -CircuitPython provides a revolutionary way to interact with microcontroller boards. This article explains how to use CircuitPython to measure a greenhouse's temperature, humidity, and ambient light and publish the results to an [MQTT][2] broker using a CircuitPython MQTT client. You can subscribe any number of programs to the MQTT queues to process the information further. - -This project uses a simple Python program that runs a web server that publishes a Prometheus-formatted scrape endpoint and pulls these metrics into [Prometheus][3] for ongoing monitoring. - -### About CircuitPython - -[CircuitPython][4] is an open source Python distribution created by [Adafruit][5] to run on low-cost microcontroller boards. CircuitPython provides a simple development experience for interacting with [compatible boards][6]. You can start a program on the board by creating a `code.py` file in the `CIRCUITPYTHON` root drive that mounts when you connect your board. CircuitPython also provides a serial connection from your board that includes an interactive read-evaluate-print loop (REPL) session that you can use to interact with your board in real time using Python code. - -Adafruit's website offers extensive documentation to help you get started with CircuitPython. First, consult the [Welcome to CircuitPython][7] guide. This will get you started running code on your microcontroller with CircuitPython and interacting with the REPL. It also documents how to install Adafruit's bundle of CircuitPython libraries and examples for many of the boards and sensors it sells. Next, read the [CircuitPython Essentials][8] guide to learn more about its capabilities and link to information about using CircuitPython with specific, compatible boards. Finally, as with all open source software, you can dig into [CircuitPython's code][9], post issues, and contribute. - -### Microcontroller setup - -The microcontroller system is very simple. To follow along with this demo, you will need: - - * **Raspberry Pi 4:** You need a computer to program the microcontroller system, and this is what I used.  - * **A CircuitPython-compatible microcontroller:** I used the [Adafruit FeatherS2][10] with built-in WiFi, ambient light sensor, and Qwiic cable input. - * **Microcontroller WiFi:** The FeatherS2 has a built-in WiFi radio. If your microcontroller does not, you will need to find a WiFi expansion board for it. - * **Sensors:** The Feather S2 has a built-in ambient light sensor, so I needed to get a temperature and humidity sensor. A variety is available from vendors, including Adafruit, SparkFun, and Amazon. I used an [Adafruit sensor][11] with a Qwiic cable connection compatible with the Feather S2 input. You may have to find CircuitPython-compatible Python libraries for sensors not purchased from Adafruit, although many SparkFun sensors work with Adafruit libraries. - * **Jumpers and cables:** To avoid using a breadboard or soldering, I used an [Adafruit Qwiic cable][12]. SparkFun also sells them in a [bundle of cables][13] of different lengths. - - - -Before plugging the microcontroller into your computer, connect the sensors to the microcontroller. - -![Connecting sensors to microcontroller][14] - -(Darin London, [CC BY-SA 4.0][15]) - -Now you can plug the microcontroller into your computer using a USB data cable. - -### The MQTT Broker - -You can use [these instructions][16] to install the [Mosquitto MQTT broker][17] and Mosquitto clients on a Raspberry Pi 4 running Raspberry Pi OS. If you want to use the Raspberry Pi as a long-term server, set a static IP address for the Raspberry Pi 4 on your network. Once the Mosquitto broker is running, create a [user/password file][18] that sets the authentication parameters for clients to use when publishing and subscribing to the broker. - -You can test the MQTT broker using the Mosquitto clients on the Raspberry Pi. Open two terminals (or SSH sessions if you are running headless): - -On Terminal 1, enter: - - -``` -`mosquitto_sub -h localhost -u $user -P $pass -t "mqtt/test"` -``` - -This will start a long-running process that listens for messages published to the `mqtt/test` queue. - -On Terminal 2, enter: - - -``` -`mosquitto_pub -h localhost -u $user -P $pass -t "mqtt/test" -m hello` -``` - -This will publish a message to the `mqtt/test` queue, which should show up in Terminal 1's output. - -You can then kill the `sub` command running on Terminal 1. - -The Mosquitto broker allows clients to publish messages to any queue, even if it has no subscribers. These messages will be lost forever, but they will not stop the client from publishing. - -Start a third terminal and subscribe to the following queues (the queues your microcontroller will publish messages to): - - * greenhouse/temperature - * greenhouse/light - * greenhouse/humidity - - - -### Code the microcontroller - -You are now ready to code your microcontroller to publish its metrics to the MQTT broker running on your Raspberry Pi 4. - -Adafruit has [excellent documentation][19] on using the [CircuitPython Library Bundle][20]'s libraries to connect your microcontroller to your WiFi router and get it publishing metrics to your MQTT broker. - -Install the following libraries, which the greenhouse monitor will use, into the `CIRCUITPYTHON/lib` directory. These are all available in the Adafruit CircuitPython Library Bundle: - - * **adafruit_bus_device:** A Python package directory with multiple .mpy files (.mpy is a compressed Python file that saves space on your microcontroller) - * **adafruit_requests:** A single .mpy file - * **adafruit_register:** Another package directory - * **adafruit_minimqtt:** Another package directory - * **adafruit_si7021:** A single .mpy file that works with the temperature and humidity sensors - - - -Once these libraries are installed, write the following into `code.py` in the `CIRCUITPYTHON` directory: - - -``` -import time -import ssl -import socketpool -import wifi -import adafruit_minimqtt.adafruit_minimqtt as MQTT -import board -from digitalio import DigitalInOut, Direction, Pull -from analogio import AnalogIn -import adafruit_si7021 -  -# Add a secrets.py to your filesystem that has a dictionary called secrets with "ssid" and -# "password" keys with your WiFi credentials. DO NOT share that file or commit it into Git or other -# source control. -# pylint: disable=no-name-in-module,wrong-import-order -try: -        from secrets import secrets -except ImportError: -        print("WiFi secrets are kept in secrets.py, please add them there!") -        raise -  -print("Connecting to %s" % secrets["ssid"]) -wifi.radio.connect(secrets["ssid"], secrets["password"]) -print("Connected to %s!" % secrets["ssid"]) -### Feeds ### -light_feed = "greenhouse/light" -temp_feed = "greenhouse/temperature" -humidity_feed = "greenhouse/humidity" -  -# Define callback methods which are called when events occur -# pylint: disable=unused-argument, redefined-outer-name -def connected(client, userdata, flags, rc): -        # This function will be called when the client is connected -        # successfully to the broker. -        print("Connected to MQTT!") -  -def disconnected(client, userdata, rc): -        # This method is called when the client is disconnected -        print("Disconnected from MQTT!") -  -  -def get_voltage(pin): -        return (pin.value * 3.3) / 65536 -  -# Create a socket pool -pool = socketpool.SocketPool(wifi.radio) -  -# Set up a MiniMQTT Client -mqtt_client = MQTT.MQTT( -        broker=secrets["broker"], -        port=secrets["port"], -        username=secrets["aio_username"], -        password=secrets["aio_key"], -        socket_pool=pool, -        ssl_context=ssl.create_default_context(), -) -  -# Setup the callback methods above -mqtt_client.on_connect = connected -mqtt_client.on_disconnect = disconnected -  -# Connect the client to the MQTT broker. -print("Connecting to MQTT...") -mqtt_client.connect() -  -# Create library object using our Bus I2C port -sensor = adafruit_si7021.SI7021(board.I2C()) -light_pin = AnalogIn(board.IO4) -  -while True: -        # Poll the message queue -        mqtt_client.loop() -  -        # get the current temperature -        light_val = get_voltage(light_pin) -        temp_val = ((sensor.temperature * 9)/5) + 32 -        humidity_val = sensor.relative_humidity -  -        # Send a new messages -        mqtt_client.publish(light_feed, light_val) -        mqtt_client.publish(temp_feed, temp_val) -        mqtt_client.publish(humidity_feed, humidity_val) -        time.sleep(0.5) -``` - -Save your code. Then attach to the serial monitor and watch it connect to your MQTT broker. You can also see the output by switching to the terminals on your Raspberry Pi 4 subscribed to the queues where this publishes. - -### Process the metrics - -Publish/subscribe workflows like MQTT offer many advantages for microcontroller systems. You can have multiple microcontroller + sensor installations reporting different metrics about the same system or reporting many readings of the same metric in parallel. You can also have many different processes that subscribe to each queue to respond to these messages in parallel. It is even possible to have multiple different processes subscribed to the same queue for different actions, such as sending an email when a value gets too high or publishing a message to another MQTT queue. - -Another option is to have a microcontroller subscribe to an external queue that sends signals to tell the microcontroller to perform an action, such as turning off or starting a new session. Finally, pub/sub workflows can be better for low-power microcontroller installations (such as those using battery or solar power) because these devices can send metrics in batches separated by long delays and turn off the power-hungry WiFi radio during the intervals between reports. - -To process these metrics, I created a Python client that uses the [Paho Python MQTT client][21] to subscribe to the metrics queues. I also use the official [Prometheus Python client][22] to create a web server that produces a Prometheus-compliant scrape endpoint with these metrics as gauges. I run this, a [Prometheus server][23], and the Mosquitto MQTT broker on the same Raspberry Pi 4. - - -``` -from prometheus_client import start_http_server, Gauge -import random -import time -import paho.mqtt.client as mqtt - -gauge = { -  "greenhouse/light": Gauge('light','light in lumens'), -  "greenhouse/temperature": Gauge('temperature', 'temperature in fahrenheit'), -  "greenhouse/humidity": Gauge('humidity','relative % humidity') -} - -try: -        from mqtt_secrets import mqtt_secrets -except ImportError: -        print("WiFi secrets are kept in secrets.py, please add them there!") -        raise - -def on_connect(client, userdata, flags, rc): -        print("Connected with result code "+str(rc)) -        # Subscribing in on_connect() means that if we lose the connection and -        # reconnect then subscriptions will be renewed. -        client.subscribe("greenhouse/light") -        client.subscribe('greenhouse/temperature') -        client.subscribe('greenhouse/humidity') - -def on_message(client, userdata, msg): -        topic = msg.topic -        payload = msg.payload -        gauge[topic].set(payload) - -client = mqtt.Client() -client.username_pw_set(mqtt_secrets["mqtt_user"],mqtt_secrets['mqtt_password']) -client.on_connect = on_connect -client.on_message = on_message -client.connect('localhost',1883,60) - -if __name__ == '__main__': -        # Start up the server to expose the metrics. - -        client = mqtt.Client() -        client.username_pw_set('london','abc123') -        client.on_connect = on_connect -        client.on_message = on_message -        client.connect('localhost',1883,60) - -        start_http_server(8000) -        client.loop_forever() -``` - -Then I configure the Prometheus server to scrape that endpoint on localhost:8000. - -You can access all the code for this project in my MIT-licensed [Greenhouse MQTT Microcontroller][24] repository on GitHub. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/monitor-greenhouse-open-source - -作者:[Darin London][a] -选题:[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/dmlond -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/zanda-photography-unsplash-greenhouse.jpg?itok=ZMnZyNMM (Greenhouse garden with tomatoes) -[2]: https://mqtt.org/ -[3]: https://prometheus.io/ -[4]: https://circuitpython.io/ -[5]: https://adafruit.com -[6]: https://circuitpython.org/downloads -[7]: https://learn.adafruit.com/welcome-to-circuitpython -[8]: https://learn.adafruit.com/circuitpython-essentials/circuitpython-essentials -[9]: https://github.com/adafruit/circuitpython -[10]: https://www.adafruit.com/product/4769 -[11]: https://www.adafruit.com/product/3251 -[12]: https://www.adafruit.com/product/4399 -[13]: https://www.sparkfun.com/products/15081 -[14]: https://opensource.com/sites/default/files/uploads/connectsensors-microcontroller.jpg (Connecting sensors to microcontroller) -[15]: https://creativecommons.org/licenses/by-sa/4.0/ -[16]: https://pimylifeup.com/raspberry-pi-mosquitto-mqtt-server/ -[17]: https://mosquitto.org/ -[18]: https://mosquitto.org/documentation/authentication-methods/ -[19]: https://learn.adafruit.com/mqtt-in-circuitpython -[20]: https://circuitpython.org/libraries -[21]: https://pypi.org/project/paho-mqtt/ -[22]: https://pypi.org/project/prometheus-client -[23]: https://opensource.com/article/21/3/iot-measure-raspberry-pi -[24]: https://github.com/dmlond/greenhouse_mqtt_microcontroller diff --git a/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md b/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md new file mode 100644 index 0000000000..c5447e39b9 --- /dev/null +++ b/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md @@ -0,0 +1,280 @@ +[#]: subject: (How I monitor my greenhouse with CircuitPython and open source tools) +[#]: via: (https://opensource.com/article/21/5/monitor-greenhouse-open-source) +[#]: author: (Darin London https://opensource.com/users/dmlond) +[#]: collector: (lujun9972) +[#]: translator: (alim0x) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +我如何用 CircuitPython 和开源工具监控温室 +====== +使用微控制器、传感器、Python 以及 MQTT 持续追踪温室的温度、湿度以及环境光。 +![种有西红柿的温室花园][1] + +CircuitPython 提供了一种革命性的方式来和微控制器板进行交互。这篇文章介绍了如何使用 CircuitPython 来监测温室的温度、湿度以及环境光,并且使用 CircuitPython MQTT 客户端将结果发布到一个 [MQTT][2] broker。你可以在若干个程序中订阅 MQTT 队列并进一步处理信息。 + +这个项目使用一个简单的 Python 程序来运行 web 服务器,它发布一个 Prometheus 格式的采集端点,拉取监控指标到 [Prometheus][3] 进行不间断的监控。 + +### 关于 CircuitPython + +[CircuitPython][4] 是一个由 [Adafruit][5] 创建的开源 Python 发行版,用于在低成本微控制器开发板上运行。CircuitPython 在与[兼容的开发板][6]的交互上,提供了一个简单的开发体验。你可以在连接你的开发板时挂载的 `CIRCUITPYTHON` 根驱动器上创建一个 `code.py` 文件来开始你的程序。CircuitPython 还为开发板提供了一个串行连接,包含一个交互式解释器(REPL)会话,你可以使用 Python 代码实时和开发板进行交互。 + +Adafruit 的网站提供了更广泛的文档来帮助你开始使用 CircuitPython。首先,考虑看下这份指南:[欢迎来到 CircuitPython][7]。这份指南能够帮助你开始使用 CircuitPython 在开发板上运行代码以及和 REPL 交互。它还记录了如何安装 Adafruit 的 CircuitPython 库文件包,以及出售的开发板和传感器的一些示例。接下来,阅读 [CircuitPython 基础][8]来学习更多关于它的能力的信息,里面还有链接指向在特定及兼容的开发板上使用 CircuitPython 的相关信息。最后,就如所有开源软件一样,你可以深入 [CircuitPython 的源码][9],发布 issue,以及做出贡献。 + +### 微控制器设置 + +微控制器系统非常简单。要完成这个示例项目,你会需要: + + * **Raspberry Pi 4:**你需要一台电脑来给微控制器系统编程,我用的是树莓派 4。 + * **CircuitPython 兼容的微控制器:**我用的是 [Adafruit FeatherS2][10],带有内置,环境光传感器,Qwiic 线缆输入。 + * **微控制器 WiFi:**FeatherS2 内置了 WiFi。如果你的微控制器没有,你需要给开发板找个 WiFi 扩展板。 + * **传感器:**Feather S2 有个内置的环境光传感器,所以我还需要一个温湿度传感器。有很多不同厂商的产品可以选择,包括 Adafruit、SparkFun、亚马逊。我用的是一个 [Adafruit 传感器][11],带有 Feather S2 输入兼容的 Qwiic 线缆。尽管多数 SparkFun 传感器可以在 Adafruit 库下工作,但如果你不是从 Adafruit 购买的传感器,你可能还是需要自己去找到它兼容 CircuitPython 的 Python 库。 + * **跳线和线缆:**为了避免使用面包板或焊接,我使用 [Adafruit Qwiic 线缆][12]。SparkFun 销售的包含不同长度的[线缆套装][13]中也有它。 + + + +在将微控制器连接到你的电脑之前,将传感器连接到微控制器上。 + +![将传感器连接到微控制器上][14] + +(Darin London, [CC BY-SA 4.0][15]) + +现在你可以将微控制器用 USB 数据线连接到你的电脑。 + +### MQTT Broker + +你可以使用[这份说明][16]来在树莓派的系统上安装 [Mosquitto MQTT broker][17] 和 Mosquitto 客户端。如果你想把树莓派做为长期服务器使用,在你的网络上给树莓派 4 设置一个静态 IP 地址。Mosquitto broker 运行起来之后,创建一份[用户名/密码文件][18],设置客户端向 broker 发布和订阅消息时用的认证信息。 + +你可以用树莓派上的 Mosquitto 客户端来测试 MQTT broker。打开两个终端(如果你是无界面运行的话打开两个 SSH 会话): + +在终端一输入: + +``` +`mosquitto_sub -h localhost -u $user -P $pass -t "mqtt/test"` +``` + +这条命令会启动一个持续运行的进程,监听发布到 `mqtt/test` 队列的消息。 + +在终端二输入: + +``` +`mosquitto_pub -h localhost -u $user -P $pass -t "mqtt/test" -m hello` +``` + +这条命令会向 `mqtt/test` 队列发布一条消息,它应该会显示在终端一的输出里。 + +现在你可以中止终端一运行的 `sub` 命令了。 + +Mosquitto broker 允许客户端发布消息到任何队列,甚至没有任何订阅的队列也可以。这些消息会永久丢失,但这不会阻止客户端继续发布消息。 + +打开第三个终端,订阅下列队列(你的控制器会发布消息到这些队列上): + + * greenhouse/temperature + * greenhouse/light + * greenhouse/humidity + + +### 给微控制器编码 + +现在你已经准备好给微控制器编码,发布它的监测指标到树莓派 4 上运行的 MQTT broker 上了。 + +Adafruit 有[出色的文档][19],指导你使用 [CircuitPython Library Bundle][20] 的库来将你的微控制器连接到 WiFi 路由器,并发布监测指标到 MQTT broker 上。 + +安装下列库到 `CIRCUITPYTHON/lib` 目录,温室监控会用到它们。这些库在 Adafruit 的 CircuitPython Library Bundle 中都有提供: + + * **adafruit_bus_device:**一个带有多个 .mpy 文件的 Python 包文件夹(.mpy 是经过压缩的 Python 文件,用以节省空间) + * **adafruit_requests:**单个 .mpy 文件 + * **adafruit_register:**一个包文件夹 + * **adafruit_minimqtt:**一个包文件夹 + * **adafruit_si7021:**单个 .mpy 文件,用来支持温湿度传感器 + +库装好了之后,将以下代码写入 `CIRCUITPYTHON` 文件夹的 `code.py` 文件中: + + +``` +import time +import ssl +import socketpool +import wifi +import adafruit_minimqtt.adafruit_minimqtt as MQTT +import board +from digitalio import DigitalInOut, Direction, Pull +from analogio import AnalogIn +import adafruit_si7021 +  +# Add a secrets.py to your filesystem that has a dictionary called secrets with "ssid" and +# "password" keys with your WiFi credentials. DO NOT share that file or commit it into Git or other +# source control. +# pylint: disable=no-name-in-module,wrong-import-order +try: +        from secrets import secrets +except ImportError: +        print("WiFi secrets are kept in secrets.py, please add them there!") +        raise +  +print("Connecting to %s" % secrets["ssid"]) +wifi.radio.connect(secrets["ssid"], secrets["password"]) +print("Connected to %s!" % secrets["ssid"]) +### Feeds ### +light_feed = "greenhouse/light" +temp_feed = "greenhouse/temperature" +humidity_feed = "greenhouse/humidity" +  +# Define callback methods which are called when events occur +# pylint: disable=unused-argument, redefined-outer-name +def connected(client, userdata, flags, rc): +        # This function will be called when the client is connected +        # successfully to the broker. +        print("Connected to MQTT!") +  +def disconnected(client, userdata, rc): +        # This method is called when the client is disconnected +        print("Disconnected from MQTT!") +  +  +def get_voltage(pin): +        return (pin.value * 3.3) / 65536 +  +# Create a socket pool +pool = socketpool.SocketPool(wifi.radio) +  +# Set up a MiniMQTT Client +mqtt_client = MQTT.MQTT( +        broker=secrets["broker"], +        port=secrets["port"], +        username=secrets["aio_username"], +        password=secrets["aio_key"], +        socket_pool=pool, +        ssl_context=ssl.create_default_context(), +) +  +# Setup the callback methods above +mqtt_client.on_connect = connected +mqtt_client.on_disconnect = disconnected +  +# Connect the client to the MQTT broker. +print("Connecting to MQTT...") +mqtt_client.connect() +  +# Create library object using our Bus I2C port +sensor = adafruit_si7021.SI7021(board.I2C()) +light_pin = AnalogIn(board.IO4) +  +while True: +        # Poll the message queue +        mqtt_client.loop() +  +        # get the current temperature +        light_val = get_voltage(light_pin) +        temp_val = ((sensor.temperature * 9)/5) + 32 +        humidity_val = sensor.relative_humidity +  +        # Send a new messages +        mqtt_client.publish(light_feed, light_val) +        mqtt_client.publish(temp_feed, temp_val) +        mqtt_client.publish(humidity_feed, humidity_val) +        time.sleep(0.5) +``` + +保存你的代码。然后连接到串行监视器,看程序连接到你的 MQTT broker。你还可以将树莓派 4 上的终端切换到订阅了它的发布队列的终端来查看输出。 + +### 处理监测指标 + +像 MQTT 的发布/订阅工作流给微控制器系统提供了诸多好处。你可以有多个微控制器+传感器来回报同一个系统的不同指标或并行回报相同指标的若干读数。你还可以有多个不同进程订阅各个队列,并行地对这些消息进行回应。甚至还可以有多个进程订阅相同的队列,对消息做出不同的动作,比如数值过高时发送通知邮件或将消息发送到另一个 MQTT 队列上去。 + +另一个选项是让一个微控制器订阅一个外部队列,可以发送信号告诉微控制器做出动作,比如关闭或开始一个新会话。最后,发布/订阅工作流对低功耗微控制器系统更佳(比如那些使用电池或太阳能的系统),因为这些设备可以在更长的延迟周期后批量发布监测指标,并在回报的间隔期间关闭大量消耗电量的 WiFi 广播。 + +要处理这些监测指标,我创建了一个 Python 客户端,使用 [Paho Python MQTT 客户端][21]订阅监测指标队列。我还使用官方的 [Prometheus Python 客户端][22] 创建了一个 web 服务器,它产生一个符合 Prometheus 标准的采集端点,使用这些监测指标作为面板信息。[Prometheus 服务器][23]和 Mosquitto MQTT broker 我都是运行在同一个树莓派 4 上的。 + +``` +from prometheus_client import start_http_server, Gauge +import random +import time +import paho.mqtt.client as mqtt + +gauge = { +  "greenhouse/light": Gauge('light','light in lumens'), +  "greenhouse/temperature": Gauge('temperature', 'temperature in fahrenheit'), +  "greenhouse/humidity": Gauge('humidity','relative % humidity') +} + +try: +        from mqtt_secrets import mqtt_secrets +except ImportError: +        print("WiFi secrets are kept in secrets.py, please add them there!") +        raise + +def on_connect(client, userdata, flags, rc): +        print("Connected with result code "+str(rc)) +        # Subscribing in on_connect() means that if we lose the connection and +        # reconnect then subscriptions will be renewed. +        client.subscribe("greenhouse/light") +        client.subscribe('greenhouse/temperature') +        client.subscribe('greenhouse/humidity') + +def on_message(client, userdata, msg): +        topic = msg.topic +        payload = msg.payload +        gauge[topic].set(payload) + +client = mqtt.Client() +client.username_pw_set(mqtt_secrets["mqtt_user"],mqtt_secrets['mqtt_password']) +client.on_connect = on_connect +client.on_message = on_message +client.connect('localhost',1883,60) + +if __name__ == '__main__': +        # Start up the server to expose the metrics. + +        client = mqtt.Client() +        client.username_pw_set('london','abc123') +        client.on_connect = on_connect +        client.on_message = on_message +        client.connect('localhost',1883,60) + +        start_http_server(8000) +        client.loop_forever() +``` + +然后我配置 Prometheus 服务器采集端点数据到 localhost:8000。 + +你可以在 Github 上访问 [Greenhouse MQTT Microcontroller][24] 这个项目的代码,项目采用 MIT 许可证授权。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/monitor-greenhouse-open-source + +作者:[Darin London][a] +选题:[lujun9972][b] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dmlond +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/zanda-photography-unsplash-greenhouse.jpg?itok=ZMnZyNMM (Greenhouse garden with tomatoes) +[2]: https://mqtt.org/ +[3]: https://prometheus.io/ +[4]: https://circuitpython.io/ +[5]: https://adafruit.com +[6]: https://circuitpython.org/downloads +[7]: https://learn.adafruit.com/welcome-to-circuitpython +[8]: https://learn.adafruit.com/circuitpython-essentials/circuitpython-essentials +[9]: https://github.com/adafruit/circuitpython +[10]: https://www.adafruit.com/product/4769 +[11]: https://www.adafruit.com/product/3251 +[12]: https://www.adafruit.com/product/4399 +[13]: https://www.sparkfun.com/products/15081 +[14]: https://opensource.com/sites/default/files/uploads/connectsensors-microcontroller.jpg (Connecting sensors to microcontroller) +[15]: https://creativecommons.org/licenses/by-sa/4.0/ +[16]: https://pimylifeup.com/raspberry-pi-mosquitto-mqtt-server/ +[17]: https://mosquitto.org/ +[18]: https://mosquitto.org/documentation/authentication-methods/ +[19]: https://learn.adafruit.com/mqtt-in-circuitpython +[20]: https://circuitpython.org/libraries +[21]: https://pypi.org/project/paho-mqtt/ +[22]: https://pypi.org/project/prometheus-client +[23]: https://opensource.com/article/21/3/iot-measure-raspberry-pi +[24]: https://github.com/dmlond/greenhouse_mqtt_microcontroller From b06240fcd81518c89646df0013946c90146af28c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 12 Jun 2021 05:03:15 +0800 Subject: [PATCH 048/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210611=20?= =?UTF-8?q?How=20to=20use=20the=20FreeDOS=20text=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210611 How to use the FreeDOS text editor.md --- ...0611 How to use the FreeDOS text editor.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20210611 How to use the FreeDOS text editor.md diff --git a/sources/tech/20210611 How to use the FreeDOS text editor.md b/sources/tech/20210611 How to use the FreeDOS text editor.md new file mode 100644 index 0000000000..4afe36aa36 --- /dev/null +++ b/sources/tech/20210611 How to use the FreeDOS text editor.md @@ -0,0 +1,96 @@ +[#]: subject: (How to use the FreeDOS text editor) +[#]: via: (https://opensource.com/article/21/6/freedos-text-editor) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to use the FreeDOS text editor +====== +FreeDOS provides a user-friendly text editor called FreeDOS Edit. +![Person using a laptop][1] + +Editing files is a staple on any operating system. Whether you want to make a note about something, write a letter to a friend, or update a system configuration file—you need an editor. And FreeDOS provides a user-friendly text editor called (perhaps unimaginatively) "FreeDOS Edit." + +### Editing files + +The simplest invocation of FreeDOS Edit is just `EDIT`. This brings up an empty editor window. The patterned background suggests an empty "desktop"—a reminder that you aren't editing any files. + +![FreeDOS Edit][2] + +FreeDOS Edit without any files loaded +Jim Hall, CC-BY SA 4.0 + +Like most DOS applications, you can access the menus in Edit by tapping the Alt key once on your keyboard. This activates the menu. After hitting Alt, Edit will switch to "menu" access and will highlight the "File" menu. If you want to access a different menu on the menu bar, use the left and right arrow keys. Press the down arrow or hit the Enter key to go "into" the menu. + +![FreeDOS Edit menu][3] + +Highlighting the menu +Jim Hall, CC-BY SA 4.0 + +Do you notice that the first letter for each menu title is a different color? This highlight indicates a shortcut. For example, the "F" in the "File" menu is highlighted in red. So you could instead press Alt+F (Alt and F at the same time) and Edit will bring up the "File" menu. + +![File menu][4] + +The File menu +Jim Hall, CC-BY SA 4.0 + +You can use the "File" menu to either start a new (empty) file, or open an existing file. Let's start a new file by using the arrow keys to move down to "New" and pressing the Enter key. You can also start a new file by pressing Ctrl+N (Ctrl and N at the same time): + +![new file][5] + +Editing a new file +Jim Hall, CC-BY SA 4.0 + +Editing files should be pretty straightforward after that. Most of the familiar keyboard shortcuts exist in FreeDOS Edit: Ctrl+C to copy text, Ctrl+X to cut text, and Ctrl+V to paste copied or cut text into a new location. If you need to find specific text in a long document, press Ctrl+F. To save your work, use Ctrl+S to commit changes back to the disk. + +### Programming in Edit + +If you're a programmer, you may find the extended ASCII table a useful addition. DOS systems supported an "extended" ASCII character set commonly referred to as "code page 437." The standard characters between 0 and 127 include the letters A through Z (uppercase and lowercase), numbers, and special symbols like punctuation. However, the DOS extended characters from code 128 to code 255 included foreign language characters and "line drawing" elements. DOS programmers often made use of these extended ASCII characters, so FreeDOS Edit makes it easy to view a table of all the ASCII codes and their associated characters. + +To view the ASCII table, use the "Utilities" menu and select the "ASCII Table" entry. This brings up a window containing a table. + +![utilities menu - ascii table][6] + +Find the ASCII Table in the Utilities menu +Jim Hall, CC-BY SA 4.0 + +Along the left, the table shows the hexadecimal values "00" through "F0," and the top shows the single values "0" through "F." These provide a quick reference to the hexadecimal code for each character. For example, the item in the first row (00) and the first column (0) has the hexadecimal value 00 + 0, or 0x00 (the "NULL" value). And the character in the fifth row (40) and the second column (1) has the value 40 + 1, or 0x41 (the letter "A"). + +![utilities menu - ascii table][7] + +The ASCII Table provides a handy reference for extended characters +Jim Hall, CC-BY SA 4.0 + +As you move the cursor through the table to highlight different characters, you'll see the values at the bottom of the table change to show the character's code in decimal, hexadecimal, and octal. For example, moving the cursor to highlight the "line intersection" character at row C0 and column 5 shows this extended character code as 197 (dec), 0xc5 (hex), and 305 (oct). In a program, you might reference this extended character by typing the hex value `0xc5`, or the octal "escape code" `\305`. + +![ASCII 0xc5][8] + +The "line intersection" character is 197 (dec), 0xc5 (hex), and 305 (oct) +Jim Hall, CC-BY SA 4.0 + +Feel free to explore the menus in Edit to discover other neat features. For example, the "Options" menu allows you to change the behavior and appearance of Edit. If you prefer to use a more dense display, you can use the "Display" menu (under "Options") to set Edit to 25, 43, or 50 lines. You can also force Edit to display in monochrome (white on black) or reversed mode (black on white). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-text-editor + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/sites/default/files/uploads/edit.png (FreeDOS Edit without any files loaded) +[3]: https://opensource.com/sites/default/files/uploads/edit-menu.png (Highlighting the menu) +[4]: https://opensource.com/sites/default/files/uploads/edit-file.png (The File menu) +[5]: https://opensource.com/sites/default/files/uploads/edit-new.png (Editing a new file) +[6]: https://opensource.com/sites/default/files/uploads/utilities-ascii.png (Find the ASCII Table in the Utilities menu) +[7]: https://opensource.com/sites/default/files/uploads/ascii-table-0x00.png (The ASCII Table provides a handy reference for extended characters) +[8]: https://opensource.com/sites/default/files/uploads/ascii-0xc5.png (The "line intersection" character is 197 (dec), 0xc5 (hex), and 305 (oct)) From 8eb8d087af320917d7de6bf0724071e510e8e080 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 12 Jun 2021 05:03:34 +0800 Subject: [PATCH 049/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210611=20?= =?UTF-8?q?How=20hypertext=20can=20establish=20application=20state=20in=20?= =?UTF-8?q?REST?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210611 How hypertext can establish application state in REST.md --- ...can establish application state in REST.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20210611 How hypertext can establish application state in REST.md diff --git a/sources/tech/20210611 How hypertext can establish application state in REST.md b/sources/tech/20210611 How hypertext can establish application state in REST.md new file mode 100644 index 0000000000..2dc4c4627b --- /dev/null +++ b/sources/tech/20210611 How hypertext can establish application state in REST.md @@ -0,0 +1,109 @@ +[#]: subject: (How hypertext can establish application state in REST) +[#]: via: (https://opensource.com/article/21/6/hateoas) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How hypertext can establish application state in REST +====== +The Hypertext As The Engine Of Application State architectural style +supports non-brittle, resilient systems that enable risk-free changes. +![diagram of planning a cloud][1] + +HATEOAS is a difficult-to-pronounce acronym that stands for "[Hypertext As The Engine Of Application State][2]." Invented by [Roy Fielding][3] in the year 2000, HATEOAS was proposed as an architectural style for network-based software systems. + +The central concept of this architectural style is [hypertext][4]. With hypertext, we have encoded content that may also imply action. Each action, in turn, implies a change of state. HATEOAS represents the mechanism that can be used to control the transition from one application state to another application state. Its name contains the word Engine, based on the assumption that hypertext could drive the transitions from state to state. + +### Why HATEOAS? + +There are several reasons why HATEOAS may be a desirable architectural style. Two main reasons are: + + 1. Late binding + 2. Uniform interface + + + +#### 1\. Late binding + +Brittle systems are invariably a sign of shoddy engineering. When we discover a brittle system, usually we learn that its constituent components and subsystems are tightly coupled (almost welded together). That tight coupling creates a lot of friction that produces a lot of "heat." No wonder such brittle systems are notorious for defective behavior, which is often perceived as malfunctioning. And those defects are typically very hard to troubleshoot and fix. + +But what causes tight coupling? In most cases, it is early binding. We sometimes refer to early binding as premature optimization (which, as the saying goes, is the root of all evil). So, to avoid designing and building brittle systems, we ought to avoid tight coupling, which in practical terms means we should avoid early binding or premature optimization. + +HATEOAS is a prime example of the extreme late-binding design style. Systems built with HATEOAS style are completely decoupled and not prematurely optimized, which gives them the flexibility to be changed safely at a drop of a hat. + +#### 2\. Uniform interface + +Interfaces between the client and the server act as a unifying agent that obfuscates the need for a client to assume or understand the resource structure. A uniform interface relieves clients from having to understand anything about the servers. + +Also, a uniform interface fully separates identification from interaction. In a uniform interface, a resource that is implemented on the backend is identified by a unique resource identifier (URI). A client interested in the services rendered by the back-end resource only needs to know the starting endpoint (the home URI). A client need not know any details about how to interact with the resource. + +As is also the case with late binding, a uniform interface provides resilient, non-brittle solutions. A system built with HATEOAS style retains the freedom to radically revamp its structure without disturbing its clients in the least. + +### In-band and out-of-band information + +Another important concept related to HATEOAS is in-band vs. out-of-band access to information. If a caller (e.g., a client) needs to manipulate a resource (e.g., a server), the client's intention must somehow be translated into the implementation. If the client knows WHAT they want to do or accomplish, their next concern becomes: HOW to do it. + +There are two ways that this knowledge of how to do something could be implemented: + + * Client needs to go out of their way to obtain the how-to information (out-of-band) + * Client is given the how-to information by the resource (in-band) following the just-in-time communications model + + + +Because HATEOAS is a late-bound, uniform-interface style of design, it serves the how-to information in-band. This means a calling client need not learn any details of how to interact with the resource before initiating the interaction. + +In contrast, a traditional remote procedure call (RPC) design hinges on the out-of-band arrangement—a calling client must obtain details needed to interact with the server before initiating the interaction. In other words, it is not sufficient for the calling client to know how to begin the interaction with the server; the client is also expected to know all the necessary details before making precise calls needed for obtaining desired services. + +This upfront knowledge that the calling client must possess before making any calls to the server renders the system extremely brittle. Clients and the server are tightly coupled; the server is not at liberty to modify its API at will and must go the extra mile to maintain backward compatibility. + +Part of the in-band design philosophy of HATEOAS is self-descriptive messages. Clients do not have to know anything about the server state; a self-descriptive message represents the important points that the client needs to continue interacting with the server. + +That arrangement further loosens any possible coupling between the client (the caller) and the server. + +### How does HATEOAS work? + +There is no difference between how the HTML works and how HATEOAS works. When we browse the web, we start from an entry point—a URL. The first step in web browsing consists of instructing the web browser to send the HTTP GET request to the specified URL. + +Upon receiving that HTTP GET request, the back-end resource (the server) replies with an HTTP response. That HTTP response contains both the data and possibly (and most likely) the network operations that can be enacted on that data. These network operations are encoded as hypertext links. If we then click on one of those links, we enact a network operation: the browser sends, on our behalf, another HTTP request (it could be a GET request, or a POST request, etc.). + +The salient point in this description of the mundane web-browsing experience is that we, the clients, don't have to know anything in advance about the structure implemented on the server. All we know is the hypertext links that the server sends to us in the form of a resource representation (the HTML document). + +Replace a web browser with a computer program, and you get the picture of how HATEOAS works. A client (e.g., a computer program) obtains the entry point of the resource (the endpoint of the API). The client then programmatically sends the HTTP GET request to the resource and receives the HTTP response. In the response, the client will find one or more hypertext links. It is those hypertext links that enable the calling program to make the change in the application state. The client makes that change by sending another HTTP request using the in-band details found in the resource representation—the HTML document. + +Step-by-step, the interaction between the client and the server continues in this fashion. + +### What are the advantages of HATEOAS? + +In addition to the above advantages (a non-brittle, resilient system that invites risk-free changes), HATEOAS enables building systems that are: + + * Performant + * Scalable + * Reliable + * Simple to understand + * Transparent + * Portable + + + +These advantages are made possible by the stateless nature of the systems built using the HATEOAS style. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/hateoas + +作者:[Alex Bunardzic][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_darwincloud_520x292_0311LL.png?itok=74DLgd8Q (diagram of planning a cloud) +[2]: https://en.wikipedia.org/wiki/HATEOAS +[3]: https://en.wikipedia.org/wiki/Roy_Fielding +[4]: https://en.wikipedia.org/wiki/Hypertext From fea8df8df2865d0c5d054f1cd60c05ef960a3342 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 12 Jun 2021 11:55:41 +0800 Subject: [PATCH 050/870] PRF&PUB @geekpi https://linux.cn/article-13477-1.html --- ...ed decorators and improved dictionaries.md | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) rename {translated/tech => published}/20210521 How Python 3.9 fixed decorators and improved dictionaries.md (68%) diff --git a/translated/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md b/published/20210521 How Python 3.9 fixed decorators and improved dictionaries.md similarity index 68% rename from translated/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md rename to published/20210521 How Python 3.9 fixed decorators and improved dictionaries.md index 1b0a407c4f..6f4a929d87 100644 --- a/translated/tech/20210521 How Python 3.9 fixed decorators and improved dictionaries.md +++ b/published/20210521 How Python 3.9 fixed decorators and improved dictionaries.md @@ -3,40 +3,40 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13477-1.html) Python 3.9 如何修复装饰器并改进字典 ====== -探索最近版本的 Python 的一些有用的特性。 -![Python in a coffee cup.][1] -这是关于首次出现在 Python 3.x 版本中的特性的系列文章中的第十篇,其中一些版本已经发布了一段时间。Python 3.9 在 2020 年首次发布,具有很酷的新特性,但仍未被充分利用。下面是其中的三个。 +> 探索最近版本的 Python 的一些有用的特性。 + +![](https://img.linux.net.cn/data/attachment/album/202106/12/115315xrnd4evse8uzpi8i.jpg) + +这是 Python 3.x 首发特性系列文章中的第十篇,其中一些版本已经发布了一段时间。Python 3.9 在 2020 年首次发布,具有很酷的新特性,但仍未被充分利用。下面是其中的三个。 ### 添加字典 -假设你有一个 “defaults” 字典,而你想更新它的参数。在 Python 3.9 之前,最好的办法是复制 defaults 字典,然后使用 `.update()` 方法。 +假设你有一个 `defaults` 字典,而你想更新它的参数。在 Python 3.9 之前,最好的办法是复制 `defaults` 字典,然后使用 `.update()` 方法。 Python 3.9 为字典引入了联合运算符: - ``` defaults = dict(who="someone", where="somewhere") params = dict(where="our town", when="today") defaults | params - -``` -``` -` {'who': 'someone', 'where': 'our town', 'when': 'today'}` ``` -注意,顺序很重要。在这种情况下,来自 `params` 的 `where ` 值覆盖了默认值,因为它应该如此。 +``` + {'who': 'someone', 'where': 'our town', 'when': 'today'} +``` + +注意,顺序很重要。在这种情况下,正如预期,来自 `params` 的 `where` 值覆盖了默认值。 ### 删除前缀 -如果你用 Python 做了临时的文本解析或清理,你会写出这样的代码: - +如果你用 Python 做临时的文本解析或清理,你会写出这样的代码: ``` def process_pricing_line(line): @@ -44,25 +44,27 @@ def process_pricing_line(line): return line[len("pricing:"):] return line process_pricing_line("pricing:20") +``` ``` -``` -` '20'` + '20' ``` 这样的代码很容易出错。例如,如果字符串被错误地复制到下一行,价格就会变成 `0` 而不是 `20`,而且会悄悄地发生。 从 Python 3.9 开始,字符串有了一个 `.lstrip()` 方法: +``` +"pricing:20".lstrip("pricing:") +``` ``` -`"pricing:20".lstrip("pricing:")`[/code] [code]` '20'` + '20' ``` ### 任意的装饰器表达式 -以前,关于装饰器中允许哪些表达式的规则没有得到充分的记录,而且很难理解。例如:虽然 - +以前,关于装饰器中允许哪些表达式的规则没有得到充分的说明,而且很难理解。例如:虽然 ``` @item.thing @@ -72,7 +74,6 @@ def foo(): 是有效的,而且: - ``` @item.thing() def foo(): @@ -81,7 +82,6 @@ def foo(): 是有效的,相似地: - ``` @item().thing def foo(): @@ -92,7 +92,6 @@ def foo(): 从 Python 3.9 开始,任何表达式作为装饰器都是有效的: - ``` from unittest import mock @@ -102,10 +101,10 @@ item = mock.MagicMock() def foo(): pass print(item.return_value.thing.call_args[0][0]) +``` ``` -``` -` ` + ``` 虽然在装饰器中保持简单的表达式仍然是一个好主意,但现在是人类的决定,而不是 Python 分析器的选择。 @@ -121,7 +120,7 @@ via: https://opensource.com/article/21/5/python-39-features 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 15ed4cc1d8fb9ee64b4558c3e116917905584320 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 12 Jun 2021 12:10:16 +0800 Subject: [PATCH 051/870] APL --- ...to Read (and Understand) the Fantastic Man Pages in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md b/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md index 001918163d..711fb63ed3 100644 --- a/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md +++ b/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/linux-man-page-guide/) [#]: author: (Bill Dyer https://itsfoss.com/author/bill/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7961feff12b02457a1673e59ab59ab73fcb736f4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 12 Jun 2021 16:10:28 +0800 Subject: [PATCH 052/870] TSL&PRF --- ...stand) the Fantastic Man Pages in Linux.md | 353 ------------------ ...stand) the Fantastic Man Pages in Linux.md | 347 +++++++++++++++++ 2 files changed, 347 insertions(+), 353 deletions(-) delete mode 100644 sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md create mode 100644 translated/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md diff --git a/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md b/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md deleted file mode 100644 index 711fb63ed3..0000000000 --- a/sources/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md +++ /dev/null @@ -1,353 +0,0 @@ -[#]: subject: (RTFM! How to Read (and Understand) the Fantastic Man Pages in Linux) -[#]: via: (https://itsfoss.com/linux-man-page-guide/) -[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -RTFM! How to Read (and Understand) the Fantastic Man Pages in Linux -====== - -The _man pages_, short for _reference manual pages_, are your keys to Linux. Everything you want to know is there – take it all in an run with it. The collection of documents will never win a Pulitzer prize, but the set is quite accurate and complete. The man pages are _the_ primary source and that authority is well-known. - -While they are the “go to” source, they aren’t the most pleasant to read. Once, in a long past philosophy class, I was told that reading [Aristotle][1] was the most boring read around. I disagreed: when it comes to dry reading, Aristotle comes in at a distant second to man pages. - -At first glance, the pages may look incomplete but, believe it or not, the man pages aren’t designed to hide information from you – it’s just that there is so much information that the pages have to be structured and information is given in the most brief form possible. The explanations are rather spartan and they will take some getting used to, but once you get the hang of using them, you’ll see how useful they actually are. - -### Getting Started with the man Pages in Linux - -The pages are viewed through a utility called, `man`, and the command to use it is rather easy. In the simplest form, to use `man`, you type `man` on the command line, followed by a `space` and the command that you want to look up, such as `ls` or `cp`, like so: - -``` -man ls -``` - -man opens the manual page of the `ls` command. - -![][2] - -You can move up and down with the arrow keys and press `q` to quit viewing the man page. Usually, the man pages are opened with less so the keyboard shortcuts for less command work in man as well. - -For example, you can search for a specific text using /search_term and so on. - -There is an introduction to the man pages and it’s important that you read this one. It spells out, in great detail, how the man pages are laid out and organized. - -To see this page, open a terminal and type: - -``` -man man -``` - -![man page of man][3] - -### Section What? - -Before you begin to look at man pages much deeper, it will be helpful to know that man pages have a set page layout _and_ a filing scheme. This can be confusing to a newcomer since I can say: “Look at the NAME _section_ of the man page for `ls`.” I can also say, “Look at the man page for `passwd` in _section_ 5.” - -I italicized the word, _section_ to try to show a source of confusion. The word, _section_ is being used in two different ways, but the difference isn’t always explained to newcomers. - -I am not sure why this confusion sets in, but I have seen it happen a few times back when I trained new users and entry-level sysadmins. I think it might be tunnel vision. Focusing on one thing can make a person forget about another. It’s a lot like not being able to see the forest because the trees are in the way. - -To those who know the difference already, you can skip this sub-section. This part is directed to the people new to man pages. - -Here is the difference: - -#### The man page - -Individual man pages are made to show blocks of information. For example, every man page has a **NAME** section to show the name of the command along with a brief description. There will be another block of information, called **SYNOPSIS** to show how the command is used, and so on. - -![][4] - -Every man page will have these, and other headings. These sections, or headings, on individual man pages, helps keep things consistent and information compartmentalized. - -#### The Manual - -The use of _section_, as in “Look at the man page for `passwd` in _section_ 5” speaks of the manual as a whole. When we look at only one page, it can be easy to overlook that, but the man page for `passwd` is part of the same manual that has a man page for `ls`, `rm`, `date`, `cal`, and others. - -The entire Linux manual is huge; it has thousands of pages. Some of those pages have specialized information. Some pages have information that programmers need, while others have information unique to networking, and others that system administrators would be interested in. - -These pages are grouped according to their unique purpose. Think of splitting the entire manual into several chapters – each chapter having a specific topic. There are 9 or so chapters (very large ones at that). It just so happens that these chapters are called _sections_. - -To sum this up: - - * Sections of a single page of the manual (what we call the man page) are blocks of information defined by the headings and - * Sections of the manual-at-large (the collection of all of the pages) are chapters which happen to be called _sections_. - - - -Now you know the difference and, hopefully, the rest of this article will be easier to follow. - -### man Page Sections - -You will be looking at different man pages so let’s study the individual page layout first. - -Manual pages are split into several headings and they may vary from vendor to vendor, but they will be similar. The general breakdown is as follows: - - * NAME - * SYNOPSIS - * DESCRIPTION - * EXAMPLES - * DIAGNOSTICS - * FILES - * LIMITS - * PORTABILITY - * SEE ALSO - * HISTORY WARNING (or Bugs) - * NOTES - - - -**NAME** – Under this heading is the command name and a brief description of the command. - -**SYNOPSIS** – Shows how the command is used. For instance, here is a synopsis of the `cal` command: - -``` -cal [Month] [Year] -``` - -The synopsis begins with the name of the command, with a list of options following. The synopsis takes the general form of a command line; it shows what you can type and the order of the arguments. Arguments in square brackets (`[]`) are optional; you can leave these arguments out and the command will still work correctly. Items not in brackets must be used. - -Take note that brackets are for readability only. They should not be typed when you enter a command. - -**DESCRIPTION** – Describes the command or utility as to what it does and how you can use it. This section usually starts off with an explanation of the synopsis as well as telling what happens if you omit any of the optional arguments. This section may be subdivided for long or complex commands. - -**EXAMPLES** – Some man pages provide examples of how the command or utility can be used. If this section is present, the page tries to give a few simple usage examples, as well as more complex examples to show how complex tasks can be completed. - -**DIAGNOSTICS** – This section lists status or error messages returned by the command or utility. Self-explanatory error and status messages aren’t usually shown. Messages that may be hard to understand are usually listed. - -**FILES** This section contains a list of supplementary files used by UNIX to run this specific command. Here, _supplementary_ files are files not specified on the command line. For example, if you were looking at a man page for the `passwd` command, you may find `/etc/passwd` listed in this section since that is where UNIX stores password information. - -**LIMITS** – This section describes any limitations of a utility. Operating system and hardware limitations are usually not listed as they are outside of the utility’s control. - -**PORTABILITY** – Lists other systems where the utility is available, along with how other versions of the utility may differ. - -**SEE ALSO** – lists related man pages that contain relevant information. - -**HISTORY** – Gives a brief history of the command such as when it first appeared. - -**WARNING** – If this section is present, it contains important advice for users. - -**NOTES** – Not as severe as a warning, but important information. - -Again, not all man pages use the exact headings listed above, but they’re close enough to follow. - -### The Manual’s Sections - -The entire Linux manual collection of pages are traditionally divided into numbered sections: - - * **Section 1** : Shell commands and applications - * **Section 2** : Basic kernel services – system calls and error codes - * **Section 3** : Library information for programmers - * **Section 4** : Network services – if TCP/IP or NFS is installed Device drivers and network protocols - * **Section 5** : Standard file formats – for example: shows what a _tar_ archive looks like. - * **Section 6** : Games - * **Section 7** : Miscellaneous files and documents - * **Section 8** : System administration and maintenance commands - * **Section 9** : Obscure kernel specs and interfaces - - - -The grouping of pages into these groups makes for more efficient searching. I sometimes do a little programming where I work, so I spend a little time look at section 3 man pages. I also do a little work in networking, so I’ve been known to wade through the networking section, and as a system administrator of several experimental machines, I spend a good deal of time in section 8. - -Grouping pages into specific (chapters) sections make searching for information easier – both for the human needing it, and for the machine doing the searching. - -You can tell which page belongs to which section by the number next to the name. For example, if you’re looking at a man page for `ls` and the very top of the page says this: `LS(1)`, you are viewing the `ls` page in section 1, which contains the pages about shell commands and applications. - -Here is another example. If you’re looking at a man page for `passwd` and the top of the page shows: `PASSWD(1)`, you are reading the page from section 1 that describes how the `passwd` command changes passwords for user accounts. If you see `PASSWD(5)`, you are reading about the the password file and how it is made up. - -![][5] - -`passwd` happens to be be two different things: it is the name of a command and a name of a file. Again, section 1 describes the command, while section 5 covers file formats. - -The number in the parenthesis is the big clue – that number tells you what section that the page you’re reading, came from. - -### Searching for a Specific Section - -The basic command: - -``` -man name -``` - -will search for the man page identified by _name_ in every section, displaying them one at a time, in numerical order. To limit your search to a specific section, use an argument with the `man` command, like so: - -``` -man 1 name -``` - -This command will only search section 1, of the man pages, for _name_. Using our `passwd` example earlier, this means that we can keep the search targeted. If I want to read about the `passwd` command, I can type this in the terminal: - -``` -man 1 passwd -``` - -The `man` utility will only search through section 1 for `passwd` and display it. It will not look through any other section for `passwd`. - -An alternative method for this command is to type: `man passwd.1` - -### Using man -k to Search all man Pages Containing a Certain Keyword - -The _man_ command, with the _k_ option (often called a _flag_ or _switch_) can come in handy if you want a listing of man pages containing a certain keyword. For example, if you want to see a list of man pages that deal with, say, `ftp`, you can get this list by typing: - -``` -man -k ftp -``` - -From the listing that will follow, you’ll be able to pick a specific man page to read: - -![man k example][6] - -On some systems, before `man -k` will work, the system administrator will need to run a utility called `catman`. - -### Using whatis and whereis Commands to Know the Manual’s Sections - -There are two nifty utilities that can be helpful in your search for information: whatis and whereis. - -#### whatis - -There are times when we can quite get the information we need. Chances are great that the information we need is available – finding it can be a small problem. - -For example, if I want to look at the man page about the `passwd` file, and I type this on the terminal: - -``` -man passwd -``` - -I would see the page that tells me all about the `passwd` command, but nothing about the `passwd` file. I know that `passwd` is a command and there’s also a `passwd` file, but sometimes, I might forget that. It’s then that I realize that file structures are in a different section in the man pages, so I type: - -``` -man 4 passwd -``` - -and I get this reply: - -``` -No manual entry for passwd in section 4 -See 'man 7 undocumented' for help when manual pages are not available. -``` - -Another lapse of forgetfulness. File structures are in section 4 of System V UNIX pages. Years ago, when I built files, I used `man 4...` _a lot_; it’s still a habit with me. So where is it in the Linux manual? - -It’s time to call `whatis` to straighten me out. To do this, I type this in my terminal: - -``` -whatis passwd -``` - -and I see the following: - -``` -passwd (1) - change user password -passwd (1ssl) - compute password hashes -passwd (5) - the password file -``` - -Ah! the page for the `passwd` file is in section 5. Now I am set straight and can access the information I want: - -``` -man 5 passwd -``` - -and I am brought to the man page that has the information I need. - -`whatis` is handy utility that can tell you, in a brief one-liner, what a command does. Imagine that you want to know what `cal` does without having to view the man page. Just type this at the command prompt: - -``` -whatis cal -``` - -and you will see this in response: - -``` -cal (1) - displays a calendar and the date of Easter -``` - -Now that you know about the `whatis` command, I can let you in on a secret – there is a `man` command equivalent. To get this, we use the `-f` switch: `man -f ...` - -Try it out. Type: `whatis cal` at a terminal prompt. Once that executes, type: `man -f cal`. The output of both commands will be identical. - -![whatis cal and man f cal outputs are the same][7] - -#### whereis - -The very name of the `whereis` command explains itself – it tells you where a program is within the filesystem. It will also tell you where the man page is stored too. Using `cal` as an example again, I type this at the prompt: - -``` -whereis cal -``` - -I will see this: - -![whereis cal output][8] - -Look carefully at the reply. The answer is on one line, but it tells me two things: - -`/usr/bin/cal` is where the `cal` program is and - -`/usr/share/man/man1/cal.1.gz` is where the man page resides (I’m also clued into the fact that the man page is compressed, but not to worry – the man command knows how to decompress it on the fly) - -`whereis` is PATH dependent; it can only tell you where files are if they are in your PATH environment. - -You may be wondering if there is an equivalent `man` command for `whereis`. There isn’t one that will tell you where the executable file is, but there is a switch you can use that will tell you where the man page is. Using the `date` command in this example, if we type: - -``` -whereis date -``` - -at a terminal prompt, we will see: - -![whereis date output][9] - -We see that the `date` program is in the `/usr/bin/` directory and the name and location of its man page is: `/usr/share/man/man1/date.1.gz` - -The closest we can get man to act like `whereis` is to use the `-w` switch. We won’t get the location of the program, but we can at least get the location of the man page, like this: - -``` -man -w date -``` - -and we will see this returned: - -![][10] - -You know about `whatis` and `whereis` as well as a method to get the `man` command to do the same (or close) thing. I showed both ways for a couple of different reasons. - -For years, I used `whatis` and `whereis` since they were in my training manuals. I didn’t learn about `man -f ...` and `man -w ...` until fairly recently. I’m sure I looked at the man page for `man` hundreds of times, but I never noticed the `-f` and `-w` switches. I was always looking at the man page for something else (i.e. `man -k ...`). I concentrated only on what I needed to find and ignored the rest. Once I found the information I needed, I would leave the page and get the work done, not paying attention to some of the other gems the command had to offer. - -This is okay since this is partly what the man pages are for: to help you get work done. - -It wasn’t until I was recently showing someone how to use man pages, that I took the time to just read – “to see what else was possible” – and we took real notice of the information about what the `man` command’s `-f` and `-w` flags can do. - -No matter how long you have been using Linux, or how experienced, there is always something new to learn. - -The man pages will tell you what you may need to know to work through a certain task – but they also hold a lot more – enough to make you look like a magician – but only if you take the time to read. - -### Conclusion - -If you spend some time and effort with the man pages, you will come out on top. Your proficiency of the man pages, will play a huge part in your mastery over Linux. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-man-page-guide/ - -作者:[Bill Dyer][a] -选题:[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/bill/ -[b]: https://github.com/lujun9972 -[1]: https://www.britannica.com/biography/Aristotle -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-example-800x527.png?resize=800%2C527&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/man_man.png?resize=800%2C455&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-example-1.png?resize=800%2C527&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-passwd-command.png?resize=1026%2C676&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/man-k_example.png?resize=800%2C200&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/whatis_cal_man-f_cal.png?resize=800%2C135&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/whereis_cal.png?resize=800%2C100&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/whereis_date.png?resize=800%2C100&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/man-w_date-1.png?resize=800%2C100&ssl=1 diff --git a/translated/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md b/translated/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md new file mode 100644 index 0000000000..4b04c72e37 --- /dev/null +++ b/translated/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md @@ -0,0 +1,347 @@ +[#]: subject: (RTFM! How to Read \(and Understand\) the Fantastic Man Pages in Linux) +[#]: via: (https://itsfoss.com/linux-man-page-guide/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +RTFM!如何阅读(和理解)Linux 中神奇的手册页 +====== + +手册页man pages,即参考手册页reference manual pages的简称,是你进入 Linux 的钥匙。你想知道的一切都在那里,包罗万象。这套文档永远不会赢得普利策奖,但这套文档是相当准确和完整的。手册页是主要信源,其权威性是众所周知的。 + +虽然它们是源头,但阅读起来并不是最令人愉快的。有一次,在很久以前的哲学课上,有人告诉我,阅读 [亚里士多德][1] 是最无聊的阅读。我不同意:说到枯燥的阅读,亚里士多德远远地排在第二位,仅次于手册页。 + +乍一看,这些页面可能看起来并不完整,但是,不管你信不信,手册页并不是为了隐藏信息 —— 只是因为信息量太大,这些页面必须要有结构,而且信息是以尽可能简短的形式给出的。这些解释相当简略,需要一些时间来适应,但一旦你掌握了使用它们的技巧,你就会发现它们实际上是多么有用。 + +### Linux 中的手册页入门 + +这些页面是通过一个叫做 `man` 的工具查看的,使用它的命令相当简单。在最简单的情况下,要使用 `man`,你要在命令行上输入 `man`,后面加一个空格和你想查询的命令,比如 `ls` 或 `cp`,像这样: + +``` +man ls +``` + +`man` 会打开 `ls` 命令的手册页。 + +![][2] + +你可以用方向键上下移动,按 `q` 退出查看手册页。通常情况下,手册页是用 `less` 打开的,所以 `less` 命令的键盘快捷键在 `man` 中也可以使用。 + +例如,你可以用 `/search_term` 来搜索一个特定的文本,等等。 + +有一个关于手册页的介绍,这是一篇值得阅读介绍。它非常详细地说明了手册页是如何布局和组织的。 + +要看这个页面,请打开一个终端,然后输入: + +``` +man man +``` + +![man page of man][3] + +### 节 + +在你开始更深入地研究手册页之前,知道手册页有一个固定的页面布局和一个归档方案会有帮助。这可能会让新手感到困惑,因为我可以说:“看手册页中关于 `ls` 的 NAME section”,我也可以说:“看第 5 section中的 `passwd` 的手册页。” + +我把 “section” 这个词用斜体字表示,是为了显示混淆的来源。这个词,“节” 被用于两种不同的方式,但并不总是向新人解释其中的区别。 + +我不确定为什么会出现这种混淆,但我在培训新用户和初级系统管理员时看到过几次这种混淆。我认为这可能是隧道视野,专注于一件事会使一个人忘记另一件事。一叶障目,不见泰山。 + +对于那些已经知道其中的区别的人,你可以跳过这一小节。这一部分是针对那些刚接触到手册页的人。 + +这就是区别: + +#### 对于手册页 + +单独的手册页是用来显示信息块的。例如,每个手册页都有一个“NAME”节,显示命令的名称和简短的描述。还会有另一个信息块,称为“SYNOPSIS”,显示该命令是如何使用的,以此类推。 + +![][4] + +每个手册页都会有这些,以及其他的标题。这些在各个手册页上的节,或者说标题,有助于保持事情的一致性和信息的分工。 + +#### 对于手册 + +使用“节”,如 “查看第 5 节中的 `passwd` 的手册页”,是指整个手册的内容。当我们只看一页时,很容易忽略这一点,但是 `passwd` 手册页是同一本手册的一部分,该手册还有 `ls`、`rm`、`date`、`cal` 等的手册页。 + +整个 Linux 手册是巨大的;它有成千上万的手册页。其中一些手册页有专门的信息。有些手册页有程序员需要的信息,有些手册页有网络方面的独特信息,还有一些是系统管理员会感兴趣的。 + +这些手册页根据其独特的目的被分组。想想看,把整个手册分成几个章节 —— 每章有一个特定的主题。有 9 个左右的章节(非常大的章节)。碰巧的是,这些章节被称为“节”。 + +总结一下: + + * 手册中单页(我们称之为“手册页”)的节是由标题定义的信息块。 + * 这个大的手册(所有页面的集合)中的章节,刚好被称为“节”。 + +现在你知道区别了,希望本文的其余部分会更容易理解。 + +### 手册页的节 + +你将会看到不同的手册页,所以让我们先研究一下各个页面的布局。 + +手册页被分成几个标题,它们可能因提供者不同而不同,但会有相似之处。一般的分类如下: + + * `NAME`(名称) + * `SYNOPSIS`(概要) + * `DESCRIPTION`(描述) + * `EXAMPLES`(例子) + * `DIAGNOSTICS`(诊断) + * `FILES`(文件) + * `LIMITS`(限制) + * `PORTABILITY`(可移植性) + * `SEE ALSO`(另见) + * `HISTORY`(历史) + *  WARNING`(警告)或 `BUGS`(错误) + * `NOTES`(注意事项) + +`NAME` - 在这个标题下是命令的名称和命令的简要描述。 + +`SYNOPSIS` - 显示该命令的使用方法。例如,这里是 `cal` 命令的概要: + +``` +cal [Month] [Year] +``` + +概要以命令的名称开始,后面是选项列表。概要采用命令行的一般形式;它显示了你可以输入的内容和参数的顺序。方括号中的参数(`[]`)是可选的;你可以不输入这些参数,命令仍然可以正常工作。不在括号内的项目必须使用。 + +请注意,方括号只是为了便于阅读。当你输入命令时,不应该输入它们。 + +`DESCRIPTION` - 描述该命令或工具的作用以及如何使用它。这一节通常以对概要的解释开始,并说明如果你省略任何一个可选参数会发生什么。对于长的或复杂的命令,这一节可能会被细分。 + +`EXAMPLES ` - 一些手册页提供了如何使用命令或工具的例子。如果有这一节,手册页会尝试给出一些简单的使用例子,以及更复杂的例子来说明如何完成复杂的任务。 + +`DIAGNOSTICS` - 本节列出了由命令或工具返回的状态或错误信息。通常不显示不言自明的错误和状态信息。通常会列出可能难以理解的信息。 + +`FILES` - 本节包含了 UNIX 用来运行这个特定命令的补充文件的列表。这里,“补充文件”是指没有在命令行中指定的文件。例如,如果你在看 `passwd` 命令的手册,你可能会发现 `/etc/passwd` 列在这一节中,因为 UNIX 是在这里存储密码信息。 + +`LIMITS` - 本节描述了一个工具的限制。操作系统和硬件的限制通常不会被列出,因为它们不在工具的控制范围内。 + +`PORTABILITY` - 列出其他可以使用该工具的系统,以及该工具的其他版本可能有什么不同。 + +`SEE ALSO` - 列出包含相关信息的相关手册页。 + +`HISTORY` - 提供命令的简要历史,如它第一次出现的时间。 + +`WARNING` - 如果有这个部分,它包含了对用户的重要建议。 + +`NOTES` - 不像警告那样严重,但也是重要的信息。 + +同样,并不是所有的手册都使用上面列出的确切标题,但它们足够接近,可以遵循。 + +### 手册的节 + +整个 Linux 手册集合的手册页传统上被划分为有编号的节: + + **第 1 节**:Shell 命令和应用程序 + **第 2 节**:基本内核服务 - 系统调用和错误代码 + **第 3 节**:为程序员提供的库信息 + **第 4 节**:网络服务 - 如果安装了 TCP/IP 或 NFS 设备驱动和网络协议 + **第 5 节**:文件格式 - 例如:显示 `tar` 存档的样子 + **第 6 节**:游戏 + **第 7 节**:杂项文件和文档 + **第 8 节**:系统管理和维护命令 + **第 9 节**:不知名的内核规格和接口 + +将手册页分成这些组,可以使搜索更有效率。在我工作的地方,我有时会做一些编程工作,所以我花了一点时间看第 3 节的手册页。我也做一些网络方面的工作,所以我也知道要涉足网络部分。作为几个实验性机器的系统管理员,我在第 8 节花了很多时间。 + +将手册网归入特定的节(章节),使搜索信息更加容易 —— 无论是对需要搜索的人,还是对进行搜索的机器。 + +你可以通过名称旁边的数字来判断哪个手册页属于哪个部分。例如,如果你正在看 `ls` 的手册页,而页面的最上面写着。 `LS(1)`,那么你正在浏览第 1 节中的 `ls` 页面,该节包含关于 shell 命令和应用程序的页面。 + +下面是另一个例子。如果你在看 `passwd` 的手册页,页面的顶部显示: `PASSWD(1)`,说明你正在阅读第 1 节中描述 `passwd` 命令如何更改用户账户密码的手册页。如果你看到 `PASSWD(5)`,那么你正在阅读关于密码文件和它是如何组成的的手册页。 + +![][5] + +`passwd` 恰好是两个不同的东西:一个是命令的名称,一个是文件的名称。同样,第 1 节描述了命令,而第 5 节涉及文件格式。 + +括号中的数字是重要的线索 —— 这个数字告诉你正在阅读的页面来自哪一节。 + +### 搜索一个特定的节 + +基本命令: + +``` +man -a name +``` + +将在每一节中搜索由 `name` 标识的手册页,按数字顺序逐一显示。要把搜索限制在一个特定的部分,请在 `man` 命令中使用一个参数,像这样: + +``` +man 1 name +``` + +这个命令将只在手册页的第 1 节中搜索 `name`。使用我们前面的 `passwd` 例子,这意味着我们可以保持搜索的针对性。如果我想阅读 `passwd` 命令的手册页,我可以在终端输入以下内容: + +``` +man 1 passwd +``` + +`man` 工具将只在第 1 节中搜索 `passwd` 并显示它。它不会在任何其他节中寻找 `passwd`。 + +这个命令的另一种方法是输入: `man passwd.1`。 + +### 使用 man -k 来搜索包含某个关键词的所有手册页 + +如果你想获得包含某个关键词的手册页的列表,`man` 命令中的 `-k` 选项(通常称为标志或开关)可以派上用场。例如,如果你想看一个关于 `ftp` 的手册列表,你可以通过输入以下内容得到这个列表: + +``` +man -k ftp +``` + +在接下来的列表中,你可以选择一个特定的手册页来阅读: + +![man k example][6] + +在某些系统上,在 `man -k` 工作之前,系统管理员需要运行一个叫做 `catman` 的工具。 + +### 使用 whatis 和 whereis 命令来了解手册的各个节 + +有两个有趣的工具可以帮助你搜索信息:`whatis`和 `whereis`。 + +#### whatis + +有的时候,我们完全可以得到我们需要的信息。我们需要的信息有很大的机会是可以找到的 —— 找到它可能是一个小问题。 + +例如,如果我想看关于 `passwd` 文件的手册页,我在终端上输入: + +``` +man passwd +``` + +我就会看到关于 `passwd` 命令所有信息的手册页,但没有关于 `passwd` 文件的内容。我知道 `passwd` 是一个命令,也有一个 `passwd` 文件,但有时,我可能会忘记这一点。这时我才意识到,文件结构在手册页中的不同节,所以我输入了: + +``` +man 4 passwd +``` + +我得到这样的答复: + +``` +No manual entry for passwd in section 4 +See 'man 7 undocumented' for help when manual pages are not available. +``` + +又是一次健忘的失误。文件结构在 System V UNIX 页面的第 4 节中。几年前,当我建立文件时,我经常使用 `man 4 ...`;这仍然是我的一个习惯。那么它在 Linux 手册中的什么地方呢? + +现在是时候调用 `whatis` 来纠正我了。为了做到这一点,我在我的终端中输入以下内容: + +``` +whatis passwd +``` + +然后我看到以下内容: + +``` +passwd (1) - change user password +passwd (1ssl) - compute password hashes +passwd (5) - the password file +``` + +啊!`passwd` 文件的页面在第 5 节。现在没问题了,可以访问我想要的信息了: + +``` +man 5 passwd +``` + +然后我被带到了有我需要的信息的手册页。 + +`whatis` 是一个方便的工具,可以用简短的一句话告诉你一个命令的作用。想象一下,你想知道 `cal` 是做什么的,而不想查看手册页。只要在命令提示符下键入以下内容。 + +``` +whatis cal +``` + +你会看到这样的回应: + +``` +cal (1) - displays a calendar and the date of Easter +``` + +现在你知道了 `whatis` 命令,我可以告诉你一个秘密 —— 有一个 `man` 命令的等价物。为了得到这个,我们使用 `-f` 开关:`man -f ...`。 + +试试吧。在终端提示下输入 `whatis cal`。执行后就输入:`man -f cal`。两个命令的输出将是相同的: + +![whatis cal and man f cal outputs are the same][7] + +#### whereis + +`whereis` 命令的名字就说明了这一点 —— 它告诉你一个程序在文件系统中的位置。它也会告诉你手册页的存放位置。再以 `cal` 为例,我在提示符下输入以下内容: + +``` +whereis cal +``` + +我将看到这个: + +![whereis cal output][8] + +仔细看一下这个回答。答案只在一行里,但它告诉我两件事: + +- `/usr/bin/cal` 是 `cal` 程序所在的地方,以及 +- `/usr/share/man/man1/cal.1.gz` 是手册页所在的地方(我也知道手册页是被压缩的,但不用担心 —— `man` 命令知道如何即时解压)。 + +`whereis` 依赖于 `PATH` 环境变量;它只能告诉你文件在哪里,如果它们在你的 `PATH` 环境变量中。 + +你可能想知道是否有一个与 `whereis` 相当的 `man` 命令。没有一个命令可以告诉你可执行文件的位置,但有一个开关可以告诉你手册页的位置。在这个例子中使用 `date` 命令,如果我们输入: + +``` +whereis date +``` + +在终端提示符下,我们会看到: + +![whereis date output][9] + +我们看到 `date` 程序在 `/usr/bin/` 目录下,其手册页的名称和位置是:`/usr/share/man/man1/date.1.gz`。 + +我们可以让 `man` 像 `whereis` 一样行事,最接近的方法是使用 `-w` 开关。我们不会得到程序的位置,但我们至少可以得到手册页的位置,像这样: + +``` +man -w date +``` + +我们将看到这样的返回: + +![][10] + +你知道了 `whatis` 和 `whereis`,以及让 `man` 命令做同样(或接近)事情的方法。我展示了这两种方法,有几个不同的原因。 + +多年来,我使用 `whatis` 和 `whereis`,因为它们在我的培训手册中。直到最近我才了解到 `man -f ...` 和 `man -w ...`。我确信我看了几百次 `man` 的手册页,但我从未注意到 `-f` 和 `-w` 开关。我总是在看手册页的其他东西(例如:`man -k ...`)。我只专注于我需要找到的东西,而忽略了其他的东西。一旦我找到了我需要的信息,我就会离开这个页面,去完成工作,而不去注意这个命令所提供的其他一些宝贝。 + +这没关系,因为这部分就是手册页的作用:帮助你完成工作。 + +直到最近我向别人展示如何使用手册页时,我才花时间去阅读 —— “看看还有什么可能” —— 我们才真正注意到关于 `man` 命令的 `-f` 和 `-w` 标记可以做什么的信息。 + +不管你使用 Linux 多久了,或者多么有经验,总有一些新东西需要学习。 + +手册页会告诉你在完成某项任务时可能需要知道的东西 —— 但它们也有很多内容 —— 足以让你看起来像个魔术师,但前提是你要花时间去读。 + +### 结论 + +如果你花一些时间和精力在手册页上,你将会取得胜利。你对手册页的熟练程度,将在你掌握 Linux 的过程中发挥巨大作用。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-man-page-guide/ + +作者:[Bill Dyer][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/bill/ +[b]: https://github.com/lujun9972 +[1]: https://www.britannica.com/biography/Aristotle +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-example-800x527.png?resize=800%2C527&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/man_man.png?resize=800%2C455&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-example-1.png?resize=800%2C527&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/man-page-passwd-command.png?resize=1026%2C676&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/man-k_example.png?resize=800%2C200&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/whatis_cal_man-f_cal.png?resize=800%2C135&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/whereis_cal.png?resize=800%2C100&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/whereis_date.png?resize=800%2C100&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/man-w_date-1.png?resize=800%2C100&ssl=1 From f79913518f28162516dbfdfee95116f98a684102 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 12 Jun 2021 16:19:17 +0800 Subject: [PATCH 053/870] PUB @wxy https://linux.cn/article-13478-1.html --- ...ead (and Understand) the Fantastic Man Pages in Linux.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md (99%) diff --git a/translated/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md b/published/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md similarity index 99% rename from translated/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md rename to published/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md index 4b04c72e37..aa785206b5 100644 --- a/translated/tech/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md +++ b/published/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md @@ -4,12 +4,14 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13478-1.html) RTFM!如何阅读(和理解)Linux 中神奇的手册页 ====== +![](https://img.linux.net.cn/data/attachment/album/202106/12/161749re6iiuhzn9ni2in4.jpg) + 手册页man pages,即参考手册页reference manual pages的简称,是你进入 Linux 的钥匙。你想知道的一切都在那里,包罗万象。这套文档永远不会赢得普利策奖,但这套文档是相当准确和完整的。手册页是主要信源,其权威性是众所周知的。 虽然它们是源头,但阅读起来并不是最令人愉快的。有一次,在很久以前的哲学课上,有人告诉我,阅读 [亚里士多德][1] 是最无聊的阅读。我不同意:说到枯燥的阅读,亚里士多德远远地排在第二位,仅次于手册页。 From 79b8e53e0197ce6741deee12fe3ed31fc4ecd6e4 Mon Sep 17 00:00:00 2001 From: ywxgod Date: Sat, 12 Jun 2021 17:56:41 +0800 Subject: [PATCH 054/870] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oard Shortcuts to Increase Productivity.md | 240 ------------------ ...oard Shortcuts to Increase Productivity.md | 240 ++++++++++++++++++ 2 files changed, 240 insertions(+), 240 deletions(-) delete mode 100644 sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md create mode 100644 translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md diff --git a/sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md b/sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md deleted file mode 100644 index caa31862c3..0000000000 --- a/sources/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: subject: (15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity) -[#]: via: (https://itsfoss.com/vs-code-shortcuts/) -[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) -[#]: collector: (lujun9972) -[#]: translator: (ywxgod) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity -====== - -There is no doubt that Microsoft’s [VS Code is one of the best open source code editor][1] out there. Unlike the legendary Vim, VS Code doesn’t need you to be a keyboard ninja and has tons of features that developers swear by. - -But this doesn’t mean you cannot, or you should not use keyboard shortcuts in Visual Studio Code. - -Do you hate breaking your coding flow and move your hand to a mouse for performing an action like toggling terminal in your Visual Studio Code (VS Code) editor? If yes, then you should immediately get yourself familiar and memorize these useful keyboard shortcuts for VS Code. - -It will not just help you to get rid of a mouse, but also make you highly productive and efficient. - -So, let’s get to know how you can code fast by quickly navigating through the code editor using keyboard shortcuts. - -### Useful VS Code Keyboard Shortcuts - -Just a disclaimer. These keyboard shortcuts are what I find most useful when working in VS Code. You may explore more of them based on your needs. - -I have also mentioned keyboard shortcuts for macOS users. - -#### 1\. Show All Commands - -Windows/Linux | macOS ----|--- -CTRL + SHIFT + P or F1 | SHIFT + ⌘ + P or F1 - -Starting with the most helpful shortcut, it opens Command Palette that provides access to all of the functionality of VS Code. - -![Command Palette][2] - -It is a very important VS Code Shortcut because even if you forget or don’t want to remember any shortcut except this one, you can still perform various operations using Command Palette like create a new file, open settings, change theme, and view all keyboard shortcuts as well. - -#### 2\. Split VS Code Editor Vertically Or Horizontally - -Windows/Linux | macOS ----|--- -CTRL + \ -| ⌘ + \ - -If you don’t have a multi-monitor setup for high productivity, you can still view codes of multiple files at once by splitting the editor either horizontally or vertically. - -![Split VS Code][3] - -To change focus into editor group, you can either use number or arrow keys. - -Windows/Linux | macOS ----|--- -CTRL + 1/2/3 | ⌘ + 1/2/3 -CTRL + K CTRL + ←/→ | ⌘ + K ⌘ + ←/→ - -#### 3\. Toggle Integrated Terminal - -Windows/Linux | macOS ----|--- -CTRL + ` | ⌘ + ` - -Integrated terminal in VS Code is a very convenient feature that lets you execute the task quickly without switching windows. To hide/unhide the terminal in the editor, this keyboard shortcut comes in very handy. - -![Integrated Terminal][4] - -However, like me, if you find pressing “CTRL+`” difficult to use due to its weird corner location, you can still open Command Palette and execute `View: Toggle Terminal` command. - -![Toggle Terminal Using Command Palette][5] - -#### 4\. Go To File - -Windows/Linux | macOS ----|--- -CTRL + P | ⌘ + P - -As the project grows, looking for a file might become a very difficult task. Hence, I would suggest even you use a mouse, this command can save you a lot of time in searching and navigating to a file in a repository. - -![Go to file][6] - -#### 5\. Go To Line - -Windows/Linux | macOS ----|--- -CTRL + G | ^ + G - -Once you search a file, you may now want to jump to a specific line for adding or editing code. If a file contains thousands of lines of code, scrolling can definitely eat up your time. Hence, CTRL+G or ^+G VS Code Keyboard Shortcut can quickly take you to a line you want. - -![Go to line][7] - -Alternatively, you can also use the fourth shortcut for ‘Go To File,’ where appending `:` colon with line number in the input box works as ‘Go To Line.’ - -#### 6\. Search Complete Project - -Windows/Linux | macOS ----|--- -CTRL + SHIFT + F | ⌘ + SHIFT + F - -Most probably you may also want to search for a text, variable, or function in your whole project. In such a case, this command is very convenient that shows search input in the sidebar. - -![Search project][8] - -You can also add filters to your search using ALT+C to match case, ALT+W to match the whole word, and ALT+R to use regular expression. - -#### 7\. Zen Mode - -Windows/Linux | macOS ----|--- -CTRL + K Z | ⌘ + K Z - -Want to work in a distraction-free environment to stay more focused? Zen mode is a feature in a VS Code that hides all UI (Status Bar, Activity Bar, Panel, and Sidebar) and displays only the editor on a full screen. - -![Zen Mode][9] - -To enable Zen Mode, you can either use the above shortcut or open Command Palette and execute “View: Toggle Zen Mode.” To exit Zen mode, you need to press `Esc` button twice. - -#### 8\. Add Selection To Next Find Match - -Windows/Linux | macOS ----|--- -CTRL + D | ⌘ + D - -This command enables you to select the next occurrences of a selected text for editing. It comes very handy if the next match is located far away from the first match. - -![Next find match][10] - -#### 9\. Toggle Line Comment - -Windows/Linux | macOS ----|--- -CTRL + / | ⌘ + / - -The struggle to reach the start of a line and then add a double forward slash to the comment line can be replaced with this quick keyboard shortcut. - -![Comment out code][11] - -Even if you want to comment out multiple lines, you can select all lines using `SHIFT+UP/Down` and then press `CTRL+/`. - -#### 10\. Jump To The Beginning Or End Of File - -Windows/Linux | macOS ----|--- -CTRL + HOME/END | ⌘ + ↑/↓ - -If you get lost in the middle of your codes, the command can help to quickly reach either start or end of the file. - -#### 11\. Code Folding Or Unfolding - -Windows/Linux | macOS ----|--- -CTRL + SHIFT + [ or ] | ⌥ + ⌘ + [ or ] - -It is one of the most useful shortcuts that can help you collapse/uncollapse a region of code. In this way, you can hide unnecessary code and view only the required section of code at a time to focus more and code fast. - -![Collapse a region of code][12] - -#### 12\. Peek Implementation - -Windows/Linux | macOS ----|--- -CTRL + SHIFT + F12 | ⌘ + SHIFT + F12 - -The shortcut is most likely to help you in your code analysis or bug fixing where you want to understand the working of functions and variables. - -![Peek Implementation][13] - -#### 13\. Delete Current Line - -Windows/Linux | macOS ----|--- -CTRL + SHIFT + K | SHIFT + ⌘ + K - -A single quick command can sum up two tasks of selecting a current line and pressing the delete/backspace button. - -#### 14\. Find And Replace - -Windows/Linux | macOS ----|--- -CTRL + F -CTRL + H | ⌘ + F -⌥ + ⌘ + F - -What could be the best way to replace all occurrences of a text in a file with a new one? If you go for one by one manually by scrolling down the code, no wonder how much time it will take if text occurrence is large. - -![Find and replace][14] - -While using Find and Replace do the same task within seconds. You can open it using two shortcuts where one actually opens the input box for finding text and the other for replacing text. - -#### 15\. VS Code Keyboard Shortcuts - -Windows/Linux | macOS ----|--- -CTRL + K CTRL + S | ⌘ + K ⌘ + S - -At last, if you still struggle with remembering all the above keyboard shortcuts, you still don’t have to worry. This is because you can view all available commands for your editor using the above shortcut. - -![Keyboard Shortcuts][15] - -Here you can also edit keybinding for the command as per your comfort. - -### Want More Keyboard Shortcuts For VS Code? - -If you want to have complete knowledge of VS Code keyboard shortcuts, you can check out the [documentation][16] of Visual Studio Code. - -Or, if you want all available shortcuts in a single piece of paper, get the cheatsheet for [Linux][17], [macOS][18], and [Windows][19]. You can have a quick look whenever you forget. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/vs-code-shortcuts/ - -作者:[Sarvottam Kumar][a] -选题:[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/sarvottam/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Command-Palette.jpg?resize=800%2C418&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Split-VS-Code.png?resize=800%2C405&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Integrated-Terminal.png?resize=800%2C221&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Toggle-Terminal-Using-Command-Palette.png?resize=686%2C118&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Go-to-file.jpg?resize=800%2C388&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Go-to-line.jpg?resize=800%2C99&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Search-project.jpg?resize=381%2C450&ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Zen-Mode.png?resize=800%2C450&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Next-find-match.jpg?resize=800%2C313&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Comment-out-code.jpg?resize=800%2C313&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Collapse-a-region-of-code.jpg?resize=800%2C287&ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Peek-Implementation.png?resize=800%2C339&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Find-and-replace.png?resize=800%2C223&ssl=1 -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Keyboard-Shortcuts.png?resize=800%2C406&ssl=1 -[16]: https://code.visualstudio.com/docs/getstarted/keybindings -[17]: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf -[18]: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf -[19]: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf diff --git a/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md b/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md new file mode 100644 index 0000000000..7e6beb58c9 --- /dev/null +++ b/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md @@ -0,0 +1,240 @@ +[#]: subject: (15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity) +[#]: via: (https://itsfoss.com/vs-code-shortcuts/) +[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) +[#]: collector: (lujun9972) +[#]: translator: (ywxgod) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +15个提高工作效率的VS Code键盘快捷键 +====== + +毫无疑问,微软的[VS Code是最好的开源代码编辑器之一][1]。它与传说中的Vim不同,VS Code不需要你是一个快捷键(译者注:以下都指键盘快捷键)大师,开发者们对它大部分的功能都及其熟悉,且推崇备至。 + +但这并不意味着你不能成为快捷键大师,或者说你在VS Code中不应该使用快捷键。 + +在敲代码的时候,你可能需要用鼠标去执行其他的动作,比如在VS Code编辑器中切换终端,而此时你的代码流程会被打断,这是不是很讨厌?如果是的,那么你应该立即熟记下面这些VS Code有用的快捷键。 + +它不仅能帮助你摆脱鼠标,还能使你的生产力和工作效率得到提高。 + +那么,让我们来了解一下如何通过使用快捷键快速进行代码导航来进行快速编码。 + +### 有用的VS Code快捷键 + +免责声明。下面的这些快捷键是我在VS Code的使用中发现的较为有用的,你可以根据你的需要来发现更多有用的快捷键。 + +下面我还列举了一些MacOS用户的键盘快捷键。 + +#### 1\. 显示所有命令 + +Windows/Linux | macOS +---|--- +CTRL + SHIFT + P or F1 | SHIFT + ⌘ + P or F1 + +我们从最有用的快捷键开始,这个快捷键能打开命令面板(列表),它提供了对VS Code所有功能的访问。 + +![命令面板][2] + +这是一个非常重要的VS Code快捷键,因为即使你忘记了或不想记起其他任何快捷键,但你记得这个,那么你仍然可以使用命令面板进行各种操作,如创建新文件,打开设置,改变主题,还可以查看所有快捷键。 + +#### 2\. 垂直和水平拆分VS Code编辑器 + +Windows/Linux | macOS +---|--- +CTRL + \ +| ⌘ + \ + +为了提高效率,但你又没有安装多个显示器,那么你可以通过水平或垂直分割VS Code的编辑器来一次查看多个文件的代码。 + +![分割VS Code编辑区][3] + +要在多个编辑区间切换焦点,你可以使用数字键或箭头键。 + +Windows/Linux | macOS +---|--- +CTRL + 1/2/3 | ⌘ + 1/2/3 +CTRL + K CTRL + ←/→ | ⌘ + K ⌘ + ←/→ + +#### 3\. 切换集成终端 + +Windows/Linux | macOS +---|--- +CTRL + ` | ⌘ + ` + +VS Code中的集成终端是一个非常方便的功能,它可以让你在不切换窗口的情况下快速执行任务。要在编辑器中显示/隐藏终端,下面的快捷键会非常方便。 + +![集成终端][4] + +但是,如果你跟我一样觉得“CTRL+`”在键盘的角落位置而比较难按到,你可以打开命令面板执行`View: Toggle Terminal`命令来切换终端。 + +![使用命令面板切换终端][5] + +#### 4\. 转到文件 + +Windows/Linux | macOS +---|--- +CTRL + P | ⌘ + P + +随着项目的壮大,查找文件可能会变得困难。因此,我建议,即使你使用鼠标,这个命令也能为你节省很多搜索和导航到版本库中的文件的时间。 + +![转到文件][6] + +#### 5\. 转到行 + +Windows/Linux | macOS +---|--- +CTRL + G | ^ + G + +当你找到文件,你可能需要去到文件中指定的行增加或编辑代码,而如果这个文件包含了数千行代码,那么滚动代码将会浪费你大量的时间。而CTRL+G或^+G 快捷键能让你快速的去掉指定的行。 + +![转到行][7] + +另外,你也可以使用上面的第四种‘转到文件’的快捷键,在输入框中输入冒号`:`加行号,结果就跟‘转到行’一样的。 + +#### 6\. 在整个项目中搜索 + +Windows/Linux | macOS +---|--- +CTRL + SHIFT + F | ⌘ + SHIFT + F + +很可能你需要在整个项目中搜索一个文本、变量或函数,在这种情况下,上面的命令就非常方便,它会在侧边栏显示一个搜索输入框。 + +![在项目中搜索][8] + +我们还可以在搜索的时候添加一些过滤器,比如使用ALT+C来启用大写匹配,ALT+W用于匹配整个单词,ALT+R用于启用正则表达式。 + +#### 7\. Zen模式 + +Windows/Linux | macOS +---|--- +CTRL + K Z | ⌘ + K Z + +想要在不受干扰的环境中工作以保持更专注? 你可以试试Zen模式,它会隐藏所有UI(状态栏、活动栏、面板和侧边栏)并仅在全屏上显示编辑器。 + +![Zen模式][9] + +要启用Zen模式,你可以使用上面的快捷键或者打开命令面板执行“View: Toggle Zen Mode.”,要退出Zen模式,你可以按两次`Esc`键。 + +#### 8\. 将选择添加到下一次匹配中 + +Windows/Linux | macOS +---|--- +CTRL + D | ⌘ + D + +这条命令能让你在所选文本的下一个出现的地方进行编辑。如果下一个匹配出现的位置与第一个相离较远,那这将会很方便处理。 + +![查找下一个匹配][10] + +#### 9\. 切换行注释 + +Windows/Linux | macOS +---|--- +CTRL + / | ⌘ + / + +将光标移到行的开头,然后添加双斜杠进行注释,这种麻烦的操作我们可以用上面的快捷键来代替了。 + +![注释代码][11] + +甚至,如果你想注释多行代码,你可以先通过`SHIFT+UP/Down`快捷键来选中多行,然后按`CTRL+/`快捷键进行注释。 + +#### 10\. 转到文件的开头或结尾 + +Windows/Linux | macOS +---|--- +CTRL + HOME/END | ⌘ + ↑/↓ + +如果你在文件的中间位置感到迷糊,该命令可以让你快速达到文件的起点或终点。 + +#### 11\. 代码折叠或打开 + +Windows/Linux | macOS +---|--- +CTRL + SHIFT + [ or ] | ⌥ + ⌘ + [ or ] + +这也是最有用的快捷键之一,它可以帮助你折叠/取消折叠一个区域的代码。通过这种方式,你可以隐藏不必要的代码,每次只查看所需的部分代码,以便更加专注和快速编码。 + +![折叠一块代码][12] + +#### 12\. 窥视执行 + +Windows/Linux | macOS +---|--- +CTRL + SHIFT + F12 | ⌘ + SHIFT + F12 + +这个快捷键最有可能的作用是帮助你进行代码分析,或修复bug时了解函数和变量的运行情况。 + +![窥视执行][13] + +#### 13\. 删除当前行 + +Windows/Linux | macOS +---|--- +CTRL + SHIFT + K | SHIFT + ⌘ + K + +这是一条可以快速执行,选中当前行和按删除/退格键,这两个任务的简单命令。 + +#### 14\. 查找与替换 + +Windows/Linux | macOS +---|--- +CTRL + F +CTRL + H | ⌘ + F +⌥ + ⌘ + F + +用一个新的文本替换文件中所有出现的该文本的最好方法是啥? 如果你手动一个一个的通过滚动代码来处理,且如果需要替换的地方又很多,那么你可能会花费大量的时间。 + +![查找与替换][14] + +而使用查找和替换我们能在几秒内完成相同的任务。你可以用两个快捷键来打开它,其中一个实际上是打开用于查找文本的输入框,另一个用于输入新的文本。 + +#### 15\. VS Code键盘快捷键 + +Windows/Linux | macOS +---|--- +CTRL + K CTRL + S | ⌘ + K ⌘ + S + +最后,如果你还在为记住上述所有的快捷键而苦恼,你大可不必。因为你可以使用上面的快捷键查看编辑器所有可用的命令。 + +![快捷键][15] + +你还可以根据自己的喜好编辑命令的绑定键。 + +### 想要为VS Code添加更多快捷键? + +如果你想对VS Code的快捷键有完整的了解,你可以查看VS Code的[文档][16]。 + +或者,如果你想在纸上将所有快捷键打印出来慢慢看,下面这些是各个系统对应的快捷键小抄[Linux][17],[macOS][18]和[Windows][19]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vs-code-shortcuts/ + +作者:[Sarvottam Kumar][a] +选题:[lujun9972][b] +译者:[ywxgod](https://github.com/ywxgod) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sarvottam/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Command-Palette.jpg?resize=800%2C418&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Split-VS-Code.png?resize=800%2C405&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Integrated-Terminal.png?resize=800%2C221&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Toggle-Terminal-Using-Command-Palette.png?resize=686%2C118&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Go-to-file.jpg?resize=800%2C388&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Go-to-line.jpg?resize=800%2C99&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Search-project.jpg?resize=381%2C450&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Zen-Mode.png?resize=800%2C450&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Next-find-match.jpg?resize=800%2C313&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/Comment-out-code.jpg?resize=800%2C313&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Collapse-a-region-of-code.jpg?resize=800%2C287&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Peek-Implementation.png?resize=800%2C339&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/Find-and-replace.png?resize=800%2C223&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/Keyboard-Shortcuts.png?resize=800%2C406&ssl=1 +[16]: https://code.visualstudio.com/docs/getstarted/keybindings +[17]: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdf +[18]: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf +[19]: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf From aa50f1de5325d14cfb2e3ed22b79ac861b4f6cc2 Mon Sep 17 00:00:00 2001 From: M4Xrun <32414189+M4Xrun@users.noreply.github.com> Date: Sat, 12 Jun 2021 20:53:22 +0800 Subject: [PATCH 055/870] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...gists on careers in tech for minorities.md | 126 ----------------- ...gists on careers in tech for minorities.md | 128 ++++++++++++++++++ 2 files changed, 128 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20200228 4 technologists on careers in tech for minorities.md create mode 100644 translated/tech/20200228 4 technologists on careers in tech for minorities.md diff --git a/sources/tech/20200228 4 technologists on careers in tech for minorities.md b/sources/tech/20200228 4 technologists on careers in tech for minorities.md deleted file mode 100644 index 806300d5db..0000000000 --- a/sources/tech/20200228 4 technologists on careers in tech for minorities.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 technologists on careers in tech for minorities) -[#]: via: (https://opensource.com/article/20/2/careers-tech-minorities) -[#]: author: (Shilla Saebi https://opensource.com/users/shillasaebi) - -4 technologists on careers in tech for minorities -====== -Learn what Black History Month means to them, what influences their -career, resources for minorities wanting to break into tech, and more. -![Team meeting][1] - -In honor of Black History Month, I've garnered the opinions of a few of my favorite technology professionals and open source contributors. These four individuals are paving the way for the next generation alongside the work they're doing in the technology industry. Learn what Black History Month means to them, what influences their career, resources for minorities wanting to break into tech, and more. - -**[Tameika Reed][2], founder of Women In Linux** - -Since its launch, Tameika leads initiatives with a focus on exploring careers in infrastructure, cybersecurity, DevOps and IoT, pivoting into leadership and continuous skill-building. As a self-taught system administrator, Tameika believes the best way to learn tech is by just diving in. In efforts to give women a 360° view of tech, Tameika hosts a weekly virtual meetup to explore outside the norm of just Linux but introducing hyperledger, Kubernetes, microservices, and high-performance computing. Tameika’s career includes different conference talks from OSCon, LISA 2018, Seagl, HashiCorp EU 2019, and various local events. - -**[Michael Scott Winslow][3], Director, Core Applications and Platforms, Comcast** - -"I'm a father, husband, brother, and son. I come from a small family so I have fun turning friends into an extended family. When I attach my name to something, I obsess over its success, so I am very careful what I agree to be a part of. Oh, so as far as my career I have been involved with software development for decades. I solve problems. I work with others to help solve large problems. I lead, guide and mentor newer software engineers while observing others that I want to learn from." - -**[Bryan Liles][4], senior staff engineer, VMware** - -"I’m working with our team to rethink how developers interact with Kubernetes. When not working, I’m out in the community trying to inspire the next generation of software engineers and building robots." - -**[Mutale Nkonde][5], founding CEO of AI For the People (AFP)** - -AFP is a nonprofit creative agency. Prior to starting a nonprofit she worked in AI Governance. During that time she was part of the team that introduced the Algorithmic and Deep Fakes Algorithmic Acts, as well as the No Biometric Barriers to Housing Act to the US House of Representatives. Nkonde started her career as a broadcast journalist and worked at the BBC, CNN & ABC. She also writes widely on race and tech, as well as holding fellowships at Harvard and Stanford. - -### What influenced you to pursue a career in technology? - -My fear of the computer when I went back to college. I was afraid of the computer because I dropped out of college. After and going back, I made it my mission to learn all I can. This is still my motto to this day, learning never stops. —Tameika Reed - -I won’t mince words, I was a child geek! At 10 years old I started writing GW-BASIC from code that I read in printed magazines. Every single day. I gave it a bit of a break to have a life while I went to high school, but when it came time to pick a major for college, it was an easy choice. I stayed in technology thanks to the amazing mentors and colleagues I’ve had along the way. —Michael Scott Winslow - -I’ve been writing software since I was in middle school. I like being able to tell computers to do things and seeing the results. As an adult, I quickly realized that having a job that gave me satisfaction and paid well was the way to go. —Bryan Liles - -I wanted to explore the questions around why so few black women were being hired by tech companies. —Mutale Nkonde - -### Is there a particular person or people in open source and the tech world who have inspired you? - -I get inspired by a lot of other people and projects. For example, I love seeing others come to [Women In Linux][6] and are sure where they want to go. I try to give people a 360-view of tech so they can make a decision on what they like. Its easy to say I want to be in tech but it’s hard to get started and stay. You don’t have to be just a coder/programmer but you can be a cloud architect. —Tameika Reed - -[Kelsey Hightower][7], [Bryan Liles][4], and Kim Scott inspire me very much. They are so REAL! They say things that I feel and experience every day. Get your job done! Stop complaining! Own your actions and understand how you contribute to your situation! [Gene Kim][8] is a big inspiration as well. As a leader in the DevOps movement, I see myself following and emulating a lot of things he does. —Michael Scott Winslow - -No. I didn’t see the inspiration I wanted, so I’ve worked hard to be the inspiration I needed 20 years ago. —Bryan Liles - -There are so many! One of my favorites is [Dorothy Vaughan][9]: She was the first person in the US to program an IBM Watson computer. Her story is captured in the movie Hidden Figures. —Mutale Nkonde - -### Are there particular resources you would recommend for minorities wanting to break into tech? - -Yes, I recommend finding folks on Twitter and just ask questions. Here is a list of people I follow and admire in tech: —Tameika Reed - - * [@techgirl1908][10] - * [@bryanl][4] - * [@kelseyhightower][7] - * [@kstewart][11] - * [@tiffani][12] - * [@EricaJoy][13] - * [@womeninlinux][6] - * [@ArlanWasHere][14] - * [@blkintechnology][15] - * [@digundiv][16] - - - -Respected bootcamps are really cutting down the time it takes to break into the tech industry. I’ve met several professionals who went through bootcamps who have outshined their 4-year institution counterparts. I think we can really start respecting everything that people bring to the table, rather than technical fluency. —Michael Scott Winslow - -I’m not sure I can recommend anything specific. Tech is a big thing and there isn’t an easy answer. My advice is to pick something you think will be interested in and work to become an expert on the topic. Start asking why instead of how, and also start understanding how things work together. — Bryan Liles - -It really depends on the type of work they want to do. For people working at the intersection of tech and social justice, I would recommend the book [Algorithms of Oppression][17] by Safiya Noble. —Mutale Nkonde - -### What advice would you give to a person of color considering technology as their career? - -I suggest you study your craft. You will be a forever learner. There will always be someone or something in your way how you respond and move will be on you. Never take the first offer push back and know your worth. I look at tech like I look at art. It takes time to develop so be patient with yourself. It's okay to unplug and say no. —Tameika Reed - -As someone who is a bit of a protector of the industry, I don’t want people who are not suited for technology. So really decide if you have the personality for tech. Are you a problem solver? Are you more logical than emotional? Do you constantly find yourself creating processes? If so, no matter your background, I think you can find a home in tech. —Michael Scott Winslow - -It is not going to be simple. Your progress will be slowed because of your race. You will have to work harder. Use this adversity as a strength. You will be better prepared than those around you and when the opportunity arises, you will be able to tackle it. Find a network of those who look like you. Air grievances in private and show strength in public. You belong and you can succeed. —Bryan Liles - -To think beyond working for a company, the field of public interest tech is growing, our work centers on how technology impacts real people. Many of the people leading this work are women of color and Black women are making huge strides. Mutale Nkonde - -### What does Black History Month mean to you? - -It means never stop because you can never forget. —Tameika Reed - -Black History Month to me means focusing on the Tuskegee Airmen and not slavery. Highlighting how we contributed to history and not how were victims of it. I want people to understand where our pride comes from and not our anger. There are a lot of really bad things that happened to our people and we are still right here. Strong! —Michael Scott Winslow - -Black History Month is a time to reflect on the forgotten history of black people in the United States. I take it as a time to be thankful for the sacrifices my ancestors made. —Bryan Liles - -It is a time to center the contributions black people have made across the globe. I love it, it is one of my favorite times of year. —Mutale Nkonde - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/careers-tech-minorities - -作者:[Shilla Saebi][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/shillasaebi -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting-team-listen-communicate.png?itok=KEBP6vZ_ (Team meeting) -[2]: https://www.linkedin.com/in/tameika-reed-1a7290128/ -[3]: https://twitter.com/michaelswinslow -[4]: https://twitter.com/bryanl -[5]: https://twitter.com/mutalenkonde -[6]: https://twitter.com/WomenInLinux -[7]: https://twitter.com/kelseyhightower -[8]: https://twitter.com/RealGeneKim -[9]: https://en.wikipedia.org/wiki/Dorothy_Vaughan -[10]: https://twitter.com/techgirl1908 -[11]: https://twitter.com/kstewart -[12]: https://twitter.com/tiffani -[13]: https://twitter.com/EricaJoy -[14]: https://twitter.com/ArlanWasHere -[15]: https://twitter.com/blkintechnology -[16]: https://twitter.com/digundiv -[17]: http://algorithmsofoppression.com/ diff --git a/translated/tech/20200228 4 technologists on careers in tech for minorities.md b/translated/tech/20200228 4 technologists on careers in tech for minorities.md new file mode 100644 index 0000000000..67cb7559ab --- /dev/null +++ b/translated/tech/20200228 4 technologists on careers in tech for minorities.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: (M4Xrun) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 technologists on careers in tech for minorities) +[#]: via: (https://opensource.com/article/20/2/careers-tech-minorities) +[#]: author: (Shilla Saebi https://opensource.com/users/shillasaebi) + +4 technologists on careers in tech for minorities + +====== +了解黑人历史月对他们意味着什么,什么影响了他们的职业生涯,为想要进入科技领域的少数民族提供资源,等等。 +![Team meeting][1] + +为了纪念黑人历史月,我收集了一些我最喜欢的技术专家和开源贡献者的意见。这四位正在为下一代铺路,同时也在为他们在科技行业所做的工作铺路。了解黑人历史月对他们意味着什么,什么影响了他们的职业生涯,为想要进入科技领域的少数民族提供资源,等等。 + +**[Tameika Reed][2], Women In Linux创始人** + +自Women In Linux发起以来,Tameika一直致力于探索基础设施、网络安全、DevOps和物联网领域的职业生涯,并致力于领导力和持续技能的培养。作为一个自学成才的系统管理员,Tameika相信学习技术的最好方法就是深入其中。为了给女性一个全面的角度来看技术,Tameika每周都会举办一次线上会议来探讨hyperledger、Kubernetes、微服务和高性能计算等Linux常规之外的技术。Tameika的职业生涯包括与OSCon、LISA 2018、Seagl、HashiCorp EU 2019不同的会议以及各种当地活动进行会议发言。 + +**[Michael Scott Winslow][3], 康卡斯特公司核心应用与平台总监** + +"我是一个父亲,丈夫,兄弟,儿子。我出生在一个小家庭,所以我很乐于把朋友们变成一个大家庭。当我把我的名字附在某件事上时,我就非常希望它能成功,所以我很在意我同意参与的事情。 +噢,在我的职业生涯中我已经做了数十年的软件开发。我解决问题,和别人合作一起帮助解决大问题,我带领、引导和指导年轻的软件工程师的同时观察我想要学习的人。" + +**[Bryan Liles][4], 资深工程师, VMware** + +“我正在和我们的团队一起重新思考开发人员如何与Kubernetes进行交互。当我不工作的时候,我就制造机器人和在社区里努力激励下一代的软件工程师。” + +**[Mutale Nkonde][5], AI For the People (AFP)首席执行官** + +AFP是一家非盈利的创意机构。在创办非营利组织之前,Nkonde从事人工智能治理工作。在此期间,她是团队的一员,该团队向美国众议院介绍了算法和深度伪造算法方案,以及无生物识别障碍住房方案。Nkonde的职业生涯中最开始是做广播记者,曾在英国广播公司(BBC)、美国有线电视新闻网(CNN)和美国广播公司(ABC)工作。她还广泛从事种族和科技方面的写作,并在哈佛大学和斯坦福大学获得奖学金。 + + +### 是什么影响了你选择技术领域的职业? + +当我回到大学的时候,我害怕电脑。我害怕电脑,因为我从大学辍学了。在那之后,我就把尽我所能学习作为自己的任务。这是我至今的座右铭,学习永不停止。—Tameika Reed + +我不会拐弯抹角,我小时候是个极客!在我10岁的时候,我从印刷杂志上读到的代码开始每天写GW-BASIC。在我上高中的时候,我给了自己一点喘息的时间来享受生活,但是当到了为大学选择专业的时候,这是一个很容易做出的选择。我留在了科技行业,这得感谢我一路走来遇到的了不起的导师和同事。—Michael Scott Winslow + +我从中学就开始写软件了。我喜欢告诉电脑去做事情并看到结果。长大后,我很快就意识到,拥有一份让我满意、收入高的工作才是正确的选择。—Bryan Liles + +我想知道为什么科技公司雇佣的黑人女性这么少。 —Mutale Nkonde + +### 在开源技术领域有没有某个特别的人给了你启发? + +我从很多其他人和项目中得到启发。比如我喜欢看到其他人来到[Women In Linux][6],并确定他们想去哪里。我试着让人们从更全面的角度来看科技,这样他们就可以决定自己喜欢什么。说自己想在科技行业工作很容易,但要入手并坚持下去很难。你可以称为一名云架构师而不只是一名程序员。—Tameika Reed + +[Kelsey Hightower][7],[Bryan Liles][4],和 Kim Scott 激励了我。他们太真实了!他们说的都是我每天的感受和经历。做好你的工作!别抱怨了!承认你的行为,并明白你是如何促成你的处境的![Gene Kim][8]也给了我很大的启发。作为DevOps运动的领导者,我看到自己在追随和模仿他做的很多事情。 —Michael Scott Winslow + +不,我没有看到我想要的灵感,所以我努力成为20年前那个给我启发的人。 —Bryan Liles + +太多了!我最喜欢的一个是:[Dorothy Vaughan][9]她是美国第一个为IBM沃森电脑变成的人。她的故事被记录在电影Hidden Figures中。 —Mutale Nkonde + +### 你有什么特别的资源可以推荐给那些想要加入科技行业的少数人吗? + +有,我建议你在Twitter上交一些朋友,然后提问。以下是我在科技界关注和崇拜的一些人: —Tameika Reed + + * [@techgirl1908][10] + * [@bryanl][4] + * [@kelseyhightower][7] + * [@kstewart][11] + * [@tiffani][12] + * [@EricaJoy][13] + * [@womeninlinux][6] + * [@ArlanWasHere][14] + * [@blkintechnology][15] + * [@digundiv][16] + + + +受重视的训练营确实缩短了人们加入科技行业的时间。我遇到过几位经过培训的专业人士,他们都比4年经验的机构同行更出色。我认为我们可以真正开始尊重人们创造的成果,而不是技术的熟练。 —Michael Scott Winslow + +我不确定我能推荐什么具体的东西。科技是一个很大的整体,所以没有一个简单的答案。我的建议是选择你认为会感兴趣的东西,并努力成为这个方面的专家。从问为什么开始,而不是怎么做,并且开始理解事物是如何一起运作的。 — Bryan Liles + +这取决于他们想做什么工作。对于那些在科技和社会公正的交汇处工作的人,我推荐Safiya Noble的[Algorithms of Oppression][17]。 —Mutale Nkonde + +### 你对有色人种将科技作为他们的职业有什么建议? + +我建议你学习自己的技能。你将是一个永远的学习者。总会有人或事挡在你的路上,你的反应和行动将取决于你自己。永远不要拒绝第一个提议,要知道自己的价值。我看技术就像看艺术一样。发展需要时间,所以要对自己有耐心,拔掉插头说不也没关系。 —Tameika Reed + +作为这个行业的保护者,我不想要不适合技术的人。所以要真正判断自己是否适合科技。你是一个能解决问题的人吗?你是否理性多于感性?你是否经常发现自己在创造过程?如果是这样,无论你的背景如何,我认为你都可以在科技行业找到一个家。—Michael Scott Winslow + +事情不会那么简单。你的进步会因为你的比赛而减慢。你必须更努力工作。把逆境当作动力。你比周围的人准备的更充分,这样当机会出现时你就能够应对它。找一个长的像你的人。私下发现不满,公开展示实力。你属于这里,你就能成功。 —Bryan Liles + +除了为一家公司工作,也在发展公共利益技术领域,我们的工作中心事技术如何影响真实的人。许多领导这项工作的人是有色人种妇女,黑人妇女正在取得巨大的进步。—Mutale Nkonde + +### 黑人历史月对你来说意味着什么? + +意味着永不停止,为你永远不会忘记。 —Tameika Reed + +黑人历史月对我来说意味着关注塔斯克基飞行队而不是奴隶制。强调我们如何为历史做出贡献,而不是如何成为历史的受害者。我希望人们理解我们的骄傲来自哪里,而不是我们的愤怒。在我们的人民身上发生了很多非常糟糕的事情,但我们还站在这里。强!—Michael Scott Winslow + +黑人历史月是一个反思被遗忘的美国黑人历史的日子。我把它当作是感谢我的祖先所做的牺牲的时刻。—Bryan Liles + +这是一个集中体现全球黑人所作贡献的时刻。我喜欢它,这是我一年中最喜欢的时间之一。 —Mutale Nkonde + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/careers-tech-minorities + +作者:[Shilla Saebi][a] +选题:[lujun9972][b] +译者:[M4Xrun](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/shillasaebi +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting-team-listen-communicate.png?itok=KEBP6vZ_ (Team meeting) +[2]: https://www.linkedin.com/in/tameika-reed-1a7290128/ +[3]: https://twitter.com/michaelswinslow +[4]: https://twitter.com/bryanl +[5]: https://twitter.com/mutalenkonde +[6]: https://twitter.com/WomenInLinux +[7]: https://twitter.com/kelseyhightower +[8]: https://twitter.com/RealGeneKim +[9]: https://en.wikipedia.org/wiki/Dorothy_Vaughan +[10]: https://twitter.com/techgirl1908 +[11]: https://twitter.com/kstewart +[12]: https://twitter.com/tiffani +[13]: https://twitter.com/EricaJoy +[14]: https://twitter.com/ArlanWasHere +[15]: https://twitter.com/blkintechnology +[16]: https://twitter.com/digundiv +[17]: http://algorithmsofoppression.com/ From 78af80ca6b42ac3b3799f54db90c4f324734a251 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 13 Jun 2021 05:03:08 +0800 Subject: [PATCH 056/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210612=20?= =?UTF-8?q?How=20I=20teach=20Python=20on=20the=20Raspberry=20Pi=20400=20at?= =?UTF-8?q?=20the=20public=20library?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210612 How I teach Python on the Raspberry Pi 400 at the public library.md --- ... Raspberry Pi 400 at the public library.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210612 How I teach Python on the Raspberry Pi 400 at the public library.md diff --git a/sources/tech/20210612 How I teach Python on the Raspberry Pi 400 at the public library.md b/sources/tech/20210612 How I teach Python on the Raspberry Pi 400 at the public library.md new file mode 100644 index 0000000000..1480f69fe7 --- /dev/null +++ b/sources/tech/20210612 How I teach Python on the Raspberry Pi 400 at the public library.md @@ -0,0 +1,92 @@ +[#]: subject: (How I teach Python on the Raspberry Pi 400 at the public library) +[#]: via: (https://opensource.com/article/21/6/teach-python-raspberry-pi) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How I teach Python on the Raspberry Pi 400 at the public library +====== +After a long year of putting plans on hold, declining COVID case numbers +are bringing back community-based programming courses. +![Women programming][1] + +After a long and tough year, I've been looking forward to once again sharing my love of Python and open source software with other people, especially middle and high school students. Before the pandemic, I co-wrote a grant to teach Python programming to middle school students using Raspberry Pi computers. Like many other plans, COVID-19 put mine on hold for over a year. Fortunately, vaccines and the improved health in my state, New York, have changed the dynamic. + +A couple of months ago, once I became fully vaccinated, I offered to self-fund a Raspberry Pi and Python programming course in our local public library system. The [Chautauqua-Cattaraugus Library system][2] accepted my proposal, and the co-central library in Olean, N.Y., offered to fund my program. The library purchased five [Raspberry Pi 400][3] units, Micro-HDMI-to-VGA adapters, and inline power adapters, and the library system's IT department loaned us five VGA monitors. + +With all our equipment needs met, we invited middle school students to enroll for four afternoons of learning and programming fun. + +All the students were socially distanced, each with a new Pi 400 and VGA monitor at their desk. Our class was small, made up of a fourth-grade student and two sixth-grade students. None had a programming background, and their keyboarding skills were rough. However, their innate curiosity and enthusiasm carried the day. + +### Learning and iterating + +We spent the first afternoon assembling the Pi 400s, connecting them to the library's wireless network, and installing the [Mu Python editor][4], which we used for the class. + +![Raspberry Pi 400 equipment][5] + +(Don Watkins, [CC BY-SA 4.0][6]) + +I followed this with a brief introduction to Raspberry Pi OS and how it differs from Windows and macOS computers and offered a brief tutorial on using the Mu editor. + +Since we were meeting in a public library, I emphasized that the library has books covering the concepts and Python programming code used in the class, especially [_Teach Your Kids to Code_][7] by Dr. Bryson Payne and [_Python for Kids_][8] by Jason Briggs. I created daily handouts for the students to refer to alongside the instruction. I also used my own Raspberry PI 400 connected to a 32" LCD monitor to illustrate the code and programming results. + +![Raspberry Pi 400 setup][9] + +(Don Watkins, [CC BY-SA 4.0][6]) + +I like to use the [turtle module to introduce Python][10] programming. It's always been well received, and the students love the graphics they can create while learning Python basics like variables, [`for` loops][11], lists, and the importance of syntax. + +I learn something new every time I teach, and this was no exception. I especially enjoy watching students iterate on my code examples—some are from books, and others are my own creations. The fourth-grader in our class took this example code and added two more colors and corresponding code to create a six-color spiral. + + +``` +# multicolor spiral +import turtle as t +colors = ["red", "yellow", "blue", "green"] +for x in range(100): +    t.pencolor(colors[x%4]) +    t.circle(x) +    t.left(91) +``` + +![Spiral graphic created in Python][12] + +(Don Watkins, [CC BY-SA 4.0][6]) + +At the end of the four-day course, each student received a Raspberry Pi 400 and a book explaining how to program their computer. They also got a list of free and open source software resources, a reading list of recommended books available in the library, and some open educational resources available on the web. + +### Open learning + +Mark Van Doren said, "the art of teaching is the art of assisting discovery." I saw that play out in this classroom using open source tools. More students need opportunities like this to help them gain a quality education. The Raspberry Pi 400 is a great form factor for teaching and learning. + +The [Olean Library][13] plans to offer another similar course later this year. I encourage you to share your love of free and open source software with your own communities. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/teach-python-raspberry-pi + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G (Women programming) +[2]: https://www.cclsny.org/ +[3]: https://opensource.com/article/21/3/raspberry-pi-400-review +[4]: https://opensource.com/article/18/8/getting-started-mu-python-editor-beginners +[5]: https://opensource.com/sites/default/files/uploads/pi400_library.jpg (Raspberry Pi 400 equipment) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/education/15/9/review-bryson-payne-teach-your-kids-code +[8]: https://nostarch.com/pythonforkids +[9]: https://opensource.com/sites/default/files/uploads/pi400_library-teacher.jpg (Raspberry Pi 400 setup) +[10]: https://opensource.com/article/17/10/python-101#turtle +[11]: https://opensource.com/article/18/3/loop-better-deeper-look-iteration-python +[12]: https://opensource.com/sites/default/files/uploads/pi400-spiral.jpg (Spiral graphic created in Python) +[13]: https://www.oleanlibrary.org/ From 9951a74a17c0c2545e60a873485ef57ba92a6251 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 13 Jun 2021 08:12:02 +0800 Subject: [PATCH 057/870] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E8=B6=85=E6=9C=9F?= =?UTF-8?q?=EF=BC=9B=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Starryi @iamcopper @HuengchI 超期回收,如需要重新提交请更新后提交。 @mengxinayan @PearFL 翻译后文件没有移动,下回注意。 --- ...a Revamped Design and Improved Features.md | 112 ------------------ ...d Support, Undo-Redo, and Browser Docks.md | 99 ---------------- ...top Environment with Pop-_OS 21.04 Beta.md | 94 --------------- ...ld Firefox Interface (but not for long).md | 76 ------------ ...ndy Visuals with Usability Improvements.md | 86 -------------- ...hy we open sourced our security project.md | 2 +- ...107 5 ways to improve your Bash scripts.md | 2 +- ... How key Python projects are maintained.md | 2 +- sources/tech/20210610 .md | 25 ---- ...de to the syntax of C-- method pointers.md | 0 ...0210523 3 reasons to learn Java in 2021.md | 0 11 files changed, 3 insertions(+), 495 deletions(-) delete mode 100644 sources/news/20210601 Firefox 89 is Here with a Revamped Design and Improved Features.md delete mode 100644 sources/news/20210602 OBS Studio 27 Adds Wayland Support, Undo-Redo, and Browser Docks.md delete mode 100644 sources/news/20210603 You Can Now Try the New COSMIC Desktop Environment with Pop-_OS 21.04 Beta.md delete mode 100644 sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md delete mode 100644 sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md delete mode 100644 sources/tech/20210610 .md rename {sources => translated}/tech/20210222 A friendly guide to the syntax of C-- method pointers.md (100%) rename {sources => translated}/tech/20210523 3 reasons to learn Java in 2021.md (100%) diff --git a/sources/news/20210601 Firefox 89 is Here with a Revamped Design and Improved Features.md b/sources/news/20210601 Firefox 89 is Here with a Revamped Design and Improved Features.md deleted file mode 100644 index ce4020a1cf..0000000000 --- a/sources/news/20210601 Firefox 89 is Here with a Revamped Design and Improved Features.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: subject: (Firefox 89 is Here with a Revamped Design and Improved Features) -[#]: via: (https://news.itsfoss.com/firefox-89-release/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Firefox 89 is Here with a Revamped Design and Improved Features -====== - -Firefox has long been the default web browser for many popular distributions such as Ubuntu and Manjaro. It is well known for its privacy features, as well as being completely open source. - -It has had many notable UI redesigns over the years, of which the latest was the Photon design. Although this design did improve the UI, Google Chrome has remained the browser king. - -In this release, Mozilla seems to be targeting Chrome with their new UI and new privacy features. - -### What’s New? - -Although the feature list is not particularly long, it will make a significant impact on the future of Firefox, I believe. The main new features are as follows: - - * Brand-new Proton UI - * Streamlined menu - * Calmer visuals - * Total Cookie Protection in private browsing mode - - - -In this article, we will be diving into what these are, and what impact they will have on Firefox’s future. - -#### New Proton UI - -![][1] - -By far the biggest change, this UI redesign is a huge step in the right direction. - -We already have a separate article dedicated to [the new Proton user interface][2], if you are curious to know what exactly are the changes involved in the redesign. - -![][3] - -As key highlights, the redesign involves: - - * A redesigned toolbar - * A new hamburger menu - * A redesigned address bar - * New animations while moving tabs - - - -The result is a much more modern-looking browsing experience. While some people may not like the larger UI elements and rounded corners, my experience with the beta has been incredibly positive. - -![][3] - -Overall, the interface is clean, with calmer visuals, and aims to provide you fewer distractions. - -This is the key highlight of Firefox 89 release – so you should give it a spin before you start to love it or hate it! - -#### Privacy Improvements - -First introduced in Firefox 86, Total Cookie Protection is Firefox’s way of dealing with the many security concerns associated with cookies. - -It works by putting each website’s cookies into a separate virtual cookie jar. These cookie jars are only able to be opened by the website that created them, making cross-website tracking much harder. - -Previously, this awesome feature was only available in Firefox’s ETP Strict mode. With Firefox 89, this awesome feature becomes more prominent, now becoming part of Firefox’s private browsing mode. - -This, along with the presence of [SmartBlock feature][4] (introduced in Firefox 87) should be an exciting combination. - -For more information on Total Cookie Protection, have a look at the initial release in our [coverage of Firefox 86][5]. - -### Other Improvements - -The release also includes some bug fixes and security updates. You can explore more about what has changed for other platforms like macOS in their [official release note][6]. - -### Wrapping Up - -It is praiseworthy to see Mozilla’s continued support for Firefox to protect user privacy, and this really shines through with this release. - -Between the hugely improved UI, and the new privacy features, Firefox 89 is a great release. As a privacy-oriented individual, I am really excited about Total Cookie Prevention by default in private browsing mode. - -[Download Mozilla Firefox 89][7] - -On the other hand, I also think Mozilla should stop making constant design overhauls and make refinements to a particular design over the time. While it is important to improve user experience, UI overhauls often break the workflow, which is not a good thing. - -I hope this is the last re-design Firefox implements and shifts its focus on performance, convenience, and gaining back the lost market share to Google Chrome and other chrome-based web browsers. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/firefox-89-release/ - -作者:[Jacob Crume][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/jacob/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://news.itsfoss.com/firefox-proton-redesign/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://blog.mozilla.org/security/2021/03/23/introducing-smartblock/ -[5]: https://news.itsfoss.com/firefox-86-release/ -[6]: https://www.mozilla.org/en-US/firefox/89.0/releasenotes/ -[7]: https://www.mozilla.org/firefox/download/ diff --git a/sources/news/20210602 OBS Studio 27 Adds Wayland Support, Undo-Redo, and Browser Docks.md b/sources/news/20210602 OBS Studio 27 Adds Wayland Support, Undo-Redo, and Browser Docks.md deleted file mode 100644 index b42e71cb8b..0000000000 --- a/sources/news/20210602 OBS Studio 27 Adds Wayland Support, Undo-Redo, and Browser Docks.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: (OBS Studio 27 Adds Wayland Support, Undo/Redo, and Browser Docks) -[#]: via: (https://news.itsfoss.com/obs-studio-27-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -OBS Studio 27 Adds Wayland Support, Undo/Redo, and Browser Docks -====== - -Open Broadcaster Software is a free and open-source streaming/recording solution available for multiple platforms. - -Not long ago, we [spotted native Wayland support coming to OBS Studio][1]. - -Now, with the release of OBS Studio 27, it is finally a reality. Not just limited to wayland support, but there are some significant feature additions. - -Here, I shall highlight the key changes introduced with OBS Studio 27. - -### OBS Studio 27: What’s New? - -![][2] - -The key new feature addition with this release is **Undo/Redo**. - -While it sounds like a basic feature that should have existed from the start — but they needed to have a proper implementation, for which they waited. - -The [release announcement][3] mentions a note about it back in 2018: - -> _This is on the agenda. Fortunately, it’s not a “difficult” feature to write, it’s actually pretty simple, but the implementation is what’s delicate, and requires a fair amount of experience to get right._ - -Now that it is here, you can work stress-free without needing to constantly tweak when you accidentally modify something. - -Of course, there’s a limit to what the Undo function can do, and it looks like it should be able to revert **5000 actions** in a particular session. It is worth noting that if you restart the app, you can no longer undo the last actions. - -![][4] - -More about it in the announcement post: - -> Undo is built to track actions that affect the preview. This means every potential modification to scenes, sources, groups, filters, stingers, and scripts. These have the potential to affect the feed in real-time, without a chance to “Apply” changes, and can sometimes result in complex changes that are harder to quickly revert or recreate. The Undo stack is capable of tracking the last 5,000 actions of the session, and is cleared when switching scene collections or restarting the app. - -The next important addition is the **browser dock**, which was already present for Windows users but introduced for macOS and Linux with this release. - -The dock will let you quickly access other sites or services while using the OBS app such as chats, Twitch account linking, and more. - -### Other Improvements - -The release also addresses the display capture support on Laptops with different GPUs, which should provide a good experience for Laptop users. - -There’s also a new missing files dialogue which will clearly list what’s missing to spot the sources that you need to add. - -For more information on the changes, you may refer to the [official announcement post][3]. - -### Download OBS Studio 27 - -You can directly install OBS Studio using the Ubuntu PPA but the Wayland support is available only for Ubuntu 21.04 and above through this method. - -In case you want to do that, here’s what you need to type in the terminal (ensure you have [ffmpeg][5] installed): - -``` -sudo add-apt-repository ppa:obsproject/obs-studio -sudo apt install obs-studio -``` - -So, it is best to use the [Flatpak package][6] to get started. You can also take the help of our [Flatpak guide][7] if you’re using it for the first time. - -You can find other download options in the official download page or its [GitHub page][8]. - -[Download OBS Studio 27][9] - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/obs-studio-27-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/obs-studio-wayland/ -[2]: https://i0.wp.com/i.ytimg.com/vi/LUkMxYNIyj0/hqdefault.jpg?w=780&ssl=1 -[3]: https://obsproject.com/blog/obs-studio-27-released -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://itsfoss.com/ffmpeg/ -[6]: https://flathub.org/apps/details/com.obsproject.Studio -[7]: https://itsfoss.com/flatpak-guide/ -[8]: https://github.com/obsproject/obs-studio -[9]: https://obsproject.com/download diff --git a/sources/news/20210603 You Can Now Try the New COSMIC Desktop Environment with Pop-_OS 21.04 Beta.md b/sources/news/20210603 You Can Now Try the New COSMIC Desktop Environment with Pop-_OS 21.04 Beta.md deleted file mode 100644 index 6a08460085..0000000000 --- a/sources/news/20210603 You Can Now Try the New COSMIC Desktop Environment with Pop-_OS 21.04 Beta.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: subject: (You Can Now Try the New COSMIC Desktop Environment with Pop!_OS 21.04 Beta) -[#]: via: (https://news.itsfoss.com/pop-os-21-04-beta-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -You Can Now Try the New COSMIC Desktop Environment with Pop!_OS 21.04 Beta -====== - -Pop!_OS 21.04 is one of the [most anticipated distros][1] of this year and the public beta has finally arrived. - -While we do not have an official list of changes that follows with this release, but it comes packed with its brand new COSMIC Desktop Environment. - -Let me highlight a few things about the desktop, how you can download it, and my initial thoughts on it. - -### COSMIC Desktop Environment on Pop!_OS 21.04 - -![][2] - -With Pop!_OS 21.04 beta, we have more information on it than we had when [System76 first revealed the COSMIC Desktop Environment][3]. - -The horizontal dock sure looks pretty. By default, the dock extends to the edges of the screen, but you can change that as well. Here’s how it looks without the dock extending (macOS-like layout?) - -![][4] - -The icons look colorful and attractive. You will find options to tweak the dock as well (to hide it, change the position, etc.) - -There are some options like adding a launcher icon or workspace icon in the dock itself that are in the to-do list and should be added with the updates to beta version. In addition to that, you can also expect the hot corner feature to arrive soon enough. - -![][5] - -### Other Improvements - -The overall color theme looks to be the same — so there are subtle visual changes, no big makeovers. - -Coming from Pop!_OS 20.04, it will surely feel quite unfamiliar, and you will need to take some time to adjust the workflow. - -However, thanks to the extension manager, you can get back the old workspace layout by disabling the Pop COSMIC extension. Also, you get a nice multi-monitor add-on that offers many options for users with multi-monitors. - -![][6] - -The desktop environment seems to be using GNOME 3.38 based applications. So, it is safe to assume that the COSMIC Desktop Environment is based on the same as well. - -It is important to note that the LTS release (i.e. Pop!_OS 20.04) will not be getting an update to include COMIC Desktop Environment. - -So, you will have to opt for Pop!_OS 21.04 stable version when it releases or just wait for the next LTS release that follows. - -### Pop!_OS 21.04 Without GNOME 40 Is Exciting - -As I expected, even without the direct implementation of GNOME 40, Pop!_OS 21.04 is an exciting release to look out for. - -The COSMIC Desktop Environment may not be a unique or breathtaking experience – but it manages to add essential options out of the box for a great desktop experience. - -Also, considering that multi-monitor users do not usually get an outstanding set of options on other Linux distributions by default, including an add-on for that with COSMIC desktop is a good idea. - -### Try Pop!_OS 21.04 Beta - -You can download the Pop!_OS 21.04 beta ISO from their [GitHub page][7]. You can find both the images for NVIDIA, and AMD/Intel as per your system configuration. - -Do note that this is a beta release and should be only installed for testing purposes. It is prone to bugs, and you may have to re-install it. - -The stable release should come out later this month, I will make sure to review it and also possibly make a video, if that helps. - -[Download Pop!_OS 21.04 Beta][7] - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/pop-os-21-04-beta-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/linux-distros-for-2021/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://news.itsfoss.com/cosmic-desktop-pop-os/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUwMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMzNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://github.com/pop-os/beta diff --git a/sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md b/sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md deleted file mode 100644 index ea821b8f12..0000000000 --- a/sources/news/20210608 You Can Still Use the Old Firefox Interface (but not for long).md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: subject: (You Can Still Use the Old Firefox Interface (but not for long)) -[#]: via: (https://news.itsfoss.com/firefox-old-design-switch/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -You Can Still Use the Old Firefox Interface (but not for long) -====== - -[Firefox 89][1] is finally available to download with a major redesign. While some like what they are trying to do, as a competitive alternative to Google Chrome in terms of user experience, many do not seem to like the modern design. - -Of course, the design choices will always have distinct perspective for all kinds of users. But is there a way to go back to the old Firefox design? - -Well, for now, it seems like a yes. But you may not be able to revert the design after the next Firefox update. - -Here, let me briefly highlight what it is all about. - -### How to Switch Back to the Old Firefox Design? - -Just like how [we enabled the proton design to take an early look before the final release][2], you need to disable the proton UI elements to get back to the old design. - -To get started, just type in “**about:config**” in the address bar and proceed by ignoring the warning. - -![][3] - -Once you click on “**Accept the Risk and Continue**“, you will notice a search field with no options to choose/select. - -Now, you just need to type in “**Proton**” to list all the options related to the new redesign, as shown below: - -![][3] - -Here, you need to click on the toggle button at the right-side as highlighted in this screenshot to disable all those options. - -You should already see it in action after disabling the options, but you may want to restart the browser if it does not seem right. - -I should mention that even with all the options disabled, it does not necessarily look exactly like the old Firefox design, but yes — for most of the part. - -In the same way, you just have to enable the options back to switch to the new design. - -### Wrapping Up - -Now that you can easily go back and forth between the new and old Firefox design, you may not be able to go back again after the next Firefox update. - -As originally spotted by [UbuntuHanbook][4], the options that you disabled above will no longer be available with the next Firefox update as per a [bug report][5]. - -What do you think about the new Firefox design? Would you be willing go back to the old design using the method mentioned? - -Feel free to let me know what you think in the comments below. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/firefox-old-design-switch/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/firefox-89-release/ -[2]: https://news.itsfoss.com/firefox-proton-redesign/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://ubuntuhandbook.org/index.php/2021/06/revert-old-user-interface-firefox-89/ -[5]: https://bugzilla.mozilla.org/show_bug.cgi?id=1709425 diff --git a/sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md b/sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md deleted file mode 100644 index d835c04a09..0000000000 --- a/sources/news/20210609 KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: subject: (KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements) -[#]: via: (https://news.itsfoss.com/kde-plasma-5-22-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -KDE Plasma 5.22 Features Eye Candy Visuals with Usability Improvements -====== - -KDE Plasma 5.22 is finally here. - -While we previously covered the [exciting changes coming to KDE Plasma 5.22][1] before the release, everyone can now get to experience it. - -The announcement mentions that the release focuses on usability, stability, and flexibility improvements. - -Here, let me highlight the key changes in this release. - -### KDE Plasma 5.22: What’s New? - -The major differences would include the visual improvements that come with the release. - -**Adaptive Transparency** is a big feature addition that lets you have a translucent panel but if you have a maximized window active, it will automatically turn opaque get rid of visual distractions. - -With this change, you also get the ability to have your taskbar panel always translucent or always opaque, if that is what you prefer. You can watch the video shared by a developer while it was a work in progress: - -![][2] - -You can also find an improved Wayland support that now includes the **Activities** feature to properly work, which is a favorite feature for a lot of Plasma users. - -Overall, KDE Plasma 5.22 involves a lot of visual tweaks ranging from app previews from the task bar (when you hover your mouse) to widgets. - -**System Settings** now feature a new speed dial section where it gives you quick access to commonly used settings or your most used settings. - -![][3] - -You also get a choice to disable offline updates that normally requires you to reboot in order to apply the changes. - -The **System Tray** also gets a visual touch with a consistent look along with a brand new digital clock which displays more information. - -Also, another major improvement is the ability to change the audio device (or access the audio widget) right from the System Tray area, which was not the case earlier. - -In addition to all these key changes, other improvements include: - - * Clipboard can now be accessed with the help of a keyboard shortcut (Meta + V) - * Improvements to KRunner to provide better search results - * Improved Notification widget that does not get in your way when you are recording your screen or on a video call for your work/studies (only for Wayland sessions) - * KWin window manager now supports variable refresh rate and FreeSync on Wayland - * Other KWin Wayland improvements for better visuals and performance - - - -To learn more about the release, you can refer to the [official announcement][4]. - -### Wrapping Up - -If you are using [KDE Neon][5], you should get it soon enough. For other Linux distributions, you may have to wait a little longer for them to include it an update or the next upgrade. - -What do you think about the visual improvements with KDE Plasma 5.22 update? Let me know in the comments down below. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/kde-plasma-5-22-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/kde-plasma-5-22-dev/ -[2]: https://i2.wp.com/i.ytimg.com/vi/4exHfb8Qjl0/hqdefault.jpg?w=780&ssl=1 -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://kde.org/announcements/plasma/5/5.22.0/ -[5]: https://neon.kde.org diff --git a/sources/talk/20200825 Why we open sourced our security project.md b/sources/talk/20200825 Why we open sourced our security project.md index bc11945595..c161728197 100644 --- a/sources/talk/20200825 Why we open sourced our security project.md +++ b/sources/talk/20200825 Why we open sourced our security project.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Starryi) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200107 5 ways to improve your Bash scripts.md b/sources/tech/20200107 5 ways to improve your Bash scripts.md index a2fc7d9175..ae4dd4fcf7 100644 --- a/sources/tech/20200107 5 ways to improve your Bash scripts.md +++ b/sources/tech/20200107 5 ways to improve your Bash scripts.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (iamcopper) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200206 How key Python projects are maintained.md b/sources/tech/20200206 How key Python projects are maintained.md index bb51029cd4..2b3dc0e1e2 100644 --- a/sources/tech/20200206 How key Python projects are maintained.md +++ b/sources/tech/20200206 How key Python projects are maintained.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (HuengchI) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210610 .md b/sources/tech/20210610 .md deleted file mode 100644 index eea1031861..0000000000 --- a/sources/tech/20210610 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: () -[#]: via: (https://www.2daygeek.com/linux-systemctl-command-manage-systemd-units-service/) -[#]: author: ( ) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/linux-systemctl-command-manage-systemd-units-service/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 diff --git a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md b/translated/tech/20210222 A friendly guide to the syntax of C-- method pointers.md similarity index 100% rename from sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md rename to translated/tech/20210222 A friendly guide to the syntax of C-- method pointers.md diff --git a/sources/tech/20210523 3 reasons to learn Java in 2021.md b/translated/tech/20210523 3 reasons to learn Java in 2021.md similarity index 100% rename from sources/tech/20210523 3 reasons to learn Java in 2021.md rename to translated/tech/20210523 3 reasons to learn Java in 2021.md From 4d1c10de7aa39103fe8b7a99737ed831d13e1298 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 13 Jun 2021 09:11:16 +0800 Subject: [PATCH 058/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @M4Xrun 感谢您,完成了第一篇翻译贡献! --- ...gists on careers in tech for minorities.md | 73 +++++++++---------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200228 4 technologists on careers in tech for minorities.md b/translated/tech/20200228 4 technologists on careers in tech for minorities.md index 67cb7559ab..816b2f241d 100644 --- a/translated/tech/20200228 4 technologists on careers in tech for minorities.md +++ b/translated/tech/20200228 4 technologists on careers in tech for minorities.md @@ -1,61 +1,60 @@ [#]: collector: (lujun9972) [#]: translator: (M4Xrun) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 technologists on careers in tech for minorities) [#]: via: (https://opensource.com/article/20/2/careers-tech-minorities) [#]: author: (Shilla Saebi https://opensource.com/users/shillasaebi) -4 technologists on careers in tech for minorities - +4 位技术专家谈少数族群的技术职业 ====== -了解黑人历史月对他们意味着什么,什么影响了他们的职业生涯,为想要进入科技领域的少数民族提供资源,等等。 + +> 了解 BHM 对他们意味着什么,什么影响了他们的职业生涯,为想要进入科技领域的少数族群提供资源,等等。 + ![Team meeting][1] -为了纪念黑人历史月,我收集了一些我最喜欢的技术专家和开源贡献者的意见。这四位正在为下一代铺路,同时也在为他们在科技行业所做的工作铺路。了解黑人历史月对他们意味着什么,什么影响了他们的职业生涯,为想要进入科技领域的少数民族提供资源,等等。 +为了纪念 BHM,我收集了一些我最喜欢的技术专家和开源贡献者的意见。这四位正在为下一代铺路,同时也在为他们在科技行业所做的工作铺路。了解 BHM 对他们意味着什么,是什么影响了他们的职业生涯,为想要进入科技领域的少数族群提供资源,等等。 -**[Tameika Reed][2], Women In Linux创始人** +**[Tameika Reed][2],Women In Linux 创始人** -自Women In Linux发起以来,Tameika一直致力于探索基础设施、网络安全、DevOps和物联网领域的职业生涯,并致力于领导力和持续技能的培养。作为一个自学成才的系统管理员,Tameika相信学习技术的最好方法就是深入其中。为了给女性一个全面的角度来看技术,Tameika每周都会举办一次线上会议来探讨hyperledger、Kubernetes、微服务和高性能计算等Linux常规之外的技术。Tameika的职业生涯包括与OSCon、LISA 2018、Seagl、HashiCorp EU 2019不同的会议以及各种当地活动进行会议发言。 +自 Women In Linux 发起以来,Tameika 一直致力于探索基础设施、网络安全、DevOps 和物联网领域的职业生涯,并致力于领导力和持续技能的培养。作为一个自学成才的系统管理员,Tameika 相信学习技术的最好方法就是深入其中。为了给女性一个全面的角度来看技术,Tameika 每周都会举办一次线上会议来探讨 Hyperledger、Kubernetes、微服务和高性能计算等 Linux 常规之外的技术。Tameika 的职业生涯包括与 OSCon、LISA 2018、Seagl、HashiCorp EU 2019 不同的会议以及各种当地活动进行会议发言。 -**[Michael Scott Winslow][3], 康卡斯特公司核心应用与平台总监** +**[Michael Scott Winslow][3],Comcast 公司核心应用与平台总监** -"我是一个父亲,丈夫,兄弟,儿子。我出生在一个小家庭,所以我很乐于把朋友们变成一个大家庭。当我把我的名字附在某件事上时,我就非常希望它能成功,所以我很在意我同意参与的事情。 -噢,在我的职业生涯中我已经做了数十年的软件开发。我解决问题,和别人合作一起帮助解决大问题,我带领、引导和指导年轻的软件工程师的同时观察我想要学习的人。" +“我是一个父亲、丈夫、兄弟、儿子。我出生在一个小家庭,所以我很乐于把朋友们变成一个大家庭。当我把我的名字附在某件事上时,我就非常希望它能成功,所以我很在意我参与的事情。噢,在我的职业生涯中我已经做了数十年的软件开发。我解决问题,和别人合作一起帮助解决大问题,我带领、引导和指导年轻的软件工程师的同时观察我想要学习的人。” -**[Bryan Liles][4], 资深工程师, VMware** +**[Bryan Liles][4],VMware 资深工程师** -“我正在和我们的团队一起重新思考开发人员如何与Kubernetes进行交互。当我不工作的时候,我就制造机器人和在社区里努力激励下一代的软件工程师。” +“我正在和我们的团队一起重新思考开发人员如何与 Kubernetes 进行交互。当我不工作的时候,我就制造机器人和在社区里努力激励下一代的软件工程师。” -**[Mutale Nkonde][5], AI For the People (AFP)首席执行官** - -AFP是一家非盈利的创意机构。在创办非营利组织之前,Nkonde从事人工智能治理工作。在此期间,她是团队的一员,该团队向美国众议院介绍了算法和深度伪造算法方案,以及无生物识别障碍住房方案。Nkonde的职业生涯中最开始是做广播记者,曾在英国广播公司(BBC)、美国有线电视新闻网(CNN)和美国广播公司(ABC)工作。她还广泛从事种族和科技方面的写作,并在哈佛大学和斯坦福大学获得奖学金。 +**[Mutale Nkonde][5],AI For the People(AFP)首席执行官** +AFP 是一家非营利性的创意机构。在创办非营利组织之前,Nkonde 从事人工智能治理工作。在此期间,她是向美国众议院提出《算法和深度伪造算法法案》以及《无生物识别障碍住房法案》的团队成员之一。Nkonde 的职业生涯中最开始是做广播记者,曾在英国广播公司(BBC)、美国有线电视新闻网(CNN)和美国广播公司(ABC)工作。她还广泛从事种族和科技方面的写作,并在哈佛大学和斯坦福大学获得奖学金。 ### 是什么影响了你选择技术领域的职业? -当我回到大学的时候,我害怕电脑。我害怕电脑,因为我从大学辍学了。在那之后,我就把尽我所能学习作为自己的任务。这是我至今的座右铭,学习永不停止。—Tameika Reed +当我回到大学的时候,我害怕电脑。我害怕电脑是因为我从大学辍学了。之后我又回去了,我就把尽我所能学习作为自己的任务。这是我至今的座右铭,学习永不停止。— Tameika Reed -我不会拐弯抹角,我小时候是个极客!在我10岁的时候,我从印刷杂志上读到的代码开始每天写GW-BASIC。在我上高中的时候,我给了自己一点喘息的时间来享受生活,但是当到了为大学选择专业的时候,这是一个很容易做出的选择。我留在了科技行业,这得感谢我一路走来遇到的了不起的导师和同事。—Michael Scott Winslow +我不会拐弯抹角,我小时候是个极客!在我 10 岁的时候,我就从印刷杂志上读到的代码开始每天写 GW-BASIC。在我上高中的时候,我给了自己一点喘息的时间来享受生活,但是当到了为大学选择专业的时候,这是一个很容易做出的选择。我留在了科技行业,这得感谢我一路走来遇到的了不起的导师和同事。— Michael Scott Winslow -我从中学就开始写软件了。我喜欢告诉电脑去做事情并看到结果。长大后,我很快就意识到,拥有一份让我满意、收入高的工作才是正确的选择。—Bryan Liles +我从中学就开始写软件了。我喜欢告诉电脑去做事情并看到结果。长大后,我很快就意识到,拥有一份让我满意、收入高的工作才是正确的选择。— Bryan Liles -我想知道为什么科技公司雇佣的黑人女性这么少。 —Mutale Nkonde +我想知道为什么科技公司雇佣的黑人女性这么少。 — Mutale Nkonde ### 在开源技术领域有没有某个特别的人给了你启发? -我从很多其他人和项目中得到启发。比如我喜欢看到其他人来到[Women In Linux][6],并确定他们想去哪里。我试着让人们从更全面的角度来看科技,这样他们就可以决定自己喜欢什么。说自己想在科技行业工作很容易,但要入手并坚持下去很难。你可以称为一名云架构师而不只是一名程序员。—Tameika Reed +我从很多其他人和项目中得到启发。比如我喜欢看到其他人来到 [Women In Linux][6],并确定他们想去哪里。我试着让人们从更全面的角度来看科技,这样他们就可以决定自己喜欢什么。说自己想在科技行业工作很容易,但要入手并坚持下去很难。你不必仅仅是一个程序员,你也可以成为一个云计算架构师。— Tameika Reed -[Kelsey Hightower][7],[Bryan Liles][4],和 Kim Scott 激励了我。他们太真实了!他们说的都是我每天的感受和经历。做好你的工作!别抱怨了!承认你的行为,并明白你是如何促成你的处境的![Gene Kim][8]也给了我很大的启发。作为DevOps运动的领导者,我看到自己在追随和模仿他做的很多事情。 —Michael Scott Winslow +[Kelsey Hightower][7]、[Bryan Liles][4] 和 Kim Scott 激励了我。他们是如此真实!他们说的都是我每天的感受和经历。做好你的工作!别抱怨了!承认你的行为,并明白你是如何促成你的处境的![Gene Kim][8] 也给了我很大的启发。作为 DevOps 运动的领导者,我看到自己在追随和模仿他做的很多事情。 — Michael Scott Winslow -不,我没有看到我想要的灵感,所以我努力成为20年前那个给我启发的人。 —Bryan Liles +不,我没有看到我想要的灵感,所以我努力成为 20 年前那个给我启发的人。 — Bryan Liles -太多了!我最喜欢的一个是:[Dorothy Vaughan][9]她是美国第一个为IBM沃森电脑变成的人。她的故事被记录在电影Hidden Figures中。 —Mutale Nkonde +太多了!我最喜欢的一个是:[Dorothy Vaughan][9],她是美国第一个为 IBM 沃森电脑编程的人。她的故事被记录在电影《Hidden Figures》中。 — Mutale Nkonde ### 你有什么特别的资源可以推荐给那些想要加入科技行业的少数人吗? -有,我建议你在Twitter上交一些朋友,然后提问。以下是我在科技界关注和崇拜的一些人: —Tameika Reed +有,我建议你在 Twitter 上交一些朋友,然后提问。以下是我在科技界关注和欣赏的一些人: — Tameika Reed * [@techgirl1908][10] * [@bryanl][4] @@ -68,33 +67,31 @@ AFP是一家非盈利的创意机构。在创办非营利组织之前,Nkonde * [@blkintechnology][15] * [@digundiv][16] - - -受重视的训练营确实缩短了人们加入科技行业的时间。我遇到过几位经过培训的专业人士,他们都比4年经验的机构同行更出色。我认为我们可以真正开始尊重人们创造的成果,而不是技术的熟练。 —Michael Scott Winslow +受重视的新人训练营确实缩短了人们加入科技行业的时间。我遇到过几位经过培训的专业人士,他们都比 4 年制学校的同行更出色。我认为我们可以真正开始尊重人们创造的成果,而不是技术的熟练。 — Michael Scott Winslow 我不确定我能推荐什么具体的东西。科技是一个很大的整体,所以没有一个简单的答案。我的建议是选择你认为会感兴趣的东西,并努力成为这个方面的专家。从问为什么开始,而不是怎么做,并且开始理解事物是如何一起运作的。 — Bryan Liles -这取决于他们想做什么工作。对于那些在科技和社会公正的交汇处工作的人,我推荐Safiya Noble的[Algorithms of Oppression][17]。 —Mutale Nkonde +这取决于他们想做什么工作。对于那些在科技和社会公正的交汇处工作的人,我推荐 Safiya Noble 的《[Algorithms of Oppression][17]》一书。 —Mutale Nkonde ### 你对有色人种将科技作为他们的职业有什么建议? -我建议你学习自己的技能。你将是一个永远的学习者。总会有人或事挡在你的路上,你的反应和行动将取决于你自己。永远不要拒绝第一个提议,要知道自己的价值。我看技术就像看艺术一样。发展需要时间,所以要对自己有耐心,拔掉插头说不也没关系。 —Tameika Reed +我建议你学习自己的技能。你将是一个永远的学习者。总会有人或事挡在你的路上,你的反应和行动将取决于你自己。永远不要拒绝第一个提议,要知道自己的价值。我看技术就像看艺术一样。发展需要时间,所以要对自己有耐心,拔掉插头说不也没关系。 — Tameika Reed -作为这个行业的保护者,我不想要不适合技术的人。所以要真正判断自己是否适合科技。你是一个能解决问题的人吗?你是否理性多于感性?你是否经常发现自己在创造过程?如果是这样,无论你的背景如何,我认为你都可以在科技行业找到一个家。—Michael Scott Winslow +作为一个有点像行业保护者一样的人,我不想要不适合技术的人。所以要真正判断自己是否适合科技。你是一个能解决问题的人吗?你是否理性多于感性?你是否经常发现自己在创造过程?如果是这样,无论你的背景如何,我认为你都可以在科技行业找到一个家。— Michael Scott Winslow -事情不会那么简单。你的进步会因为你的比赛而减慢。你必须更努力工作。把逆境当作动力。你比周围的人准备的更充分,这样当机会出现时你就能够应对它。找一个长的像你的人。私下发现不满,公开展示实力。你属于这里,你就能成功。 —Bryan Liles +事情不会那么简单。你的进步会因为你的族群而减慢。你必须更努力工作。把逆境当作动力。你要比周围的人准备的更充分,这样当机会出现时你就能够应对它。找一个与你相似的人的网络,私下发泄不满,公开展示实力。你属于这里,你就能成功。 — Bryan Liles -除了为一家公司工作,也在发展公共利益技术领域,我们的工作中心事技术如何影响真实的人。许多领导这项工作的人是有色人种妇女,黑人妇女正在取得巨大的进步。—Mutale Nkonde +除了为一家公司工作,也在发展公共利益技术领域,我们的工作中心是技术如何影响真实的人。许多领导这项工作的人是有色人种妇女,黑人妇女正在取得巨大的进步。— Mutale Nkonde -### 黑人历史月对你来说意味着什么? +### BHM 对你来说意味着什么? 意味着永不停止,为你永远不会忘记。 —Tameika Reed -黑人历史月对我来说意味着关注塔斯克基飞行队而不是奴隶制。强调我们如何为历史做出贡献,而不是如何成为历史的受害者。我希望人们理解我们的骄傲来自哪里,而不是我们的愤怒。在我们的人民身上发生了很多非常糟糕的事情,但我们还站在这里。强!—Michael Scott Winslow +BHM 对我来说意味着关注塔斯克基飞行队而不是奴隶制。强调我们如何为历史做出贡献,而不是如何成为历史的受害者。我希望人们理解我们的骄傲来自哪里,而不是我们的愤怒。在我们的人民身上发生了很多非常糟糕的事情,但我们还站在这里。坚强!— Michael Scott Winslow -黑人历史月是一个反思被遗忘的美国黑人历史的日子。我把它当作是感谢我的祖先所做的牺牲的时刻。—Bryan Liles +BHM 是一个反思被遗忘的美国黑人历史的日子。我把它当作是感谢我的祖先所做的牺牲的时刻。— Bryan Liles -这是一个集中体现全球黑人所作贡献的时刻。我喜欢它,这是我一年中最喜欢的时间之一。 —Mutale Nkonde +这是一个集中体现全球黑人所作贡献的时刻。我喜欢它,这是我一年中最喜欢的时间之一。 — Mutale Nkonde -------------------------------------------------------------------------------- @@ -102,8 +99,8 @@ via: https://opensource.com/article/20/2/careers-tech-minorities 作者:[Shilla Saebi][a] 选题:[lujun9972][b] -译者:[M4Xrun](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[M4Xrun](https://github.com/M4Xrun) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 50ac83ab12d933363b79dbe02ccc45ab129563bb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 13 Jun 2021 09:12:27 +0800 Subject: [PATCH 059/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @M4Xrun 本文首发地址: https://linux.cn/article-13480-1.html 你的 LCTT 专页:https://linux.cn/lctt/M4Xrun --- ...00228 4 technologists on careers in tech for minorities.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200228 4 technologists on careers in tech for minorities.md (99%) diff --git a/translated/tech/20200228 4 technologists on careers in tech for minorities.md b/published/20200228 4 technologists on careers in tech for minorities.md similarity index 99% rename from translated/tech/20200228 4 technologists on careers in tech for minorities.md rename to published/20200228 4 technologists on careers in tech for minorities.md index 816b2f241d..34ffe23bcd 100644 --- a/translated/tech/20200228 4 technologists on careers in tech for minorities.md +++ b/published/20200228 4 technologists on careers in tech for minorities.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (M4Xrun) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13480-1.html) [#]: subject: (4 technologists on careers in tech for minorities) [#]: via: (https://opensource.com/article/20/2/careers-tech-minorities) [#]: author: (Shilla Saebi https://opensource.com/users/shillasaebi) From b975f0926a4b8a26fb16df7ecc8f2086945bae51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 13 Jun 2021 12:35:42 +0800 Subject: [PATCH 060/870] PRF @ywxgod --- ...oard Shortcuts to Increase Productivity.md | 132 +++++++++--------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md b/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md index 7e6beb58c9..207af6a626 100644 --- a/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md +++ b/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md @@ -3,196 +3,196 @@ [#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) [#]: collector: (lujun9972) [#]: translator: (ywxgod) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -15个提高工作效率的VS Code键盘快捷键 +15 个提高工作效率的 VS Code 键盘快捷键 ====== -毫无疑问,微软的[VS Code是最好的开源代码编辑器之一][1]。它与传说中的Vim不同,VS Code不需要你是一个快捷键(译者注:以下都指键盘快捷键)大师,开发者们对它大部分的功能都及其熟悉,且推崇备至。 +![](https://img.linux.net.cn/data/attachment/album/202106/13/123502pqfi45mgpf8847yf.jpg) -但这并不意味着你不能成为快捷键大师,或者说你在VS Code中不应该使用快捷键。 +毫无疑问,微软的 [VS Code是最好的开源代码编辑器之一][1]。它与传说中的 Vim 不同,VS Code 不需要你是一个快捷键大师(LCTT 译注:以下都指键盘快捷键),开发者们对它大部分的功能都及其熟悉,且推崇备至。 -在敲代码的时候,你可能需要用鼠标去执行其他的动作,比如在VS Code编辑器中切换终端,而此时你的代码流程会被打断,这是不是很讨厌?如果是的,那么你应该立即熟记下面这些VS Code有用的快捷键。 +但这并不意味着你不能成为快捷键大师,或者说你在 VS Code 中不应该使用快捷键。 + +在敲代码的时候,你可能需要用鼠标去执行其他的动作,比如在 VS Code 编辑器中切换终端,而此时你的代码流程会被打断,这是不是很讨厌?如果是的,那么你应该立即熟记下面这些 VS Code 有用的快捷键。 它不仅能帮助你摆脱鼠标,还能使你的生产力和工作效率得到提高。 那么,让我们来了解一下如何通过使用快捷键快速进行代码导航来进行快速编码。 -### 有用的VS Code快捷键 +### 有用的 VS Code 快捷键 -免责声明。下面的这些快捷键是我在VS Code的使用中发现的较为有用的,你可以根据你的需要来发现更多有用的快捷键。 +免责声明。下面的这些快捷键是我在 VS Code 的使用中发现的较为有用的,你可以根据你的需要来发现更多有用的快捷键。 -下面我还列举了一些MacOS用户的键盘快捷键。 +下面我还给出了 MacOS 用户的键盘快捷键。 -#### 1\. 显示所有命令 +#### 1、显示所有命令 Windows/Linux | macOS ---|--- -CTRL + SHIFT + P or F1 | SHIFT + ⌘ + P or F1 +`CTRL + SHIFT + P` 或 `F1` | `SHIFT + ⌘ + P` 或 `F1` -我们从最有用的快捷键开始,这个快捷键能打开命令面板(列表),它提供了对VS Code所有功能的访问。 +我们从最有用的快捷键开始,这个快捷键能打开命令面板(列表),它提供了对 VS Code 所有功能的访问。 ![命令面板][2] -这是一个非常重要的VS Code快捷键,因为即使你忘记了或不想记起其他任何快捷键,但你记得这个,那么你仍然可以使用命令面板进行各种操作,如创建新文件,打开设置,改变主题,还可以查看所有快捷键。 +这是一个非常重要的 VS Code 快捷键,因为即使你忘记了或不想记起其他任何快捷键,但你记得这个,那么你仍然可以使用命令面板进行各种操作,如创建新文件、打开设置、改变主题,还可以查看所有快捷键。 -#### 2\. 垂直和水平拆分VS Code编辑器 +#### 2、垂直和水平拆分 VS Code 编辑器 Windows/Linux | macOS ---|--- -CTRL + \ -| ⌘ + \ +`CTRL + \` | `⌘ + \` -为了提高效率,但你又没有安装多个显示器,那么你可以通过水平或垂直分割VS Code的编辑器来一次查看多个文件的代码。 +为了提高效率,但你又没有安装多个显示器,那么你可以通过水平或垂直分割 VS Code 的编辑器来一次查看多个文件的代码。 -![分割VS Code编辑区][3] +![分割 VS Code 编辑区][3] 要在多个编辑区间切换焦点,你可以使用数字键或箭头键。 Windows/Linux | macOS ---|--- -CTRL + 1/2/3 | ⌘ + 1/2/3 -CTRL + K CTRL + ←/→ | ⌘ + K ⌘ + ←/→ +`CTRL + 1`/`2`/`3` | `⌘ + 1`/`2`/`3` +`CTRL + K` `CTRL + ←`/`→` | `⌘ + K` `⌘ + ←`/`→` -#### 3\. 切换集成终端 +#### 3、切换集成终端 Windows/Linux | macOS ---|--- -CTRL + ` | ⌘ + ` +CTRL + \` | ⌘ + \` -VS Code中的集成终端是一个非常方便的功能,它可以让你在不切换窗口的情况下快速执行任务。要在编辑器中显示/隐藏终端,下面的快捷键会非常方便。 +VS Code 中的集成终端是一个非常方便的功能,它可以让你在不切换窗口的情况下快速执行任务。要在编辑器中显示/隐藏终端,下面的快捷键会非常方便。 ![集成终端][4] -但是,如果你跟我一样觉得“CTRL+`”在键盘的角落位置而比较难按到,你可以打开命令面板执行`View: Toggle Terminal`命令来切换终端。 +但是,如果你跟我一样觉得 CTRL + \` 在键盘的角落位置而比较难按到,你可以打开命令面板执行`View: Toggle Terminal` 命令来切换终端。 ![使用命令面板切换终端][5] -#### 4\. 转到文件 +#### 4、转到文件 Windows/Linux | macOS ---|--- -CTRL + P | ⌘ + P +`CTRL + P` | `⌘ + P` 随着项目的壮大,查找文件可能会变得困难。因此,我建议,即使你使用鼠标,这个命令也能为你节省很多搜索和导航到版本库中的文件的时间。 ![转到文件][6] -#### 5\. 转到行 +#### 5、转到行 Windows/Linux | macOS ---|--- -CTRL + G | ^ + G +`CTRL + G` | `^ + G` -当你找到文件,你可能需要去到文件中指定的行增加或编辑代码,而如果这个文件包含了数千行代码,那么滚动代码将会浪费你大量的时间。而CTRL+G或^+G 快捷键能让你快速的去掉指定的行。 +当你找到文件,你可能需要去到文件中指定的行增加或编辑代码,而如果这个文件包含了数千行代码,那么滚动代码将会浪费你大量的时间。而 `CTRL + G` 或 `^ + G` 快捷键能让你快速的去掉指定的行。 ![转到行][7] -另外,你也可以使用上面的第四种‘转到文件’的快捷键,在输入框中输入冒号`:`加行号,结果就跟‘转到行’一样的。 +另外,你也可以使用上面的转到文件的快捷键,在输入框中输入冒号 `:` 加行号,结果就跟转到行是一样的。 -#### 6\. 在整个项目中搜索 +#### 6、在整个项目中搜索 Windows/Linux | macOS ---|--- -CTRL + SHIFT + F | ⌘ + SHIFT + F +`CTRL + SHIFT + F` | `⌘ + SHIFT + F` 很可能你需要在整个项目中搜索一个文本、变量或函数,在这种情况下,上面的命令就非常方便,它会在侧边栏显示一个搜索输入框。 ![在项目中搜索][8] -我们还可以在搜索的时候添加一些过滤器,比如使用ALT+C来启用大写匹配,ALT+W用于匹配整个单词,ALT+R用于启用正则表达式。 +我们还可以在搜索的时候添加一些过滤器,比如使用 `ALT+C` 来启用大写匹配,`ALT+W` 用于匹配整个单词,`ALT+R` 用于启用正则表达式。 -#### 7\. Zen模式 +#### 7、禅模式 Windows/Linux | macOS ---|--- -CTRL + K Z | ⌘ + K Z +`CTRL + K Z` | `⌘ + K Z` -想要在不受干扰的环境中工作以保持更专注? 你可以试试Zen模式,它会隐藏所有UI(状态栏、活动栏、面板和侧边栏)并仅在全屏上显示编辑器。 +想要在不受干扰的环境中工作以保持更专注? 你可以试试禅模式(先按下 `CTRL + K`,再按下 `Z`),它会隐藏所有 UI(状态栏、活动栏、面板和侧边栏)并仅在全屏上显示编辑器。 -![Zen模式][9] +![禅模式][9] -要启用Zen模式,你可以使用上面的快捷键或者打开命令面板执行“View: Toggle Zen Mode.”,要退出Zen模式,你可以按两次`Esc`键。 +要启用禅模式,你可以使用上面的快捷键或者打开命令面板执行 `View: Toggle Zen Mode`,要退出禅模式,你可以按两次 `Esc` 键。 -#### 8\. 将选择添加到下一次匹配中 +#### 8、将选择添加到下一次匹配中 Windows/Linux | macOS ---|--- -CTRL + D | ⌘ + D +`CTRL + D` | `⌘ + D` -这条命令能让你在所选文本的下一个出现的地方进行编辑。如果下一个匹配出现的位置与第一个相离较远,那这将会很方便处理。 +这条命令能让你选择所选文本的下一个出现的地方,从而进行编辑。如果下一个匹配出现的位置与第一个相离较远,那这将会很方便处理。 ![查找下一个匹配][10] -#### 9\. 切换行注释 +#### 9、切换行注释 Windows/Linux | macOS ---|--- -CTRL + / | ⌘ + / +`CTRL + /` | `⌘ + /` 将光标移到行的开头,然后添加双斜杠进行注释,这种麻烦的操作我们可以用上面的快捷键来代替了。 ![注释代码][11] -甚至,如果你想注释多行代码,你可以先通过`SHIFT+UP/Down`快捷键来选中多行,然后按`CTRL+/`快捷键进行注释。 +甚至,如果你想注释多行代码,你可以先通过 `SHIFT+UP`/`Down` 快捷键来选中多行,然后按 `CTRL+/` 快捷键进行注释。 -#### 10\. 转到文件的开头或结尾 +#### 10、转到文件的开头或结尾 Windows/Linux | macOS ---|--- -CTRL + HOME/END | ⌘ + ↑/↓ +`CTRL + HOME`/`END` | `⌘ + ↑`/`↓` -如果你在文件的中间位置感到迷糊,该命令可以让你快速达到文件的起点或终点。 +如果你迷失在文件的中间位置,该命令可以让你快速达到文件的起点或终点。 -#### 11\. 代码折叠或打开 +#### 11、代码折叠或打开 Windows/Linux | macOS ---|--- -CTRL + SHIFT + [ or ] | ⌥ + ⌘ + [ or ] +`CTRL + SHIFT + [`/`]` | `⌥ + ⌘ + [`/`]` 这也是最有用的快捷键之一,它可以帮助你折叠/取消折叠一个区域的代码。通过这种方式,你可以隐藏不必要的代码,每次只查看所需的部分代码,以便更加专注和快速编码。 ![折叠一块代码][12] -#### 12\. 窥视执行 +#### 12、窥视执行 Windows/Linux | macOS ---|--- -CTRL + SHIFT + F12 | ⌘ + SHIFT + F12 +`CTRL + SHIFT + F12` | `⌘ + SHIFT + F12` -这个快捷键最有可能的作用是帮助你进行代码分析,或修复bug时了解函数和变量的运行情况。 +这个快捷键最有可能的作用是帮助你进行代码分析,或修复 bug 时了解函数和变量的运行情况。 ![窥视执行][13] -#### 13\. 删除当前行 +#### 13、删除当前行 Windows/Linux | macOS ---|--- -CTRL + SHIFT + K | SHIFT + ⌘ + K +`CTRL + SHIFT + K` | `SHIFT + ⌘ + K` -这是一条可以快速执行,选中当前行和按删除/退格键,这两个任务的简单命令。 +这是一条可以快速执行,选中当前行并按删除/退格键,这两个任务的简单命令。 -#### 14\. 查找与替换 +#### 14、查找与替换 Windows/Linux | macOS ---|--- -CTRL + F -CTRL + H | ⌘ + F -⌥ + ⌘ + F +`CTRL + F` | `⌘ + F` +`CTRL + H` | `⌥ + ⌘ + F` -用一个新的文本替换文件中所有出现的该文本的最好方法是啥? 如果你手动一个一个的通过滚动代码来处理,且如果需要替换的地方又很多,那么你可能会花费大量的时间。 +用一个新的文本替换文件中所有出现的该文本的最好方法是什么?如果你手动一个一个的通过滚动代码来处理,且如果需要替换的地方又很多,那么你可能会花费大量的时间。 ![查找与替换][14] -而使用查找和替换我们能在几秒内完成相同的任务。你可以用两个快捷键来打开它,其中一个实际上是打开用于查找文本的输入框,另一个用于输入新的文本。 +而使用查找和替换功能我们能在几秒内完成相同的任务。你可以用两个快捷键来打开它,其中一个实际上是打开用于查找文本的输入框,另一个用于输入新的文本。 -#### 15\. VS Code键盘快捷键 +#### 15、VS Code 的全部键盘快捷键 Windows/Linux | macOS ---|--- -CTRL + K CTRL + S | ⌘ + K ⌘ + S +`CTRL + K CTRL + S` | `⌘ + K ⌘ + S` 最后,如果你还在为记住上述所有的快捷键而苦恼,你大可不必。因为你可以使用上面的快捷键查看编辑器所有可用的命令。 @@ -200,11 +200,11 @@ CTRL + K CTRL + S | ⌘ + K ⌘ + S 你还可以根据自己的喜好编辑命令的绑定键。 -### 想要为VS Code添加更多快捷键? +### 想要为 VS Code 添加更多快捷键? -如果你想对VS Code的快捷键有完整的了解,你可以查看VS Code的[文档][16]。 +如果你想对 VS Code 的快捷键有完整的了解,你可以查看 VS Code 的 [文档][16]。 -或者,如果你想在纸上将所有快捷键打印出来慢慢看,下面这些是各个系统对应的快捷键小抄[Linux][17],[macOS][18]和[Windows][19]。 +或者,如果你想在纸上将所有快捷键打印出来慢慢看,下面这些是各个系统对应的快捷键速查表: [Linux][17]、[macOS][18] 和 [Windows][19]。 -------------------------------------------------------------------------------- @@ -213,7 +213,7 @@ via: https://itsfoss.com/vs-code-shortcuts/ 作者:[Sarvottam Kumar][a] 选题:[lujun9972][b] 译者:[ywxgod](https://github.com/ywxgod) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9fe83594aeb4b4583806b7b6c27f7ab33f68bcc9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 13 Jun 2021 12:39:18 +0800 Subject: [PATCH 061/870] PUB @ywxgod https://linux.cn/article-13481-1.html --- ...Studio Code Keyboard Shortcuts to Increase Productivity.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md (99%) diff --git a/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md b/published/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md similarity index 99% rename from translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md rename to published/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md index 207af6a626..f2d1c5cdf8 100644 --- a/translated/tech/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md +++ b/published/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ywxgod) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13481-1.html) 15 个提高工作效率的 VS Code 键盘快捷键 ====== From 89653b60469ced950b18119fd022e1faec7e5358 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 14 Jun 2021 05:03:43 +0800 Subject: [PATCH 062/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210613=20?= =?UTF-8?q?How=20Free=20&=20Open=20Source=20Software=20Can=20Save=20Online?= =?UTF-8?q?=20Privacy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210613 How Free - Open Source Software Can Save Online Privacy.md --- ...Source Software Can Save Online Privacy.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/news/20210613 How Free - Open Source Software Can Save Online Privacy.md diff --git a/sources/news/20210613 How Free - Open Source Software Can Save Online Privacy.md b/sources/news/20210613 How Free - Open Source Software Can Save Online Privacy.md new file mode 100644 index 0000000000..e5b9e3ca7a --- /dev/null +++ b/sources/news/20210613 How Free - Open Source Software Can Save Online Privacy.md @@ -0,0 +1,154 @@ +[#]: subject: (How Free & Open Source Software Can Save Online Privacy) +[#]: via: (https://news.itsfoss.com/save-privacy-with-foss/) +[#]: author: (Team It's FOSS https://news.itsfoss.com/author/team/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How Free & Open Source Software Can Save Online Privacy +====== + +_I have used services from tech giants for years. Most were free of charge, at the expense of my privacy. But those days are over. Now I browse, chat and work without anyone tracking, monetizing or censoring my data. Thanks to free (libre) and open source software._ + +### I start to worry about Big Tech + +![][1] + +I’ve always felt machines should be doing what I want them to do, not the other way round. That’s why Google’s Android operating system immediately appealed to me when it first hit the market in 2008. At the time, Google’s open-source approach was genuinely refreshing. I spent hours customizing my HTC Hero phone. Little did I care that it was uglier than my friends’ iPhones or Symbian devices. My new gadget was infinitely more versatile. + +Fast forward a decade. Google has become a tech giant, dwarfed iOS and killed Symbian OS. Today, the company captures over 90% of search traffic and dominates the browser market. This stellar growth came at a cost, as illustrated by the removal of Google’s “don’t be evil” clause. The search giant is entangled in court cases, such as the one over [data collection and tracking malpractices][2]. Researchers also found [privacy flaws][3] in Google’s contact tracing app. To top it off, the tech giant announced a controversial new algorithm that [tracks browsing behaviour][4] to better serve ads. + +Now, I don’t want to pass the buck to Google. Amazon just created the largest civilian [surveillance network][5] in US history. It provides the police with unwarranted access to millions of home security cameras. Meanwhile, Europe probes into Amazon’s compliance with [privacy rules][6]. Same goes for Microsoft, which incidentally also apologized for having facilitated [workplace surveillance][7] feature. + +One might think that users can at least count on Apple to protect their privacy. The tech giant recently gave them the choice to know whether apps track their behavior. As it turns out that [only 5%][8] of US users opt into this new app-tracking transparency. Meanwhile, the company [hugely benefits][9] from doing business with data brokers like Google. Not to mention the [antitrust trial][10] raging between Fortnite developer Epic Games and Apple, which claims to protect the privacy of its App Store. And of course, there’s Facebook. The company’s privacy misconducts culminated in a Senate hearing over the [Cambridge Analytica][11] scandal, wiping out what was left of user trust. + +Yet in spite – or because – of these questionable practices, the total value of these companies reached over [7.5 trillion dollars][12] in March 2021. “Big Tech” is now worth more than Germany’s and the UK gross domestic product – combined! + +### Why privacy matters + +![][13] + +We all use Big Tech’s services. We are part of [Surveillance Capitalism][14], a term coined by Harvard professor Shoshana Zuboff and discussed in Cory Doctorow’s [latest book][15], Surveillance Capitalism. It’s an economic system centered around tech monopolies which harvest personal data to maximize profit. This system threatens the very core of democracy, as it gives rise to mass surveillance, polarizes the political debate, interferes with the electoral process and drives uniformity of thought as well as censorship. + +Surveillance Capitalism is based on a deeply troubling invasion of our lives. We tend to forget that privacy is a fundamental right. It’s enshrined by the UN Human Rights Council, the International Covenant on Civil and Political Rights and a number of treaties. I think we can all relate: there are more than a few aspects in our lives we’d like to keep private, even without wrongdoing. Whether it is to freely express ourselves and explore our personality without being judged by others. Or to shield us from surveillance, censorship and manipulation. That’s why curtains were invented. And things like banking secrecy, attorney-client privilege, secrecy of correspondence, secrecy of the ballot, confessional secret or medical confidentiality. + +Tackling online privacy is a broad issue. It requires comprehensive changes to our legal systems and social conventions. Regulation of tech monopolies is one of the main challenges of this decade. As illustrated by the recent standoffs between tech giants and governments: [Australia vs. Facebook][16], [China vs. Tencent][17], [India vs. WhatsApp][18], the [EU vs. Facebook][19] or the [US vs. Big Tech][20]. For years, digital rights groups and software foundations have been advocating for better privacy laws, user rights and the freedom to innovate. Let’s only name a few: the Electronic Frontier Foundation, the Free Software Foundation, the Freedom of the Press Foundation, Privacy International, the Open Rights Group or the European Digital Rights. + +### What’s this got to do with FOSS? + +![][21] + +Since its inception in 1983, the [Free Software movement][22] has become quite a diverse community. Free and open source software is often referred to as FOSS, FLOSS, Libre Software or Free Software. It includes a whole range of licenses that give users the right to [use, study, share and improve][23] the software. As well as the [right to repair][24]. Free Software is “free” as in “[free speech][25]” — and sometimes as in “free beer”. As such, FOSS is not only about technology. It’s about social, political and economic emancipation. + +A few years back, a privacy controversy shook up the Free Software community. Ubuntu 12.10 – one of the various GNU/Linux flavours – started establishing Internet connections for local searches on people’s computers. It served Amazon ads and shared private data with Facebook or Twitter. The [backlash was massive][26]. A few years later, Canonical – the firm behind Ubuntu – ended up removing online searches and the Amazon web app. The more recent [Audacity drama][27] is another example of how FOSS protects privacy. The new project management decided to add Google Analytics and Yandex to the audio software, but ended up renouncing to its plans after public outcry. + +For all its merits, Free Software is not free from criticism. One claim is that FOSS projects often get abandoned. A recent [Cornell University study][28] however suggests otherwise: out of 1.932 popular open source projects, 7% (128 projects) were taken over by new developers after being neglected, reducing the dropout rate to less than 10% (187 projects). + +Another common criticism is that FOSS exposes potential security vulnerabilities by publishing the code. On the flip side, keeping the source code a secret [doesn’t necessarily increase security][29]. Arguing that closed source code is vastly more secure than FOSS conveniently omits the fact that proprietary stacks are increasingly built [on top of open source code][30]. Free Software also tends to be decentralized, which helps with resilience against surveillance, single points of failure or massive data leaks. So sure, FOSS is not immune to security breaches. But neither are proprietary solutions, as illustrated by the latest [leaks of a billion people’s data][31] from Facebook, LinkedIn and Clubhouse. Or the spectacular [security attacks][32] against SolarWind and Colonial Pipeline. + +All in all, Free Software is instrumental in promoting online privacy. For nearly forty years, FOSS has been encouraging developers to audit the code, fix issues and ensure nothing shady goes on in the background. + +### Seven steps to online privacy with FOSS + +![][33] + +While waiting for better privacy laws, there’s a lot you can do to make your devices more private. Here are seven steps to replace Big Tech with privacy-respecting, free and open source software. Depending on your [threat model][34], you’ll likely want to consider steps 1 through 4 first, as they already provide a reasonable level of privacy. If you have some tech skills and want to go further, take a look at steps 5 to 7. + + 1. **[Get involved in privacy][35]**. There is much to be said and learned about online privacy, data exploitation, filter bubbles, surveillance and censorship. Get involved and spread the word. + 2. **[Choose a safe and private browser][36]**. Switch to Firefox. Block trackers, cookies and ads. Use privacy-respecting search engines. Possibly encrypt your traffic with Tor or VPN. + 3. **[Keep your conversations private][37]**. Use end-to-end encryption to secure your emails, messages and calls. Ditch classic social media and discover the Fediverse, a federated family of various online services. + 4. **[Protect your data][38]**. Use long and unique passphrases. Choose a different one for each of your accounts and devices. Keep them safe in an encrypted password manager. Consider using two-factor authentication. Create a regular backup routine. And encrypt sensitive data. + 5. **[Free your computer][39]**. Switch to GNU/Linux and favor free and open source apps. Depending on your needs, choose a beginner friendly distribution like Linux Mint or Ubuntu. For more experienced users, pick Debian, Manjaro, openSUSE, Fedora or Gentoo Linux. And for privacy buffs, have a look at Qubes OS, Whonix or Tails. + 6. **[Free your phone][40]**. Switch to a custom mobile operating system like LineageOS, CalyxOS, GrapheneOS or /e/. Favor tracker-free open source apps from community maintained app stores. + 7. **[Free your cloud][41]**. Choose privacy-respecting cloud providers. Or set up your own secure server and self host services such as cloud storage, photo galleries, task and contact management, or media streaming. + + + +### Wrapping Up + +![][42] + +There is no one-click solution for online privacy. Replacing Big Tech with free and open source software is a process. Some changes are simple – like installing Firefox or Signal. Other methods require more time and skills. But they are definitely worth it. And you’re not alone, you can count on the support of a wonderful community. So allow me to conclude by quoting [Geoffrey A. Fowler][43] from the Washington Post: “_Online privacy is not dead, but you have to be angry enough to demand it_“. + +* * * + +### About the author + +![][42] + +_Georg Jerska is an open source enthusiast with a special interest in protecting the privacy of citizens. With his small team he runs [GoFOSS][44][][45], a comprehensive guide on how to replace Big Tech with privacy-respecting, free and open source software._ + +* * * + +_[Open source][46] illustrations by [Katerina Limpitsouni][47]._ + +_The views and opinions expressed are those of the authors and do not necessarily reflect the official policy or position of It’s FOSS._ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/save-privacy-with-foss/ + +作者:[Team It's FOSS][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/team/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI3MCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://www.gizmodo.com.au/2021/05/google-location-services-lawsuit +[3]: https://blog.appcensus.io/2021/04/27/why-google-should-stop-logging-contact-tracing-data +[4]: https://news.itsfoss.com/google-floc +[5]: https://www.theguardian.com/commentisfree/2021/may/18/amazon-ring-largest-civilian-surveillance-network-us +[6]: https://edps.europa.eu/press-publications/press-news/press-releases/2021/edps-opens-two-investigations-following-schrems_en +[7]: https://www.theguardian.com/technology/2020/dec/02/microsoft-apologises-productivity-score-critics-derided-workplace-surveillance +[8]: https://www.flurry.com/blog/ios-14-5-opt-in-rate-att-restricted-app-tracking-transparency-worldwide-us-daily-latest-update +[9]: https://www.nytimes.com/2020/10/25/technology/apple-google-search-antitrust.html +[10]: https://www.nytimes.com/2021/05/25/business/dealbook/apple-epic-case.html +[11]: https://en.wikipedia.org/wiki/Cambridge_Analytica +[12]: https://en.wikipedia.org/wiki/List_of_public_corporations_by_market_capitalization#2021 +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0OCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[14]: https://en.wikipedia.org/wiki/Surveillance_capitalism +[15]: https://www.goodreads.com/book/show/55134785-how-to-destroy-surveillance-capitalism +[16]: https://www.bbc.com/news/world-australia-56163550 +[17]: https://www.nytimes.com/2021/06/02/technology/china-tencent-monopoly.html +[18]: https://www.theguardian.com/world/2021/may/26/whatsapp-sues-indian-government-over-mass-surveillance-internet-laws +[19]: https://nypost.com/2021/05/26/eu-reportedly-set-to-open-formal-antitrust-probe-into-facebook +[20]: https://www.nytimes.com/interactive/2020/10/06/technology/house-antitrust-report-big-tech.html +[21]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2OCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[22]: https://itsfoss.com/what-is-foss +[23]: https://fsfe.org/freesoftware/freesoftware.en.html +[24]: https://framatube.org/videos/watch/99069c5c-5a00-489e-97cb-fd5cc76de77c +[25]: https://www.eff.org/deeplinks/2015/04/remembering-case-established-code-speech +[26]: https://itsfoss.com/canonical-targets-website-crictical-ubuntu-privacy +[27]: https://github.com/audacity/audacity/pull/835 +[28]: https://arxiv.org/abs/1906.08058 +[29]: https://www.schneier.com/crypto-gram/archives/2002/0515.html#1 +[30]: https://www.bcg.com/publications/2021/open-source-software-strategy-benefits +[31]: https://www.politico.eu/article/how-to-leak-data-and-get-away-with-it +[32]: https://theconversation.com/the-colonial-pipeline-ransomware-attack-and-the-solarwinds-hack-were-all-but-inevitable-why-national-cyber-defense-is-a-wicked-problem-160661 +[33]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[34]: https://www.eff.org/files/2015/11/24/3mod_threat-modeling-ssd_9-3-15.pdf +[35]: https://www.gofoss.today/nothing-to-hide +[36]: https://www.gofoss.today/intro-browse-freely +[37]: https://www.gofoss.today/intro-speak-freely +[38]: https://www.gofoss.today/intro-store-safely +[39]: https://www.gofoss.today/intro-free-your-computer +[40]: https://www.gofoss.today/intro-free-your-phone +[41]: https://www.gofoss.today/intro-free-your-cloud +[42]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1MCIgd2lkdGg9IjE1MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[43]: https://www.washingtonpost.com/technology/2019/12/31/how-we-survive-surveillance-apocalypse +[44]: https://gofoss.today/ +[45]: https://gofoss.today +[46]: https://undraw.co/license +[47]: https://undraw.co From e401ad428006e5bab0893f183b2be424b22450d4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 14 Jun 2021 11:25:06 +0800 Subject: [PATCH 063/870] Rename sources/news/20210613 How Free - Open Source Software Can Save Online Privacy.md to sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md --- ...613 How Free - Open Source Software Can Save Online Privacy.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210613 How Free - Open Source Software Can Save Online Privacy.md (100%) diff --git a/sources/news/20210613 How Free - Open Source Software Can Save Online Privacy.md b/sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md similarity index 100% rename from sources/news/20210613 How Free - Open Source Software Can Save Online Privacy.md rename to sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md From c5410ca5a4f122bfbebdbccea13210972f40ff4e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 14 Jun 2021 15:56:52 +0800 Subject: [PATCH 064/870] PRF @ywxgod --- ...tial characteristics of successful APIs.md | 150 +++++++++--------- 1 file changed, 77 insertions(+), 73 deletions(-) diff --git a/translated/tech/20210518 4 essential characteristics of successful APIs.md b/translated/tech/20210518 4 essential characteristics of successful APIs.md index 620fca7cdb..0f5fc128b5 100644 --- a/translated/tech/20210518 4 essential characteristics of successful APIs.md +++ b/translated/tech/20210518 4 essential characteristics of successful APIs.md @@ -3,107 +3,113 @@ [#]: author: (Tom Wilson https://opensource.com/users/tomwillson4014) [#]: collector: (lujun9972) [#]: translator: (ywxgod) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -成功API的4个基本特征 +完善的 API 的 4 个基本特征 ====== -创建一个API(译者注:应用程序接口),我们所要做的远远不止是让它能"正常工作。" -![看地图][1] -如果你正在构建基于C/S模型的应用程序,那么你需要一个应用程序接口(API)。API就是一种非常清晰而又明确的定义,它定义了一个过程(process)与另一个过程(process)之间的边界。 web应用中我们常见的边界定义就是 REST/JSON API. +> 创建一个 API(应用程序接口),我们所要做的远远不止是让它能“正常工作”。 -虽然很多开发者可能主要关注在如何让API正常工作(或功能正常),但却还有一些“非功能性”的要求也是需要他们注意的。 对于所有API我们有以下4个 _必须有的_ 非功能性的要求: +![](https://img.linux.net.cn/data/attachment/album/202106/14/155547zs3mffismifqqi59.jpg) + +如果你正在构建基于 C/S 模型的应用程序,那么你需要一个应用程序接口(API)。API 就是一种非常清晰而又明确的定义,它是一个进程process与另一个进程之间明确定义的边界。Web 应用中我们常见的边界定义就是 REST/JSON API。 + +虽然很多开发者可能主要关注在如何让 API 正常工作(或功能正常),但却还有一些“非功能性”的要求也是需要他们注意的。所有的 API *必须具备* 的 4 个非功能性的要求是: * 安全 * 文档 - * 校验 + * 验证 * 测试 - - ### 安全 -在软件开发中,安全是最基本的要求。对于API开发者来说,API的安全性主要包含以下4个方面: +在软件开发中,安全是最基本的要求。对于 API 开发者来说,API 的安全性主要包含以下 4 个方面: 1. HTTPS/SSL 证书 2. 跨域资源共享 - 3. 身份认证与JSON Web令牌 - 4. 授权与范围划分 + 3. 身份认证与 JSON Web 令牌 + 4. 授权与作用域 +#### 1、HTTPS/SSL 证书 +Web 应用的黄金标准是使用 SSL 证书的 HTTPS 协议。[Let's Encrypt][2] 可以帮你达到这一目的。Let's Encrypt 来自于非营利性的互联网安全研究小组(ISRG),它是一个免费的、自动化的、开放的证书颁发机构。 -#### 1\. HTTPS/SSL 证书 +Let's Encrypt 的软件会为你的域(LCTT 译注:包含域名、IP 等信息)生成中央授权证书。而正是这些证书确保了从你的 API 到客户端的数据载荷是点对点加密的。 -Web应用的黄金标准是使用HTTPS协议,而HTTPS协议的使用是要有SSL证书。关于SSL证书,[Let's Encrypt][2]可以帮我们达到目的。 Let's Encrypt来自于非营利性的互联网安全研究小组(ISRG),它是一个免费的、自动化的、开放的证书颁发机构。 +Let's Encrypt 支持证书管理的多种部署方案。我们可以通过查看 [文档][3] 来找出最适合自己需要的方案。 -Let's Encrypt的软件会为你的域(译者注:包含域名、IP等信息)生成一些权威的中央授权证书。而正是这些证书确保了,从你的API到客户端的点到点的数据都是被加密过的。 +#### 2、跨域资源共享 -Let's Encrypt支持多种不同证书管理的部署方案。我们可以通过查看[文档][3]来找出最适合自己需要的方案。 +跨域资源共享Cross-origin resource sharing(CORS)是一个针对浏览器的安全策略预检。如果你的 API 服务器与发出请求的客户端不在同一个域中,那么你就要处理 CORS。例如,如果你的服务器运行在 `api.domain-a.com` 并且接到一个来自 `domain-b.com` 的客户端的请求,那么 CORS 就会(让浏览器)发送一个 HTTP 预检请求,以便查看你的 API 服务是否会接受来自此客户域的客户端请求。 -#### 2\. 跨域资源共享 +[来自 MDN 的定义][4]: -CORS是浏览器基于浏览器安全策略的一个预检。如果你的API服务器与发出请求的客户端不在同一个域中,那么你将要处理CORS。例如,如果你的服务器运行在**api.domain-a.com **并且接到一个来自**domain-b.com**的客户端的请求, 那么CORS就会(让浏览器)发送一个HTTP预检请求,以便查看你的API服务是否会接受来自此客户域的客户端请求。 +> “跨域资源共享(CORS)是一种基于 HTTP 头的机制,这种机制允许服务器标记除自身源外的其他任何来源(域、方案或端口)。而对于这些被服务器标识的源,浏览器应该允许我们从它们加载资源。” -[来自MDN的定义][4]: +![CORS 原理][5] -> “跨域资源共享(CORS)是一种基于HTTP头的机制,这种机制允许服务器标记除自身源外的其他任何来源(域、方案或端口)。而对于这些被服务器标识的源,浏览器应该允许我们从它们加载资源。” +*([MDN文档][4], [CC-BY-SA 2.5][6])* -![CORS原理][5] +另外,有很多用于 [Node.js][7] 的辅助库来 [帮助 API 开发者处理 CORS][8]。 -([MDN文档][4], [CC-BY-SA 2.5][6]) +#### 3、身份认证与 JSON Web 令牌 -另外,有很多用于[Node.js][7]的辅助库来[帮助API开发者处理CORS][8]。 +有多种方法可以验证你的 API 中的认证用户,但最好的方法之一是使用 JSON Web 令牌(JWT),而这些令牌使用各种知名的加密库进行签名。 -#### 3\. 身份认证与JSON Web令牌 +当客户端登录时,身份管理服务会向客户端提供一个 JWT。然后,客户端可以使用这个令牌向 API 发出请求,API 收到请求后,从服务器读取公钥或私密信息来验证这个令牌。 -有多种方法可以验证你的API中的认证用户,但最好的方法之一是使用JSON Web令牌(JWT),而这些令牌都是被各种知名的加密库进行签名过的。 +有一些现有的库,可以帮助我们对令牌进行验证,包括 [jsonwebtoken][9]。关于 JWT 的更多信息,以及各种语言中对其的支持库,请查看 [JWT.io][10]。  -当客户端登录时,身份管理服务会向客户端提供一个JWT(JSON Web令牌)。然后,客户端可以使用这个令牌向API发出请求,API收到请求后,从服务器读取公钥或私钥来验证这个令牌。 +``` +import jwt from 'jsonwebtoken' -有一些现有的库,可以帮助我们对令牌进行验证,包括[jsonwebtoken][9]。关于JWT的更多信息,以及各种语言中对其的支持库,请查看[JWT.io][10]。  +export default function (req, res, next) { + // req.headers.authorization Bearer token + const token = extractToken(req) + jwt.verify(token, SECRET, { algorithms: ['HS256'] }, (err, decoded) => { + if (err) { next(err) } + req.session = decoded + next() + }) +} +``` -![JWT验证示例][11] +#### 4、授权与作用域 -(Tom Wilson, [Hyper63 blog][12]) +认证(或身份验证)很重要,但授权同样很重要。也就是说,经过验证的客户端是否有权限让服务器执行某个请求呢?这就是作用域的价值所在。当身份管理服务器对客户端进行身份认证,且创建 JWT 令牌时,身份管理服务会给当前客户提供一个作用域,这个作用域将会决定当前经过验证的客户的 API 请求能否被服务器执行。这样也就免去了服务器对访问控制列表的一些不必要的查询。 -#### 4\. 授权与范围划分 +作用域是一个文本块(通常以空格分隔),用于描述一个 API 端点的访问能力。一般来说,作用域被分为资源与动作。这种模式对 REST/JSON API 很有效,因为它们有相似的 `RESOURCE:ACTION` 结构。(例如,`ARTICLE:WRITE` 或 `ARTICLE:READ`,其中 `ARTICLE` 是资源,`READ` 和 `WRITE` 是动作)。 -认证(或身份认证)很重要,但授权同样很重要。比如, _经过认证的客户端是否有权限让服务器执行某个请求呢?_ 这就是**scopes(范围划分)**的价值所在。 当身份管理服务器对客户端进行身份认证,且创建JWT令牌时,身份管理服务会给当前客户提供一个权限范围,这个权限范围将会决定当前客户的API请求能否被服务器执行。这样也就免去了服务器对访问控制列表的一些不必要的查询。 - -授权范围通常是一个文本块(通常以空格分隔),用于描述一个API的访问能力。一般来说,范围被分为资源(Resources)与动作(Actions)。这种模式对REST/JSON API很有效,因为他们有相似的RESOURCE:ACTION结构。(例如,ARTICLE:WRITE或ARTICLE:READ,其中ARTICLE是资源,READ和WRITE是动作)。 - -授权范围的划分让我们的API能够专注于功能的实现,而不是去考虑各种角色和用户。 身份管理服务可以将不同的角色和用户分配不同的权限范围, 然后再将这些不同的授权范围提供给不同的JWT验证中的客户。 +作用域的划分让我们的 API 能够专注于功能的实现,而不是去考虑各种角色和用户。身份访问管理服务可以将不同的角色和用户分配不同的权限范围,然后再将这些不同的作用域提供给不同的 JWT 验证中的客户。 #### 总结 -当我们开发和部署API时,安全应该一直是最重要的要求。虽然安全性是一个比较泛的话题,但如果能解决上面四个方面的问题,这对于你的API来说,在生产环境中将会表现得更好。 +当我们开发和部署 API 时,安全应该一直是最重要的要求之一。虽然安全性是一个比较宽泛的话题,但如果能解决上面四个方面的问题,这对于你的 API 来说,在生产环境中将会表现得更好。 ### 文档 -_有什么能比没有文档更糟糕? 过期的文档._ +_有什么能比没有文档更糟糕?过期的文档。_ -开发者对文档真的是又爱又恨。 尽管如此,文档仍然是API定义是否成功的一个关键部分。开发者需要从文档中知道如何使用这些API,且你创建的文档对于开发者如何更好地使用API也有着非常巨大的作用。 +开发者对文档真的是又爱又恨。尽管如此,文档仍然是 API 定义是否完善的一个关键部分。开发者需要从文档中知道如何使用这些 API,且你创建的文档对于开发者如何更好地使用 API 也有着非常巨大的作用。 -创建API文档,我们需要关注下面三个方面: +创建 API 文档,我们需要关注下面三个方面: - 1. 开发者入门文档 (自述文件/基本介绍) - 2. 技术参考 (说明书/规格) - 3. 使用方法 (如何开始和其他指南) + 1. 开发者入门文档(自述文件/基本介绍) + 2. 技术参考(规范/说明书) + 3. 使用方法(入门和其他指南) +#### 1、入门文档 +在构建 API 服务的时候,你需要明确一些事情,比如:这个 API 是做什么的?如何建立开发者环境?如何测试该服务?如何提交问题?如何部署它? -#### 1\. 入门文档 +通常我们可以通过自述(`README`)文件来回答上面的这些问题,自述文件一般放在你的代码库中,用于为开发者提供使用你项目的最基本的起点和说明。 -在构建API服务的时候,你需要明确一些事情,比如:这个API是干嘛的?如何建立开发者环境?如何测试该服务?如何提交问题?如何部署它? +自述文件应该包含: -通常我们可以通过README文件来回答上面的这些问题,README文件一般放在你的代码库中,用于为开发者提供使用你项目的最基本的起点和说明。 - -README文件应该包含: - - * API的描述 - * 技术参考与指南链接 + * API 的描述 + * 技术参考与指南的链接 * 如何以开发者的身份设置你的项目 * 如何测试这个项目 * 如何部署这个项目 @@ -113,57 +119,55 @@ README文件应该包含: * 许可证 * 致谢 +你的自述文件应该简明扼要;你不必解释每一个方面,但要提供足够的信息,以便开发者在熟悉你的项目后可以进一步深入研究。 +#### 2、技术参考 -你的README文件应该简明扼要; 你不必解释每一个方面,但要提供足够的信息,以便开发者在熟悉你的项目后可以进一步深入研究。 +在 REST/JSON API 中, 每一个具体的端点endpoint都对应一个特定的功能,都需要一个具体的说明文档,这非常重要。文档中会定义 API 的描述,输入和可能的输出,并为各种客户端提供使用示例。 -#### 2\. 技术参考 +[OpenAPI][13] 是一个创建 REST/JSON 文档的标准, 它可以指导你完成编写 API 文档所需的各种细节。OpenAPI 还可以为你的 API 生成演示文档。 -在REST/JSON API中, 每一个具体的网址(endpoint)都对应一个特定的功能,所以每一个具体的网址(endpoint)都需要对应一个具体的说明文档,这显得非常重要,文档中会定义API的描述,输入和可能的输出,并为各种客户端提供使用示例。 +#### 3、使用方法 -[OpenAPI][13]是一个创建REST/JSON文档的标准, 它可以指导你完成编写API文档所需的各种细节。OpenAPI还可以为你的API生成演示文档。 +对于 API 的用户来说,仅仅只有技术说明是不够的。他们还需要知道如何在一些特定的情况和场景下来使用这些 API,而大多数的潜在用户可能希望通过你的 API 来解决他们所遇到的问题。 -#### 3\. 使用方法 - -对于API的用户来说,仅仅只有技术说明是不够的。他们还需要知道如何在一些特定的情况和场景下来使用这些API,而大多数的潜在用户可能希望通过你的API来解决他们所遇到的问题。 - -向用户介绍API的一个好的方法是利用一个“开始”页面。“开始”页面可以通过一个简单的用例引导用户,让他们迅速了解你的API能给他们能带来的益处。 +向用户介绍 API 的一个好的方法是利用一个“开始”页面。“开始”页面可以通过一个简单的用例引导用户,让他们迅速了解你的 API 能给他们能带来的益处。 #### 总结 -对于任何完善的API,文档都是一个很关键的组成部分。当你在创建文档时,你需要关注API文档中的如何入门,技术参考以及如何快速开始等三个方面,这样你的API才算是一个完善的API。 +对于任何完善的 API,文档都是一个很关键的组成部分。当你在创建文档时,你需要关注 API 文档中的如何入门、技术参考以及如何快速开始等三个方面,这样你的 API 才算是一个完善的 API。 -### 校验 +### 验证 -API开发过程中经常被忽视的一个点就是校验。 校验是一个验证来自外部源的输入的过程。 这些源可能给是客户端发送过来的JSON数据,或者是你请求别人的服务收到的响应数据。 我们不仅仅要检查这些数据的类型,还要确保这些数据确实是我们要的数据,这样可以消除很多潜在的问题。 了解你的边界以及你能控制的和不能控制的东西,对于API的数据校验来说这是一个很重要的方面。 +API 开发过程中经常被忽视的一个点就是验证。它是一个验证来自外部来源的输入的过程。这些来源可以是客户端发送过来的 JSON 数据,或者是你请求别人的服务收到的响应数据。我们不仅仅要检查这些数据的类型,还要确保这些数据确实是我们要的数据,这样可以消除很多潜在的问题。了解你的边界以及你能控制的和不能控制的东西,对于 API 的数据验证来说是一个很重要的方面。 -最好的策略是在进入数据逻辑处理之前,在你能控制的边界的边缘处进行数据的校验。当客户端向你的API发送数据时,你需要对该数据做出任何处理之前应用你的验证,比如:确保email是真实的邮件地址, 日期数据有正确的格式, 字符串符合长度要求。 +最好的策略是在进入数据逻辑处理之前,在你能控制的边界的边缘处进行数据的验证。当客户端向你的 API 发送数据时,你需要对该数据做出任何处理之前应用你的验证,比如:确保 Email 是真实的邮件地址、日期数据有正确的格式、字符串符合长度要求。 -这种简单的检查可以为你的应用增加安全性和一致性。 还有,当你从某个服务接收数据时,比如数据库或缓存,你需要重新验证这些数据,以确保返回的结果符合你的数据校验。 +这种简单的检查可以为你的应用增加安全性和一致性。还有,当你从某个服务接收数据时,比如数据库或缓存,你需要重新验证这些数据,以确保返回的结果符合你的数据检查。 -你可以自己手写这些校验逻辑,当然也可以用像[Lodash][14]或[Ramda][15]这样的函数库,它们对于一些小的数据对象非常有用。像[Joi][16],[Yup][17],或[Zod][18]这样的验证库效果会更好,因为它们包含了一些常见的验证,可以节省你的时间和精力。除此,它们还能创建一个可读性强的模式。如果你需要看看与语言无关的东西,请看[JSON Schema][19]。 +你可以自己手写这些校验逻辑,当然也可以用像 [Lodash][14] 或 [Ramda][15] 这样的函数库,它们对于一些小的数据对象非常有用。像 [Joi][16]、[Yup][17] 或 [Zod][18] 这样的验证库效果会更好,因为它们包含了一些常见的验证方法,可以节省你的时间和精力。除此,它们还能创建一个可读性强的模式。如果你需要看看与语言无关的东西,请看 [JSON Schema][19]。 #### 总结 -数据校验虽然并不显眼和突出(译者注:跟API的功能实现以及其他几个方面比), 但它可以帮你节省大量的时间。如果不做校验,这些时间将可能被用于故障排除和编写数据迁移脚本。真的不要相信你的客户端会发送干净的数据给你,也不要让验证不通过(bad data)的数据渗入到你的业务逻辑或持久数据存储中去。花点时间验证你的API收到的数据和请求到的响应数据,虽然在前期你可能会感到一些挫折和不适,但这总比你在后期花大量时间去做各种数据收紧管制,故障排除等要容易得多。 +数据验证虽然并不显眼和突出(LCTT 译注:跟 API 的功能实现以及其他几个方面比),但它可以帮你节省大量的时间。如果不做验证,这些时间将可能被用于故障排除和编写数据迁移脚本。真的不要相信你的客户端会发送干净的数据给你,也不要让验证不通过的数据渗入到你的业务逻辑或持久数据存储中去。花点时间验证你的 API 收到的数据和请求到的响应数据,虽然在前期你可能会感到一些挫折和不适,但这总比你在后期花大量时间去做各种数据收紧管制、故障排除等要容易得多。 ### 测试 -测试是软件开发中的最佳实践,它应该是最主要的非功能性的要求。对于任何项目,包括API,确定测试策略都是一个挑战,因为你自始至终都要掌握各种约束,以便相应的来制定你的测试策略。 +测试是软件开发中的最佳实践,它应该是最主要的非功能性的要求。对于包括 API 在内的任何项目,确定测试策略都是一个挑战,因为你自始至终都要掌握各种约束,以便相应的来制定你的测试策略。 -集成测试是测试API的最有效的方法之一。在集成测试模式中,开发团队会创建一个测试集用来覆盖应用流程中的一个点到另一个点。一个好的集成测试流程包括测试API的入口点以及模拟请求到服务端的响应。 搞定这两点,你就覆盖了整个逻辑,包括从API请求的开始到模拟服务器的响应,并返回数据给API。 +集成测试Integration testing是测试 API 的最有效的方法之一。在集成测试模式中,开发团队会创建一个测试集用来覆盖应用流程中的某些部分,从一个点到另一个点。一个好的集成测试流程包括测试 API 的入口点以及模拟请求到服务端的响应。搞定这两点,你就覆盖了整个逻辑,包括从 API 请求的开始到模拟服务器的响应,并返回数据给 API。 -虽然使用的是模拟, 但这种方法让能我们专注于代码逻辑层,而不需要去依赖后端服务和展示逻辑来进行测试。没有依赖的测试会更加可靠, 更容易 实现自动化,且更容易被接入持续集成管道流。 +虽然使用的是模拟,但这种方法让能我们专注于代码逻辑层,而不需要去依赖后端服务和展示逻辑来进行测试。没有依赖的测试会更加可靠、更容易实现自动化,且更容易被接入持续集成管道流。 -集成测试的实施中,我会用[Tape][20],[Test-server][21],和[Fetch-mock][22]。这些库让我们能够从API的请求到数据的响应进行隔离测试,使用 Fetch-mock还可以将出站请求捕获到持久层。 +集成测试的实施中,我会用 [Tape][20]、[Test-server][21] 和 [Fetch-mock][22]。这些库让我们能够从 API 的请求到数据的响应进行隔离测试,使用 Fetch-mock 还可以将出站请求捕获到持久层。 #### 总结 -虽然其他的各种测试和类型检查对API也都有很好的益处,但集成测试在流程效率,构建和管理时间方面却有着更大的优势。 使用Fetch-mock这样的工具,可以在服务边界提供一个干净的模拟场景。 +虽然其他的各种测试和类型检查对 API 也都有很好的益处,但集成测试在流程效率、构建和管理时间方面却有着更大的优势。使用 Fetch-mock 这样的工具,可以在服务边界提供一个干净的模拟场景。 ### 专注于基础 -不管是设计和构建应用程序还是API,都要确保包含上面的四个基本要素。它们并不是我们唯一需要考虑的非功能性需求,其他的还包括应用监控,日志和API管理等都是的。 即便如此, 安全、文档、校验和测试这四个基本点,对于构建任何使用场景下的成功API都是至关重要的关注点。 +不管是设计和构建应用程序还是 API,都要确保包含上面的四个基本要素。它们并不是我们唯一需要考虑的非功能性需求,其他的还包括应用监控、日志和 API 管理等。即便如此,安全、文档、验证和测试这四个基本点,对于构建任何使用场景下的完善 API 都是至关重要的关注点。 -------------------------------------------------------------------------------- @@ -172,7 +176,7 @@ via: https://opensource.com/article/21/5/successful-apis 作者:[Tom Wilson][a] 选题:[lujun9972][b] 译者:[ywxgod](https://github.com/ywxgod) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b9971897a594bc902e59bebc8a7f08a66c3c3c12 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 14 Jun 2021 15:57:24 +0800 Subject: [PATCH 065/870] PUB @ywxgod https://linux.cn/article-13483-1.html --- ...20210518 4 essential characteristics of successful APIs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210518 4 essential characteristics of successful APIs.md (99%) diff --git a/translated/tech/20210518 4 essential characteristics of successful APIs.md b/published/20210518 4 essential characteristics of successful APIs.md similarity index 99% rename from translated/tech/20210518 4 essential characteristics of successful APIs.md rename to published/20210518 4 essential characteristics of successful APIs.md index 0f5fc128b5..63d514f348 100644 --- a/translated/tech/20210518 4 essential characteristics of successful APIs.md +++ b/published/20210518 4 essential characteristics of successful APIs.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ywxgod) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13483-1.html) 完善的 API 的 4 个基本特征 ====== From f008712bd43ccf6c8fb301a7da7daf4b6cabbe0a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 14 Jun 2021 16:49:11 +0800 Subject: [PATCH 066/870] PRF&PUB @geekpi https://linux.cn/article-13484-1.html --- ...Install Code Blocks IDE on Ubuntu Linux.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) rename {translated/tech => published}/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md (64%) diff --git a/translated/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md b/published/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md similarity index 64% rename from translated/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md rename to published/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md index f12b90fbb2..443aaf018c 100644 --- a/translated/tech/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md +++ b/published/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md @@ -3,24 +3,26 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13484-1.html) 如何在 Ubuntu Linux 上安装 Code Blocks IDE ====== +![](https://img.linux.net.cn/data/attachment/album/202106/14/164807ov99wdi2m7pmgz2j.jpg) + Code Blocks 是一个用 C++ 编写的开源 IDE,非常适合 C、C++ 和 Fortran 开发。它是跨平台的,可以在 Linux、macOS 和 Windows 上运行。 Code Blocks 是轻量级和快速的。它支持工作区、多目标项目、工作区内的项目间依赖关系。 -你可以得到语法高亮,代码折叠,标签式界面,类浏览器,智能缩进等。你还可以通过插件扩展 IDE 的功能。 +你可以得到语法高亮、代码折叠、标签式界面、类浏览器、智能缩进等功能。你还可以通过插件扩展 IDE 的功能。 在本教程中,你将学习如何在基于 Ubuntu 的 Linux 发行版上安装 Code Blocks。 -注意 - -Code Blocks 也可以在 Ubuntu 软件中心找到。然而,从 Ubuntu 21.04 开始,从 Ubuntu 软件中心以图形方式安装 Code Blocks 会安装一个 codeblocks-common 软件包,而不是图形化 IDE。因而你看不到安装在你系统上的 Code Blocks 的运行。由于这个原因,我建议采取终端的方式在 Ubuntu 上安装 Code Blocks。 +> 注意 +> +> Code Blocks 也可以在 Ubuntu 软件中心找到。然而,从 Ubuntu 21.04 开始,从 Ubuntu 软件中心以图形方式安装 Code Blocks 会安装一个 codeblocks-common 软件包,而不是图形化 IDE。因而你不能看到安装在你系统上的 Code Blocks 以运行。由于这个原因,我建议采取终端的方式在 Ubuntu 上安装 Code Blocks。 ### 在基于 Ubuntu 的 Linux 发行版上安装 Code Blocks @@ -36,7 +38,7 @@ sudo add-apt-repository universe sudo apt update ``` -最后,你可以使用 apt install 命令在基于 Ubuntu 的发行版上安装 Code Blocks: +最后,你可以使用 `apt install` 命令在基于 Ubuntu 的发行版上安装 Code Blocks: ``` sudo apt install codeblocks @@ -44,7 +46,7 @@ sudo apt install codeblocks ![][3] -建议你也安装额外的插件,以便从 Code Blocks IDE 中获得更多。你可以使用 codeblocks-contrib 包来安装它们: +建议你也安装额外的插件,以便从 Code Blocks IDE 中获得更多。你可以使用 `codeblocks-contrib` 包来安装它们: ``` sudo apt install codeblocks-contrib @@ -52,21 +54,21 @@ sudo apt install codeblocks-contrib ### 如何使用 Code Blocks -在系统菜单中搜索 Code Blocks。这是在 Ubuntu 默认的 GNOME 版本中的样子: +在系统菜单中搜索 “Code Blocks”。这是在 Ubuntu 默认的 GNOME 版本中的样子: ![][4] 当你第一次启动 Code Blocks 时,它会寻找你系统中所有可用的编译器,并将其添加到路径中,这样你就不用自己去配置它了。 -在我的例子中,我的 Ubuntu 系统上已经安装了 gcc,Code Blocks很 好地识别了它。 +在我的例子中,我的 Ubuntu 系统上已经安装了 gcc,Code Blocks 很好地识别了它。 ![][5] -Code Blocks 的用户界面绝对不现代,但请记住,这个 IDE 是轻量级的,它几乎消耗不到 50MB 的内存。 +Code Blocks 的用户界面绝对不够现代,但请记住,这个 IDE 是轻量级的,它几乎消耗不到 50MB 的内存。 如果你曾经使用过像 Eclipse 这样的其他 IDE,你就不会觉得使用 Code Block 有什么困难。你可以写你的代码并把它们组织在项目中。 -构建、运行并构建和运行按钮一起在顶部。 +构建、运行并构建和运行按钮一起放在顶部。 ![][6] @@ -74,9 +76,9 @@ Code Blocks 的用户界面绝对不现代,但请记住,这个 IDE 是轻量 ![][7] -这就是你需要的关于 Code Blocks 的最少信息。我把它留给你,让你通过浏览它的 [wiki][8] 和[用户手册][9]来进一步探索它。 +这就是你需要的关于 Code Blocks 的最少信息。剩下的留给你,你可以通过浏览它的 [维基][8] 和[用户手册][9] 来进一步探索它。 -拥有一个 IDE 可以使[在 Linux 上运行 C 或 C++ 程序][10]更容易。Eclipse 是一个很好的 IDE,但它比 Code Blocks 要消耗更多的系统资源。当然,最后,重要的是你的选择。 +拥有一个 IDE 可以使 [在 Linux 上运行 C 或 C++ 程序][10] 更容易。Eclipse 是一个很好的 IDE,但它比 Code Blocks 要消耗更多的系统资源。当然,最后,重要的是你的选择。 -------------------------------------------------------------------------------- @@ -85,7 +87,7 @@ via: https://itsfoss.com/install-code-blocks-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8274b03917033ca1f3ef8a9359f50a08d4e4f4dd Mon Sep 17 00:00:00 2001 From: littlebirdnest <63171986+littlebirdnest@users.noreply.github.com> Date: Mon, 14 Jun 2021 23:21:58 +0800 Subject: [PATCH 067/870] Update 20200930 FCC auctions should be a long-term boost for 5G availability.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Littlebirdnest 申请 --- ...uctions should be a long-term boost for 5G availability.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md b/sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md index 151561c2e4..8ecf24ea36 100644 --- a/sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md +++ b/sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) +[#]: translator: (littlebirdnest) +[#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (FCC auctions should be a long-term boost for 5G availability) From fa869f2ca0c904f09de7b389212f71af3589d3a1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 15 Jun 2021 05:03:01 +0800 Subject: [PATCH 068/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210614=20?= =?UTF-8?q?Fedora=20Classroom:=20RPM=20Packaging=20101?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210614 Fedora Classroom- RPM Packaging 101.md --- ...614 Fedora Classroom- RPM Packaging 101.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20210614 Fedora Classroom- RPM Packaging 101.md diff --git a/sources/tech/20210614 Fedora Classroom- RPM Packaging 101.md b/sources/tech/20210614 Fedora Classroom- RPM Packaging 101.md new file mode 100644 index 0000000000..c643c165af --- /dev/null +++ b/sources/tech/20210614 Fedora Classroom- RPM Packaging 101.md @@ -0,0 +1,103 @@ +[#]: subject: (Fedora Classroom: RPM Packaging 101) +[#]: via: (https://fedoramagazine.org/fedora-classroom-rpm-packaging-101/) +[#]: author: (Ankur Sinha "FranciscoD" https://fedoramagazine.org/author/ankursinha/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Classroom: RPM Packaging 101 +====== + +![Fedora classroom on RPM packaging][1] + +Fedora Classroom sessions return with a session on RPM packaging targeted at beginners. + +### About the session + +RPMs are the smallest building blocks of the Fedora Linux system. This session will walk through the basics of building an RPM from source code. You will learn how to set up your Fedora system to build RPMs, how to write a spec file that adheres to the [Fedora Packaging Guidelines][2], and how to use it to generate RPMs for distribution. The session will also provide a brief overview of the complete Fedora packaging pipeline. + +While no prior knowledge of building RPMs or building software from its source code is required, some software development experience will be useful. The hope is to help users learn the skills required to build and maintain RPM packages, and to encourage them to contribute to Fedora by joining the package collection maintainers. + +### When and where + +The classroom session will be organised on the BlueJeans video platform at 1200 UTC on June 17, 2021 and is expected to last an hour: + + * BlueJeans event URL: + * [Fedora calendar entry][3] (Click to see the event in your local time zone and add it to your calendar application). + + + +### Topics covered in the session + + * The basics of a spec file. + * Source and binary RPMs and how they are built from the spec using rpmbuild. + * A brief introduction to mock and fedpkg. + * The life cycle of a Fedora package. + * How you can join the Fedora package collection maintainers. + + + +### Prerequisites + + * A Fedora installation (Workstation or any lab/spin) + * The following software should be installed and configured: + * **git** + +``` +sudo dnf install git +``` + + * **fedora-packager +** + +``` +sudo dnf install fedora-packager +``` + + * **mock** (configured as per [these instructions][4]) + + + + +### Useful reading + + * [RPM packages explained][5] + * [How RPM packages are made: the spec file][6] + * [How RPM packages are made: the source RPM][7] + + + +### About the instructor + +[Ankur Sinha][8] has been maintaining packages in Fedora for more than a decade and is currently both a sponsor to the package maintainers group, and a [proven packager][9]. Ankur primarily focuses on maintaining neuroscience related software for the [NeuroFedora Special Interest Group][10] and contributes to other parts of the community wherever possible. + +Fedora Classroom is a project aimed at spreading knowledge on Fedora related topics. If you would like to propose a session, feel free to open a ticket [here][11] with the tag _classroom_. If you are interested in taking a proposed session, please let us know and once you take it, you will be awarded the [Sensei][12] Badge too as a token of appreciation. Recordings from the previous sessions can be found [here][13]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-classroom-rpm-packaging-101/ + +作者:[Ankur Sinha "FranciscoD"][a] +选题:[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/ankursinha/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/fedora-magazing-rpm-classroom-816x345.png +[2]: https://docs.fedoraproject.org/en-US/packaging-guidelines/ +[3]: https://calendar.fedoraproject.org/meeting/10002/ +[4]: https://fedoraproject.org/wiki/Using_Mock_to_test_package_builds#How_do_I_use_Mock.3F +[5]: https://fedoramagazine.org/rpm-packages-explained/ +[6]: https://fedoramagazine.org/how-rpm-packages-are-made-the-spec-file/ +[7]: https://fedoramagazine.org/how-rpm-packages-are-made-the-source-rpm/ +[8]: https://fedoraproject.org/wiki/User:Ankursinha +[9]: https://docs.fedoraproject.org/en-US/fesco/Provenpackager_policy/ +[10]: https://neuro.fedoraproject.org +[11]: https://pagure.io/fedora-join/Fedora-Join/issues +[12]: https://badges.fedoraproject.org/badge/sensei/ +[13]: https://www.youtube.com/playlist?list=PL0x39xti0_64FBQ7mcFt7uBXpG8EA7OF1 From 445056d88f0f3ddfff17d10ae955013f4ca885db Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 15 Jun 2021 05:03:26 +0800 Subject: [PATCH 069/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210615=20?= =?UTF-8?q?With=20Deskreen,=20You=20Can=20Mirror=20or=20Stream=20Your=20Li?= =?UTF-8?q?nux=20Computer=20Screen=20to=20Any=20Device?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md --- ...our Linux Computer Screen to Any Device.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md diff --git a/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md b/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md new file mode 100644 index 0000000000..37d96dc71f --- /dev/null +++ b/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md @@ -0,0 +1,124 @@ +[#]: subject: (With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device) +[#]: via: (https://itsfoss.com/deskreen/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device +====== + +Screen sharing or screen mirroring apps available out there aren’t that good. Even though most of the dedicated options are only available for Windows/Mac, you may have a tough time finding an open-source solution for Linux. + +With such an app, you can share your screen with any device connected to your network. + +If you have a multi-monitor setup, you realise the advantages of having multiple screens. And, with Deskreen, you can turn any device into your secondary screen, how exciting! + +### Deskreen: Turn Any Device into Secondary Screen for Your Linux System + +![I mirrored my Linux Mint desktop to my Android phone][1] + +[Deskreen][2] is a free and open-source application that lets you use any device with a web browser to use as a secondary screen for your computer. + +It also supports multiple devices to connect if you want. + +Deskreen is easy to use and works fine when all your devices are connected to the same Wi-Fi network. + +Let us take a look at the features and how it works. + +### Features of Deskreen + +[Subscribe to our YouTube channel for more Linux videos][3] + +Deskreen features the essentials that include: + + * Ability to share the entire screen + * Choose a specific application window to stream + * Flip Mode to use your screen as a teleprompter + * Supports multiple devices + * Advanced video quality settings + * Offers end-to-end encryption + * Minimal system requirements + * Dark mode + + + +You do not have a lengthy list of features here, but it should be enough for most users. + +### How to Use Deskreen App? + +The Deskreen app works in three simple steps, let me highlight them for you to get started: + +First, when you launch the app, it will display a QR code and an IP address to help you connect other devices with a web browser to stream your screen. + +![][4] + +You can go for anything you like to set up connection with the help of your web browser on your secondary device. + +Once you scan the QR code or enter the IP address in your browser’s address bar, you will get a prompt on Deskreen app to allow or deny the connection. Unless it is something that you do not recognize, go ahead to allow it. + +![][5] + +Next, you will be asked to select what do you want to stream (your entire screen or a specific application window): + +![][6] + +You can choose to stream the entire screen or select the window that you want to stream. However, not every application window may be detected. + +In my quick test, I did not get Rocket.Chat app window but it did seem to detect Slack application window, Deskscreen window, and the terminal as well. + +![][7] + +You just have to select the source and confirm, that’s it. You should notice it streaming on your secondary screen (mobile/desktop). + +![][8] + +This is how it’ll look when it is done: + +![][9] + +Deskreen also gives you the ability to manage connected devices. So, if you need to disconnect any session or all of them, you can do it from the settings. + +### Install Deskreen in Linux + +You get a DEB package and AppImage file for Linux machines. In case you did not know, go through our guides on [install DEB packages][10] and [using AppImage files][11] to get it installed. + +You can download it from the [official website][2] or explore more about it from its [GitHub page][12]. + +[Deskreen][2] + +### Closing Thoughts + +Considering it works using the Wi-Fi network, there is absolutely no issue with the streaming. This is a fantastic way to share your screen with someone else to watch or just stream it to a secondary device for any purpose. + +Of course, it doesn’t replace the advantages of a second monitor for your computer, but you may not need a second screen for a few use-cases. + +Now, I would like to ask you something. What practical use case you can think of that could take advantage of deskreen app here? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/deskreen/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-app.jpg?resize=800%2C450&ssl=1 +[2]: https://deskreen.com/lang-en +[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-connect.png?resize=800%2C559&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskscreen-connect.png?resize=800%2C553&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-select.png?resize=800%2C549&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-app-window.png?resize=800%2C551&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-confirm-1.png?resize=800%2C554&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskscreen-done.png?resize=873%2C599&ssl=1 +[10]: https://itsfoss.com/install-deb-files-ubuntu/ +[11]: https://itsfoss.com/use-appimage-linux/ +[12]: https://github.com/pavlobu/deskreen From d726806f7e8e43be0d0536bd9f72efb4e06fda02 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 15 Jun 2021 05:03:49 +0800 Subject: [PATCH 070/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210614=20?= =?UTF-8?q?13=20open=20source=20tools=20for=20developers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210614 13 open source tools for developers.md --- ...614 13 open source tools for developers.md | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 sources/tech/20210614 13 open source tools for developers.md diff --git a/sources/tech/20210614 13 open source tools for developers.md b/sources/tech/20210614 13 open source tools for developers.md new file mode 100644 index 0000000000..7546d5fd32 --- /dev/null +++ b/sources/tech/20210614 13 open source tools for developers.md @@ -0,0 +1,159 @@ +[#]: subject: (13 open source tools for developers) +[#]: via: (https://opensource.com/article/21/6/open-source-developer-tools) +[#]: author: (Nimisha Mukherjee https://opensource.com/users/nimisha) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +13 open source tools for developers +====== +Choose tools that provide maximum flexibility in software integration +and delivery. +![Tools in a cloud][1] + +Modern developers are highly technical, opinionated, passionate, community-focused, driven, polyglot, and most importantly, empowered decision-makers. Today, developers have a say in the products being built and the tools and technologies used to build them. Most importantly, time is precious, and developers and project managers can always benefit from great efficiency. To attain great efficiency, though, you must understand the software lifecycle, and how it can be organized and manipulated. + +The industry is still working on perfecting how a developer's time is spent. We can divide a developer's major tasks into two different "loops": + + * **Inner loop:** These are the most common tasks developers do, the ones that fully utilize their skillsets: code, run, validate, and debug. This is the classical developer loop. + + + +![Inner loop developer tasks][2] + +(Nimisha Mukherjee, [CC BY-SA 4.0][3]) + + * **Outer loop:** This is where a developer's code goes through continuous integration and continuous delivery (CI/CD) and gets deployed to production. On Gitlab and similar platforms, a developer's pull request (PR) gets merged to the main branch, CI/CD kicks in and creates the build, runs the necessary tests, and deploys to the specified environments. This is a DevOps loop. + + + +![Outer loop developer tasks][4] + +(Nimisha Mukherjee, [CC BY-SA 4.0][3]) + +Developers should spend most of their effort on inner-loop tasks, driving innovation, and minimal time on the outer loop. + +Understanding the differences between the inner and outer loops can help identify the developer tools that work best for each part of the software lifecycle. + +### Open source inner-loop tools + +Here are some of my favorite open source tools for the _code, run, validate, and debug_ cycle. + +#### Code + + * [Eclipse Che][5] makes Kubernetes development accessible for developer teams. Che provides an in-browser integrated development environment (IDE), allowing developers to code, build, test, and run applications from any machine exactly as they run in production. + * [Visual Studio Code][6] (VS Code) and [VSCodium][7] are open source code editors with support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. + + + +#### Run + + * [OpenShift Do][8] (odo) is a command-line interface for developers that supports fast, iterative development, allowing them to focus on what's most important to them: code. + * [Minishift][9] helps developers run [OKD][10] (the community distribution of Kubernetes) locally by launching a single-node OKD cluster inside a virtual machine. Minishift allows trying out OKD or developing with it, day-to-day, on a local machine. + * Eclipse Che + + + +#### Validate + + * Eclipse Che + * Odo + * [VS Code Dependency Analytics][11] is an open source vulnerability database. + + + +#### Deploy + + * Eclipse Che + * Odo + + + +### Learn more + +There are many workflows to implement a good coding cycle. To get an idea of how developers are using these tools, read Daniel Oh's article about how he uses [Quark for serverless application development][12] and Bryan Son's article about [how his team uses Eclipse Che][13]. + +### Open source outer-loop tools + +There are great open source tools that make it easier to send code through CI/CD and deploy it to production. + +#### CI/CD + + * [Tekton][14] is an open source framework for creating CI/CD systems, allowing developers to build, test, and deploy. + * [Jenkins][15] is a free and open source automation server. It helps automate the parts of software development related to building, testing, and deploying to facilitate CI/CD. + + + +#### Build + + * [Shipwright][16] is an extensible framework for building container images on Kubernetes. + * [Eclipse JKube][17] is a collection of plugins and libraries used to build container images using Docker, Jib, or OpenShift Source-to-Image (S2I) build strategies. + + + +#### Run + + * [CodeReady Containers][18] (CRC) manages a local OpenShift 4.x cluster optimized for testing and development purposes. + + + +#### Monitor + + * [Prometheus][19] provides event monitoring and alerting. + + + +#### Deploy + + * Tekton + * Jenkins + * [Helm][20] is a package manager for Kubernetes. + * [Argo CD][21] is a declarative, GitOps continuous delivery tool for Kubernetes. It makes application deployment and lifecycle management automated, auditable, and easy to understand. + + + +### Learn DevOps + +If you're keen to implement a DevOps strategy, you can get started with Jess Cherry's article on how to [use Minishift and Jenkiins to setup your first pipeline][22]. + +### Make it easy + +Today, developers choose the tools and technologies used in software integration and delivery. If you're a developer, then choose open source tools for maximum flexibility. If you're a project manager or architect, choose open source tools to help your developers succeed by working less and getting more done. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/open-source-developer-tools + +作者:[Nimisha Mukherjee][a] +选题:[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/nimisha +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud_tools_hardware.png?itok=PGjJenqT (Tools in a cloud) +[2]: https://opensource.com/sites/default/files/uploads/innerloop.png (Inner loop developer tasks) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/outerloop.png (Outer loop developer tasks) +[5]: https://www.eclipse.org/che/ +[6]: https://code.visualstudio.com/ +[7]: https://opensource.com/article/20/6/open-source-alternatives-vs-code#vscodium +[8]: https://docs.openshift.com/container-platform/4.4/cli_reference/developer_cli_odo/understanding-odo.html +[9]: https://www.okd.io/minishift/ +[10]: https://www.okd.io/ +[11]: https://marketplace.visualstudio.com/items?itemName=redhat.fabric8-analytics +[12]: https://opensource.com/article/21/5/edge-quarkus-linux +[13]: https://opensource.com/article/19/10/cloud-ide-che +[14]: https://tekton.dev/ +[15]: https://www.jenkins.io/ +[16]: https://shipwright.io/ +[17]: https://projects.eclipse.org/projects/ecd.jkube +[18]: https://github.com/code-ready/crc +[19]: https://prometheus.io/ +[20]: https://helm.sh/ +[21]: https://argoproj.github.io/argo-cd/ +[22]: https://opensource.com/article/20/11/minishift-linux From 9fb21156ccf1b74043f051a7378d902b803cae72 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 15 Jun 2021 05:04:02 +0800 Subject: [PATCH 071/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210614=20?= =?UTF-8?q?What=20is=20a=20CI/CD=20pipeline=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210614 What is a CI-CD pipeline.md --- .../tech/20210614 What is a CI-CD pipeline.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210614 What is a CI-CD pipeline.md diff --git a/sources/tech/20210614 What is a CI-CD pipeline.md b/sources/tech/20210614 What is a CI-CD pipeline.md new file mode 100644 index 0000000000..282926567e --- /dev/null +++ b/sources/tech/20210614 What is a CI-CD pipeline.md @@ -0,0 +1,83 @@ +[#]: subject: (What is a CI/CD pipeline?) +[#]: via: (https://opensource.com/article/21/6/what-cicd-pipeline) +[#]: author: (Will Kelly https://opensource.com/users/willkelly) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What is a CI/CD pipeline? +====== +How you define a continuous integration/continuous deployment pipeline +depends on your organization's requirements. +![Plumbing tubes in many directions][1] + +A continuous integration/continuous deployment (CI/CD) pipeline is an anchor for every DevOps initiative. The CI/CD pipeline breaks down traditional silos and enables development and operations teams to collaborate throughout the entire software development lifecycle. + +Better yet, moving to DevOps and a CI/CD pipeline can help your organization [deliver software][2] more securely at a higher velocity. + +### Breaking down the CI/CD pipeline + +There are many definitions of CI/CD pipelines out there, so I always advise organizations to define their own version of a CI/CD pipeline and other DevOps concepts rather than using someone else's. Open source CI/CD tools give you the freedom and options to construct a CI/CD pipeline that meets your organization's requirements. + +The stages that form a CI/CD pipeline are distinct subsets of tasks grouped into _pipeline stages_. Typical pipeline stages include: + + * **Build:** Developers compile the application code.  + * **Test**: The quality assurance (QA) team tests the application code using automated testing tools and strategies.  + * **Release:** The development team delivers the application code to the code repository. + * **Deploy**: The DevOps team stages application code to production.  + * **Security and compliance**: The QA team validates a build based on the project's requirements. This is the stage where organizations deploy container-scanning tools that check the quality of images against Common Vulnerabilities and Exposures (CVEs).  + + + +These are standard stages for a CI/CD pipeline, yet some organizations adapt the CI/CD pipeline model to fit their requirements. For example, an organization building applications for the healthcare market, with its stringent compliance standards, may distribute the test, validation, and compliance gates throughout their toolchain. + +Other examples might be an organization that depends on a complex software supply chain with open source software (OSS). Commercial components may institute a gate where development team members generate a [software bill of materials][3] (SBOM) for OSS packages or the outside commercial software vendor must deliver an SBOM as part of their contract deliverable. + +### Barriers to CI/CD pipelines + +Implementing a CI/CD pipeline changes a team's processes and culture. While many developers are receptive to automation of some tasks and testing, people can be a barrier to CI/CD adoption. + +Moving from a waterfall process to CI/CD can shake up the fundamental and implied power structure in some organizations. Since a CI/CD pipeline increases software delivery velocity, the "gatekeepers" of your old manual process may feel threatened by this change. + +### Integration opportunities + +The open source roots of the tools comprising a CI/CD toolchain create opportunities for some exciting integrations as you achieve greater DevOps maturity levels in your culture, processes, and tooling. + +Analyst firm Forrester predicted in 2020 that just-in-time learning will join the CI/CD pipeline. It makes sense if you think about it. It makes even more sense in the current era of remote work and even for remote onboarding of new employees. For instance, an organization could integrate a documentation wiki into its pipeline with documentation of internal processes. + +A more ambitious organization can integrate a learning management system (LMS) such as [Moodle][4] into its CI/CD pipeline. It could use the LMS to publish short videos about new DevOps toolchain features that developers need to learn as they onboard or when tools are updated across the pipeline. + +Some organizations are integrating group chat and other collaboration tools directly into their CI/CD pipelines. The chat platform serves alerts and enables collaboration and communication among teams. Integrating Mattermost, Rocket.Chat, or another [enterprise chat][5] platform into your CI/CD pipeline requires upfront planning and analysis to ensure that pipeline users won't drown in alerts. + +Another integration opportunity to explore is building analytics and advanced reporting into your CI/CD pipeline. This helps you harness the data that courses through your pipeline. + +### Final thoughts + +The CI/CD pipeline is foundational to DevOps. And open source makes it adaptable and flexible to new requirements resulting from operational changes you implement during your DevOps journey. + +I hope to see an open source response to the unified DevOps platform trend, in which organizations seek an end-to-end CI/CD solution. The makings of such a solution are out there. After all, GitLab and GitHub trace their platforms back to open source roots. + +Lastly, don't forget the education and outreach underlying every successful CI/CD toolchain. Documenting your toolchains and accompanying processes will improve developer onboarding and ongoing DevOps team training. + +How do you and your organization define your CI/CD toolchain? Please share your feedback in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/what-cicd-pipeline + +作者:[Will Kelly][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) +[2]: https://techbeacon.com/devops/5-reasons-why-cicd-vital-your-organizations-value-stream +[3]: https://www.ntia.gov/SBOM +[4]: https://moodle.org/ +[5]: https://opensource.com/alternatives/slack From 896171843fb86ac83d05b9aadb10acccd957b76b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 15 Jun 2021 05:04:16 +0800 Subject: [PATCH 072/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210614=20?= =?UTF-8?q?Install=20FreeDOS=20without=20the=20installer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210614 Install FreeDOS without the installer.md --- ...4 Install FreeDOS without the installer.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 sources/tech/20210614 Install FreeDOS without the installer.md diff --git a/sources/tech/20210614 Install FreeDOS without the installer.md b/sources/tech/20210614 Install FreeDOS without the installer.md new file mode 100644 index 0000000000..79a27899a9 --- /dev/null +++ b/sources/tech/20210614 Install FreeDOS without the installer.md @@ -0,0 +1,158 @@ +[#]: subject: (Install FreeDOS without the installer) +[#]: via: (https://opensource.com/article/21/6/install-freedos-without-installer) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Install FreeDOS without the installer +====== +Here's how to set up your FreeDOS system manually without using the +installer. +![FreeDOS fish logo and command prompt on computer][1] + +Most people should be able to install FreeDOS 1.3 RC4 very easily using the installer. The FreeDOS installer asks a few questions, then takes care of the rest—including making space for FreeDOS and making the system bootable. + +But what if the installer doesn't work for you? Or what if you prefer to set up your FreeDOS system _manually_, without using the installer? With FreeDOS, you can do that too! Let's walk through the steps to install FreeDOS without using the installer. I'll do all of these steps using the QEMU virtual machine, using a blank hard drive image. I created a one hundred megabyte ("100M") hard drive image with this Linux command: + + +``` +`$ qemu-img create freedos.img 100M` +``` + +I downloaded the FreeDOS 1.3 RC4 installation LiveCD as FD13LIVE.iso, which provides a "live" environment where I can run FreeDOS, including all the standard tools. Most users also use the LiveCD to install FreeDOS with the regular installer, but here I'll only use the LiveCD to install FreeDOS using individual commands from the command line. + +I started the virtual machine with this rather long QEMU command, and selected the "Use FreeDOS 1.3 in Live Environment mode" boot menu entry: + + +``` +`$ qemu-system-x86_64 -name FreeDOS -machine pc-i440fx-4.2,accel=kvm,usb=off,dump-guest-core=off -enable-kvm -cpu host -m 8 -overcommit mem-lock=off -no-user-config -nodefaults -rtc base=utc,driftfix=slew -no-hpet -boot menu=on,strict=on -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on -hda freedos.img -cdrom FD13LIVE.iso -device sb16 -device adlib -soundhw pcspk -vga cirrus -display sdl -usbdevice mouse` +``` + +![manual install][2] + +Select "Use FreeDOS 1.3 in Live Environment mode" to boot the LiveCD +(Jim Hall, [CC-BY SA 4.0][3]) + +That QEMU command line includes a bunch of options that may seem confusing at first. You configure QEMU entirely with command-line options, so there is a lot to examine here. But I'll briefly highlight a few important options: + + * `-m 8:` Set the system memory ("RAM") to 8 megabytes + * **`-boot menu=on,strict=on:`** Use a boot menu, so I can select if I want to boot from the CD-ROM image or the hard drive image + * **`-hda freedos.img`:** Use **freedos.img** as the hard drive image + * `-cdrom FD13LIVE.iso:`Use **FD13LIVE.iso** as the CD-ROM image + * **`-device sb16 -device adlib -soundhw pcspk`:** Define the machine with a SoundBlaster16 sound card, AdLib digitial music card, and PC speaker emulation (these are useful if you want to play DOS games) + * **`-usbdevice mouse`:** Recognize the user's mouse as a USB mouse (click in the QEMU window to use the mouse) + + + +### Partition the hard drive + +You can use FreeDOS 1.3 RC4 from the LiveCD, but if you want to install FreeDOS to your computer, you'll first need to make space on the hard drive. This requires creating a _partition_ with the FDISK program. + +From the DOS command line, type `FDISK` to run the _fixed disk_ setup program. FDISK is a full-screen interactive program, and you only need to type a number to select a menu item. From the main FDISK menu, enter "1" to create a DOS partition on the drive, then enter "1" on the next screen to create a _primary_ DOS partition. + +![using fdisk][4] + +Select "1" to create a partition +(Jim Hall, [CC-BY SA 4.0][3]) + +![using fdisk][5] + +Select "1" on the next menu to make a primary partition +(Jim Hall, [CC-BY SA 4.0][3]) + +FDISK asks you if you wish to use the full size of the hard disk to create the partition. Unless you need to share space on this hard drive with another operating system, such as Linux, you should answer "Y" to this prompt. + +After FDISK creates the new partition, you'll need to reboot before DOS can recognize the new partition information. Like all DOS operating systems, FreeDOS identifies the hard drive information only when it boots up. So if you create or delete any disk partitions, you'll need to reboot so FreeDOS recognizes the changed partition information. FDISK reminds you to reboot, so you don't forget. + +![using fdisk][6] + +You need to reboot to recognize the new partition +(Jim Hall, [CC-BY SA 4.0][3]) + +You can reboot by stopping and restarting the QEMU virtual machine, but I prefer to reboot FreeDOS from the FreeDOS command line, using the FreeDOS Advanced Power Management (FDADPM) tool. To reboot, type the command `FDADPM /WARMBOOT` and FreeDOS reboots itself. + +### Formatting the hard drive + +After FreeDOS restarts, you can continue setting up the hard drive. Creating the disk partition was "step 1" in this process; now you need to make a DOS _filesystem_ on the partition so FreeDOS can use it. + +DOS systems identify "drives" using the letters `A` through `Z`. FreeDOS recognizes the first partition on the first hard drive as the `C` drive, and so on. You often indicate the drive with the letter and a colon (`:`) so the new partition we created above is actually the `C:` drive. + +You can create a DOS filesystem on the new partition with the FORMAT command. This command takes a few options, but we'll only use the `/S` option to tell FORMAT to make the new filesystem bootable—the "S" means to install the FreeDOS "System" files. Type `FORMAT /S C:` to make a new DOS filesystem on the `C:` drive. + +![formatting the disk][7] + +Format the partition to create the DOS filesystem +(Jim Hall, [CC-BY SA 4.0][3]) + +With the `/S` option, FORMAT will run the SYS program to transfer the system files. You'll see this as part of the output from FORMAT: + +![formatting the disk][8] + +FORMAT /S will use SYS to make the disk bootable +(Jim Hall, [CC-BY SA 4.0][3]) + +### Installing software + +Having created a new partition with FDISK and a new filesystem with FORMAT, the new `C:` drive is basically empty. At this point, the `C:` drive only contains a copy of the kernel and the `COMMAND.COM` command-line shell. To do anything useful with the new disk, we need to install software on it. This is the last step for the manual install process. + +The FreeDOS 1.3 RC4 LiveCD contains all of the software you might want to install on the new system. Each FreeDOS program is available as a separate "package," which is really just a Zip archive file. The packages that set up the standard DOS environment are stored in the `BASE` directory, under the `PACKAGES` directory on the LiveCD. + +You could install the packages by "unzipping" each of them to the hard drive, one at a time. With 62 individual packages in the "Base" group, installing each package individually would take a very long time. However, you can run a one-line `FOR` "loop" command to "unzip" each program. Then FreeDOS can "unzip" all of the packages for you. + +The basic usage of the `FOR` loop indicates a single-letter variable (let's use `%F`) that FreeDOS uses to "fill in" the filename later. The `FOR` also requires a list of files in brackets and the command that it should run against each of the files. The syntax to unzip a list of Zip files looks like this: + + +``` +`FOR %F IN (*.ZIP) DO UNZIP %F` +``` + +This extracts all of the Zip files into the current directory. To extract or "unzip" the files into a different location, use the `-d` ("destination") option at the end of the `UNZIP` command line. For most FreeDOS systems, you will want to install the software packages to the `C:\FDOS` directory: + +![installing the software][9] + +Unzip all of the Base packages to finish installing FreeDOS +(Jim Hall, [CC-BY SA 4.0][3]) + +FreeDOS takes care of the rest, installing all 62 packages to your system. This may take several minutes because DOS can be slow when working with lots of individual files—and this command needs to extract 62 Zip files. The installation process would run a lot faster if we used a single `BASE.ZIP` archive file, but using packages provides more flexibility in what software you might want to install versus what you choose to leave out. + +![installing the software][10] + +After installing all the Base packages +(Jim Hall, [CC-BY SA 4.0][3]) + +After you've installed everything, reboot your system with `FDADPM /WARMBOOT`. Installing manually means your new FreeDOS system won't have the usual `FDCONFIG.SYS` configuration file, so FreeDOS will assume a few typical default values when it starts up. Without the `AUTOXEC.BAT` file, FreeDOS also prompts you for the time and date. + +![rebooting FreeDOS][11] + +Rebooting FreeDOS after a manual install +(Jim Hall, [CC-BY SA 4.0][3]) + +Most users should be able to use the more user-friendly process to install FreeDOS on a new computer. But if you want to install it yourself the "old school" way, you can also run the installation steps manually. This can provide some additional flexibility and control because you install everything yourself. And now you know how to do it. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/install-freedos-without-installer + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos-fish-laptop-color.png?itok=vfv_Lpph (FreeDOS fish logo and command prompt on computer) +[2]: https://opensource.com/sites/default/files/uploads/manual-install3.png (Select "Use FreeDOS 1.3 in Live Environment mode" to boot the LiveCD) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/manual-install6.png (Select "1" to create a partition) +[5]: https://opensource.com/sites/default/files/uploads/manual-install7.png (Select "1" on the next menu to make a primary partition) +[6]: https://opensource.com/sites/default/files/uploads/manual-install10.png (You need to reboot to recognize the new partition) +[7]: https://opensource.com/sites/default/files/uploads/manual-install13.png (Format the partition to create the DOS filesystem) +[8]: https://opensource.com/sites/default/files/uploads/manual-install14.png (FORMAT /S will use SYS to make the disk bootable) +[9]: https://opensource.com/sites/default/files/uploads/manual-install18.png (Unzip all of the Base packages to finish installing FreeDOS) +[10]: https://opensource.com/sites/default/files/uploads/manual-install24.png (After installing all the Base packages) +[11]: https://opensource.com/sites/default/files/uploads/manual-install28.png (Rebooting FreeDOS after a manual install) From c53ea831dd941eb668ea5e0972bd6e8cda28b7ef Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 15 Jun 2021 08:54:48 +0800 Subject: [PATCH 073/870] translated --- ...Based Text Editor for Power Linux Users.md | 104 ------------------ ...Based Text Editor for Power Linux Users.md | 104 ++++++++++++++++++ 2 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md create mode 100644 translated/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md diff --git a/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md b/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md deleted file mode 100644 index b71d2aa4b5..0000000000 --- a/sources/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: subject: (Helix: A Terminal Based Text Editor for Power Linux Users) -[#]: via: (https://itsfoss.com/helix-editor/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Helix: A Terminal Based Text Editor for Power Linux Users -====== - -When it comes to [terminal based text editors][1], it is usually Vim, Emacs and Nano that get the limelight. - -That doesn’t mean there are not other such text editors. [Neovim][2], a modern enhancement to Vim, is one of many such examples. - -Along the same line, I would like to introduce yet another terminal based text editor called Helix Editor. - -### Helix, a modern text editor written in Rust - -![][3] - -[Helix][4] is written in Rust and uses Tree-sitter for syntax highlighting. The developer claims that it is faster than regex highlighting because Tree-sitter parses code into syntax trees like a compiler and thus giving a lot more information about code structure. - -You can track local variables, calculate indentations and manipulate selection to select syntax nodes. It is robust enough to produce results even with syntax error. - -The main focus of Helix is on ‘multiple selection’. This is based on [Kakoune][5]. - -The built-in language server support provides context aware completion, diagnostics and code actions. - -### Installing Helix on Linux - -For Arch and Manjaro users, Helix is available in the AUR in two packages: - - * [helix-bin][6]: contains prebuilt binary from GitHub releases - * [helix-git][7]: builds the master branch of this repository - - - -As an Arch user, you probably already know [how to install applications using AUR][8], I believe. - -For other Linux distributions, you have to use Cargo. Cargo is Rust package manager. With this, you can install Rust packages. Consider it Rust equivalent to PIP of Python. - -You should be able to install Cargo using your distribution’s package manager. On Ubuntu based distributions, install cargo like this: - -``` -sudo apt install cargo -``` - -Next, you clone the Helix repository: - -``` -git clone --recurse-submodules --shallow-submodules -j8 https://github.com/helix-editor/helix -``` - -Move to the cloned directory: - -``` -cd helix -``` - -And now use cargo to install Helix: - -``` -cargo install --path helix-term --features "embed_runtime" -``` - -One last step is to add the hx binary to the PATH variable so that you can run it from anywhere. This should be added to your bashrc or bash profile. - -``` -export PATH=”$HOME/.cargo/bin:$PATH” -``` - -Now that everything is set, you should be able to use the editor by typing `hx` in the terminal. - -You can find the keyboard shortcuts for using Helix on its [documentation page][9]: - -[Helix Keyboard Shortcuts][10] - -How does it compare with Vim or Neovim? I cannot say. I can use Vim for basic editing but I am not a Vim ninja. If you are someone who swears and live by Vim (or Emacs), I let you try Helix and judge it yourself. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/helix-editor/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/command-line-text-editors-linux/ -[2]: https://neovim.io/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/helix-editor-screenshot.png?resize=800%2C515&ssl=1 -[4]: https://helix-editor.com/ -[5]: http://kakoune.org/ -[6]: https://aur.archlinux.org/packages/helix-bin/ -[7]: https://aur.archlinux.org/packages/helix-git/ -[8]: https://itsfoss.com/aur-arch-linux/ -[9]: https://docs.helix-editor.com/ -[10]: https://docs.helix-editor.com/keymap.html diff --git a/translated/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md b/translated/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md new file mode 100644 index 0000000000..6ec636b651 --- /dev/null +++ b/translated/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md @@ -0,0 +1,104 @@ +[#]: subject: (Helix: A Terminal Based Text Editor for Power Linux Users) +[#]: via: (https://itsfoss.com/helix-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Helix:为有经验的 Linux 用户提供的基于终端的文本编辑器 +====== + +说到[基于终端的文本编辑器][1],通常是 Vim、Emacs 和 Nano 受到了关注。 + +这并不意味着没有其他这样的文本编辑器。[Neovim][2],是 Vim 的现代增强版,是许多这样的例子之一。 + +按照同样的思路,我想介绍另一个基于终端的文本编辑器,叫做 Helix Editor。 + +### Helix,一个用 Rust 编写的现代文本编辑器 + +![][3] + +[Helix][4] 是用 Rust 编写的,使用 Tree-sitter 进行语法高亮。开发者声称,它比 regex 高亮更快,因为 Tree-sitter 像编译器一样将代码解析成语法树,从而给出更多的代码结构信息。 + +你可以跟踪局部变量,计算缩进和操作选择来选择语法节点。它足够强大,即使有语法错误也能产生结果。 + +Helix 的主要重点是“多重选择”。这是以 [Kakoune][5] 为基础的。 + +内置的语言服务器支持提供上下文感知补全、诊断和代码操作。 + +### 在 Linux 上安装 Helix + +对于 Arch 和 Manjaro 用户来说,Helix 在 AUR 中有两个包: + + * [helix-bin][6]: 包含来自 GitHub 发布的预构建二进制文件 + * [helix-git][7]: 构建该仓库的主分支 + + + +作为一个 Arch 用户,我相信你可能已经知道[如何使用 AUR 安装应用][8]。 + +对于其他 Linux 发行版,你必须使用 Cargo。Cargo 是 Rust 软件包管理器。有了它,你可以安装 Rust 包。可以认为它相当于 Python 的 PIP。 + +你应该能够使用你的发行版的包管理器来安装 Cargo。在基于 Ubuntu 的发行版上,可以这样安装 Cargo: + +``` +sudo apt install cargo +``` + +接下来,你要克隆 Helix 仓库: + +``` +git clone --recurse-submodules --shallow-submodules -j8 https://github.com/helix-editor/helix +``` + +进入克隆的目录中: + +``` +cd helix +``` + +现在用 cargo 来安装 Helix: + +``` +cargo install --path helix-term --features "embed_runtime" +``` + +最后一步是将 hx 二进制文件添加到 PATH 变量中,这样你就可以从任何地方运行它。这应该被添加到你的 bashrc 或 bash 配置文件中。 + +``` +export PATH=”$HOME/.cargo/bin:$PATH” +``` + +现在都设置好了,你应该可以通过在终端输入 `hx` 来使用编辑器。 + +你可以在 Helix 的[文档页][9]上找到使用 Helix 的键盘快捷键: + +[Helix 键盘快捷键][10] + +它与 Vim 或 Neovim 相比如何?我无法说。我可以用 Vim 进行基本的编辑,但我不是 Vim 忍者。如果你是一个信奉 Vim(或 Emacs)的人,请你试试 Helix 并自己判断。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/helix-editor/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/command-line-text-editors-linux/ +[2]: https://neovim.io/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/helix-editor-screenshot.png?resize=800%2C515&ssl=1 +[4]: https://helix-editor.com/ +[5]: http://kakoune.org/ +[6]: https://aur.archlinux.org/packages/helix-bin/ +[7]: https://aur.archlinux.org/packages/helix-git/ +[8]: https://itsfoss.com/aur-arch-linux/ +[9]: https://docs.helix-editor.com/ +[10]: https://docs.helix-editor.com/keymap.html From cfab2c7c2201672a5d5902ac0fe686f477fd114e Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 15 Jun 2021 08:56:40 +0800 Subject: [PATCH 074/870] translating --- sources/tech/20210610 Use cpulimit to free up your CPU.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210610 Use cpulimit to free up your CPU.md b/sources/tech/20210610 Use cpulimit to free up your CPU.md index e07d69a1e1..63c3c4aaae 100644 --- a/sources/tech/20210610 Use cpulimit to free up your CPU.md +++ b/sources/tech/20210610 Use cpulimit to free up your CPU.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/use-cpulimit-to-free-up-your-cpu/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 59debb4abffb652cf91d2ef26375da99bcb61721 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 15 Jun 2021 14:41:18 +0800 Subject: [PATCH 075/870] PRF @ShuyRoy --- ...8 Manage your Raspberry Pi with Cockpit.md | 72 ++++++++----------- 1 file changed, 29 insertions(+), 43 deletions(-) diff --git a/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md b/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md index 1b40fa9c15..ca512f06b2 100644 --- a/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md +++ b/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md @@ -3,24 +3,24 @@ [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -使用Cockpit管理你的树莓派 +使用 Cockpit 管理你的树莓派 ====== -用Cockpit建立你的树莓派的控制中心。 -![Neon colorized Raspberry Pi cluster with LEGOs][1] -去年,我写了关于使用[Cockpit管理我的Linux服务器的文章][2]。它是一个基于web的工具,为管理多个服务器及其相关的服务和应用提供了一个干净、强大的接口。它还简化了日常的管理任务。 +> 用 Cockpit 建立你的树莓派的控制中心。 -在这篇文章中,我将会介绍如何在树莓派基金会提供的标准操作系统(OS)上安装Linux服务器的Cockpit web控制台。我还会简要介绍它的特性。 +![](https://img.linux.net.cn/data/attachment/album/202106/15/144053hmswm01w6qus011n.jpg) +去年,我写了关于使用 [Cockpit 管理我的 Linux 服务器的文章][2]。它是一个基于 Web 的工具,为管理多个服务器及其相关的服务和应用提供了一个简洁、强大的界面。它还简化了日常的管理任务。 -### 在树莓派OS上安装Cockpit +在这篇文章中,我将会介绍如何在树莓派基金会提供的标准操作系统树莓派 OS 上安装用于 Linux 服务器的 Cockpit Web 控制台。我还会简要介绍它的特性。 -在sudo权限下使用一个账户通过SSH登录你的树莓派系统。如果你还没有建立一个账户: +### 在树莓派 OS 上安装 Cockpit +在 `sudo` 权限下使用一个账户通过 SSH 登录你的树莓派系统。如果你还没有建立一个账户: ``` $ ssh pibox @@ -37,17 +37,15 @@ Last login: Tue May  4 09:55:57 2021 from 172.1.4.5 alan@pibox:~ $ ``` -在树莓派OS上安装Cockpit web控制台和在Linux服务器上一样简单: - +在树莓派 OS 上安装 Cockpit Web 控制台和在 Linux 服务器上一样简单: ``` -`$ sudo apt install cockpit` +$ sudo apt install cockpit ``` -Cockpit只需要60.4 KB的磁盘空间。加上它的几个包依赖项,总使用量是115MB。 - -安装过程将负责设置和启动服务。你可以使用 `systemctl` 命令来验证状态。 +Cockpit 只需要 60.4 KB 的磁盘空间。加上它的几个包依赖项,总使用量是 115MB。 +安装过程将负责设置和启动服务。你可以使用 `systemctl` 命令来验证状态: ``` $ systemctl status cockpit.socket @@ -62,34 +60,27 @@ $ systemctl status cockpit.socket    CGroup: /system.slice/cockpit.socket ``` -### 使用Cockpit +### 使用 Cockpit #### 连接 -默认的监听端口号是9090。打开你最喜欢的web浏览器并输入地址,例如: `https://pibox:9090`. +默认的监听端口号是 9090。打开你最喜欢的 Web 浏览器并输入地址,例如: `https://pibox:9090`。 ![Cockpit home page][3] -(Alan Formy-Duval, [CC BY-SA 4.0][4]) +你现在可以使用你的普通账户登录。同样,这个账户上需要有使用 `sudo` 的权限 —— 很可能就是你用来 SSH 和运行 Apt 的那个账户。一定要勾选“为特权任务重用我的密码”。 -你现在可以使用你的常规账户登录。同样,在这个账户上使用sudo权限是很有帮助的——使用SSH和运行Apt很像。一定要勾选“为特权任务重用我的密码”。 - -#### 管理你的派 - -Cockpit的初始屏幕以 **System** 开始,将提供当前CPU和内存使用的详细信息和图。 +#### 管理你的树莓派 +Cockpit 的初始屏幕以 “System” 页开始,提供当前 CPU 和内存使用的详细信息和图表。 ![Initial Cockpit screen][5] -(Alan Formy-Duval, [CC BY-SA 4.0][4]) - 你可以从这个屏幕看到硬件细节。 ![Cockpit hardware details][6] -(Alan Formy-Duval, [CC BY-SA 4.0][4]) - -通过点击每一项来展开左边的列(例如,日志、存储、服务等)。这些是标准的Cockpit部分,而且非常明显。 +通过点击每一项来展开左边的列(例如,日志、存储、服务等)。这些是标准的 Cockpit 部分,不言自明。让我快速描述一下每个部分。 #### 日志 @@ -97,15 +88,15 @@ Cockpit的初始屏幕以 **System** 开始,将提供当前CPU和内存使用 #### 存储 -存储部分展示了已经安装的物理驱动器和RAID设备。例如大小、序列号等细节都被展示了出来。还展示了读/写活动和真实的空间使用的图。专门存储日志的在底部展示。 +存储部分展示了已经安装的物理驱动器和 RAID 设备。例如大小、序列号等细节都被展示了出来。还展示了读/写活动和实际空间使用的图表。存储的具体日志显示在底部。 #### 网络 -这部分展示了发送和接收活动、IP地址以及网络的日志。你也可以添加更多的网络设备,例如使用各自按钮的bonds、桥以及VLAN。 +这部分展示了发送和接收活动、IP 地址以及网络特定的日志。你还可以使用相应的按钮添加更多的网络设备,如绑定、网桥和 VLAN。 #### 账户 -这里展示了已有的账户。点击每个账户来管理或使用创建新账户按钮来添加用户。账户也可以被删除。 +这里展示了已有的账户。点击每个账户来管理,或使用创建新账户按钮来添加用户。账户也可以被删除。 #### 服务 @@ -113,34 +104,29 @@ Cockpit的初始屏幕以 **System** 开始,将提供当前CPU和内存使用 #### 应用程序 -通常,这个屏幕提供了各种用于管理功能的应用程序,例如389目录服务器或Podman同期的创建。但在我的树莓派OS上,这个屏幕只显示“没有安装或可用的应用程序”。在写应用程序的时候,这个或许还没有实现。尽管如此,你得不得怀疑这类型的过程对于树莓派硬件来说是否太沉重。 +通常,这个屏幕提供了各种用于管理功能的应用程序,例如 389 目录服务器或创建 Podman 容器。但在我的树莓派 OS 上,这个屏幕只显示“没有安装或可用的应用程序”。在写这篇文章的时候,这个或许还没有实现。虽然,你可能会怀疑这类型的程序对于树莓派硬件来说是否太过沉重。 #### 软件更新 -对任何系统管理员来说,保持软件最新是最重要的任务之一。Cockpit的软件更新部分检查并进行更新。 +对任何系统管理员来说,保持软件最新是最重要的任务之一。Cockpit 的软件更新部分可以检查并进行更新。 ![Software updates in Cockpit][7] -(Alan Formy-Duval, [CC BY-SA 4.0][4]) - #### 终端 -Cockpit最整洁的特点之一是终端。你可以使用它,而不是打开一个单独的终端模拟器并使用SSH。我使用中断来安装[ScreenFetch][8]: - +Cockpit 最方便的特点之一是终端。你可以使用它,而不是打开一个单独的终端模拟器并使用 SSH。我使用终端来安装 [ScreenFetch][8]: ``` -`$ sudo apt install screenfetch` +$ sudo apt install screenfetch ``` -我使用ScreenFetch生成了这张截图: +使用 ScreenFetch 生成了这张截图: ![Terminal in Cockpit][9] -(Alan Formy-Duval, [CC BY-SA 4.0][4]) +### 使用 Cockpit 的中心控制 -### 使用Cockpit的中心控制 - -Cockpit在树莓派上的行为就像它在任何其他Linux系统上一样。你可以将它添加到控制面板上进行集中控制。它允许组织将基于树莓派的服务和系统集成到他们的整个Linux基础设施中,无论Cockpit在哪里被用来作为管理控制面板的解决方案。这是非常方便的,因为派经常在无领导者的高密度机架数据中心运行,而这些数据中心通常会缺乏KVM访问。 +Cockpit 在树莓派上的表现就像它在其他 Linux 系统上一样。你可以将它添加到仪表盘上进行集中控制。它允许企业在 Cockpit 作为管理仪表盘解决方案的任何地方,将基于树莓派的服务和系统整合到他们的整体 Linux 基础设施中。因为树莓派经常在高密度机架数据中心以无外接控制headless方式运行,而这些数据中心通常会缺乏 KVM 访问方式,这是非常方便的。 -------------------------------------------------------------------------------- @@ -149,7 +135,7 @@ via: https://opensource.com/article/21/5/raspberry-pi-cockpit 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[RiaXu](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fc53ac7a8a717a57a2fedd1444fae1bee7defcb5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 15 Jun 2021 14:42:02 +0800 Subject: [PATCH 076/870] PUB @ShuyRoy https://linux.cn/article-13487-1.html --- .../20210518 Manage your Raspberry Pi with Cockpit.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210518 Manage your Raspberry Pi with Cockpit.md (98%) diff --git a/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md b/published/20210518 Manage your Raspberry Pi with Cockpit.md similarity index 98% rename from translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md rename to published/20210518 Manage your Raspberry Pi with Cockpit.md index ca512f06b2..d64b731d9a 100644 --- a/translated/tech/20210518 Manage your Raspberry Pi with Cockpit.md +++ b/published/20210518 Manage your Raspberry Pi with Cockpit.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13487-1.html) 使用 Cockpit 管理你的树莓派 ====== From 27335eaf8c1f37a8315f96ab738349cabfaf804c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 16 Jun 2021 05:03:23 +0800 Subject: [PATCH 077/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210616=20?= =?UTF-8?q?Hash=20Linux:=20Arch=20Linux=20Preconfigured=20With=20Xmonad,?= =?UTF-8?q?=20Awesome,=20i3,=20and=20Bspwm=20Window=20Manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md --- ..., Awesome, i3, and Bspwm Window Manager.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md diff --git a/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md b/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md new file mode 100644 index 0000000000..cbe68de7d3 --- /dev/null +++ b/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md @@ -0,0 +1,135 @@ +[#]: subject: (Hash Linux: Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager) +[#]: via: (https://itsfoss.com/hash-linux-review/) +[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Hash Linux: Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager +====== + +With some effort, [you can install Arch Linux][1]. You may also install a desktop environment or windows manager of your choice on your Arch system. + +That takes some time and effort but it is surely achievable. However, there exists projects that try to ease the pain by providing you a system preconfigured with a desktop environment or window manager of your choice. [ArcoLinux][2] is one such example. + +Recently, I came across another project that has its sole focus on providing choice of window managers on top of the wonderful Arch distribution. + +[Hash Project][3] offers four preconfigured Arch variants with tiling window managers: Awesome, [Xmonad][4], i3, and Bspwm. + +If you’re a beginner window manager hopper, the Hash project is what you should definitely try at once. Without investing time to configure it first, you can explore the potential of window managers and get used to keyboard-driven systems. + +In this article, I’ll discuss my part of the experience with the **Hash Linux Xmonad edition** featuring Linux kernel 5.12. + +### Installation Of Hash Linux + +The ISO image of all four editions of Hash Linux is available to [download][5] for x86_64 system architecture. + +To avoid any unexpected error while installing it on a bare system, I created a virtual machine of Hash Linux Xmonad version in GNOME Boxes. + +As I booted into Hash Linux, I noticed two things. First, a panel providing important shortcuts for managing windows and commands. I’ll discuss it later after installation. Second, a beautiful and easy-to-use GUI installer. + +![Hash Linux GUI Installer][6] + +As usual, the graphical installer made the installation process very smooth by providing buttons to click on. Within a few steps of configuration, Hash Linux was installed and ready to reboot. + +![Installer Welcome Page][7] + +### First Impression + +![Hash Linux][8] + +If you’ve ever installed Xmonad window manager on your Linux system, what is the first thing you saw after reboot? Blank screen right. + +And if you’re a beginner or you don’t know the default key binding, you get stuck on the same screen. Hence, you must have to read keyboard shortcuts first before using any window manager. + +What if you get all the important shortcuts right on your window? A cheat sheet can save you a lot of time. + +Therefore, for the sake of simplicity and beginner-friendly, Hash Linux has pinned important keys on the desktop window. + +So, let’s try some of it first. Starting with one of the most important `[Super]+Enter`, it opens the default termite terminal emulator with Z shell (ZSH). + +If you click it multiple times, you notice that by default Xmonad follows a dwindle layout where it first fixes one window on the right side and then arranges the rest of all on the left side in the same manner. + +![Xmonad default layout][9] + +Using `[Super]+[Space]`, you can also change the current layout to a tabbed one. Even you can use `[Super]+[left+click]` to move a window into a float mode. + +![Moved to float][10] + +To quit the currently focussed window, you can press `[Super]+Q`. + +### Applications In Hash Linux + +By default, Hash Linux contains several useful command-line tools such as NeoFetch, Htop, Vim, Pacman, Git, and Speedtest-cli. + +![Htop][11] + +It also has a good amount of graphical applications such as Firefox 89, Gparted, Nitrogen, Conky, Flameshot, Geany, and CPU-X. + +`[Super]+D` is the default key in Hash Linux to open application search menu. + +![Application search menu][12] + +### Theming + +Hash Cyan is the default theme in Hash Linux. Besides it, Hash Linux provides four more themes: Light Orange, Sweet Purple, Night Red, and Arch Dark. + +Hash Theme Selector is a home-baked Hash Linux application that you can use to configure the theme for a window manager. + +![Hash Theme Selector][13] + +### Upgrading Hash Linux + +Being a rolling release distribution, you don’t need to download a new ISO of Hash Linux to update the existing system. The only thing you need to upgrade your system is to run `upgrade` command in a terminal. + +![upgrading hash linux][14] + +### Closing Thought + +If you want to use a window manager instead of the desktop environment but do not want to spend a lot of time configuring it, Hash project saves the day. + +First, it will save you a lot of time and effort for configuration, and second, it will easily make you comfortable in using a keyboard-driven system. Later, you can definitely learn to configure according to your own needs. + +As Hash Linux already provides four ISO with the different window managers, you can start using any version and find your favorite one. Overall, it is a [good Arch-based Linux distribution][15]. + +At last, I would also like to mention that the current official [site][3] of Hash Linux does not contain much information about it. + +![][16] + +An earlier [site][17] (not accessible to me now) that also mentioned in the release info, contained information about it including configuration details when I checked last time. + +Don’t want to go the Arch way just for tiling window manager? Try [Regolith Linux][18]. It is Ubuntu preconfigured with i3wm. Awesome, right? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/hash-linux-review/ + +作者:[Sarvottam Kumar][a] +选题:[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/sarvottam/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-arch-linux/ +[2]: https://arcolinux.com/ +[3]: https://hashproject.ga/ +[4]: https://xmonad.org/ +[5]: https://hashproject.ga/index.html#downloads +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-GUI-Installer.jpg?resize=800%2C451&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Installer-Welcome-Page.png?resize=800%2C452&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux.jpg?resize=800%2C451&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Xmonad-default-layout.png?resize=800%2C452&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Moved-to-float.png?resize=800%2C452&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Htop.jpg?resize=800%2C451&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Application-search-menu.jpg?resize=800%2C451&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Theme-Selector.png?resize=800%2C452&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Upgrading-hash-linux.png?resize=800%2C452&ssl=1 +[15]: https://itsfoss.com/arch-based-linux-distros/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-Site-URL.png?resize=575%2C193&ssl=1 +[17]: https://hashproject.org/ +[18]: https://itsfoss.com/regolith-linux-desktop/ From 7095dd171d1955fb7a1fc60847412aac8110dcf3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 16 Jun 2021 05:03:35 +0800 Subject: [PATCH 078/870] add done: 20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md --- sources/tech/20210616 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210616 .md diff --git a/sources/tech/20210616 .md b/sources/tech/20210616 .md new file mode 100644 index 0000000000..931fe8c066 --- /dev/null +++ b/sources/tech/20210616 .md @@ -0,0 +1,25 @@ +[#]: subject: () +[#]: via: (https://www.2daygeek.com/linux-create-systemd-service-unit-file/) +[#]: author: ( ) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-create-systemd-service-unit-file/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From 41db0ff5b1d5656d23b5931dc042019f96fcabbc Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 16 Jun 2021 08:35:19 +0800 Subject: [PATCH 079/870] translated --- sources/tech/20210608 How FreeDOS boots.md | 76 ------------------- translated/tech/20210608 How FreeDOS boots.md | 75 ++++++++++++++++++ 2 files changed, 75 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/20210608 How FreeDOS boots.md create mode 100644 translated/tech/20210608 How FreeDOS boots.md diff --git a/sources/tech/20210608 How FreeDOS boots.md b/sources/tech/20210608 How FreeDOS boots.md deleted file mode 100644 index e513d80d0b..0000000000 --- a/sources/tech/20210608 How FreeDOS boots.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: subject: (How FreeDOS boots) -[#]: via: (https://opensource.com/article/21/6/freedos-boots) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How FreeDOS boots -====== -An overview of how your computer boots up and starts a simple operating -system like FreeDOS. -![Code going into a computer.][1] - -One thing I appreciate from growing up with DOS computers is that the boot process is relatively easy to understand. There aren't a lot of moving parts in DOS. And today, I'd like to share an overview of how your computer boots up and starts a simple operating system like FreeDOS. - -### Initial bootstrapping - -When you turn on the power to your computer, the system performs several self-checks, such as verifying the memory and other components. This is called the **Power On Self Test** or "POST." After the POST, the computer uses a hard-coded instruction that tells it where to find its instructions to load the operating system. This is the "boot loader," and usually it will try to locate a Master Boot Record or (MBR) on the hard drive. The MBR then loads the primary operating system; in this case, that's FreeDOS. - -This process of locating one piece of information so the computer can load the next part of the operating system is called "bootstrapping," from the old expression of "picking yourself up by your bootstraps." It is from this usage that we adopted the term "boot" to mean starting up your computer. - -### The kernel - -When the computer loads the FreeDOS kernel, one of the first things the kernel does is identify any parameters the user has indicated to use. This is stored in a file called `FDCONFIG.SYS`, stored in the same root directory as the kernel. If `FDCONFIG.SYS` does not exist, then the FreeDOS kernel looks for an alternate file called `CONFIG.SYS`. - -If you used DOS in the 1980s or 1990s, you may be familiar with the `CONFIG.SYS` file. Since 1999, FreeDOS looks for `FDCONFIG.SYS` first in case you have a DOS system that is _dual booting_ FreeDOS with some other DOS, such as MS-DOS. Note that MS-DOS only uses the `CONFIG.SYS` file. So if you use the same hard drive to boot both FreeDOS and MS-DOS, MS-DOS uses `CONFIG.SYS` to configure itself, and FreeDOS uses `FDCONFIG.SYS` instead. That way, each can use its own configuration. - -`FDCONFIG.SYS` can contain a number of configuration settings, one of which is `SHELL=` or `SHELLHIGH=`. Either one will instruct the kernel to load this program as the interactive shell for the user. - -If neither `FDCONFIG.SYS` nor `CONFIG.SYS` exist, then the kernel assumes several default values, including where to find the shell. If you see the message "Bad or missing Command Interpreter" when you boot your FreeDOS system, that means `SHELL=` or `SHELLHIGH=` is pointing to a shell program that doesn't exist on your system. - -![Bad or missing Command Interpreter][2] - -Jim Hall, CC-BY SA 4.0 - -You might debug this by looking at the `SHELL=` or `SHELLHIGH=` lines. Failing that, make sure you have a program called `COMMAND.COM` in the root directory of your FreeDOS system. This is the _shell_, which I'll talk about next. - -### The shell - -The term "shell" on a DOS system usually means a command-line interpreter; an interactive program that reads instructions from the user, then executes them. In this way, the FreeDOS shell is similar to the Bash shell on Linux. - -Unless you've asked the kernel to load a different shell using `SHELL=` or `SHELLHIGH=`, the standard command-line shell on DOS is called `COMMAND.COM`. And as `COMMAND.COM` starts up, it also looks for a file to configure itself. By default, `COMMAND.COM` will look for a file called `AUTOEXEC.BAT` in the root directory. `AUTOEXEC.BAT` is a "batch file" that contains a set of instructions that run at startup, and is roughly analogous to the `~/.bashrc` "resource file" that Bash reads when it starts up on Linux. - -You can change the shell, and the startup file for the shell, in the `FDCONFIG.SYS` file, with `SHELL=` or `SHELLHIGH=`. The FreeDOS 1.3 RC4 installer sets up the system to read `FDAUTO.BAT` instead of `AUTOEXEC.BAT`. This is for the same reason that the kernel reads an alternate configuration file; you can dual-boot FreeDOS on a hard drive with another DOS. FreeDOS will use `FDAUTO.BAT` while MS-DOS will use `AUTOEXEC.BAT`.. - -Without a startup file like `AUTOEXEC.BAT`, the shell will simply prompt the user to enter the date and time. - -![Without AUTOEXEC.BAT, the shell will prompt for date and time][3] - -Jim Hall, CC-BY SA 4.0 - -And that's it. Once FreeDOS has loaded the kernel, and the kernel has loaded the shell, FreeDOS is ready for the user to type commands. - -![FreeDOS is ready for you to enter your first command][4] - -Jim Hall, CC-BY SA 4.0 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/freedos-boots - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) -[2]: https://opensource.com/sites/default/files/uploads/bad-missing-command.png (Bad or missing Command Interpreter) -[3]: https://opensource.com/sites/default/files/uploads/no-autoexec.png (Without AUTOEXEC.BAT, the shell will prompt for date and time) -[4]: https://opensource.com/sites/default/files/uploads/freedos-boot.png (FreeDOS is ready for you to enter your first command) diff --git a/translated/tech/20210608 How FreeDOS boots.md b/translated/tech/20210608 How FreeDOS boots.md new file mode 100644 index 0000000000..e041bebf0f --- /dev/null +++ b/translated/tech/20210608 How FreeDOS boots.md @@ -0,0 +1,75 @@ +[#]: subject: (How FreeDOS boots) +[#]: via: (https://opensource.com/article/21/6/freedos-boots) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +FreeDOS 如何启动 +====== +概述你的计算机如何启动和启动一个像 FreeDOS 的简单操作系统。 +![Code going into a computer.][1] + +在使用 DOS 计算机的过程中,我很欣赏的一点是,启动过程相对容易理解。在 DOS 中没有太多的变动组件。而今天,我想和大家分享一下电脑是如何启动和启动像 FreeDOS 这样的简单操作系统的概况。 + +### 初始引导 + +当你打开计算机的电源时,系统会进行一些自我检查,如验证内存和其他组件。这被称为**开机自检** (Power On Self Test) 或 “POST”。POST 之后,计算机使用一个硬编码指令,告诉它在哪里找到加载操作系统的指令。这就是“引导加载程序”,通常它将试图找到硬盘上的主启动记录 (MBR)。然后,MBR 加载主操作系统。在这里就是 FreeDOS。 + +这个定位一个信息以便计算机能够加载操作系统的下一个部分的过程被称为“引导” (bootstrapping),来自于“通过引导程序启动自己”的古老说法。正是从这个用法中,我们采用了“启动” (boot) 一词来表示启动你的计算机。 + +### 内核 + +当计算机加载 FreeDOS 内核时,内核所做的第一件事就是识别用户所表示要使用的任何参数。它被保存在一个叫做 `FDCONFIG.SYS` 的文件中,与内核保存在同一个根目录下。如果 `FDCONFIG.SYS` 不存在,那么 FreeDOS 的内核就会寻找一个叫做 `CONFIG.SYS` 的替代文件。 + +如果你在 20 世纪 80 年代或 90 年代使用过 DOS,你可能对 `CONFIG.SYS` 文件很熟悉。从 1999 年起,FreeDOS 首先寻找 `FDCONFIG.SYS`,以防你的 DOS 系统与其他 DOS(如 MS-DOS)有_双启动_。请注意,MS-DOS 只使用 `CONFIG.SYS` 文件。因此,如果你用同一个硬盘同时启动 FreeDOS 和 MS-DOS,MS-DOS 使用 `CONFIG.SYS` 来配置自己,而 FreeDOS 则使用 `FDCONFIG.SYS`。这样一来,双方都可以使用自己的配置。 + +`FDCONFIG.SYS` 可以包含一些配置设置,其中之一是 `SHELL=` 或 `SHELLHIGH=`。任何一个都会指示内核加载这个程序作为用户的交互式 shell。 + +如果 `FDCONFIG.SYS` 和 `CONFIG.SYS` 都不存在,那么内核就会假定几个默认值,包括在哪里找到 shell。如果你在启动 FreeDOS 系统时看到 “Bad or missing Command Interpreter” 的信息,这意味着 `SHELL=` 或 `SHELLHIGH=` 指向了一个在你系统中不存在的 shell 程序。 + +![Bad or missing Command Interpreter][2] + +Jim Hall,CC-BY SA 4.0 + +你可以通过查看 `SHELL=` 或 `SHELLHIGH=` 行来调试这个问题。如果做不到这一点,请确保你在 FreeDOS 系统的根目录下有一个名为 `COMMAND.COM` 的程序。它就是 _shell_,我接下来会讲到它。 + +### shell + +在 DOS 系统中,“shell” 一词通常是指一个命令行解释器:一个交互式程序,它从用户那里读取指令,然后执行它们。在这里,FreeDOS 的 shell 与 Linux 的 Bash shell 相似。 + +除非你用 `SHELL=` 或 `SHELLHIGH=` 要求内核加载一个不同的 shell,否则 DOS 上的标准命令行 shell 被称为 `COMMAND.COM`。当 `COMMAND.COM`启动时,它也寻找一个文件来配置自己。默认情况下,`COMMAND.COM` 会在根目录下寻找一个名为 `AUTOEXEC.BAT` 的文件。`AUTOEXEC.BAT` 是一个“批处理文件”,它包含一组启动时运行的指令,大致类似于 Linux 上 Bash 启动时读取的 `~/.bashrc` “资源文件”。 + +你可以在 `FDCONFIG.SYS` 文件中用 `SHELL=` 或 `SHELLHIGH=` 改变 shell 以及 shell 的启动文件。FreeDOS 1.3 RC4 安装程序将系统设置为读取 `FDAUTO.BAT` 而不是 `AUTOEXEC.BAT`。这与内核读取另一个配置文件的原因相同;你可以在硬盘上用另一个 DOS 双启动 FreeDOS。FreeDOS 将使用 `FDAUTO.BAT` 而 MS-DOS 将使用 `AUTOEXEC.BAT`。 + +如果没有像 `AUTOEXEC.BAT` 这样的启动文件,shell 将简单地提示用户输入日期和时间。 + +![Without AUTOEXEC.BAT, the shell will prompt for date and time][3] + +Jim Hall, CC-BY SA 4.0 + +就是这些了。当 FreeDOS 加载了内核,而内核也加载了 shell,FreeDOS 就准备好让用户输入命令了。 + +![FreeDOS is ready for you to enter your first command][4] + +Jim Hall, CC-BY SA 4.0 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-boots + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) +[2]: https://opensource.com/sites/default/files/uploads/bad-missing-command.png (Bad or missing Command Interpreter) +[3]: https://opensource.com/sites/default/files/uploads/no-autoexec.png (Without AUTOEXEC.BAT, the shell will prompt for date and time) +[4]: https://opensource.com/sites/default/files/uploads/freedos-boot.png (FreeDOS is ready for you to enter your first command) From 4bbf91ddafd9397cf07eb97b20fccfcca9d21ec3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 16 Jun 2021 08:39:29 +0800 Subject: [PATCH 080/870] translating --- ...Mirror or Stream Your Linux Computer Screen to Any Device.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md b/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md index 37d96dc71f..18ab57df8b 100644 --- a/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md +++ b/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/deskreen/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fcfc7389a7069b2d9da152f87fe1a6c7fedc388d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 16 Jun 2021 09:35:50 +0800 Subject: [PATCH 081/870] Delete 20210616 .md --- sources/tech/20210616 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210616 .md diff --git a/sources/tech/20210616 .md b/sources/tech/20210616 .md deleted file mode 100644 index 931fe8c066..0000000000 --- a/sources/tech/20210616 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: () -[#]: via: (https://www.2daygeek.com/linux-create-systemd-service-unit-file/) -[#]: author: ( ) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/linux-create-systemd-service-unit-file/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 From 6373bc808e0a3901f2b8f28c2d5b060375eabeb6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 16 Jun 2021 12:21:02 +0800 Subject: [PATCH 082/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @PearFL 感谢您,完成了第一篇翻译贡献! --- ...0210523 3 reasons to learn Java in 2021.md | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210523 3 reasons to learn Java in 2021.md b/translated/tech/20210523 3 reasons to learn Java in 2021.md index 81a1f3be6b..4e0352a668 100644 --- a/translated/tech/20210523 3 reasons to learn Java in 2021.md +++ b/translated/tech/20210523 3 reasons to learn Java in 2021.md @@ -3,61 +3,62 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (PearFL) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -2021年学习Java的三个理由 +2021 年学习 Java 的三个理由 ====== -Java具有功能强大、多样化、可拓展、有趣的特点。这就是Java为什么被我们广泛使用,也是我们应当找到正确使用它的方式。 -![Learning and studying technology is the key to success][1] +> Java 具有功能强大、多样化、可拓展、有趣的特点。这就是 Java 为什么被我们广泛使用,也是我们如何正确使用它的方式。 -Java是在1995年发布的,当我写这篇文章的时候,它已经26岁了。起初它是闭源的,但在2007年,Java基于GPL协议被开源发布了。如果想要理解是什么使得Java变得非常重要,您就必须理解它声称要解决的是什么样的问题,从而您就能理解它让开发者和用户受益的原因和方式。 +![](https://img.linux.net.cn/data/attachment/album/202106/16/122019wdrbtby3dlf9uu49.jpg) -理解Java解决问题的最好方式就是进行软件开发,当然啦,如果不做开发,仅仅只是使用软件也会是一个很好的开始。作为一名开发人员,当您将在自己的本地计算机上运行良好的软件部署到其他计算机上运行时,一些稀奇古怪的麻烦可能就出现了,从而导致软件可能无妨正常运行。软件本应正常工作,但每个程序员都明白,一些问题总是会被忽视。当您在另一个操作系统(OS)上尝试运行该软件时,情况就变得更加复杂了。这也是为什么在每一个软件的获取页面上都会有针对不同的操作系统有对应下载按钮的原因:Windows的、macOS的、Linux的、移动端的、甚至许多其他操作系统环境的下载选项。 +Java 是在 1995 年发布的,当我写这篇文章的时候,它已经 26 岁了。起初它是专有的,但在 2007 年,Java 基于 GPL 协议被开源发布了。如果想要理解是什么使得 Java 变得非常重要,你就必须理解它声称要解决的是什么样的问题,从而你就能理解它让开发者和用户受益的原因和方式。 -作为一名用户,一个典型的场景是您想下载一些优秀的软件,但它却不适用于您的平台。遗憾的是这样的情况仍然发生在当下非常先进的计算机上,它们可以在计算机中运行虚拟机,通过仿真使旧视频游戏保持活力,甚至可以放在您的口袋里,但软件交付实际上相当困难。 +理解 Java 解决了什么问题的最好方式就是进行软件开发,当然啦,如果不做开发,仅仅只是使用软件也会是一个很好的开始。作为一名开发人员,当你将在自己的本地计算机上运行良好的软件部署到其他计算机上运行时,一些稀奇古怪的麻烦可能就出现了,从而导致软件可能无妨正常运行。软件本应正常工作,但每个程序员都明白,一些问题总是会被忽视。当你在另一个操作系统上尝试运行该软件时,情况就变得更加复杂了。这也是为什么在每一个软件的获取页面上都会有针对不同的操作系统有对应下载按钮的原因:Windows 的、macOS 的、Linux 的、移动端的、甚至许多其他操作系统环境的下载选项。 + +作为一名用户,一个典型的场景是你想下载一些优秀的软件,但它却不适用于你的平台。遗憾的是这样的情况仍然发生在当下非常先进的计算机上,它们可以在计算机中运行虚拟机,通过仿真使老式视频游戏保持活力,甚至可以放在你的口袋里,但软件交付实际上相当困难。 有没有更好的办法?可能会有吧。 -### 1\. 一次编码, 任意环境都能跑通 +### 1、一次编码,任意环境都能跑通 -如果代码只能在特定的操作系统和环境下运行,那这会很令人惊讶甚至是失望的。代码需要从对人友好的高级程序设计语言编译成机器语言,即被设计可以用于响应CPU的一系列二进制指令。在先进的计算机世界中,我们很难理解为什么不能仅仅只要编写代码,就能将它发送给任何一个想要稳定运行它的平台,无需担忧它们正处在什么样的平台中。 +令人惊讶甚至是失望的是,代码是特定于操作系统和环境的。代码需要从对人友好的高级程序设计语言编译成机器语言,即被设计可以用于让 CPU 响应的一系列二进制指令。在先进的计算机世界中,我们很难理解为什么不能仅仅只要编写代码,就能将它发送给任何一个想要运行它的平台,无需担忧它们正处在什么样的平台中。 -Java可以解决这种不协调的问题。它的代码是可以跨平台进行工作的,在任何运行它的系统上都执行相同的工作。Java 实现这一壮举的方法起初是有驳常理的。在某种程度上,Java只与一台计算机兼容。奇怪的是,这台电脑实际上并不存在。Java代码的目标计算机是Java虚拟机 (JVM)。这是一个由Java的创建者编写的程序,可用于您能想到的任何计算机设备。只要您安装了它,您运行的任何 Java 代码都会由您计算机中的这台“虚拟”计算机进行处理。Java代码会由JVM执行,JVM向您的计算机发送适当的特定于平台的指令,因此所有内容在每个操作系统和架构上都相同。 +Java 可以解决这种不协调的问题。它的代码是可以跨平台进行工作的,在任何运行它的系统上都执行相同的工作。Java 实现这一壮举的方法起初是有悖常理的。在某种程度上,Java 只与一台计算机兼容。奇怪的是,这台电脑实际上并不存在。Java 代码的目标计算机是Java 虚拟机(JVM)。这是一个由 Java 的创建者编写的程序,可用于你能想到的任何计算机设备。只要你安装了它,你运行的任何 Java 代码都会由你计算机中的这台“虚拟”计算机进行处理。Java 代码会由 JVM 执行,JVM 向你的计算机发送适当的特定于平台的指令,因此所有工作在每个操作系统和架构上都是一样的。 -当然,Java 使用的方法并不是真正的卖点。大多数用户和许多开发人员并不关心软件兼容性是如何实现的,只关心它是否具备兼容性。许多语言都承诺提供跨平台的功能,通常情况下,这个承诺最终都是真的,但是这个过程并不总是容易实现的。编程语言必须针对其目标平台进行编译,脚本语言需要特定于平台的解释器,而且两者都很难确保对底层系统资源的一致访问。跨平台支持变得越来越好,库可以帮助转换路径、环境变量和设置,并且一些框架(特别是 [Qt][2])在弥补外设访问的差距方面做了很多工作。Java始终可靠地提供它的兼容性。 +当然,Java 使用的方法并不是这里的真正的卖点。大多数用户和许多开发人员并不关心软件兼容性是如何实现的,只关心它是否具备兼容性。许多语言都承诺提供跨平台的功能,通常情况下,这个承诺最终都是真的,但是这个过程并不总是容易实现的。编程语言必须针对其目标平台进行编译,脚本语言需要特定于平台的解释器,而且两者都很难确保对底层系统资源的一致访问。跨平台支持变得越来越好,库可以帮助转换路径、环境变量和设置,并且一些框架(特别是 [Qt][2])在弥补外设访问的差距方面做了很多工作。但是,Java 始终可靠地提供它的兼容性。 -### 2\. 明智的代码 +### 2、明智的代码 -Java 的语法即使是在最好的方面也很无聊。如果您把所有流行的编程语言都放在一个摇滚杯中,那么您会得到 Java。 通过观察Java编写的源代码,您或多或少会看到编程中所有特定表达式的平均值。括号表示函数和流程控制的范围,变量在使用前被清楚地声明和实例化,并且表达式具有清晰一致的结构。 +Java 的语法即使是在最好的方面也很无聊。如果你把所有流行的编程语言都放在一个摇滚杯中,那么你会得到 Java。通过观察 Java 编写的源代码,你或多或少会均匀地看到所有特定的编程表达方式。括号表示函数和流程控制的范围、变量在使用前被明确地声明和实例化,并且表达式具有清晰一致的结构。 -我发现Java学习过程中通常会鼓励自学的程序员使用结构较少的语言编写更精炼的代码。有许多“基本”编程课程是无法通过从在线学习的源代码中收集技术来学习的,比如将全局变量声明保持在Java公共字段的风格中、正确地预测和处理异常、使用类和函数、和许多其他的技术。从Java借鉴的一点小改动可以产生很大的不同。 +我发现 Java 学习过程中通常会鼓励自学成才的程序员使用结构化程度较少的语言编写更精炼的代码。从网上学习的源代码中收集到的技术中,有许多“基本”编程经验是你无法学到的,比如以 Java 公开字段的风格进行全局变量声明、正确地预测和处理异常、使用类和函数、和许多其他的技术。从 Java 借鉴的一点小改动可以产生很大的不同。 -### 3\. 基础设施和支持 +### 3、脚手架和支持 -所有流行的编程语言都有很好的支持系统,这也是使得其变成流行语言的原因。他们都有很多文档资料,有针对它们的集成开发环境 (IDE) 或 IDE 扩展、示例代码、免费和付费培训和开发者社区。在另一方面,当您在尝试做某事遇到困难时,似乎没有任何编程语言有足够的支持。 +流行的编程语言都有很好的支持系统,这也是使得其变成流行语言的原因。它们都有很多文档资料,有针对它们的集成开发环境或 IDE 扩展、示例代码、免费和付费培训和开发者社区。在另一方面,当你在尝试做某事遇到困难时,似乎没有任何编程语言有足够的支持。 -我不能认为Java与这两个普遍但又相互矛盾的真理能够区分开。尽管如此,我发现当我需要一个Java库时,我不可避免地会为给定的任务找到多个选项。通常我不想使用一个库的原因是我不喜欢它的开发人员在实现我需要的功能时,对应的许可证与我喜欢的有所不同或者有其他琐碎的争论点。当一门语言得到大量支持时,我就会很多的选择性。我可以从许多合适的解决方案中选择一个最能满足我需求的,不论我的需求多么微不足道都能被最好得满足。 +我不能说 Java 可以摆脱这两个普遍但又相互矛盾的事实。尽管如此,我发现当我需要一个 Java 库时,我必然能为给定的任务找到多个选项。通常我不想使用一个库的原因是我不喜欢它的开发人员如何实现我需要的功能,它的许可证与我喜欢的有所不同,或者有其他琐碎的争议点。当一门语言得到大量支持时,我就会很多的选择性。我可以从许多合适的解决方案中选择一个最能满足我需求的,不论我的需求多么微不足道都能被最好得满足。 -更好的是,有一个围绕Java的健康的基础设施。像[Apache Ant][3]、[Gradle][4]、和[Maven][5]等工具 帮助您管理构建和交付的过程。像[Sonatype Nexus][6]等服务帮助您实现监控的安全性。[Spring][7]和[Grails][8]使网络开发变得更加容易, 而[Quarkus][9]和[Eclipse Che][10]有助于云上的开发。 +更好的是,围绕 Java 有一个健康的基础设施。像 [Apache Ant][3]、[Gradle][4] 和 [Maven][5] 等工具可以帮助管理构建和交付的过程。像 [Sonatype Nexus][6] 等服务帮助实现监控的安全性。[Spring][7] 和 [Grails][8] 使 Web 开发变得更加容易,而 [Quarkus][9] 和 [Eclipse Che][10] 有助于云上的开发。 -在接触Java语言本身时,您甚至可以选择使用什么样的版本。[OpenJDK][11]提供经典的官方Java,而[Groovy][12]是一种类似于脚本语言的简化方法 (您可以将它与Python进行比较), 并且[Quarkus][13]为容器优先开发提供了一个框架。 +在接触 Java 语言本身时,你甚至可以选择使用什么样的版本。[OpenJDK][11] 提供经典的、官方的 Java,而 [Groovy][12] 是一种类似于脚本语言的简化方法(你可以把它比作 Python),而 [Quarkus][13] 提供了一个容器优先开发的框架。 -还有很多论点,但现在已经足以说明Java是一个完整的包了,无论您想在其中寻找什么。 +还有很多,但现在已经足以说明 Java 是一个完整的生态了,无论你想在其中寻找什么。 -### 优点:简单易学 +### 此外,简单易学 -事实证明,Java对我和各行各业的许多开发人员来说是一个明智的解决方案。以下是我喜欢使用Java的一些原因。 +事实证明,Java 对我和各行各业的许多开发人员来说是一个明智的解决方案。以下是我喜欢使用 Java 的一些原因。 -您可能听说过或推断出Java是一种“专业”语言,只适用于笨重的政府网站,专供“真正的”开发人员使用。千万不要被 Java超过25年以来的各种名声所迷惑!它的可怕程度只有它名声的一半,并不比其他任何语言更可怕。 +你可能听说过或推断出 Java 是一种“专业”语言,只适用于笨重的政府网站,专供“真正的”开发人员使用。千万不要被 Java 25 年以来的各种名声所迷惑!它的可怕程度只有它名声的一半,这意思是,并不比其他任何语言更可怕。 -编程很困难的这件事是无法逃避的,它要求您基于逻辑进行思考,学习一种比母语表达选方式更少的新语言,要您弄清楚如何解决困难的问题,使它们可以使用您的程序完成自动化的执行,没有语言可以避免这些问题。 +编程很困难的这件事是无法回避的,它要求你基于逻辑进行思考,学习一种比母语表达方式更少的新语言,要你弄清楚如何解决困难的问题,使它们可以使用你的程序完成自动化的执行,没有语言可以避免这些问题。 -然而,编程语言的学习曲线的差异令人惊讶。有些一开始很容易,但当您开始探索细节时就会变得复杂。换句话说,打印“hello world”可能只需要一行代码,但当您学习到了类和函数, 您相当于开始重新学习这门语言(或者至少是它的数据模型)。Java从一开始就是Java,一旦您学会了它,就可以使用它的许多技巧和便利。 +然而,编程语言的学习曲线的差异令人惊讶。有些一开始很容易,但当你开始探索细节时就会变得复杂。换句话说,打印“hello world”可能只需要一行代码,但当你学习到了类和函数, 你相当于开始重新学习这门语言(或者至少是它的数据模型)。Java 从一开始就是 Java,一旦你学会了它,就可以使用它的许多技巧和便利。 -简而言之: 去学习Java吧!它具有功能强大、多样化、可拓展、有趣的特点。为了给您提供帮助, [下载我们的Java 备忘单][14], 它包含您在处理前十个项目时需要的所有基本语法。在那之后,您就不再需要它了,因为Java具有完美的一致性和可预测性。来享受它吧! +简而言之: 去学习 Java 吧!它具有功能强大、多样化、可拓展、有趣的特点。为了给你提供帮助, [下载我们的 Java 备忘单][14], 它包含你在开发前十个项目时需要的所有基本语法。在那之后,你就不再需要它了,因为 Java 具有完美的一致性和可预测性。来享受它吧! -------------------------------------------------------------------------------- @@ -66,7 +67,7 @@ via: https://opensource.com/article/21/5/java 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[PearFL](https://github.com/PearFL) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 27df56129cc8ce4cf1f1cb06e74a4f6467eb0db4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 16 Jun 2021 12:22:33 +0800 Subject: [PATCH 083/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @PearFL 本文首发地址:https://linux.cn/article-13491-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/PearFL --- .../20210523 3 reasons to learn Java in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210523 3 reasons to learn Java in 2021.md (99%) diff --git a/translated/tech/20210523 3 reasons to learn Java in 2021.md b/published/20210523 3 reasons to learn Java in 2021.md similarity index 99% rename from translated/tech/20210523 3 reasons to learn Java in 2021.md rename to published/20210523 3 reasons to learn Java in 2021.md index 4e0352a668..fbbf2c5e53 100644 --- a/translated/tech/20210523 3 reasons to learn Java in 2021.md +++ b/published/20210523 3 reasons to learn Java in 2021.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (PearFL) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13491-1.html) 2021 年学习 Java 的三个理由 ====== From ce9bd6770ea93f8441099981c7dfb27e48d64e36 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 16 Jun 2021 12:36:20 +0800 Subject: [PATCH 084/870] PRF @geekpi --- .../tech/20210601 Get started with FreeDOS.md | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210601 Get started with FreeDOS.md b/translated/tech/20210601 Get started with FreeDOS.md index 63eca9cb9d..757f23d157 100644 --- a/translated/tech/20210601 Get started with FreeDOS.md +++ b/translated/tech/20210601 Get started with FreeDOS.md @@ -3,18 +3,20 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -开始使用 FreeDOS +FreeDOS 入门 ====== -它看起来像复古计算,但它是一个现代的操作系统,你可以用它来完成任务。 -![Old UNIX computer][1] + +> 它看起来像复古计算,但它是一个现代的操作系统,你可以用它来完成任务。 + +![](https://img.linux.net.cn/data/attachment/album/202106/16/123557an8ybzgnqg833vz4.jpg) 在整个 1980 年代和 1990 年代,我主要是一个 DOS 用户。我喜欢 DOS 提供的命令行环境,它随着每一个连续的版本变得更加强大。我甚至学会了如何用 C 语言编写自己的 DOS 程序,这样我就可以扩展 DOS 命令行,并为标准的 DOS 命令编写更强大的替代程序。我曾经试验过微软的 Windows,但如果你记得当时的 Windows 3,你就会知道它很慢,而且容易崩溃。但无论如何我更喜欢命令行,所以我坚持使用 DOS。 -这一切在 1994 年发生了变化。流行的技术杂志谈到了即将到来的 Windows 版本,它将完全废除 DOS。我不想被迫使用 Windows。在我访问的 Usenet 讨论区中,其他人也有同样的感觉。所以在 [1994 年 6 月 29 日][2],我决定如果我们想保留 DOS,我们需要自己编写。所以在 6 月 29 日,我宣布了一个小项目,这个项目后来成为 [FreeDOS 项目][3]。 +这一切在 1994 年发生了变化。流行的技术杂志谈到了即将到来的 Windows 版本,它将完全废除 DOS。我不想被迫使用 Windows。在我访问的 Usenet 讨论区中,其他人也有同样的感觉。所以在 [1994 年 6 月 29 日][2],我认为如果我们想保留 DOS,我们需要自己编写。所以在 6 月 29 日,我宣布了一个小项目,这个项目后来成为 [FreeDOS 项目][3]。 从那时起,我们已经发布了几个完整的 FreeDOS 发行版。我们从 1994 年到 1997 年的 alpha 系列开始,再到 1998 年到 2005 年的 beta 系列,最后在 2006 年发布了 FreeDOS 1.0 版本。从那时起,进展是缓慢但稳定的。在 1.0 之后,我们并没有真正急于发布每个新版本,因为 DOS 在 1995 年不再是一个变动的目标。 @@ -24,41 +26,41 @@ ### 无需安装 FreeDOS 即可运行 FreeDOS -在我们以前所有的 FreeDOS 发行版中,我们把重点放在_安装_ FreeDOS 到电脑上。但我们认识到,大多数用户实际上已经不在实际硬件上运行 FreeDOS 了。他们在[像 QEMU 或 VirtualBox 这样的虚拟机][4]中运行 FreeDOS。所以在 FreeDOS 1.3 RC4 中,我们改进了 “LiveCD” 环境。 +在我们以前所有的 FreeDOS 发行版中,我们把重点放在 _安装_ FreeDOS 到电脑上。但我们认识到,大多数用户实际上已经不在实际硬件上运行 FreeDOS 了。他们在 [像 QEMU 或 VirtualBox 这样的虚拟机][4] 中运行 FreeDOS。所以在 FreeDOS 1.3 RC4 中,我们改进了 “LiveCD” 环境。 通过 FreeDOS 1.3 RC4,你可以在你喜欢的虚拟机中启动 LiveCD 镜像,并立即开始使用 FreeDOS。这就是我现在运行 FreeDOS 的方式。我有一个小的虚拟硬盘镜像,我把所有的文件都放在那里,但我从 LiveCD 启动并运行 FreeDOS。 ![Booting the FreeDOS 1.3 RC4 LiveCD on QEMU][5] -启动 FreeDOS 1.3 RC4 LiveCD (Jim Hall, [CC-BY SA 4.0][6]) +*启动 FreeDOS 1.3 RC4 LiveCD (Jim Hall, [CC-BY SA 4.0][6])* ### 安装真的很简单 如果你不想从 LiveCD 上运行 FreeDOS,你也可以在你的硬盘上安装它。我们更新了 FreeDOS 的安装程序,所以它本身并不是一个真正的“程序”,而是一个非常聪明的 DOS “批处理”文件,它可以检测到各种情况并采取适当的行动,例如在没有 FreeDOS 分区的情况下为其创建一个新的磁盘分区。 -旧的 FreeDOS 发行版曾经提示你一切,甚至选择个别程序来安装。新的安装程序非常精简。它只问你几个问题就开始了,然后就自己做其他事情。在一个空的虚拟机上安装 FreeDOS 只需要几分钟时间。 +旧的 FreeDOS 发行版会提示你各种问题,甚至选择个别程序来安装。新的安装程序非常精简。它只问你几个问题就开始了,然后就自己做其他事情。在一个空的虚拟机上安装 FreeDOS 只需要几分钟时间。 ![Installing FreeDOS 1.3 RC4][7] -安装FreeDOS 1.3 RC4 (Jim Hall, [CC-BY SA 4.0][6]) +*安装FreeDOS 1.3 RC4 (Jim Hall, [CC-BY SA 4.0][6])* ### 你可以从软盘安装它 不是每个人都喜欢在虚拟机中运行 FreeDOS。现在有一个复古计算社区,他们收集并精心修复经典的 PC 硬件,如 Pentium 或 486 系统。你甚至可以在那里找到一些 XT(8088)或 AT(80286)系统,它由一个专门的用户社区运营。 -虽然我们认为 FreeDOS 是一个现代的 DOS,但如果我们不在旧的 PC 硬件上运行,我们就不是 “DOS”。因此,在 FreeDOS 1.3 中,我们包含了一个纯软盘版!这个版本可以运行在任何硬件上。这个版本应该可以在任何可以运行 FreeDOS 的硬件上运行,并且有 EGA 或更好的图形。 +虽然我们认为 FreeDOS 是一个现代的 DOS,但如果我们不在旧的 PC 硬件上运行,我们就不是 “DOS” 了。因此,在 FreeDOS 1.3 中,我们包含了一个纯软盘版!这个版本可以运行在任何硬件上。这个版本应该可以在任何可以运行 FreeDOS 的硬件上运行,并且有 EGA 或更好的图形。 -你在运行 286 或其他没有 CD-ROM 驱动器的经典系统吗?从这些软盘安装 FreeDOS。你是否只有一个硬盘而没有 CD 或软盘驱动器?只要把软盘的内容复制到一个临时目录,然后从那里运行安装程序。想执行“无头”安装到不同的 DOS 目录吗?用命令行选项就可以了。 +你在运行 286 或其他没有 CD-ROM 驱动器的经典系统吗?从这些软盘安装 FreeDOS。你是否只有一个硬盘而没有 CD 或软盘驱动器?只要把软盘的内容复制到一个临时目录,然后从那里运行安装程序。想执行“无交互外设方式”安装到不同的 DOS 目录吗?用命令行选项就可以了。 纯软盘版使用一个完全不同的安装程序,并包含一套有限的 FreeDOS 程序,它们在经典的 PC 硬件上更有用。 ![Installing the FreeDOS Floppy-Only Edition][8] -安装FreeDOS纯软盘版 (Jim Hall, [CC-BY SA 4.0][6]) +*安装FreeDOS纯软盘版 (Jim Hall, [CC-BY SA 4.0][6])* ### 充满了开源应用和游戏 -如果 FreeDOS 是一个闭源的 DOS,它就不是一个_自由_的 DOS。我们希望每个人都能使用和研究 FreeDOS,包括其源代码。当我们计划 FreeDOS 1.3 发行版时,我们仔细检查了每个软件包中的每一个许可证,并专注于只包括_开源_程序。(在以前的 FreeDOS 发行版中,有几个程序并不完全是 "开源",还有一两个程序没有包括源码,但是可以“自由使用和发布”。在这个版本中,所有的东西都是开源的,以开源定义作为我们的模型。) +如果 FreeDOS 是一个闭源的 DOS,它就不是一个 _自由_ 的 DOS。我们希望每个人都能使用和研究 FreeDOS,包括其源代码。当我们计划 FreeDOS 1.3 发行版时,我们仔细检查了每个软件包中的每一个许可证,并专注于只包括 _开源_ 程序。(在以前的 FreeDOS 发行版中,有几个程序并不完全“开源”,还有一两个程序没有包括源码,但是可以“自由使用和发布”。在这个版本中,所有的东西都是开源的,以“开源定义”作为我们的模型。) 而且,这是一个多么棒的开源应用和游戏的集合。游戏是 FreeDOS 1.3 RC4 中我最喜欢的内容。许多人使用 FreeDOS 来玩经典的 DOS 游戏,但我们想提供我们自己的开源游戏给人们玩。 @@ -66,15 +68,15 @@ ![Playing the Floppy Bird game][9] -玩 Floppy Bird 游戏 (Jim Hall, [CC-BY SA 4.0][6]) +*玩 Floppy Bird 游戏 (Jim Hall, [CC-BY SA 4.0][6])* ![The ancient game of Senet][10] -古老的 Senet 游戏 (Jim Hall, [CC-BY SA 4.0][6]) +*古老的 Senet 游戏 (Jim Hall, [CC-BY SA 4.0][6])* ### 现在就试试 FreeDOS 1.3 RC4 -你可以在 FreeDOS 的[下载][11]页面上找到新的 FreeDOS 1.3 RC4,。要安装 FreeDOS,你需要至少 20MB 的可用磁盘空间:20MB 用来安装一个普通的 FreeDOS 系统,或者 250MB 用来安装所有,包括应用和游戏。要安装源码,你将需要高达 450MB 的可用空间。 +你可以在 FreeDOS 的 [下载][11] 页面上找到新的 FreeDOS 1.3 RC4。要安装 FreeDOS,你需要至少 20MB 的可用磁盘空间:20MB 用来安装一个普通的 FreeDOS 系统,或者 250MB 用来安装所有,包括应用和游戏。要安装源码,你将需要高达 450MB 的可用空间。 -------------------------------------------------------------------------------- @@ -83,7 +85,7 @@ via: https://opensource.com/article/21/6/get-started-freedos 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 107e997207e1fa19f4f4385ddeb64493b9b08bb0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 16 Jun 2021 12:37:01 +0800 Subject: [PATCH 085/870] PUB @geekpi https://linux.cn/article-13492-1.html --- .../tech => published}/20210601 Get started with FreeDOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210601 Get started with FreeDOS.md (99%) diff --git a/translated/tech/20210601 Get started with FreeDOS.md b/published/20210601 Get started with FreeDOS.md similarity index 99% rename from translated/tech/20210601 Get started with FreeDOS.md rename to published/20210601 Get started with FreeDOS.md index 757f23d157..9706804d74 100644 --- a/translated/tech/20210601 Get started with FreeDOS.md +++ b/published/20210601 Get started with FreeDOS.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13492-1.html) FreeDOS 入门 ====== From 71c3f8f0dea7a3dc25682eb03a926a0fccad4f7a Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:58:40 +0800 Subject: [PATCH 086/870] Update 20210613 How Free - Open Source Software Can Save Online Privacy.md zz-air is translating --- ...3 How Free - Open Source Software Can Save Online Privacy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md b/sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md index e5b9e3ca7a..7ee1d14d11 100644 --- a/sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md +++ b/sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/save-privacy-with-foss/) [#]: author: (Team It's FOSS https://news.itsfoss.com/author/team/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zz-air) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ed80863eeb3661bf076d29771d09e0ba70e42613 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:03:31 +0800 Subject: [PATCH 087/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210616=20?= =?UTF-8?q?Migrate=20virtual=20machines=20to=20Kubernetes=20with=20this=20?= =?UTF-8?q?new=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md --- ...chines to Kubernetes with this new tool.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md diff --git a/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md b/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md new file mode 100644 index 0000000000..6cca2c61a8 --- /dev/null +++ b/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md @@ -0,0 +1,95 @@ +[#]: subject: (Migrate virtual machines to Kubernetes with this new tool) +[#]: via: (https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift) +[#]: author: (Miguel Perez Colino https://opensource.com/users/mperezco) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Migrate virtual machines to Kubernetes with this new tool +====== +Transition your virtualized workloads to Kubernetes with Forklift. +![Containers on a ship on the ocean][1] + +In 2017, the [KubeVirt][2] team [launched][3] the project to manage virtual machines (VMs) alongside containers in [Kubernetes][4]. The open source project's intent was to make VMs first-class citizens in this environment. + +Since its introduction at [Open Source Summit 2018][5], KubeVirt has continued maturing and growing. It's reached more than 200 stars on GitHub and even introduced its own event, [KubeVirt Summit][6], in February 2021. + +![KubeVirt architecture][7] + +KubeVirt architecture (© 2020, [Red Hat OpenShift][8]) + +KubeVirt is the foundation underneath [OpenShift Virtualization][9], which helps developers bring VMs into containerized workflows. + +### Leveraging VMs in Kubernetes + +KubeVirt enables you to use Kubernetes natives on VMs. This means they can connect to pod networks that are accessible using standard Kubernetes methods, including Service, Route, Pipelines, etc. Network policies apply to VM pods the same way they apply to application pods, providing a consistent model to manage VM-to-pod (and vice-versa) communication. + +A real-world example of this is the way an aeronautical company leveraged old simulator software. It injected models with artificial intelligence and machine learning (AI/ML), then automatically deployed and tested them on a VM-based simulator. This allowed it to fully automate obtaining test results and new telemetry training data using Kubernetes and [Kubeflow][10]. + +![VM-creation workflow][11] + +(Konveyor, [CC BY-SA 4.0][12]) + +[Konveyor.io][13] is an open source project that helps transition existing workloads (development, test, and production) to Kubernetes. Its tools include [Crane][14], to move containers from one Kubernetes platform to another; [Move2Kube][15], to bring workloads from Cloud Foundry to Kubernetes; and [Tackle][16], to analyze Java applications to modernize them by making them more standard and portable for the runtimes available in containerized platforms like Kubernetes. + +These tools are useful in transformation patterns, but many projects want to utilize Kubernetes at earlier stages to become more agile and productive. On the infrastructure side, these benefits can include blue/green load balancing, route management, declarative deployments, or (depending on how you deploy) easier upgrades due to immutable infrastructure. On the development side, they may include integrating continuous integration/continuous development (CI/CD) pipelines with the platform, getting apps to production faster, self-provisioning resources, or integrating health checks and monitoring. + +KubeVirt can help you by running workloads as VMs in a Kubernetes environment. It enables you to onboard your workloads to Kubernetes quickly, enjoy its benefits, and steadily modernize your workloads over time. But, you still have the issue of bringing your VMs from your traditional virtualization platform to the modern Kubernetes platform. This is where Konveyor's [Forklift][17] project comes in. + +### About Forklift + +Forklift migrates virtualized workloads from different sources to Kubernetes using KubeVirt. It is designed to make the task simple so that you can migrate anything from one or two machines to hundreds of them. + +Migration is a simple, three-stage process: + + 1. Connect to an existing virtualization platform (known as a "source provider") and to a Kubernetes environment (a "target provider"). + 2. Map network and storage resources from the source provider to the target provider, looking for equivalent resources in both. + 3. Select virtual machines to migrate and assign the network and storage mappings to formulate a migration plan. Then run it. + + + +### How to get started + +To get started with Forklift, first, you need a compatible source provider. You also need a Kubernetes environment with KubeVirt 0.40 or newer and bare-metal nodes (although for testing, you can use nested virtualization). Configure your storage classes with read-write-execute (RWX) capabilities, and use [Multus][18] to configure your networks to match the ones your VMs are using in the source provider. (If you can't do this, no worries; you also have the option to rearrange IP addressing.) + +Finally, [install Forklift][19] on your Kubernetes using the provided operator, and access the user interface to start running your first test migrations. + +Forklift is the upstream version of Red Hat's [Migration Toolkit for Virtualization][20]. Therefore, if you want to use it in a production environment, you may wish to consider using that supported version of the tool. + +Happy migrating! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift + +作者:[Miguel Perez Colino][a] +选题:[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/mperezco +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-1-osdc-lead.png?itok=VEB4zwza (Containers on a ship on the ocean) +[2]: http://kubevirt.io/ +[3]: https://kubevirt.io/2017/This-Week-in-Kube-Virt-1.html +[4]: https://opensource.com/resources/what-is-kubernetes +[5]: https://ossna18.sched.com/event/FAOR/kubevirt-cats-and-dogs-living-together-stephen-gordon-red-hat +[6]: https://kubevirt.io/summit/ +[7]: https://opensource.com/sites/default/files/uploads/image1_1.png (KubeVirt architecture) +[8]: https://www.openshift.com/learn/topics/virtualization/ +[9]: https://openshift.com/virtualization/ +[10]: https://www.kubeflow.org/ +[11]: https://opensource.com/sites/default/files/uploads/image2_0_6.png (VM-creation workflow) +[12]: https://creativecommons.org/licenses/by-sa/4.0/ +[13]: https://www.konveyor.io/ +[14]: https://www.konveyor.io/crane +[15]: https://move2kube.konveyor.io/ +[16]: https://www.konveyor.io/tackle +[17]: https://www.konveyor.io/forklift +[18]: https://github.com/k8snetworkplumbingwg/multus-cni +[19]: https://www.youtube.com/watch?v=RnoIP3QjHww&t=1693s +[20]: https://access.redhat.com/documentation/en-us/migration_toolkit_for_virtualization/2.0/ From ce446d443fb88e87a2410d7aa9e74e3c74635383 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:03:45 +0800 Subject: [PATCH 088/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210616=20?= =?UTF-8?q?Set=20up=20a=20service=20mesh=20on=20Istio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210616 Set up a service mesh on Istio.md --- ...20210616 Set up a service mesh on Istio.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20210616 Set up a service mesh on Istio.md diff --git a/sources/tech/20210616 Set up a service mesh on Istio.md b/sources/tech/20210616 Set up a service mesh on Istio.md new file mode 100644 index 0000000000..637687bb8e --- /dev/null +++ b/sources/tech/20210616 Set up a service mesh on Istio.md @@ -0,0 +1,139 @@ +[#]: subject: (Set up a service mesh on Istio) +[#]: via: (https://opensource.com/article/21/6/service-mesh-serverless) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Set up a service mesh on Istio +====== +A quick example of going serverless on Knative. +![Net catching 1s and 0s or data in the clouds][1] + +Service mesh and serverless deployment models represent the next phase in the evolution of microservice architectures. Service mesh enables developers to focus on business feature development rather than managing non-functional microservices capabilities such as monitoring, tracing, fault tolerance, and service discovery. + +[Open source service mesh][2] projects, including [Istio][3], [LinkerD][4], and [Kuma][5], use a sidecar, a dedicated infrastructure layer built right into an app, to implement service mesh functionalities. So, for example, developers can improve monitoring and tracing of cloud-native microservices on a distributed networking system using [Jaeger to build an Istio service mesh][6]. + +![CNCF Service Mesh Landscape][7] + +CNCF Service Mesh Landscape (Source: [CNCF][2]) + +In this next phase of implementing service mesh in microservices, developers can advance their serverless development using an event-driven execution pattern. It's not just a brand-new method; it also tries to modernize business processes from 24x7x365 uptime to on-demand scaling. Developers can leverage the traits and benefits of serverless deployment by using one of the [open source serverless projects][8] shown below. For example, [Knative][9] is a faster, easier way to develop serverless applications on Kubernetes platforms. + +![CNCF Serverless Landscape][10] + +CNCF Serverless Landscape (Source: [CNCF][8]) + +Imagine combining service mesh and serverless for more advanced cloud-native microservices development and deployment. This combined architecture allows you to configure additional networking settings, such as custom domains, mutual Transport Layer Security (mTLS) certificates, and JSON Web Token authentication. + +Here is a quick example of setting up service mesh on Istio with serverless on Knative Serving. + +### 1\. Add Istio with sidecar injection + +When you install the Istio service mesh, you need to set the `autoInject: enabled` configuration for automatic sidecar injection: + + +``` +    global: +      proxy: +        autoInject: enabled +``` + +If you'd like to learn more, consult Knative's documentation about [installing Istio without and with sidecar injection][11]. + +### 2\. Enable a sidecar for mTLS networking + +To use mTLS network communication between a `knative-serving` namespace and another namespace where you want the application pod to be running, enable a sidecar injection: + + +``` +`$ kubectl label namespace knative-serving istio-injection=enabled` +``` + +You also need to configure `PeerAuthentication` in the `knative-serving namespace`: + + +``` +cat <<EOF | kubectl apply -f - +apiVersion: "security.istio.io/v1beta1" +kind: "PeerAuthentication" +metadata: +  name: "default" +  namespace: "knative-serving" +spec: +  mtls: +    mode: PERMISSIVE +EOF +``` + +If you've installed a local gateway for Istio service mesh and Knative, the default cluster gateway name will be `knative-local-gateway` for the Knative service and application deployment. + +### 3\. Deploy an application for a Knative service + +Create a Knative service resource YAML file (e.g., `myservice.yml`) to enable sidecar injection for a Knative service. + +Add the `sidecar.istio.io/inject="true"` annotation to the service resource: + + +``` +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: +  name: hello-example-1 +spec: +  template: +    metadata: +      annotations: +        sidecar.istio.io/inject: "true" (1) +        sidecar.istio.io/rewriteAppHTTPProbers: "true" (2) +    spec: +      containers: +      - image: docker.io/sample_application (3) +        name: container +``` + +In the code above: + +(1) Adds the sidecar injection annotation. +(2) Enables JSON Web Token (JWT) authentication. +(3) Replace the application image with yours in an external container registry (e.g., DockerHub, Quay.io). + +Apply the Knative service resource above: + + +``` +`$ kubectl apply -f myservice.yml` +``` + +Note: Be sure to log into the right namespace in the Kubernetes cluster to deploy the sample application. + +### Conclusion + +This article explained the benefits of service mesh and serverless deployment for the advanced cloud-native microservices architecture. You can evolve existing microservices to service mesh or serverless step-by-step, or you can combine them to handle more advanced application implementation with complex networking settings on Kubernetes. However, this combined architecture is still in an early stage due to the architecture's complexity and lack of use cases. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/service-mesh-serverless + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_analytics_cloud.png?itok=eE4uIoaB (Net catching 1s and 0s or data in the clouds) +[2]: https://landscape.cncf.io/card-mode?category=service-mesh&grouping=category +[3]: https://istio.io/docs/concepts/what-is-istio/ +[4]: https://linkerd.io/ +[5]: https://kuma.io/ +[6]: https://opensource.com/article/19/3/getting-started-jaeger +[7]: https://opensource.com/sites/default/files/uploads/cncf-service-mesh-landscape.png (CNCF Service Mesh Landscape) +[8]: https://landscape.cncf.io/serverless?category=service-mesh&grouping=category&zoom=200 +[9]: https://opensource.com/article/19/4/enabling-serverless-kubernetes +[10]: https://opensource.com/sites/default/files/uploads/cncf-serverless-landscape2.png (CNCF Serverless Landscape) +[11]: https://knative.dev/docs/install/installing-istio/#installing-istio-without-sidecar-injection From 6794da1a40b71e1162a19b3a4815cf02b40e6d24 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:03:59 +0800 Subject: [PATCH 089/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210616=20?= =?UTF-8?q?How=20to=20use=20FreeDOS=20as=20an=20embedded=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210616 How to use FreeDOS as an embedded system.md --- ...ow to use FreeDOS as an embedded system.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/tech/20210616 How to use FreeDOS as an embedded system.md diff --git a/sources/tech/20210616 How to use FreeDOS as an embedded system.md b/sources/tech/20210616 How to use FreeDOS as an embedded system.md new file mode 100644 index 0000000000..7f32a2c807 --- /dev/null +++ b/sources/tech/20210616 How to use FreeDOS as an embedded system.md @@ -0,0 +1,155 @@ +[#]: subject: (How to use FreeDOS as an embedded system) +[#]: via: (https://opensource.com/article/21/6/freedos-embedded-system) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to use FreeDOS as an embedded system +====== +Many embedded systems today run on Linux. But once upon a time, embedded +systems either ran on a custom, proprietary platform or ran on DOS. +![Computer laptop in space][1] + +The [FreeDOS website][2] says that most people use FreeDOS for three main tasks: + + 1. Playing classic DOS games + 2. Running legacy DOS software + 3. Running an embedded system + + + +But what does it mean to run an "embedded" system? + +An embedded system is basically a very minimal system that is dedicated to run a specific task. You might think of embedded systems today as part of the _Internet of Things_ (IoT) including sensors, thermostats, and doorbell cameras. Many embedded systems today run on Linux. + +But once upon a time, embedded systems either ran on a custom, proprietary platform or ran on DOS. Some of these DOS-based embedded systems still run today, such as cash registers or phone private branch exchange (PBX) systems. In one example as recently as 2017, trainspotters discovered a Russian electric train control system (Russian: _САВПЭ_) running FreeDOS with special software to control and monitor the route of suburban trains and to make passenger announcements. + +Setting up an embedded system on DOS requires defining a minimal DOS environment that runs a single application. Fortunately, setting up a minimal FreeDOS environment is pretty easy. Technically, all you need to boot FreeDOS and run DOS applications is the kernel and a `FDCONFIG.SYS` configuration file. + +### Installing a minimal system + +We can simulate a dedicated, minimal FreeDOS system by using the QEMU emulator with very small allocations. To reflect an embedded system more accurately, I'll define a virtual machine with only 8 megabytes of memory and a mere 2 megabytes for a virtual hard drive. + +To create the tiny virtual hard drive, I'll use this `qemu-img` command to define a 2-megabyte file: + + +``` +$ qemu-img create tiny.img 2M +Formatting 'tiny.img', fmt=raw size=2097152 +``` + +This command line defines a 32-bit "i386" CPU with 8 megabytes of memory, using the 2-megabyte `tiny.img` file as the hard drive image and the FreeDOS 1.3 RC4 LiveCD as the CD-ROM media. We'll also set the machine to boot from the CD-ROM drive (`-boot order=d`) although we only need that to install. We'll boot the completed embedded system from the hard disk after we've set everything up: + + +``` +qemu-system-i386 -m 8 -hda tiny.img -cdrom FD13LIVE.iso -boot order=d +``` + +Boot the system using the "Live Environment mode"—this provides us with a running FreeDOS system that we can use to transfer a minimal FreeDOS to the hard disk. + +![embedded setup][3] + +Boot into the LiveCD environment +(Jim Hall, [CC-BY SA 4.0][4]) + +We'll need to create a partition on the virtual hard drive for our programs. To do that, run the FDISK program from the command line. FDISK is the standard _fixed disk_ utility on FreeDOS. Use FDISK to create a single hard drive partition that spans the entire (2-megabyte) hard drive. + +![embedded setup][5] + +FDISK, after creating the 2 megabyte partition +(Jim Hall, [CC-BY SA 4.0][4]) + +But FreeDOS won't see the new hard drive partition until you reboot—FreeDOS only reads the hard disk details at startup. Exit FDISK and reboot, and you'll be ready for the next step. + +After rebooting, you need to create a DOS filesystem on the new hard drive. Since there's just the one virtual hard disk, FreeDOS will identify it as the `C:` drive. You can create a DOS filesystem on `C:` with the FORMAT command. The `/S` option transfers the operating system files (the kernel, plus a copy of the `COMMAND.COM` shell) to the new drive. + +![embedded setup][6] + +Format the new drive to create a DOS filesystem +(Jim Hall, [CC-BY SA 4.0][4]) +  + +Now that you've created the drive and formatted it, you can install the application that will run on the embedded system. + +### Installing the dedicated application + +An embedded system is really just a single-purpose application running on a dedicated system. Such applications are usually custom-built for the system it will control, such as a cash register, display terminal, or control environment. For this demonstration, let's use a program from the FreeDOS 1.3 RC4 installation CD-ROM. It needs to be small enough to fit in the tiny 2-megabyte hard drive we've created for it. This can be anything—so just for fun, let's make it a game. + +FreeDOS 1.3 RC4 includes several fun games. One game that I like is a board game called Simple Senet. It's based on Senet, an ancient Egyptian board game. The details of the game aren't important for this demonstration, except that we'll install it and set it up as the dedicated application for the embedded system. + +To install the application, go into the `\PACKAGES\GAMES` directory on the FreeDOS 1.3 RC4 LiveCD. You'll see a long list of packages there, and the one we want is `SENET.ZIP`. + +![embedded setup][7] + +A list of game packages from FreeDOS 1.3 RC4 +(Jim Hall, [CC-BY SA 4.0][4]) + +To unzip the Simple Senet package onto the virtual hard drive, use the `UNZIP` command. All FreeDOS packages are Zip files, so you can use any Zip-compatible archive utility to manage them. FreeDOS 1.3 RC4 includes `ZIP` to create Zip archives, and `UNZIP` to extract Zip archives. Both are from the [Info-Zip Project][8]. + + +``` +`UNZIP SENET.ZIP -d C:\FDOS` +``` + +Normally, using `UNZIP` will extract a Zip file in the current directory. The `-d C:\FDOS` option at the end of the command line tells `UNZIP` to extract the Zip file to the `C:\FDOS` directory. (`-d` means "destination.") + +![embedded setup][9] + +Unzipping the Simple Senet game +(Jim Hall, [CC-BY SA 4.0][4]) + +To run the Simple Senet game whenever the embedded system boots, we need to tell FreeDOS to use Senet as the system "shell." The default FreeDOS shell is the `COMMAND.COM` program, but you can define a different shell program using the `SHELL=` directive in the `FDCONFIG.SYS` kernel configuration file. We can use FreeDOS Edit to create the new `C:\FDCONFIG.SYS` file. + +![Embedded edit senet][10] + +(Jim Hall, [CC-BY SA 4.0][4]) + +If you need to define other parameters to support the embedded system, you can add those to the `FDCONFIG.SYS` file. For example, you might need to set environment variables using the `SET` action, or tune the FreeDOS kernel with `FILES=` or `BUFFERS=` statements. + +### Run the embedded system + +With the embedded system fully defined, we can now reboot the machine to run the embedded application. Running an embedded system usually requires only limited resources, so for this demonstration, we'll tweak the QEMU command line to only boot from the hard drive (`-boot order=c`) and not define a CD-ROM drive: + + +``` +qemu-system-i386 -m 8 -hda tiny.img -boot order=c +``` + +When the FreeDOS kernel starts up, it reads the `FDCONFIG.SYS` file for its startup parameters. Then it runs the shell using the `SHELL=` line. That runs the Simple Senet game automatically. + +![embedded setup][11] + +Running Simple Senet as an embedded system +(Jim Hall, [CC-BY SA 4.0][4]) + +We've used Simple Senet to demonstrate how to set up an embedded system on FreeDOS. Depending on your needs, you can use whatever standalone application you like. Define it as the DOS shell using the `SHELL=` line in `FDCONFIG.SYS` and FreeDOS will automatically launch the application at boot-time. + +However, there's one limitation here. Embedded systems do not usually need to exit back to a command prompt, so these dedicated applications don't usually allow the user to quit to DOS. If you manage to exit the embedded application, you'll likely see a "Bad or missing Command Interpreter" prompt, where you'll need to enter the full path to a new shell. For a user-focused desktop system, this would be a problem. But on an embedded system that's dedicated to doing only one job, you should never need to exit anyway. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-embedded-system + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) +[2]: https://www.freedos.org/ +[3]: https://opensource.com/sites/default/files/uploads/embedded-setup02.png (Boot into the LiveCD environment) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/embedded-setup09.png (FDISK, after creating the 2 megabyte partition) +[6]: https://opensource.com/sites/default/files/uploads/embedded-setup19.png (Format the new drive to create a DOS filesystem) +[7]: https://opensource.com/sites/default/files/uploads/games-dir.png (A list of game packages from FreeDOS 1.3 RC4) +[8]: http://infozip.sourceforge.net/ +[9]: https://opensource.com/sites/default/files/uploads/senet-unzip.png (Unzipping the Simple Senet game) +[10]: https://opensource.com/sites/default/files/pictures/embedded-edit-senet.png (Embedded edit senet) +[11]: https://opensource.com/sites/default/files/uploads/senet.png (Running Simple Senet as an embedded system) From 4e5e4a048999139523ead079927881031053c875 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:04:13 +0800 Subject: [PATCH 090/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210615=20?= =?UTF-8?q?Try=20this=20new=20open=20source=20tool=20for=20data=20analytic?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210615 Try this new open source tool for data analytics.md --- ...new open source tool for data analytics.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210615 Try this new open source tool for data analytics.md diff --git a/sources/tech/20210615 Try this new open source tool for data analytics.md b/sources/tech/20210615 Try this new open source tool for data analytics.md new file mode 100644 index 0000000000..02d00b8131 --- /dev/null +++ b/sources/tech/20210615 Try this new open source tool for data analytics.md @@ -0,0 +1,84 @@ +[#]: subject: (Try this new open source tool for data analytics) +[#]: via: (https://opensource.com/article/21/6/cubejs) +[#]: author: (Ray Paik https://opensource.com/users/rpaik) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Try this new open source tool for data analytics +====== +Cube.js is an open source analytical platform that acts as a layer +between data sources and applications. +![metrics and data shown on a computer screen][1] + +Data analytics is a trendy field with many solutions available. One of them is [Cube.js][2], an open source analytical platform. You can think of Cube.js as a layer between your data sources and applications. + +As the diagram below shows, Cube.js supports serverless data warehouses and most modern relational database management systems (RDBMS). You can work with any JavaScript front-end library for data visualization, and Cube.js will take care of the rest, including access control, performance, concurrency, and more. + +![Cube.js architecture][3] + +(©2021, [Cube Dev, Inc.][2]) + +### Key benefits + +When I ask our community members about Cube.js's key benefits, they frequently mention: + + * **Its abstraction layer:** After configuring Cube.js, people say they no longer have to worry about performance optimization, resource management, SQL expertise, etc. Many refer to Cube.js as a "black box" because its abstraction layer helps them focus on understanding the data rather than the implementation details. + * **Ease of customization:** Since Cube.js is visualization-agnostic, it's easy to integrate with front-end frameworks to build solutions that look like a user's own platform. Most commercial platforms (e.g., Looker, Tableau, etc.) require a lot more customization work to integrate with their infrastructure. Many users say that the ease of customization combined with the abstraction layer enables them to reduce development time for their data analytics platforms. + * **Community support:** When getting started with Cube.js, people usually get help from fellow community members (especially on our [Slack][4]), and many mention community support as a key onboarding resource. + + + +Visit the [user stories page][5] to read more about people's experience with Cube.js and how they use it. + +### Get started + +If you want to check out Cube.js: + + * Go to our [Documentation page][6], click on **Getting started**, and follow the instructions to get Cube.js up and running on your laptop or workstation. + * Once you get to the [developer playground][7], you will be able to generate the data schema, execute queries, and build dashboards to see Cube.js in action. + + + +After you get Cube.js up and running, here are some helpful resources: + + * [Documentation][6]: We put a lot of focus on our documentation because it is a critical resource for open source communities. We're also adding video clips to our documentation pages and the [getting started playlist][8] on our YouTube channel. + * [Discourse][9]: The Cube.js forum is a recent addition where community members can share their use cases, tips & tricks, etc. so that we can build a community knowledge base. + * [GitHub][10]: You'll find the Cube.js code here, and community members file bugs or feature requests via [issues][11]. We also publish our [quarterly roadmaps][12] on GitHub so that everyone can see what we're working on. + * [Monthly community calls][13]: We have calls on the second Wednesday of each month to discuss community updates, showcase feature demos, and invite community members to share their use cases. You will find call logistics on the [community calls page][13], and you can find recordings of past calls on the [community calls playlist][14] on our YouTube channel. + + + +As with any good open source project, Cube.js has many contributors to the software. If you want to look at pull requests (PRs) from the community, search for PRs with the label `pr:community`. If you are eager to look for issues that you can work on, search for issues with the labels `good first issue` or `help wanted`. + +I hope you will give Cube.js a try. If you have any questions, please feel free to leave comments below or find me on the [Cube.js Slack][4]! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/cubejs + +作者:[Ray Paik][a] +选题:[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/rpaik +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://cube.dev/ +[3]: https://opensource.com/sites/default/files/uploads/cubejs-architecture.png (Cube.js architecture) +[4]: https://slack.cube.dev/ +[5]: https://cube.dev/blog/category/user-stories/ +[6]: https://cube.dev/docs/ +[7]: https://cube.dev/docs/dev-tools/dev-playground +[8]: https://www.youtube.com/playlist?list=PLtdXl_QTQjpaXhVEefh7JCIdtYURoyWo9 +[9]: https://forum.cube.dev/ +[10]: https://github.com/cube-js/cube.js +[11]: https://github.com/cube-js/cube.js/issues +[12]: https://github.com/cube-js/cube.js/projects +[13]: https://cube.dev/community-call/ +[14]: https://www.youtube.com/playlist?list=PLtdXl_QTQjpb1dHZCM09qKTsgvgqjSvc9 From 4a41649d913c5f78651d75fb2c6ec69116f2dd92 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:04:26 +0800 Subject: [PATCH 091/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210615=20?= =?UTF-8?q?Build=20a=20static=20website=20with=20Eleventy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210615 Build a static website with Eleventy.md --- ...15 Build a static website with Eleventy.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20210615 Build a static website with Eleventy.md diff --git a/sources/tech/20210615 Build a static website with Eleventy.md b/sources/tech/20210615 Build a static website with Eleventy.md new file mode 100644 index 0000000000..0b58114659 --- /dev/null +++ b/sources/tech/20210615 Build a static website with Eleventy.md @@ -0,0 +1,145 @@ +[#]: subject: (Build a static website with Eleventy) +[#]: via: (https://opensource.com/article/21/6/static-site-builder) +[#]: author: (Nwokocha Wisdom https://opensource.com/users/wise4rmgod) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Build a static website with Eleventy +====== +Eleventy is a JavaScript-based alternative to Jekyll and Hugo for +building static websites. +![Digital images of a computer desktop][1] + +A static site generator is a tool that generates a full, static HTML website based on raw data and a set of templates. It automates the task of coding individual HTML pages and gets those pages ready to serve to users. Because the HTML pages are prebuilt, they load very quickly in users' browsers. + +Static sites work particularly well for documentation, too, because static sites are easy to scale, and they're an easy way to generate, maintain, and deploy your project's documentation. For these reasons, organizations often use them to document application programming interfaces (APIs), database schemas, and other information. Documentation is an important part of software development, design, and other aspects of tech. All codebases require some form of documentation, with options ranging from a simple README to full documentation. + +### Eleventy: A static site generator + +[Eleventy][2] (11ty) is a simple static site generator and an alternative to [Jekyll][3] and [Hugo][4]. It's written in JavaScript and transforms a directory of templates (of varying types) into HTML. It's also open source, released under the MIT License. + +Eleventy works with HTML, Markdown, Liquid, Nunjucks, Handlebars, Mustache, EJS, Haml, Pug, and JavaScript Template Literals. + +Its features include: + + * Easy setup + * Supports multiple template languages (e.g., Nunjucks, HTML, JavaScript, Markdown, Liquid) + * Customizable + * Based on JavaScript, which is familiar to many web developers and easy for new users to learn + + + +### Install Eleventy + +Eleventy requires Node.js. On Linux, you can install Node.js using your package manager: + + +``` +`$ sudo dnf install nodejs` +``` + +If your package manager doesn't have Node.js available, or if you're not on Linux, you can [install it][5] from the Node.js website. + +Once Node.js is installed, use it to install Eleventy: + + +``` +`$ npm install -g @11ty/eleventy` +``` + +That's it! + +### Build a static site for your documentation + +Now you can start using Eleventy to build your static documentation site. Here are the steps to follow. + +#### 1\. Create a package.json file + +To install Eleventy into your project, you need a package.json file: + + +``` +`$ npm init -y` +``` + +#### 2\. Install Eleventy into package.json + +Install and save Eleventy into your project's `package.json` by running: + + +``` +`$ npm install-save-dev @11ty/eleventy` +``` + +#### 3\. Run Eleventy + +Use the `npx` command to run your local project's version of Eleventy. After you verify installation went as expected, try to run Eleventy: + + +``` +`$ npx @11ty/eleventy` +``` + +#### 4\. Create some templates + +Now run two commands to create two new template files (an HTML and a Markdown file): + + +``` +$ cat << EOF >> index.html +<!doctype html><html> +<head> +<title>Page title</title> +</head><body> +<p>Hello world</p> +</body></html> +EOF +$ echo '# Page header' > index.md +``` + +This compiles any content templates in the current directory or subdirectories into the output folder (which defaults to `_site`). + +Run `eleventy --serve` to start a development web server. + + +``` +`$ npx @11ty/eleventy-serve` +``` + +Open `http://localhost:8080/README/` in the web browser of your choice to see your Eleventy output. + +Then upload the files in `_site` to your web server to publish your site for the world to see. + +### Try Eleventy + +Eleventy is a static site generator that's easy to use, template, and theme. If you're already using Node.js in your development workflow, Eleventy may be a more natural fit than Jekyll or Hugo. It provides great results quickly and saves you from complex site design and maintenance. To learn more about using Eleventy, read through its [documentation][6]. + +* * * + +_This is based on [Building a technical documentation static site for open source projects][7], which first appeared on Nwokocha Wisdom Maduabuchi's Medium site, and is republished with permission._ + +See how Jekyll, an open source generator of static HTML files, makes running a blog as easy as... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/static-site-builder + +作者:[Nwokocha Wisdom][a] +选题:[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/wise4rmgod +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop) +[2]: https://www.11ty.dev/ +[3]: https://opensource.com/article/17/4/getting-started-jekyll +[4]: https://opensource.com/article/18/3/start-blog-30-minutes-hugo +[5]: https://nodejs.org/en/ +[6]: https://www.11ty.dev/docs/getting-started/ +[7]: https://wise4rmgodadmob.medium.com/building-a-technical-documentation-static-site-for-open-source-projects-7af4e73d77f0 From 9d11e1ed182f5844c049175258b42d24150448f1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:04:40 +0800 Subject: [PATCH 092/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210615=20?= =?UTF-8?q?Keep=20track=20of=20your=20IRC=20chats=20with=20ZNC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210615 Keep track of your IRC chats with ZNC.md --- ...5 Keep track of your IRC chats with ZNC.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/tech/20210615 Keep track of your IRC chats with ZNC.md diff --git a/sources/tech/20210615 Keep track of your IRC chats with ZNC.md b/sources/tech/20210615 Keep track of your IRC chats with ZNC.md new file mode 100644 index 0000000000..73d4fd5f0c --- /dev/null +++ b/sources/tech/20210615 Keep track of your IRC chats with ZNC.md @@ -0,0 +1,132 @@ +[#]: subject: (Keep track of your IRC chats with ZNC) +[#]: via: (https://opensource.com/article/21/6/irc-matrix-bridge-znc) +[#]: author: (John 'Warthog9' Hawley https://opensource.com/users/warthog9) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Keep track of your IRC chats with ZNC +====== +Create a bridge between IRC and Matrix. +![Chat bubbles][1] + +For a bit more than a year, I've been wondering if it is possible to bolt the open source [Matrix][2] communications network to Internet Relay Chat (IRC) in such a way that I can still use my [ZNC][3] IRC bouncer without an extra proliferation of nicknames. The answer, is amusingly, yes. But first, some background. + +### What's IRC? + +IRC has been around since August 1988, and it's been a staple of real-time communications ever since. It's also one of the early open source projects, as the code for the original IRC server was eventually shared. Over the years, it's been quite useful for meeting many developers' real-time communication needs, although not without its own share of drama. However, it has been resilient and is still widely used despite newer options. + +### Enter the bouncer + +ZNC solves a specific problem on IRC: IRC is intentionally a very ephemeral system, so no state is saved. When you log into an IRC server, you get nothing except what is happening right then—nothing before, and once you leave, nothing after. This contrasts with more modern systems that give historical context, scrollback, searchability, etc. + +Some of this can be handled by clients that are left on continuously, but that's not ideal. Enter the IRC bouncer. A bouncer acts as a middleman to the IRC connection. It connects to IRC and can log in on the user's behalf. It can then relay chats back out to the client (or, in many cases, clients). This can make it seem like a user is always on, which gives some context. + +Many folks who use IRC use either a bouncer or a client that runs long-term to keep that context going. ZNC is a relatively popular and well-understood bouncer for IRC. Other services like [IRCCloud][4] can provide this and other features bolted around IRC to make the experience more pleasant and usable. + +### Building bridges + +Matrix is a newer standard that isn't really a program or a codebase. It's actually a protocol definition that lends itself particularly well to bridging other protocols and provides a framework for real-time encrypted chat. One of its reference implementations is called Synapse, and it happens to be a pretty solid base from which to build. It has a rich set of prebuilt [bridges][5], including Slack, Gitter, XMPP, and email. While not all features translate everywhere, the fact that so many good bridges exist speaks to a great community and a robust protocol. + +### The crux of the matter + +I've been on IRC for 26 or 27 years; my clients are set up the way I like, and I'm used to interacting with it in certain ways on certain systems. This is great until I want to start interfacing with IRC when I have Matrix, [Mattermost][6], [Rocket.Chat][7], or other systems running. Traditionally, this meant I ended up with an extra nickname every time I logged into IRC. After a while, username[m], username[m]1, username[m]2, and so forth start looking old. Imagine everyone trying to do this, and you understand that this eventually gets untenable. + +I've been running a Matrix server with bridges. So why can't I bridge ZNC into Matrix and get the best of all worlds? + +It's doable with some prerequisites and prep work (which I won't cover in detail, but there's documentation out there should you wish to set this up for yourself). + + * You need a Matrix server, I'm using [Synapse][8], and it's what I'm going to assume going forward. You will also need admin privileges and access to the low-level system. + * You need a [ZNC server][3] up and running or a bouncer that acts like ZNC (although your mileage will vary if you aren't using ZNC). You just need a ZNC account; you don't need admin privileges. + * You need a copy of Heisenbridge, an IRC bridge for Matrix that works differently from a normal IRC bridge. It's possible to run both simultaneously; I am, and the [Heisenbridge README][9] will help you do the same. You'll likely want to run Heisenbridge on the same system you're running Synapse, although it's not required. + + + +I'll assume you have Synapse and a working IRC bouncer set up and working. Now comes the fun part: bolting Heisenbridge into place. Follow the Heisenbridge install guide, except before you restart Synapse and start Heisenbridge, you'll want to make a couple of small changes to the configuration file generated during setup. That config file will look something like this: + + +``` +id: heisenbridge +url: +as_token: alongstringtoken +hs_token: anotherlongstringtoken +rate_limited: false +sender_localpart: heisenbridge +namespaces: + users: + - regex: '@irc_.*' +   exclusive: true + aliases: [] + rooms: [] +``` + + * Change the port it will use because `9898` is also preferred by other bridges. I chose `9897`. As long as it is the same in Synapse and the bridge, it doesn't matter what you use. + * In the `namespaces` section, take note of the regex for the users. The `matrix-appservice-irc` system uses the same regex, and having both of them run in the same namespace causes issues. I changed mine from `@irc_` to `@hirc`. + * You need to add `@heisenbridge:your.homeserver.tld` to the admin list on your server. The easiest way to do this is to start up Heisenbridge once, turn it off, and then edit the database to give the user admin privileges (i.e., set `admin=1` on that user). Then restart Heisenbridge. + + + +My updated config file looks like this: + + +``` +id: heisenbridge +url: +as_token: alongstringtoken +hs_token: anotherlongstringtoken +rate_limited: false +sender_localpart: heisenbridge +namespaces: + users: + - regex: '@hirc_.*' +   exclusive: true + aliases: [] + rooms: [] +``` + +Then, restart Synapse, start Heisenbridge, and go from there. I started mine using: + + +``` +`python3 -m heisenbridge -c /path/to/heisenbridge.yaml -p 9897` +``` + +Next, talk to the Heisenbridge user on your home server and set up a network and a server for your bouncer. + +If you want to add a server, there are some options that aren't documented. If you want to add a server name and host, issue: + + +``` +`addserver networkname hostname portnumber --tls` +``` + +Open the network as your user. You'll be invited to a room where you can set the password for the network login (this is likely needed for ZNC), and then you can connect. + +> **Security warning:** The password will be stored in clear text, so don't use passwords you don't mind being stored this way, and don't do this on machines you don't trust. + +After you hit **Connect**, you should get a flurry of activity as your IRC bouncer pushes its state into Matrix. That should do it! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/irc-matrix-bridge-znc + +作者:[John 'Warthog9' Hawley][a] +选题:[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/warthog9 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://matrix.org/ +[3]: https://wiki.znc.in/ZNC +[4]: https://www.irccloud.com/ +[5]: https://matrix.org/bridges/ +[6]: https://mattermost.com/ +[7]: http://rocket.chat/ +[8]: https://matrix.org/docs/projects/server/synapse +[9]: https://github.com/hifi/heisenbridge From 86f026ecf0e0f95a06e87806f3ce0791c94a5b3c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:04:53 +0800 Subject: [PATCH 093/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210615=20?= =?UTF-8?q?Listen=20to=20music=20on=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210615 Listen to music on FreeDOS.md --- .../20210615 Listen to music on FreeDOS.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210615 Listen to music on FreeDOS.md diff --git a/sources/tech/20210615 Listen to music on FreeDOS.md b/sources/tech/20210615 Listen to music on FreeDOS.md new file mode 100644 index 0000000000..35431d0388 --- /dev/null +++ b/sources/tech/20210615 Listen to music on FreeDOS.md @@ -0,0 +1,99 @@ +[#]: subject: (Listen to music on FreeDOS) +[#]: via: (https://opensource.com/article/21/6/listen-music-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Listen to music on FreeDOS +====== +Mplayer is an open source media player that's usually found on Linux, +Windows, Mac, and DOS. +![Woman programming][1] + +Music is a great way to relax. On Linux, I listen to music using Rhythmbox. But did you know you can listen to music on FreeDOS, as well? Let's take a look at two popular programs to listen to music: + +### Listen to music with Mplayer + +[Mplayer][2] is an open source media player that's usually found on Linux, Windows, and Mac—but there's a DOS version available, too. And that's the version we include in FreeDOS. While the DOS port is based on an older version (version 1.0rc2-3-3-2 from 2007) it is perfectly serviceable for playing media on DOS. + +I use Mplayer to listen to music files on FreeDOS. For this example, I've copied one of my favorite audiobooks, Doctor Who: Flashpoint by [Big Finish Productions][3], and saved it as `C:\MUSIC\FLASHPNT.MP3` on my FreeDOS computer. To listen to Flashpoint on FreeDOS, I launch Mplayer from the FreeDOS command line and specify the MP3 filename to play. The basic usage of Mplayer is `mplayer [options] filename` so if the default settings work well for you, then you can just launch Mplayer with the filename. In this case, I ran these commands to change my working directory to `\MUSIC` and then run Mplayer with my MP3 audiobook file: + + +``` +CD \MUSIC +MPLAYER FLASHPNT.MP3 +``` + +FreeDOS is _case insensitive_, so it will accept uppercase or lowercase letters for DOS commands and any files or directories. You could also type `cd \music` or `Cd \Music` to move into the Music directory, and that would work the same. + +![mplayer on FreeDOS][4] + +You can use Mplayer to listen to MP3 files +(Jim Hall, [CC-BY SA 4.0][5]) + +Using Mplayer is a "no frills" way to listen to music files on FreeDOS. But at the same time, it's not distracting, so I can leave FreeDOS to play the MP3 file on my DOS computer while I use my other computer to do something else. However, FreeDOS runs tasks one at a time (in other words, DOS is a "single-tasking" operating system) so I cannot run Mplayer in the "background" on FreeDOS while I work on something else _on the same FreeDOS computer_. + +Note that Mplayer is a big program that requires a lot of memory to run. While DOS itself doesn't require much RAM to operate, I recommend at least 16 megabytes of memory to run Mplayer. + +### Listen to audio files with Open Cubic Player + +FreeDOS offers more than just Mplayer for playing media. We also include the [Open Cubic Player][6], which supports a variety of file formats including Midi and WAV files. + +In 1999, I recorded a short audio file of me saying, "Hello, this is Jim Hall, and I pronounce 'FreeDOS' as _FreeDOS_." This was meant as a joke, riffing off of a [similar audio file][7] (`english.au`, included in the Linux source code tree in 1994) recorded by Linus Torvalds to demonstrate how he pronounces "Linux." We don't distribute the _FreeDOS_ audio clip in FreeDOS itself, but you are welcome to download it from our [Silly Sounds][8] directory, found in the FreeDOS files archive at [Ibiblio][9]. + +You can listen to the _FreeDOS_ audio clip using the Open Cubic Player. To run Open Cubic Player, you normally would run `CP` from the `\APPS\OPENCP` directory. However, Open Cubic Player is a 32-bit application that requires a 32-bit DOS extender. A common DOS extender is DOS/4GW. While free to use, DOS/4GW is not an open source program, so we do not distribute it as a FreeDOS package. + +Instead, FreeDOS provides another open source 32-bit extender called DOS/32A. If you did not install everything when you installed FreeDOS, you may need to install it using [FDIMPLES][10]. I used these two commands to move into the `\APPS\OPENCP` directory, and to run Open Cubic Player using the DOS/32A extender: + + +``` +CD \APPS\OPENCP +DOS32A CP +``` + +Open Cubic Player doesn't sport a fancy user interface, but you can use the arrow keys to navigate the _File Selector_ to the directory that contains the media file you want to play. + +![Open Cubic Player][11] + +Open Cubic Player opens with a file selector +(Jim Hall, [CC-BY SA 4.0][5]) + +The text appears smaller than in other DOS applications because Open Cubic Player automatically changes the display to use 50 lines of text, instead of the usual 25 lines. Open Cubic Player will reset the display back to 25 lines when you exit the program. + +When you have selected your media file, Open Cubic Player will play it in a loop. (Press the Esc key on your keyboard to quit.) As the file plays over the speakers, Open Cubic Player displays a spectrum analyzer so you can see the audio for the left and right channels. The _FreeDOS_ audio clip is recorded in mono, so the left and right channels are the same. + +![Open Cubic Player][12] + +Open Cubic Player playing the "FreeDOS" audio clip +(Jim Hall, [CC-BY SA 4.0][5]) + +DOS may be from an older era, but that doesn't mean you can't use FreeDOS to run modern tasks or play current media. If you like to listen to digital music, try using Open Cubic Player or Mplayer on FreeDOS. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/listen-music-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://en.wikipedia.org/wiki/MPlayer +[3]: https://bigfinish.com/ +[4]: https://opensource.com/sites/default/files/uploads/mplayer.png (You can use Mplayer to listen to MP3 files) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://www.cubic.org/player/ +[7]: https://commons.wikimedia.org/wiki/File:Linus-linux.ogg +[8]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/sillysounds/ +[9]: https://www.ibiblio.org/ +[10]: https://opensource.com/article/21/6/freedos-package-manager +[11]: https://opensource.com/sites/default/files/uploads/opencp1.png (Open Cubic Player opens with a file selector) +[12]: https://opensource.com/sites/default/files/uploads/opencp2.png (Open Cubic Player playing the "FreeDOS" audio clip) From 8babcbea048782c716662980ae87ce455bec9120 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:05:15 +0800 Subject: [PATCH 094/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210616=20?= =?UTF-8?q?Top=205=20Chrome-like=20Browsers=20That=20Are=20Better=20Than?= =?UTF-8?q?=20Google=20Chrome=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md --- ...t Are Better Than Google Chrome in 2021.md | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 sources/news/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md diff --git a/sources/news/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md b/sources/news/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md new file mode 100644 index 0000000000..d0de8fbccf --- /dev/null +++ b/sources/news/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md @@ -0,0 +1,200 @@ +[#]: subject: (Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021) +[#]: via: (https://news.itsfoss.com/chrome-like-browsers-2021/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021 +====== + +Want to switch away from Google? But, looking for something potentially better than Google Chrome (and similar) for your Linux system? + +Fortunately, there are multiple Google Chrome alternatives that you can try. + +Each of them brings something interesting to the table, while also keeping the fantastic compatibility Chrome is known for. Read on to find out more about these browsers. + +### Options That Are Better Than Google Chrome + +**Note:** _While [free and open-source software plays a crucial role in replacing big tech][1], any choice available on Linux other than Google Chrome should be a good start. Hence, you will find some non-FOSS options as well._ + +In my opinion, the best alternatives to Chrome are Chromium-based, meaning that they share the same DNA with Chrome. The advantage of this is that they already have feature parity with Chrome, while having more time to add their own. + +Also, if you want, you can explore [opensource alternatives to Chrome][2] that are not based on Chromium. + +In any case, even if the alternatives to Google Chrome do not seem superior to you, it is worth a try to move away from Big Tech. + +The result of this is a collection of browsers that are equal or better than Chrome in various aspects. Without further ado, here are my top five picks for Chrome-like browsers that are better than Chrome itself: + + * **UnGoogled Chromium** + * **Brave** + * **Microsoft Edge** + * **Vivaldi** + * **Opera** + + + +This list is in no order of ranking. + +### 1\. UnGoogled Chromium + +![][3] + +**Features:** + + * Removal of functionality specific to Google domains. + * Blocking of internal requests to Google at runtime. + * Stripping Google binaries from the source code. + * Many new command-line switches and `chrome://flags` entries. + * Forces all pop-ups into tabs. + + + +For the privacy fans out there, this browser will be a godsend. While it may look identical to Chrome, it has many privacy tweaks under-the-hood. + +As the name suggests, the biggest setback for Chrome users will be the absence of Google’s service integrations. This also means no more internal requests to Google, Google URL tracking, and much more. + +It does not boast anything extraordinary to protect your privacy, but it should be better than Google Chrome. + +You can choose to explore and toggle privacy settings at will through the Chrome flags settings as well. + +All-in-all, UnGoogled Chromium provides a familiar browsing experience, with a suite of privacy features added in as well. It is reliable and is also compatible with the large ecosystem of Chrome extensions. + +[UnGoogled Chromium][4] + +### 2\. Brave + +![][3] + +**Features:** + + * Built-in ad blocker. + * Faster page loading times. + * Brave rewards program. + * Ability to synchronise between devices. + * Chrome web store support. + + + +When Brave first marched onto the stage in 2016, people around the world were gawking at its privacy and performance features. At launch, these included a built-in ad-blocker and a new UI. + +Since then, the browser has gained many more features, including a rewards program and [Tor][5] integration. This has led it to become one of the fastest-growing browsers. + +[Brave][6] + +### 3\. Microsoft Edge + +![][3] + +**Features:** + + * Chrome Web Store support + * Child browsing mode (additional protection and simpler UI) + * Good PDF editing tools + * Built-in coupon finder + * Reader Mode + * Built-in password generator + + + +When Microsoft Edge first released alongside Windows 10 in 2015, it was widely criticized for being slow and buggy. However, in early 2020 it was completely remade using the Chromium web engine. + +This is the same engine Chrome is based on. The result of this is a modern and fast browsing experience. One perk of this transition is the web browser’s ability to run on many different platforms, from Windows 7 and macOS to Ubuntu and other Linux-based distros. + +I know, if you hate Microsoft for some reason, this may not entice you – but Microsoft Edge for Linux is a serious alternative to Google Chrome. + +[Microsoft Edge (Beta)][7] + +### 4\. Vivaldi + +![][3] + +**Features:** + + * Built-in translator + * Vivaldi Email (Beta) + * Feed Reader (Beta) + * Vivaldi Calendar (Beta) + * Highly customizable UI + * Built-in Ad Blocker + * Chrome Web Store support + * Tab grouping + * Split-screen tabs + + + +First released in 2016, Vivaldi has quickly risen the ranks in browser wars. Originally designed for Opera users disgruntled by its transition from the [Presto][8] [layout engine][9], it has managed to re-implement many of the features lost during Opera’s transition to Chromium. + +Amazingly, it has managed to do this all while being based on Chromium (the very reason Opera dropped these features). + +The latest [Vivaldi 4.0 release][10] also turned the tables with several features for power users. + +While it isn’t 100% FOSS, 93% of its source code is available, with only the UI being proprietary. Considering Vivaldi’s development team actively focus on Linux users for improvement, this could be a worthy tradeoff due to the sheer number of features Vivaldi offers. + +[Vivaldi][11] + +### 5\. Opera + +![][3] + +**Features:** + + * Built-in VPN + * Easy access to social media + * Built-in cryptocurrency wallet + * Fraud and malware protection + * Highly visible website security badge + + + +While it has never been the king of web browsers, Opera has always been present in the debate over which browser to use. Originally based on its in-house Presto Layout Engine, it switched over to Chromium in 2013. + +Unfortunately, this switch meant that the Opera team was forced to drop some of its most well-known features, paving the way for alternatives such as Vivaldi and Firefox to fill the space Opera had left. + +That isn’t to say that Opera is without features. It contains many, some of which are listed below. + +[Opera][12] + +### Wrapping Up + +Here we have listed a wide variety of browsers tailored to all kinds of users on any desktop platform. + +No matter whether you want more features, a better user interface, or something that helps you get away from Google, there is an option for you. + +Since all these browsers are based on Chromium, they all offer a good compatibility and user experience like Chrome. So, switch to one of these Chrome-like browsers and enjoy the freedom that each of them grants! + +_What’s your favorite alternative to Google Chrome on Linux in 2021? Let me know in the comments down below._ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/chrome-like-browsers-2021/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/save-privacy-with-foss/ +[2]: https://itsfoss.com/open-source-browsers-linux/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQxNiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://github.com/Eloston/ungoogled-chromium +[5]: https://itsfoss.com/tor-guide/ +[6]: https://brave.com +[7]: https://www.microsoftedgeinsider.com/en-us/download +[8]: https://en.wikipedia.org/wiki/Presto_(browser_engine) +[9]: https://en.wikipedia.org/wiki/Browser_engine +[10]: https://news.itsfoss.com/vivaldi-4-0-release/ +[11]: https://vivaldi.com +[12]: https://www.opera.com From d4966b186a9444fb56282a60a6bae924d2616052 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 17 Jun 2021 05:05:28 +0800 Subject: [PATCH 095/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210615=20?= =?UTF-8?q?PDF=20Mix=20Tool=201.0.1=20Now=20Lets=20You=20Edit=20Metadata?= =?UTF-8?q?=20with=20an=20Improved=20UI=20&=20Qt=206=20Support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md --- ...data with an Improved UI - Qt 6 Support.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md diff --git a/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md b/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md new file mode 100644 index 0000000000..4898095a65 --- /dev/null +++ b/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md @@ -0,0 +1,94 @@ +[#]: subject: (PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI & Qt 6 Support) +[#]: via: (https://news.itsfoss.com/pdf-mix-tool-1-0-1-release/) +[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI & Qt 6 Support +====== + +[PDF Mix Tool][1] is one of the [best PDF editors for Linux][2] and an alternative to [PDF Arranger][3]. +It is a neat and simple GUI tool for manipulating pdf files and allows you to modify your files (rotating, splitting, extracting from files), not their content, however. + +Although this application does not come with a lot of tools, it provides a concise toolset so you can manipulate your documents. + +After a year of no new releases, the developer is back with another release (1.0.1) with some significant improvements. + +Let us discover what features this release has to offer. + +### Improved User Interface (UI) + +There is now a left sidebar containing icons for all the operations you might need to perform. Each one of the icons has a respective function and its name below it. + +![][4] + +This is not a big makeover but helps enhancing the user experience, which should be the focus for a useful tool like PDF Mix Tool. + +### PDF Metadata Editing + +![][5] + +You can now modify your document’s title, author, subject, keywords, creator, producer, and creation and modification dates. Thus, you can edit your document’s metadata easily. + +### Support for Qt 6.0 + +PDF Mix Tool is written in C++, and it relies on **qpdf** and the **Qt** library to make its magic work. It supports [Qt 6.0][6] now, which will affect the UX positively. + +### Other Improvements + + * PDF Mix Tool now adds right-to-left support in page composition. + * Links, annotations, and outlines are preserved as much as possible in all operations. + * This version fixed some bugs. + + + +You can check out the [official changelog][7] in their GitLab page. + +### Summing Up + +Despite its reputation for being a lightweight, PDF Mix Tool is a handy application that delivers essential capabilities to the user. + +You can get it from [Flathub][8] or [Snap store][9]. For Arch Linux users, you may not find the latest release in the repositories or the [AUR][10]. In either case, you can build it from source that can be found on [GitLab][11]. + +You may want to go through our [Flatpak guide][12] or the tutorial for [using Snaps in Linux][13] to get help with installation. + +[Download PDFMixTool][14] + +_What do you think about this release? I’m also curious to know what PDF editor do you happen to use?_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/pdf-mix-tool-1-0-1-release/ + +作者:[Omar Maarof][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/omar/ +[b]: https://github.com/lujun9972 +[1]: https://scarpetta.eu/pdfmixtool/ +[2]: https://itsfoss.com/pdf-editors-linux/ +[3]: https://news.itsfoss.com/pdf-arranger-1-7-release/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU3MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://news.itsfoss.com/qt-6-released/ +[7]: https://gitlab.com/scarpetta/pdfmixtool/-/blob/master/CHANGELOG.md +[8]: https://flathub.org/apps/details/eu.scarpetta.PDFMixTool +[9]: https://snapcraft.io/pdfmixtool +[10]: https://itsfoss.com/aur-arch-linux/ +[11]: https://gitlab.com/scarpetta/pdfmixtool +[12]: https://itsfoss.com/flatpak-guide/ +[13]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ +[14]: https://scarpetta.eu/pdfmixtool/#download From c97939d5b4c9e98fff03c640cddc4a42eff00e08 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 17 Jun 2021 08:35:23 +0800 Subject: [PATCH 096/870] Rename sources/news/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md to sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md --- ...me-like Browsers That Are Better Than Google Chrome in 2021.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => tech}/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md (100%) diff --git a/sources/news/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md b/sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md similarity index 100% rename from sources/news/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md rename to sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md From 0d3e1c5013926167503b79f1507524ec5410b817 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 17 Jun 2021 08:43:34 +0800 Subject: [PATCH 097/870] translated --- ...210610 Use cpulimit to free up your CPU.md | 93 ------------------- ...210610 Use cpulimit to free up your CPU.md | 93 +++++++++++++++++++ 2 files changed, 93 insertions(+), 93 deletions(-) delete mode 100644 sources/tech/20210610 Use cpulimit to free up your CPU.md create mode 100644 translated/tech/20210610 Use cpulimit to free up your CPU.md diff --git a/sources/tech/20210610 Use cpulimit to free up your CPU.md b/sources/tech/20210610 Use cpulimit to free up your CPU.md deleted file mode 100644 index 63c3c4aaae..0000000000 --- a/sources/tech/20210610 Use cpulimit to free up your CPU.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: subject: (Use cpulimit to free up your CPU) -[#]: via: (https://fedoramagazine.org/use-cpulimit-to-free-up-your-cpu/) -[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Use cpulimit to free up your CPU -====== - -![][1] - -Photo by [Henning Witzel][2] on [Unsplash][3] - -The recommended tool for managing system resources on Linux systems is [cgroups][4]. While very powerful in terms of what sorts of limits can be tuned (CPU, memory, disk I/O, network, etc.), configuring cgroups is non-trivial. The [_nice_][5] command has been available since 1973. But it only adjusts the scheduling priority among processes that are competing for time on a processor. The _nice_ command will not limit the percentage of CPU cycles that a process can consume per unit of time. The _[cpulimit][6]_ command provides the best of both worlds. It limits the percentage of CPU cycles that a process can allocate per unit of time and it is relatively easy to invoke. - -The _cpulimit_ command is mainly useful for long-running and CPU-intensive processes. Compiling software and converting videos are common examples of long-running processes that can max out a computer’s CPU. Limiting the CPU usage of such processes will free up processor time for use by other tasks that may be running on the computer. Limiting CPU-intensive processes will also reduce the power consumption, heat output, and possibly the fan noise of the system. The trade-off for limiting a process’s CPU usage is that it will require more time to run to completion. - -### Install cpulimit - -The _cpulimit_ command is available in the default Fedora Linux repositories. Run the following command to install _cpulimit_ on a Fedora Linux system. - -``` -$ sudo dnf install cpulimit -``` - -### View the documentation for cpulimit - -The cpulimit package does not come with a man page. Use the following command to view cpulimit’s built-in documentation. The output is provided below. But you may want to run the command on your own system in case the options have changed since this article was written. - -``` -$ cpulimit --help -Usage: cpulimit [OPTIONS…] TARGET - OPTIONS - -l, --limit=N percentage of cpu allowed from 0 to 800 (required) - -v, --verbose show control statistics - -z, --lazy exit if there is no target process, or if it dies - -i, --include-children limit also the children processes - -h, --help display this help and exit - TARGET must be exactly one of these: - -p, --pid=N pid of the process (implies -z) - -e, --exe=FILE name of the executable program file or path name - COMMAND [ARGS] run this command and limit it (implies -z) -``` - -### A demonstration - -To demonstrate using the _cpulimit_ command, a contrived, computationally-intensive Python script is provided below. The script is run first with no limit and then with a limit of 50%. It computes the value of the 42nd [Fibonacci number][7]. The script is run as a child process of the _time_ command in both cases to show the total time that was required to compute the answer. - -``` -$ /bin/time -f '(computed in %e seconds)' /bin/python -c 'f = lambda n: n if n<2 else f(n-1)+f(n-2); print(f(42), end=" ")' -267914296 (computed in 51.80 seconds) -$ /bin/cpulimit -i -l 50 /bin/time -f '(computed in %e seconds)' /bin/python -c 'f = lambda n: n if n<2 else f(n-1)+f(n-2); print(f(42), end=" ")' -267914296 (computed in 127.38 seconds) -``` - -You might hear the CPU fan on your PC rev up when running the first version of the command. But you should not when running the second version. The first version of the command is not CPU limited but it should not cause your PC to become bogged down. It is written in such a way that it can only use at most one CPU. Most modern PCs have multiple CPUs and can simultaneously run other tasks without difficulty when one of the CPUs is 100% busy. To verify that the first command is maxing out one of your processors, run the _top_ command in a separate terminal window and press the **1** key. Press the **Q** key to quit the _top_ command. - -Setting a limit above 100% is only meaningful on a program that is capable of [task parallelism][8]. For such programs, each increment of 100% represents full utilization of a CPU (200% = 2 CPUs, 300% = 3 CPUs, etc.). - -Notice that the **-i** option has been passed to the _cpulimit_ command in the above example. This is necessary because the command to be limited is not a direct child process of the _cpulimit_ command. Rather it is a child process of the _time_ command which in turn is a child process of the _cpulimit_ command. Without the **-i** option, _cpulimit_ would only limit the _time_ command. - -### Final notes - -If you want to limit a graphical application that you start from a desktop icon, copy the application’s _.desktop_ file (often located under the _/usr/share/applications_ directory) to your _~/.local/share/applications_ directory and modify the _Exec_ line accordingly. Then run the following command to apply the changes. - -``` -$ update-desktop-database ~/.local/share/applications -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/use-cpulimit-to-free-up-your-cpu/ - -作者:[Gregory Bartholomew][a] -选题:[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/glb/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/cpulimit-816x345.jpg -[2]: https://unsplash.com/@henning?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/speed-limit?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://en.wikipedia.org/wiki/Cgroups -[5]: https://en.wikipedia.org/wiki/Nice_(Unix) -[6]: https://github.com/opsengine/cpulimit -[7]: https://en.wikipedia.org/wiki/Fibonacci_number -[8]: https://en.wikipedia.org/wiki/Task_parallelism diff --git a/translated/tech/20210610 Use cpulimit to free up your CPU.md b/translated/tech/20210610 Use cpulimit to free up your CPU.md new file mode 100644 index 0000000000..6f90bb03ed --- /dev/null +++ b/translated/tech/20210610 Use cpulimit to free up your CPU.md @@ -0,0 +1,93 @@ +[#]: subject: (Use cpulimit to free up your CPU) +[#]: via: (https://fedoramagazine.org/use-cpulimit-to-free-up-your-cpu/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 cpulimit 来释放你的 CPU +====== + +![][1] + +由 [Henning Witzel][2] 拍摄,发布于 [Unsplash][3] + +在 Linux 系统上管理系统资源的推荐工具是 [cgroups][4]。虽然在可以调整的限制方面(CPU、内存、磁盘I/O、网络等)非常强大,但配置 cgroups 并不简单。[_nice_][5] 命令从 1973 年起就可以使用了。但它只是调整在一个处理器上竞争时间的进程之间的调度优先级。_nice_ 命令不会限制一个进程在单位时间内所能消耗的 CPU 周期的百分比。_[cpulimit][6]_ 命令提供了两个世界的最佳方案。它限制了一个进程在每单位时间内可以分配的 CPU 周期的百分比,而且相对容易调用。 + +_cpulimit_ 命令主要对长期运行的和 CPU 密集型的进程有用。编译软件和转换视频是长期运行的进程的常见例子,它们可以使计算机的 CPU 使用率达到最大。限制这类进程的 CPU 使用率将释放出处理器时间,供计算机上可能运行的其他任务使用。限制 CPU 密集型进程也将减少功耗及热输出,并可能减少系统的风扇噪音。限制一个进程的 CPU 使用率的代价是,它需要更多的时间来完成运行。 + +### 安装 cpulimit + +_cpulimit_ 命令在默认的 Fedora Linux 仓库中可用。运行下面的命令,在 Fedora Linux 系统上安装 _cpulimit_: + +``` +$ sudo dnf install cpulimit +``` + +### 查看 cpulimit 的文档 + +cpulimit 软件包并没有附带的手册页。使用下面的命令来查看 cpulimit 的内置文档。输出结果在下面提供。但你可能想在你自己的系统上运行该命令,以防止自本文编写以来选项发生变化。 + +``` +$ cpulimit --help +Usage: cpulimit [OPTIONS…] TARGET + OPTIONS + -l, --limit=N percentage of cpu allowed from 0 to 800 (required) + -v, --verbose show control statistics + -z, --lazy exit if there is no target process, or if it dies + -i, --include-children limit also the children processes + -h, --help display this help and exit + TARGET must be exactly one of these: + -p, --pid=N pid of the process (implies -z) + -e, --exe=FILE name of the executable program file or path name + COMMAND [ARGS] run this command and limit it (implies -z) +``` + +### 演示 + +为了演示 _cpulimit_ 命令的使用,下面提供了一个精心设计的、计算量很大的 Python 脚本。该脚本首先在没有限制的情况下运行,然后在限制为 50% 的情况下运行。它计算的是第 42 个[斐波那契数][7]的值。该脚本在两种情况下都作为 _time_ 命令的子进程运行,以显示计算答案所需的总时间。 + +``` +$ /bin/time -f '(computed in %e seconds)' /bin/python -c 'f = lambda n: n if n<2 else f(n-1)+f(n-2); print(f(42), end=" ")' +267914296 (computed in 51.80 seconds) +$ /bin/cpulimit -i -l 50 /bin/time -f '(computed in %e seconds)' /bin/python -c 'f = lambda n: n if n<2 else f(n-1)+f(n-2); print(f(42), end=" ")' +267914296 (computed in 127.38 seconds) +``` + +当运行第一个版本的命令时,你可能会听到电脑上的 CPU 风扇转动起来。但在运行第二个版本时,你应该不会。第一个版本的命令不受 CPU 的限制,但它不应该导致你的电脑陷入瘫痪。它是以这样一种方式编写的,它最多只能使用一个 CPU 核心。大多数现代 PC 都有多个 CPU 核心,当其中一个 CPU 100% 繁忙时,可以毫无困难地同时运行其他任务。为了验证第一条命令是否使你的一个处理器达到最大,在一个单独的终端窗口中运行 _top_ 命令并按下 **1**键。按 **Q** 键,退出 _top_ 命令。 + +设置高于 100% 的限制只对能够进行[任务并行化][8]的程序有意义。对于这样的程序,高于 100% 的增量代表一个 CPU 的全部利用率(200%=2 个CPU,300%=3 个CPU,等等)。 + +注意,在上面的例子中,**-i** 选项已经传递给 _cpulimit_ 命令。这是必要的,因为要限制的命令不是 _cpulimit_ 命令的直接子进程。相反,它是_time_命令的一个子进程,而后者又是 _cpulimit_ 命令的一个子进程。如果没有 **-i** 选项,_cpulimit_ 将只限制 _time_ 命令。 + +### 最后说明 + +如果你想限制一个从桌面图标启动的图形程序,请将该程序的 _.desktop_ 文件(通常位于 _/usr/share/applications_ 目录下)复制到你的 _~/.local/share/applications_ 目录下,并相应修改 _Exec_ 行。然后运行下面的命令来应用这些变化。 + +``` +$ update-desktop-database ~/.local/share/applications +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-cpulimit-to-free-up-your-cpu/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/cpulimit-816x345.jpg +[2]: https://unsplash.com/@henning?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/speed-limit?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://en.wikipedia.org/wiki/Cgroups +[5]: https://en.wikipedia.org/wiki/Nice_(Unix) +[6]: https://github.com/opsengine/cpulimit +[7]: https://en.wikipedia.org/wiki/Fibonacci_number +[8]: https://en.wikipedia.org/wiki/Task_parallelism From 846748ea004fab800d396357241eac5a82543411 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 17 Jun 2021 08:46:06 +0800 Subject: [PATCH 098/870] translating --- sources/tech/20210615 Build a static website with Eleventy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210615 Build a static website with Eleventy.md b/sources/tech/20210615 Build a static website with Eleventy.md index 0b58114659..f23d477ffd 100644 --- a/sources/tech/20210615 Build a static website with Eleventy.md +++ b/sources/tech/20210615 Build a static website with Eleventy.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/static-site-builder) [#]: author: (Nwokocha Wisdom https://opensource.com/users/wise4rmgod) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 13172a263802deddf0aca38d1f67c2e1bfc1c68e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 17 Jun 2021 13:17:38 +0800 Subject: [PATCH 099/870] PUB @geekpi https://linux.cn/article-13495-1.html --- ...Based Text Editor for Power Linux Users.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) rename {translated/tech => published}/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md (74%) diff --git a/translated/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md b/published/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md similarity index 74% rename from translated/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md rename to published/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md index 6ec636b651..6e71cd3c0e 100644 --- a/translated/tech/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md +++ b/published/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md @@ -3,16 +3,16 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13495-1.html) -Helix:为有经验的 Linux 用户提供的基于终端的文本编辑器 +Helix:高级 Linux 用户的终端文本编辑器 ====== -说到[基于终端的文本编辑器][1],通常是 Vim、Emacs 和 Nano 受到了关注。 +说到 [基于终端的文本编辑器][1],通常 Vim、Emacs 和 Nano 受到了关注。 -这并不意味着没有其他这样的文本编辑器。[Neovim][2],是 Vim 的现代增强版,是许多这样的例子之一。 +这并不意味着没有其他这样的文本编辑器。Vim 的现代增强版 [Neovim][2],是许多这样的例子之一。 按照同样的思路,我想介绍另一个基于终端的文本编辑器,叫做 Helix Editor。 @@ -20,11 +20,11 @@ Helix:为有经验的 Linux 用户提供的基于终端的文本编辑器 ![][3] -[Helix][4] 是用 Rust 编写的,使用 Tree-sitter 进行语法高亮。开发者声称,它比 regex 高亮更快,因为 Tree-sitter 像编译器一样将代码解析成语法树,从而给出更多的代码结构信息。 +[Helix][4] 是用 Rust 编写的,使用 Tree-sitter 进行语法高亮。开发者声称,它比正则表达式高亮更快,因为 Tree-sitter 像编译器一样将代码解析成语法树,从而给出更多的代码结构信息。 你可以跟踪局部变量,计算缩进和操作选择来选择语法节点。它足够强大,即使有语法错误也能产生结果。 -Helix 的主要重点是“多重选择”。这是以 [Kakoune][5] 为基础的。 +Helix 的主要亮点是“多重选择”,这是基于 [Kakoune][5] 的。 内置的语言服务器支持提供上下文感知补全、诊断和代码操作。 @@ -35,9 +35,7 @@ Helix 的主要重点是“多重选择”。这是以 [Kakoune][5] 为基础的 * [helix-bin][6]: 包含来自 GitHub 发布的预构建二进制文件 * [helix-git][7]: 构建该仓库的主分支 - - -作为一个 Arch 用户,我相信你可能已经知道[如何使用 AUR 安装应用][8]。 +作为一个 Arch 用户,我相信你可能已经知道 [如何使用 AUR 安装应用][8]。 对于其他 Linux 发行版,你必须使用 Cargo。Cargo 是 Rust 软件包管理器。有了它,你可以安装 Rust 包。可以认为它相当于 Python 的 PIP。 @@ -59,13 +57,13 @@ git clone --recurse-submodules --shallow-submodules -j8 https://github.com/helix cd helix ``` -现在用 cargo 来安装 Helix: +现在用 `cargo` 来安装 Helix: ``` cargo install --path helix-term --features "embed_runtime" ``` -最后一步是将 hx 二进制文件添加到 PATH 变量中,这样你就可以从任何地方运行它。这应该被添加到你的 bashrc 或 bash 配置文件中。 +最后一步是将 `hx` 二进制文件添加到 `PATH` 变量中,这样你就可以从任何地方运行它。这应该被添加到你的 `bashrc` 或 bash 配置文件中。 ``` export PATH=”$HOME/.cargo/bin:$PATH” @@ -75,7 +73,7 @@ export PATH=”$HOME/.cargo/bin:$PATH” 你可以在 Helix 的[文档页][9]上找到使用 Helix 的键盘快捷键: -[Helix 键盘快捷键][10] +- [Helix 键盘快捷键][10] 它与 Vim 或 Neovim 相比如何?我无法说。我可以用 Vim 进行基本的编辑,但我不是 Vim 忍者。如果你是一个信奉 Vim(或 Emacs)的人,请你试试 Helix 并自己判断。 @@ -86,7 +84,7 @@ via: https://itsfoss.com/helix-editor/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0b22005567c3c68afc914b848d38872dfa19430a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 18 Jun 2021 05:03:20 +0800 Subject: [PATCH 100/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210618=20?= =?UTF-8?q?How=20to=20Set=20Up=20Razer=20Devices=20on=20Linux=20for=20Ligh?= =?UTF-8?q?ting=20Effects=20and=20Other=20Configurations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md --- ...ghting Effects and Other Configurations.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md diff --git a/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md b/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md new file mode 100644 index 0000000000..d58655251b --- /dev/null +++ b/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md @@ -0,0 +1,142 @@ +[#]: subject: (How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations) +[#]: via: (https://itsfoss.com/set-up-razer-devices-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations +====== + +You have a shiny new Razer hardware, but you cannot find the Razer Synapse software for Linux. And you end up with no proper RGB sync and do not get to customize it. What do you do? + +Well, for certain functionalities, like adding macros to your mouse, you will still need access to Razer Synapse (on Windows or macOS). + +But, to tweak a few other options like macros for the keyboard, changing the DPI of your mouse, or lighting effects, you can easily set up your Razer peripherals on Linux. + +![My Razer Basilisk V2 with lighting effect][1] + +Here are sme pictures of both the mouse and the mouse pad. It’s the same setup but with different lighting schemes. Click on the images to see bigger images. + +![][2] + +![][3] + +![][4] + +Razer Basilisk is a good gaming mouse. If you want you can order it from Amazon or get it from your local store. + +SaleBestseller No. 1 + +![Razer Basilisk v2 Wired Gaming Mouse: 20K DPI Optical Sensor, Fastest Gaming Mouse Switch, Chroma RGB Lighting, 11 Programmable Buttons, Classic Black][5] + +![Razer Basilisk v2 Wired Gaming Mouse: 20K DPI Optical Sensor, Fastest Gaming Mouse Switch, Chroma RGB Lighting, 11 Programmable Buttons, Classic Black][5] + +[Razer Basilisk v2 Wired Gaming Mouse: 20K DPI Optical Sensor, Fastest Gaming Mouse Switch, Chroma RGB Lighting, 11 Programmable Buttons, Classic Black][6] + +$49.99 [][7] + +If you already own a Razer device, let me show the steps to configure it just like what I did here. + +### Step 1. Install OpenRazer + +**OpenRazer** is an open-source driver to make Razer hardware work on Linux. It supports several functionalities to customize and control your devices, including RGB mousemats. + +While this is not an official driver for Linux, it works quite well for a wide range of devices. + +**It offers support for a variety of Linux distributions that include Solus, openSUSE, Fedora, Debian, Arch Linux, Ubuntu, and a few others.** + +Here, I will be focusing on the steps to install it on any Ubuntu-based distro, you may want to refer to the [official instructions][8] for other distros. + +You need to install OpenRazer [using a PPA][9] on Ubuntu, here’s how to do that: + +``` +sudo apt install software-properties-gtk +sudo add-apt-repository ppa:openrazer/stable +sudo apt update +sudo apt install openrazer-meta +``` + +It also offers a [daemon][10] as well, you can choose to make it work, you will be adding your user to the **plugdev** group — which gives privileged access to the device: + +``` +sudo gpasswd -a $USER plugdev +``` + +I did not need to configure/add a daemon using the above command, but I can still use the devices just fine. The daemon mostly ensures that the driver stays active. + +[Download OpenRazer][11] + +### Stpe 2. Install a GUI to Manage and Tweak Options + +Now that the driver has been installed, all you need is a graphical user interface (GUI) to help you customize your Razer hardware. + +You can find a few options available out there, but I will recommend installing [Polychromatic][12], which offers an attractive UI and works well as well. + +![][13] + +Polychromatic app is the closest I could recommend to Razer Synapse, and it works good. + +For Ubuntu-based distros, all you need to do is install it using PPA: + +``` +sudo add-apt-repository ppa:polychromatic/stable +sudo apt update +sudo apt install polychromatic +``` + +You can find it listed in [AUR][14] for Arch Linux users. For more installation instructions, you can refer to the [official download page][15]. + +[Download Polychromatic][16] + +While you will get distinct set of options for various devices. Here, I tried changing the DPI, customizing the color cycle, and the polling rate of my Razer Basilisk v2 mouse and it worked completely fine. + +![Customization options for a mouse][17] + +It also offers you the ability to easily restart or stop the [daemon][10], change the applet icon, and perform advanced configuration options if you know what you want to do. + +Alternatively, you can try [RazerGenie][18], [Snake][19], or [OpenRGB][20] (meant for changing the colors) to tweak the mouse color or any other settings. + +### Wrapping Up + +Now that you can easily customize your Razer hardware, hope you have fun! + +While you may find some other options to configure your Razer devices, I did not find any other options that work very well. + +If you have come across something that works and that deserves a mention here for all the Razer users, let me know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/set-up-razer-devices-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Razer-Basilisk-V2.jpg?resize=800%2C600&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-3-com.jpg?resize=800%2C600&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-2-com.jpg?resize=800%2C600&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-1-com.jpg?resize=800%2C600&ssl=1 +[5]: https://i1.wp.com/m.media-amazon.com/images/I/31WrG8CTRHL._SL160_.jpg?ssl=1 +[6]: https://www.amazon.com/dp/B082G5BDNC?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1&keywords=Razer%20Basilisk%20V2 (Razer Basilisk v2 Wired Gaming Mouse: 20K DPI Optical Sensor, Fastest Gaming Mouse Switch, Chroma RGB Lighting, 11 Programmable Buttons, Classic Black) +[7]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[8]: https://openrazer.github.io/#download +[9]: https://itsfoss.com/ppa-guide/ +[10]: https://itsfoss.com/linux-daemons/ +[11]: https://openrazer.github.io/ +[12]: https://polychromatic.app +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/polychromatic-app-1.png?resize=800%2C500&ssl=1 +[14]: https://itsfoss.com/aur-arch-linux/ +[15]: https://polychromatic.app/download/ +[16]: https://polychromatic.app/ +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-basilisk-polychromatic.png?resize=800%2C505&ssl=1 +[18]: https://github.com/z3ntu/RazerGenie +[19]: https://github.com/bithatch/snake +[20]: https://itsfoss.com/openrgb/ From ffaa84c00e3131c28d308470db26b7cc35048dca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 18 Jun 2021 05:03:46 +0800 Subject: [PATCH 101/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210617=20?= =?UTF-8?q?Refactor=20your=20applications=20to=20Kubernetes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210617 Refactor your applications to Kubernetes.md --- ...efactor your applications to Kubernetes.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/tech/20210617 Refactor your applications to Kubernetes.md diff --git a/sources/tech/20210617 Refactor your applications to Kubernetes.md b/sources/tech/20210617 Refactor your applications to Kubernetes.md new file mode 100644 index 0000000000..4e41b3bb01 --- /dev/null +++ b/sources/tech/20210617 Refactor your applications to Kubernetes.md @@ -0,0 +1,190 @@ +[#]: subject: (Refactor your applications to Kubernetes) +[#]: via: (https://opensource.com/article/21/6/tackle-diva-kubernetes) +[#]: author: (Yasu Katsuno https://opensource.com/users/yasu-katsuno) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Refactor your applications to Kubernetes +====== +Tackle-DiVA helps developers understand database operations and +transaction processes inside applications. +![Tips and gears turning][1] + +Application modernization developers must be able to understand database operations and transaction processes inside applications precisely. [Tackle-DiVA][2] (Data-intensive Validity Analyzer) is an open source data-centric Java application analysis tool in the [Konveyor Tackle project][3] that aims at refactoring applications to Kubernetes. + +This article gives an overview of Tackle-DiVA and presents example instructions and analysis results. + +### What is Tackle-DiVA? + +Tackle-DiVA is built using Java and Python and operated using a command-line interface. It imports target Java application source files and provides analysis results as files. + +![Tackle-DiVA operation][4] + +(Yasuharu Katsuno, [CC BY-SA 4.0][5]) + +Breaking down this diagram: + + * **Service entry inventory** analysis extracts a list of Java classes for implementing public APIs. + * **Database inventory** analysis exports a list of database tables operated by an application. + * **Transaction inventory** extracts a set of transaction processes. + * **Code-to-database dependency** analyzes which Java class operates which database table. + * The **database-to-database** and **transaction-to-transaction dependency** analyses find clues for transforming parallel executions. + * Finally, **transaction refactoring recommendation** analysis shows parallel executable transactions from original sequential executions. + + + +### Try it out! + +It is easy to get started with Tackle-DiVA. It makes full use of [Docker][6] containers, and the only prerequisite is a Docker-runnable environment, such as RedHat Enterprise Linux, Ubuntu, or macOS. + +Once you have Docker available on your machine, run: + + +``` +$ cd /tmp +$ git clone && tackle-diva +$ docker build . -t diva +``` + +This builds Tackle-DiVA and packs it as a Docker image. Tackle-DiVA is now ready to use on your machine. + +The next step is to prepare source codes of your target Java applications. I'll use the [DayTrader][7] application as an example: + + +``` +$ cd /tmp +$ git clone +``` + +The final step is to execute the `diva_docker` command by attaching the full directory path: + + +``` +$ cd /tmp/tackle-diva/distrib/bin/ +$ ./diva_docker /tmp/sample.daytrader7/ +``` + +This creates the `tackle-diva/distrib/output` directory and stores the analysis result files: + + +``` +$ ls /tmp/tackle-diva/distrib/output +contexts.yml            transaction.json        transaction_summary.dot +database.json           transaction.yml         transaction_summary.pdf +``` + +### Explore the analysis results + +Take a look at some analysis results for the DayTrader application. + +The **service entry inventory** result is stored in the `contexts.yml` file. It finds that the `TradeAppServlet.init class/method` plays a key role in service entries for the `login` and `register` actions: + + +``` +\- entry: +   methods: +  - "com.ibm.websphere.samples.daytrader.web.TradeAppServlet.init" + http-param: +   action: +  - "login" +\- entry: +   methods: +  - "com.ibm.websphere.samples.daytrader.web.TradeAppServlet.init" + http-param: +   action: +  - "register" +``` + +The **database inventory** analysis exports six database tables in the `database.json` file. These tables are used in the DayTrader application: + + +``` +{ + "/app": [ +   "orderejb", +   "holdingejb", +   "quoteejb", +   "accountejb", +   "keygenejb", +   "accountprofileejb" + ] +} +``` + +The **transaction inventory** analysis result is dumped into the `transaction.json` and `.yml` files, but it's better to check the `transaction_summary.pdf` file when looking through transactions. The following transaction consists of six SQL operations to two database tables: `holdingejb` and `orderejb`: + +![Tackle-DiVA transaction inventory][8] + +(Yasuharu Katsuno, [CC BY-SA 4.0][5]) + +The `transaction.json` and `.yml` files also contain **code-to-database dependency** analysis results. The following shows how the TradeDirect class invokes query operations to two database tables, `accountprofileejb` and `accountejb`: + + +``` +"stacktrace" : [ +  ... +  { +  "method" : "<src-method: < Source, +              Lcom/ibm/websphere/samples/daytrader/direct/TradeDirect, +              getStatement(Ljava/sql/Connection;Ljava/lang/String;) +              Ljava/sql/PreparedStatement; >>", +  "file" : "/app/daytrader-ee7-ejb/src/ +            main/java/com/ibm/websphere/ +            samples/daytrader/direct/TradeDirect.java", +  "position" : "TradeDirect.java [1935:15] -> [1935:41]" +  } +], +"sql" : "select * from accountprofileejb ap where ap.userid = ( +            select profile_userid from accountejb a where a.profile_userid=?)" +``` + +The **database-to-database dependency** analysis result is located in the `transaction_summary.dot `and `.pdf` files. The `accoutprofileejb` and `accoutejb` database tables have a mutual-query relationship: + +![Tackle-DiVA database-to-database dependency][9] + +(Yasuharu Katsuno, [CC BY-SA 4.0][5]) + +The **transaction-to-transaction dependency** analysis results are found in the `transaction_summary.dot` and `.pdf` files. Two transactions have a dependency on the `orderejb` database table. The upper transaction updates the table, and the lower transaction queries it: + +![Tackle-DiVA transaction-to-transaction dependency][10] + +(Yasuharu Katsuno, [CC BY-SA 4.0][5]) + +Finally, parallel executable transactions are shown in the `transaction_summary.dot` and `.pdf` files, resulting from the **transaction refactoring recommendation** analysis. In this example, two transactions in the lower part can be executed in parallel after the upper transaction processing completes, which helps keep data consistency due to no transaction dependencies: + +![Tackle-DiVA transaction refactoring recommendation][11] + +(Yasuharu Katsuno, [CC BY-SA 4.0][5]) + +### Learn more + +To learn more about application refactoring, check out the [Konveyor Tackle site][12], join the community, and access the source code on [GitHub][2]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/tackle-diva-kubernetes + +作者:[Yasu Katsuno][a] +选题:[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/yasu-katsuno +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://github.com/konveyor/tackle-diva +[3]: https://www.konveyor.io/tackle +[4]: https://opensource.com/sites/default/files/uploads/tackle-diva_operation.png (Tackle-DiVA operation) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/resources/what-docker +[7]: https://github.com/WASdev/sample.daytrader7 +[8]: https://opensource.com/sites/default/files/uploads/tackle-diva_transaction-inventory.png (Tackle-DiVA transaction inventory) +[9]: https://opensource.com/sites/default/files/uploads/tackle-diva_dbtodb.png (Tackle-DiVA database-to-database dependency) +[10]: https://opensource.com/sites/default/files/uploads/tackle-diva_ttot.png (Tackle-DiVA transaction-to-transaction dependency) +[11]: https://opensource.com/sites/default/files/uploads/tackle-diva_transaction-refactoring.png (Tackle-DiVA transaction refactoring recommendation) +[12]: https://github.com/konveyor/tackle From 69b368835ff295939da83a64c6fff31da2a8cb86 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 18 Jun 2021 05:04:02 +0800 Subject: [PATCH 102/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210617=20?= =?UTF-8?q?Linux=20package=20management=20with=20dnf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210617 Linux package management with dnf.md --- ...10617 Linux package management with dnf.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20210617 Linux package management with dnf.md diff --git a/sources/tech/20210617 Linux package management with dnf.md b/sources/tech/20210617 Linux package management with dnf.md new file mode 100644 index 0000000000..5aa3c827b4 --- /dev/null +++ b/sources/tech/20210617 Linux package management with dnf.md @@ -0,0 +1,182 @@ +[#]: subject: (Linux package management with dnf) +[#]: via: (https://opensource.com/article/21/6/dnf-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux package management with dnf +====== +Learn how to install packages on Linux with the dnf command, then +download our cheat sheet to keep the right command at your fingertips. +![Package wrapped with brown paper and red bow][1] + +Installing an application on a computer system is pretty simple. You copy files from an archive (like a .zip file) onto the target computer in a place the operating system expects there to be applications. Because many of us are accustomed to having fancy installer "wizards" to help us get software on our computers, the process seems like it should be technically more complex than it is. + +What _is_ complex, though, is the issue of what makes up an application. What users think of as a single application actually contains code borrowing from software libraries (i.e., `.so` files on Linux, `.dll` files on Windows, and `.dylib` on macOS) scattered throughout an operating system. + +So that users don't have to worry about that veritable matrix of interdependent code, Linux uses a **package management system** to track what application needs what library, and which library or application has security or feature updates, and what extra data files were installed with each software title. A package manager is, essentially, an installer wizard. They're easy to use, they provide both graphical interfaces and terminal-based interfaces, and they make your life easier. The better you know your distribution's package manager, the easier your life gets. + +### Installing applications on Linux + +If you're a casual desktop user who wants to install an application on Linux, then you may be looking for [GNOME Software][2], a desktop application browser. + +![Image of the GNOME Software application][3] + +It works as you'd expect: You click through its interface until you find an application that seems like it would be useful, and then you click the **Install** button. + +Alternately, you can open `.rpm` or `.flatpakref` packages downloaded from the web in GNOME Software for it to install them for you. + +If you're inclined toward controlling your computer with typed commands, read on! + +### Finding software with dnf + +Before you can install an application, you may need to confirm that it exists on your distribution's servers. Usually, searching for the common name of an application with `dnf` suffices. For instance, say you recently read [an article about Cockpit][4] and decide you want to try it. You could search for `cockpit` to verify that your distribution includes it: + + +``` +$ dnf search cockpit + Last metadata expiration check: 0:01:46 ago on Tue 18 May 2021 19:18:15 NZST. + ==== Name Exactly Matched: cockpit ==== + cockpit.x86_64 : Web Console for Linux servers + +==== Name & Summary Matched: cockpit == + cockpit-bridge.x86_64 : Cockpit bridge server-side component + cockpit-composer.noarch : Composer GUI for use with Cockpit + [...] +``` + +There's an exact match. The package listed as a match is called `cockpit.x86_64`, but the `.x86_64` part of the name only denotes the CPU architecture it's compatible with. By default, your system installs packages with matching CPU architectures, so you can ignore that extension. Therefore, you've confirmed that the package you're looking for is indeed called simply `cockpit`. + +Now you can confidently install it with `dnf install`. This step requires administrative privileges: + + +``` +`$ sudo dnf install cockpit` +``` + +More often than not, that's the typical `dnf` workflow: search and install. + +Sometimes, however, the results of `dnf search` aren't clear to you, or you want more information about a package than just its common name. There are a few relevant `dnf` subcommands, depending on what information you're after. + +### Package metadata + +If you feel like your search got you _close_ to the package you want, but you're just not sure yet, it's often helpful to take a look at the package's metadata, such as the project's URL and description. To get this info, use the pleasantly intuitive `dnf info` command: + + +``` +$ dnf info terminator +Available Packages +Name         : terminator +Version      : 1.92 +Release      : 2.el8 +Architecture : noarch +Size         : 526 k +Source       : terminator-1.92-2.el8.src.rpm +Repository   : epel +Summary      : Store and run multiple GNOME terminals in one window +URL          : +License      : GPLv2 +Description  : Multiple GNOME terminals in one window.  This is a project to produce +             : an efficient way of filling a large area of screen space with +             : terminals. This is done by splitting the window into a resizeable +             : grid of terminals. As such, you can  produce a very flexible +             : arrangements of terminals for different tasks. +``` + +This info dump tells you the version of the available package, which repository registered with your system provides it, the project's website, and a long description of what it does. + +### What package provides a file? + +Package names don't always match what you're looking for. For instance, suppose you're reading documentation telling you that you must install something called `qmake-qt5`: + + +``` +$ dnf search qmake-qt5 +No matches found. +``` + +The `dnf` database is extensive, so you don't have to restrict yourself to searches for exact matches. You can use the `dnf provides` command to learn whether anything provides what you're looking for as part of some larger package: + + +``` +$ dnf provides qmake-qt5 +qt5-qtbase-devel-5.12.5-8.el8.i686 : Development files for qt5-qtbase +Repo        : appstream +Matched from: +Filename    : /usr/bin/qmake-qt5 + +qt5-qtbase-devel-5.15.2-3.el8.x86_64 : Development files for qt5-qtbase +Repo        : appstream +Matched from: +Filename    : /usr/bin/qmake-qt5 +``` + +This confirms that the application `qmake-qt5` is a part of a package named `qt5-qtbase-devel`. It also tells you that the application gets installed to `/usr/bin`, so you know exactly where to find it once it's installed. + +### What files are included in a package? + +There are times when I find myself approaching `dnf` from a different angle entirely. Sometimes, I've already confirmed that an application is installed on my system; I just can't figure out how I got it. Other times, I know I have a specific package installed, but I'm not clear on exactly what that package put on my system. + +If you ever need to "reverse engineer" a package's payload, you can use the `dnf repoquery` command along with the `--list` option. This looks at the repository's metadata about a package and returns a list of all files provided by that package: + + +``` +$ dnf repoquery --list qt5-qtbase-devel +/usr/bin/fixqt4headers.pl +/usr/bin/moc-qt5 +/usr/bin/qdbuscpp2xml-qt5 +/usr/bin/qdbusxml2cpp-qt5 +/usr/bin/qlalr +/usr/bin/qmake-qt5 +/usr/bin/qvkgen +/usr/bin/rcc-qt5 +[...] +``` + +These lists can get long, so it helps to pipe the command through `less` or your favorite pager. + +### Removing an application + +Should you decide you no longer need an application installed on your system, you can use `dnf remove` to uninstall it, all of the files that were installed as part of its package, and any dependencies that are no longer necessary: + + +``` +`$ dnf remove bigapp` +``` + +Sometimes, dependencies get installed with one app and are later found useful by some other application you install. In the event that two packages require the same dependency, `dnf remove` does _not_ remove the dependency. It's not unheard of to end up with a stray package here and there after installing and uninstalling lots of applications. About once a year, I perform a `dnf autoremove` to clear out any unused packages: + + +``` +`$ dnf autoremove` +``` + +This isn't necessary, but it's a housecleaning step that makes me feel better about my computer. + +### Getting to know dnf + +The more you know about how your package manager works, the easier it is for you to install and query applications when necessary. Even if you're not a regular `dnf` user, it can be useful to know it when you find yourself interfacing with an RPM-based distro. + +Having graduated from `yum`, one of my favorite package managers is the `dnf` command. While I don't love all its subcommands, I find it to be one of the more robust package management systems out there. [**Download our `dnf` cheat sheet**][5] to get used to the command, and don't be afraid to try some new tricks with it. Once you get familiar with it, you might find it hard to use anything else. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/dnf-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brown-package-red-bow.jpg?itok=oxZYQzH- (Package wrapped with brown paper and red bow) +[2]: https://wiki.gnome.org/Apps/Software +[3]: https://opensource.com/sites/default/files/gnome-software.png (The GNOME Software app) +[4]: https://opensource.com/article/20/11/cockpit-server-management +[5]: https://opensource.com/downloads/dnf-cheat-sheet From 19f0185051884dbe709983a5b98e78c5e9fd6a56 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 18 Jun 2021 05:04:18 +0800 Subject: [PATCH 103/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210617=20?= =?UTF-8?q?Why=20FreeDOS=20has=2016=20colors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210617 Why FreeDOS has 16 colors.md --- .../20210617 Why FreeDOS has 16 colors.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/tech/20210617 Why FreeDOS has 16 colors.md diff --git a/sources/tech/20210617 Why FreeDOS has 16 colors.md b/sources/tech/20210617 Why FreeDOS has 16 colors.md new file mode 100644 index 0000000000..60e6790e11 --- /dev/null +++ b/sources/tech/20210617 Why FreeDOS has 16 colors.md @@ -0,0 +1,128 @@ +[#]: subject: (Why FreeDOS has 16 colors) +[#]: via: (https://opensource.com/article/21/6/freedos-sixteen-colors) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why FreeDOS has 16 colors +====== +Why does text only come in this limited palette, and why does FreeDOS +use those colors and shades, instead of some other colors? The answer, +like many things in technology, is because of history. +![Person typing on a 1980's computer][1] + +If you've looked carefully at FreeDOS, you've probably noticed that text only comes in a limited range of colors—sixteen text colors, and eight background colors. This is similar to how Linux displays text color—you might be able to change _what text colors are used_ in a Linux terminal, but you're still stuck with just sixteen text colors and eight background colors. + +![terminal colors][2] + +DOS text comes in 16 colors and 8 background colors +(Jim Hall, [CC-BY SA 4.0][3]) + +Why does text only come in this limited palette, and why does FreeDOS use _those_ colors and shades, instead of some other colors? The answer, like many things in technology, is because of _history_. + +### The origins of PC color + +To explain why text only comes in sixteen colors, let me tell you a story about the first IBM Personal Computer. Parts of this story may be somewhat apocryphal, but the basics are close enough. + +IBM released the Personal Computer 5150 (the "IBM PC") in 1981. The PC used a simple monitor screen that displayed text in green. Because this display only worked with one color, it was dubbed _monochrome_ (the "IBM 5151 monochrome display," with the IBM Monochrome Display Adapter card, or "MDA"). + +That same year, IBM released an updated version of the PC that sported an amazing technical achievement—color! The new IBM 5153 color display relied on a new IBM Color Graphics Adapter, or "CGA." And it is because of this original CGA that all DOS text inherited their colors. + +But before we go there, we first need to understand something about color. When we talk about colors on a computer screen, we're talking about mixing different values of the three _primary_ light colors—red, green, and blue. You can mix together different levels (or "brightnesses") of red, green, and blue light to create almost any color. Mix just red and blue light, and you get magenta. Mix blue and green, and you get cyan or aqua. Mix all colors equally, and you get white. Without any light colors, you see black (an absence of color). + +![light colors][4] + +Mix red, green, and blue light to get different colors +(Jim Hall, [CC-BY SA 4.0][3]) + +The IBM 5153 color display presented color to the user by lighting up tiny red, green, and blue phosphor dots on a cathode ray tube (a "CRT"). These tiny dots were arranged very close together and in a pattern where a triad of red, green, and blue dots would form a "pixel." By controlling which phosphor dots were lit at one time, the IBM 5153 color display could show different colored pixels. + +![CRT pixels][5] + +Each red, green, and blue triad is a single pixel +(Jim Hall, [CC-BY SA 4.0][3]) + +By the way, even modern displays use this combination of red, green, and blue dots to represent colors. The difference in modern computers is that instead of tiny phosphor dots, each pixel uses a triad of red, green, and blue LED lights—usually arranged side by side. The computer can turn each LED light on or off to mix the red, green, and blue colors in each pixel. + +![LCD pixels][6] + +Each red, green, and blue triad is a single pixel +(Jim Hall, [CC-BY SA 4.0][3]) + +### Defining CGA colors + +The IBM engineers realized they could display several colors by mixing each red, green, and blue pixels. In the simplest case, you could assume each red, green, and blue dot in a single-pixel was either "on" or "off." And as any computer programmer will tell you, you can represent "on" and "off" as binary—ones (1=on) and zeroes (0=off). + +Representing red, green, and blue with ones or zeroes means you can combine up to eight colors, from 000 (red, green, and blue are all off) to 111 (red, green, and blue are all on). Note that the bit pattern goes like "RGB," so RGB=001 is blue (only blue is on) and RGB=011 is cyan (both green and blue are on): + +| | | | | ----------- | | | 000 Black | | | 001 Blue | | | 010 Green | | | 011 Cyan | | | 100 Red | | | 101 Magenta | | | 110 Yellow | | | 111 White | + +But that's just the simplest case. A particularly clever IBM engineer realized you could double the number of colors from eight to sixteen simply by adding another bit. So instead of a bit pattern like RGB, we can use a bit pattern like iRGB. We'll call this extra "i" bit the "intensity" bit because if we set the "intensity" bit to 1 (on), then we'll light up the red, green, and blue phosphor dots at full brightness; if the "intensity" bit is 0 (off) we can use some mid-level brightness. + +And with that simple fix, now CGA could display sixteen colors! For the sake of simplicity, the IBM engineers referred to the high-intensity colors as the "bright" versions of the regular color names. So "red" pairs with "bright red," and "magenta" pairs with "bright magenta." + +| | | | | | | ------------ | | ------------------- | | | 0000 Black | | 1000 Bright Black | | | 0001 Blue | | 1001 Bright Blue | | | 0010 Green | | 1010 Bright Green | | | 0011 Cyan | | 1011 Bright Cyan | | | 0100 Red | | 1100 Bright Red | | | 0101 Magenta | | 1101 Bright Magenta | | | 0110 Yellow | | 1110 Bright Yellow | | | 0111 White | | 1111 Bright White | + +Oh no! But wait! This isn't actually sixteen colors. If you notice iRGB=0000 (black) and iRGB=1000 (bright black), they are both the same _black_. There's no color to make "bright," so they are just both regular black. This means we only have fifteen colors, not the sixteen we were hoping for. + +But IBM has clever engineers working for them, and they realized how to fix this to get sixteen colors. Rather than implement a straight RGB to iRGB, IBM actually implemented a _modified_ iRGB scheme. With this change, IBM set four levels of brightness for each phosphor dot: completely off, one-third brightness, two-thirds brightness, and full brightness. If the "intensity" bit was turned off, then each red, green, and blue phosphor dot would light up at two-thirds brightness. If you set the "intensity" bit on, any zeroes in the RGB colors would be lit at one-third brightness, and any ones in the RGB colors would be lit at full brightness. + +Let me describe this to you another way, using web color code representation. If you are familiar with the HTML colorspace, you probably know that you can represent colors using #RGB, where RGB represents a combination of red, green, and blue values, each between the hexadecimal values 0 through F. So using IBM's modified iRGB definition, iRGB=0001 is #00a (blue) and iRGB=1001 is #55f (bright blue) because with high-intensity colors, all zeroes in RGB=001 are lit at one-third brightness (around "5" on the 0 to F scale) and all ones in RGB=001 are lit at two-third brightness (about "A" on the 0 to F scale). + +| | | | | | | ------------ | | ------------------- | | | 0000 Black | | 1000 Bright Black | | | 0001 Blue | | 1001 Bright Blue | | | 0010 Green | | 1010 Bright Green | | | 0011 Cyan | | 1011 Bright Cyan | | | 0100 Red | | 1100 Bright Red | | | 0101 Magenta | | 1101 Bright Magenta | | | 0110 Yellow | | 1110 Bright Yellow | | | 0111 White | | 1111 Bright White | + +And with those colors, we are finally done! We have a full spectrum of colors from iRGB=0000 (black) to iRGB=1111 (bright white) and every color in between. Like a rainbow of colors, this is beautiful. + +Except, no. Wait. Something's wrong here. We can't actually replicate all of the colors of the rainbow yet. The handy mnemonic we learned in grade school was ROYGBIV, to help us remember that a rainbow has colors from red, orange, yellow, green, blue, indigo, and violet. Our modified iRGB color scheme includes red, yellow, green, and blue—and we can "fake" it for indigo and "violet." But we're missing orange. Oh no! + +![rainbow][7] + +A beautiful rainbow - which unfortunately contains orange  +([Paweł Fijałkowski][8], public domain) + +To fix this, the smart IBM engineers made one final fix for RGB=110. The high-intensity color (iRGB=1110) lit up the red and green phosphor dots at full brightness to make yellow. But at the low-intensity color (iRGB=0110), they lit the red at two-thirds brightness and the green at one-third brightness. This turned iRGB=0110 into an orange color—although it was later dubbed "brown" because IBM had to mess up the standard names somewhere. + +| | | | | | | ------------ | | ------------------- | | | 0000 Black | | 1000 Bright Black | | | 0001 Blue | | 1001 Bright Blue | | | 0010 Green | | 1010 Bright Green | | | 0011 Cyan | | 1011 Bright Cyan | | | 0100 Red | | 1100 Bright Red | | | 0101 Magenta | | 1101 Bright Magenta | | | 0110 Brown | | 1110 Yellow | | | 0111 White | | 1111 Bright White | + +And that's how CGA—and by extension, DOS—got the sixteen colors! And in case you're curious, that's also why there's a "bright black" color, even though it's just a shade of gray. + +### Representing colors (bits and bytes) + +But you may wonder: why can DOS only display eight background colors if it can display sixteen text colors? For that, we need to take a quick diversion into how computers passed color information to the CGA card. + +In brief, the CGA card expected each character's text color and background color to be encoded in a single byte packet. That's eight bits. So where do the eight bits come from? + +We just learned how iRGB (four bits) generates the sixteen colors. Text color uses iRGB, or four bits. The background color is limited to the eight low-intensity colors (RGB, or three bits). Together, that makes only seven bits. Where is the missing eighth bit? + +The final bit was reserved for perhaps the DOS era's most important user interface element—blinking text. While the blinking text might be annoying today, throughout the early 1980s, blinking text was the friendly way to represent critical information such as error messages. + +Adding this "blink" bit to the three background color bits (RGB) and the four text color bits (iRGB) makes eight bits or a byte! Computers like to count in full bytes, making this a convenient way to package color (and blink) information to the computer. + +Thus, the full byte to represent color (and blink) was `Bbbbffff`, where `ffff` is the iRGB bit pattern for the text color (from 0 to 15), `bbb` is the RGB bit pattern for the low-intensity background color (from 0 to 7), and `B` is the "blink" bit. + +The limit of sixteen text colors and eight background colors continues to this day. Certainly, DOS is stuck with this color palette, but even Linux terminal emulators like GNOME Terminal remain constrained to sixteen text colors and eight background colors. Sure, a Linux terminal might let you change the specific colors used, but you're still limited to sixteen text colors and eight background colors. And for that, you can thank DOS and the original IBM PC. You're welcome! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-sixteen-colors + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://opensource.com/sites/default/files/uploads/16colors.png (DOS text comes in 16 colors and 8 background colors) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/rgb.svg_.png (Mix red, green, and blue light to get different colors) +[5]: https://opensource.com/sites/default/files/uploads/crt.svg_.png (Each red, green, and blue triad is a single pixel) +[6]: https://opensource.com/sites/default/files/uploads/lcd.svg_.png (Each red, green, and blue triad is a single pixel) +[7]: https://opensource.com/sites/default/files/uploads/rainbow.jpg (A beautiful rainbow - which unfortunately contains orange ) +[8]: https://www.pexels.com/photo/landscape-photography-of-field-with-wind-mill-with-rainbow-1253748/ From 6fd55cccea4074e1414bf4ba401c1b85632aef2f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 18 Jun 2021 05:04:54 +0800 Subject: [PATCH 104/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210617=20?= =?UTF-8?q?elementary=20OS=206=20Beta=202=20is=20the=20First=20Step=20to?= =?UTF-8?q?=20Have=20Flatpak=20Apps=20Out-of-the-box?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md --- ...tep to Have Flatpak Apps Out-of-the-box.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md diff --git a/sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md b/sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md new file mode 100644 index 0000000000..065429576a --- /dev/null +++ b/sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md @@ -0,0 +1,95 @@ +[#]: subject: (elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box) +[#]: via: (https://news.itsfoss.com/elementary-os-6-beta-2-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box +====== + +elementary OS 6 “Odin” [beta release][1] gave us a sneak peek on a variety of interesting things that are in motion for the final release. + +Now, the second beta release, i.e. **elementary OS 6 Beta 2** is starting to make sense of the ambitious plans that the development team has for the stable release soon. + +This release is meant for testing and development, do not install it on your production system. + +### What’s New in elementary OS 6 Beta 2? + +elementary OS 6 beta 2 brings in three major key upgrades along with under-the-hood improvements. + +First, the improvements to the installer. + +There are a few UI tweaks to the installer for a cleaner and consistent look. You will also find a subtle animation with the installation progress instead of a static icon. + +![Credits: elementary OS Blog][2] + +If you have been using the first beta, you will need to re-install for proper testing. The installer window did not resize, which was a problem for me to test using a virtual machine setup. + +The next major highlight is the **addition of first party Flatpak applications**. While they already made it clear that they want to transition to Flatpak packages for any pre-installed apps, now they are finally making progress. + +![][3] + +As mentioned in the beta 2 [release announcement][4]: + +> elementary OS 6 now comes with Calculator, Camera, Document Viewer, Screenshot, Tasks, and Web from the AppCenter Flatpak repository. + +So, you should expect more first-party applications to embrace Flatpak packaging. It will also make its way to third-party applications available in the App Center (which the developers can follow to make their applications available as a Flatpak package). + +Of course, this may also encourage other distributions to adopt Flatpak applications to provide a secure sandbox experience out of the box. + +The last important addition with this release is the **ability to add online accounts from the System settings**. + +You can add both mail and calendar accounts, note that both IMAP and CalDav standards are supported. + +Once you add the accounts, it will show up in apps like Calendar, Tasks, and Mail making the experience seamless. + +#### Other Improvements + +![][5] + +Along with several under-the-hood improvements, other significant changes include: + + * Improved notification system that supports icon badges and action buttons + * Updating the documentation before the final release + * Web supports dark style theme + + + +For more information on the latest beta release, you can explore the [release announcement][4]. + +### Download elementary OS 6 Beta 2 + +You can download the beta 2 for public testing from its [official builds][6] page. It is worth noting that only GitHub sponsors can access early/daily builds. + +[elementary OS 6 Beta 2][6] + +_I’m excited about elementary OS 6, what about you? Drop your thoughts in the comments section below._ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/elementary-os-6-beta-2-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/elementary-os-6-beta/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU1MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMiIgd2lkdGg9IjcxOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://blog.elementary.io/elementary-os-6-odin-beta-2/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4MCIgd2lkdGg9IjcyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://builds.elementary.io From e7a35f5de91b1f4e7e751295d774fd390f852f52 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 18 Jun 2021 08:44:26 +0800 Subject: [PATCH 105/870] translated --- ...our Linux Computer Screen to Any Device.md | 124 ------------------ ...our Linux Computer Screen to Any Device.md | 122 +++++++++++++++++ 2 files changed, 122 insertions(+), 124 deletions(-) delete mode 100644 sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md create mode 100644 translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md diff --git a/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md b/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md deleted file mode 100644 index 18ab57df8b..0000000000 --- a/sources/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md +++ /dev/null @@ -1,124 +0,0 @@ -[#]: subject: (With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device) -[#]: via: (https://itsfoss.com/deskreen/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device -====== - -Screen sharing or screen mirroring apps available out there aren’t that good. Even though most of the dedicated options are only available for Windows/Mac, you may have a tough time finding an open-source solution for Linux. - -With such an app, you can share your screen with any device connected to your network. - -If you have a multi-monitor setup, you realise the advantages of having multiple screens. And, with Deskreen, you can turn any device into your secondary screen, how exciting! - -### Deskreen: Turn Any Device into Secondary Screen for Your Linux System - -![I mirrored my Linux Mint desktop to my Android phone][1] - -[Deskreen][2] is a free and open-source application that lets you use any device with a web browser to use as a secondary screen for your computer. - -It also supports multiple devices to connect if you want. - -Deskreen is easy to use and works fine when all your devices are connected to the same Wi-Fi network. - -Let us take a look at the features and how it works. - -### Features of Deskreen - -[Subscribe to our YouTube channel for more Linux videos][3] - -Deskreen features the essentials that include: - - * Ability to share the entire screen - * Choose a specific application window to stream - * Flip Mode to use your screen as a teleprompter - * Supports multiple devices - * Advanced video quality settings - * Offers end-to-end encryption - * Minimal system requirements - * Dark mode - - - -You do not have a lengthy list of features here, but it should be enough for most users. - -### How to Use Deskreen App? - -The Deskreen app works in three simple steps, let me highlight them for you to get started: - -First, when you launch the app, it will display a QR code and an IP address to help you connect other devices with a web browser to stream your screen. - -![][4] - -You can go for anything you like to set up connection with the help of your web browser on your secondary device. - -Once you scan the QR code or enter the IP address in your browser’s address bar, you will get a prompt on Deskreen app to allow or deny the connection. Unless it is something that you do not recognize, go ahead to allow it. - -![][5] - -Next, you will be asked to select what do you want to stream (your entire screen or a specific application window): - -![][6] - -You can choose to stream the entire screen or select the window that you want to stream. However, not every application window may be detected. - -In my quick test, I did not get Rocket.Chat app window but it did seem to detect Slack application window, Deskscreen window, and the terminal as well. - -![][7] - -You just have to select the source and confirm, that’s it. You should notice it streaming on your secondary screen (mobile/desktop). - -![][8] - -This is how it’ll look when it is done: - -![][9] - -Deskreen also gives you the ability to manage connected devices. So, if you need to disconnect any session or all of them, you can do it from the settings. - -### Install Deskreen in Linux - -You get a DEB package and AppImage file for Linux machines. In case you did not know, go through our guides on [install DEB packages][10] and [using AppImage files][11] to get it installed. - -You can download it from the [official website][2] or explore more about it from its [GitHub page][12]. - -[Deskreen][2] - -### Closing Thoughts - -Considering it works using the Wi-Fi network, there is absolutely no issue with the streaming. This is a fantastic way to share your screen with someone else to watch or just stream it to a secondary device for any purpose. - -Of course, it doesn’t replace the advantages of a second monitor for your computer, but you may not need a second screen for a few use-cases. - -Now, I would like to ask you something. What practical use case you can think of that could take advantage of deskreen app here? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/deskreen/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-app.jpg?resize=800%2C450&ssl=1 -[2]: https://deskreen.com/lang-en -[3]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-connect.png?resize=800%2C559&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskscreen-connect.png?resize=800%2C553&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-select.png?resize=800%2C549&ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-app-window.png?resize=800%2C551&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-confirm-1.png?resize=800%2C554&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskscreen-done.png?resize=873%2C599&ssl=1 -[10]: https://itsfoss.com/install-deb-files-ubuntu/ -[11]: https://itsfoss.com/use-appimage-linux/ -[12]: https://github.com/pavlobu/deskreen diff --git a/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md b/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md new file mode 100644 index 0000000000..4e37ff0115 --- /dev/null +++ b/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md @@ -0,0 +1,122 @@ +[#]: subject: (With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device) +[#]: via: (https://itsfoss.com/deskreen/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +有了 Deskreen,你可以将你的 Linux 屏幕镜像或串流到任何设备上 +====== + +外面的屏幕共享或屏幕镜像应用并不那么好。尽管大多数选项仅适用于 Windows/Mac,但你可能很难找到一个适用于 Linux 的开源解决方案。 + +有了这个应用,你可以与连接到网络的任何设备共享你的屏幕。 + +如果你有多显示器设置,你会意识到拥有多个屏幕的好处。而且,有了 Deskreen,你可以把任何设备变成你的副屏,多么令人激动啊! + +### Deskreen:将任何设备变成你的 Linux 系统的副屏 + +![我把我的 Linux Mint 桌面镜像到我的 Android 手机上][1] + +[Deskreen][2] 是一个免费开源的应用,可以让你使用任何带有网络浏览器的设备来作为电脑的副屏。 + +如果你愿意,它还支持多个设备连接。 + +Deskreen 很容易使用,当你的所有设备都连接到同一个 Wi-Fi 网络时,它可以正常工作。 + +让我们来看看它的功能和工作原理。 + +### Deskreen 的功能 + +Deskreen 的功能包括以下要点: + + * 分享整个屏幕的能力 + * 选择一个特定的应用窗口进行串流 + * 翻转模式,将你的屏幕作为提词器使用 + * 支持多种设备 + * 高级视频质量设置 + * 提供端对端加密 + * 最小的系统要求 + * 黑暗模式 + + + +这里没有一个冗长的功能列表,但对大多数用户来说应该是足够的。 + +### 如何使用 Deskreen 应用? + +Deskreen 使用分为三个简单的步骤,让我为你强调一下,以便你开始使用: + +首先,当你启动该应用时,它会显示一个二维码和一个 IP 地址,以帮助你用网络浏览器连接其他设备,以串流你的屏幕。 + + +![][4] + +你可以去做任何你喜欢的事情,在你的辅助设备上的网络浏览器的帮助下建立连接。 + +当你扫描二维码或在浏览器的地址栏中输入 IP 地址,你会在 Deskreen 应用上得到一个提示,允许或拒绝连接。除非是你不认识它,否则就允许吧。 + +![][5] + +接下来,你将被要求选择你想要串流的内容(你的整个屏幕或特定的应用窗口): + +![][6] + +你可以选择串流整个屏幕或选择你想串流的窗口。然而,并不是每个应用窗口都能被检测到。 + +在我的快速测试中,我没有得到 Rocket.Chat 应用窗口,但它似乎也能检测到 Slack 窗口、Deskscreen 窗口和终端。 + +![][7] + +你只需要选择源并确认,就可以了。你应该注意到它在你的副屏(手机/桌面)上串流。 + +![][8] + +这是它完成后的样子: + +![][9] + +Deskreen 还为你提供了管理连接设备的能力。因此,如果你需要断开任何会话或所有会话的连接,你可以从设置中进行操作。 + +### 在 Linux 中安装 Deskreen + +你会得到一个用于 Linux 机器的 DEB 包和 AppImage 文件。如果你不知道,可以通过我们的[安装 DEB 包][10]和[使用 AppImage 文件][11]指南来安装它。 + +你可以从[官方网站][2]下载它,或者从它的 [GitHub 页面][12]探索更多的信息。 + +[Deskreen][2] + +### 结束语 + +考虑到它使用 Wi-Fi 网络工作,在串流方面绝对没有问题。这是一种奇妙的方式,可以与别人分享你的屏幕,或者出于任何目的将其串流到第二个设备上。 + +当然,它不能取代你的电脑的第二个显示器的优势,但在一些使用情况下,你可能不需要第二个屏幕。 + +现在,我想问你一些事情。你能想到哪些实际应用可以用到 Deskreen? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/deskreen/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-app.jpg?resize=800%2C450&ssl=1 +[2]: https://deskreen.com/lang-en +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-connect.png?resize=800%2C559&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskscreen-connect.png?resize=800%2C553&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-select.png?resize=800%2C549&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-app-window.png?resize=800%2C551&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskreen-confirm-1.png?resize=800%2C554&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/deskscreen-done.png?resize=873%2C599&ssl=1 +[10]: https://itsfoss.com/install-deb-files-ubuntu/ +[11]: https://itsfoss.com/use-appimage-linux/ +[12]: https://github.com/pavlobu/deskreen From 98b7fa069df097b238e7755585f8f5f209b49b5d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 18 Jun 2021 08:49:05 +0800 Subject: [PATCH 106/870] translating --- ...20210615 Try this new open source tool for data analytics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210615 Try this new open source tool for data analytics.md b/sources/tech/20210615 Try this new open source tool for data analytics.md index 02d00b8131..00d140a470 100644 --- a/sources/tech/20210615 Try this new open source tool for data analytics.md +++ b/sources/tech/20210615 Try this new open source tool for data analytics.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/cubejs) [#]: author: (Ray Paik https://opensource.com/users/rpaik) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1efe1dcbc356cbd24df730793f32e2464fc689d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 18 Jun 2021 10:14:13 +0800 Subject: [PATCH 107/870] PRF @geekpi --- ...6 requirements of cloud-native software.md | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/translated/tech/20200108 6 requirements of cloud-native software.md b/translated/tech/20200108 6 requirements of cloud-native software.md index 3e31a7d0dd..169ac24faf 100644 --- a/translated/tech/20200108 6 requirements of cloud-native software.md +++ b/translated/tech/20200108 6 requirements of cloud-native software.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (6 requirements of cloud-native software) @@ -9,20 +9,21 @@ 云原生软件的 6 个要求 ====== -开发和实施云原生(容器优先)软件的检查清单。 -![Team checklist][1] -许多年来,单体应用是实现业务需求的标准企业架构。但是,当云基础设施开始以规模和速度为业务加速,这种情况就发生了重大变化。应用架构也发生了转变,以适应云原生应用和[微服务][2]、[无服务器][3]以及事件驱动的服务,这些服务在跨混合云和多云平台的不可变的基础设施上运行。 +> 开发和实施云原生(容器优先)软件的检查清单。 + +![](https://img.linux.net.cn/data/attachment/album/202106/18/101348dcjg3u7wugo5uouw.jpg) + +许多年来,单体应用是实现业务需求的标准企业架构。但是,当云基础设施开始以规模和速度为业务加速,这种情况就发生了重大变化。应用架构也发生了转变,以适应云原生应用和 [微服务][2]、[无服务器][3] 以及事件驱动的服务,这些服务运行在跨混合云和多云平台的不可变的基础设施上。 ### 云原生与 Kubernetes 的联系 -根据[云原生计算基金会][4] (CNCF) 的说法: +根据 [云原生计算基金会][4] (CNCF) 的说法: > “云原生技术使企业能够在现代动态环境中建立和运行可扩展的应用,如公共云、私有云和混合云。容器、服务网格、微服务、不可变的基础设施和声明式 API 就是这种方法的典范。” > > “这些技术使松散耦合的系统具有弹性、可管理和可观察性。与强大的自动化相结合,它们使工程师能够以最小的工作量频繁地、可预测地进行重要的改变。” - 像 [Kubernetes][5] 这样的容器编排平台允许 DevOps 团队建立不可变的基础设施,以开发、部署和管理应用服务。现在,快速迭代的速度与业务需求相一致。构建容器以在 Kubernetes 中运行的开发人员需要一个有效的地方来完成。 ### 云原生软件的要求 @@ -31,14 +32,12 @@ 虽然构建和架构云原生应用的方法有很多,但以下是一些需要考虑的部分: - * **运行时:**它们更可能以容器优先或/和 Kubernetes 原生语言编写,这意味着运行时会如 Java、Node.js、Go、Python 和 Ruby。 - * **安全:**在多云或混合云应用环境中部署和维护应用时,安全是最重要的,应该是环境的一部分。 - * **可观察性:**使用 Prometheus、Grafana 和 Kiali 等工具,这些工具可以通过提供实时指标和有关应用在云中的使用和行为的更多信息来增强可观察性。 - * **效率:**专注于极小的内存占用、小的构件大小和快速启动时间,使应用可跨混合/多云平台移植。 - * **互操作性:**将云原生应用与能够满足上述要求的开源技术相结合,包括 Infinispan、MicroProfile、Hibernate、Kafka、Jaeger、Prometheus 等,以构建标准运行时架构。 - * **DevOps/DevSecOps:**这些方法论是为持续部署到生产而设计的,与最小可行产品 (MVP) 一致,并将安全作为工具的一部分。 - - + * **运行时:** 它们更多是以容器优先或/和 Kubernetes 原生语言编写的,这意味着运行时会如 Java、Node.js、Go、Python 和 Ruby。 + * **安全:** 在多云或混合云应用环境中部署和维护应用时,安全是最重要的,应该是环境的一部分。 + * **可观察性:** 使用 Prometheus、Grafana 和 Kiali 等工具,这些工具可以通过提供实时指标和有关应用在云中的使用和行为的更多信息来增强可观察性。 + * **效率:** 专注于极小的内存占用、更小的构件大小和快速启动时间,使应用可跨混合/多云平台移植。 + * **互操作性:** 将云原生应用与能够满足上述要求的开源技术相结合,包括 Infinispan、MicroProfile、Hibernate、Kafka、Jaeger、Prometheus 等,以构建标准运行时架构。 + * **DevOps/DevSecOps:** 这些方法论是为持续部署到生产而设计的,与最小可行产品 (MVP) 一致,并将安全作为工具的一部分。 ### 让云原生具体化 @@ -53,7 +52,7 @@ via: https://opensource.com/article/20/1/cloud-native-software 作者:[Daniel Oh][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 750e3982f5c562d4e7bce6c8f58053fc51eba98b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 18 Jun 2021 10:14:56 +0800 Subject: [PATCH 108/870] PUB @geekpi https://linux.cn/article-13497-1.html --- .../20200108 6 requirements of cloud-native software.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200108 6 requirements of cloud-native software.md (98%) diff --git a/translated/tech/20200108 6 requirements of cloud-native software.md b/published/20200108 6 requirements of cloud-native software.md similarity index 98% rename from translated/tech/20200108 6 requirements of cloud-native software.md rename to published/20200108 6 requirements of cloud-native software.md index 169ac24faf..e2848eb214 100644 --- a/translated/tech/20200108 6 requirements of cloud-native software.md +++ b/published/20200108 6 requirements of cloud-native software.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13497-1.html) [#]: subject: (6 requirements of cloud-native software) [#]: via: (https://opensource.com/article/20/1/cloud-native-software) [#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) From 9cb45b5b9ab12155a2803d7445efb90d3cbc6763 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 18 Jun 2021 10:43:10 +0800 Subject: [PATCH 109/870] PRF&PUB @mengxinayan https://linux.cn/article-13498-1.html --- ...de to the syntax of C-- method pointers.md | 69 +++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) rename {translated/tech => published}/20210222 A friendly guide to the syntax of C-- method pointers.md (65%) diff --git a/translated/tech/20210222 A friendly guide to the syntax of C-- method pointers.md b/published/20210222 A friendly guide to the syntax of C-- method pointers.md similarity index 65% rename from translated/tech/20210222 A friendly guide to the syntax of C-- method pointers.md rename to published/20210222 A friendly guide to the syntax of C-- method pointers.md index 19125cb1bc..a80a7bffc1 100644 --- a/translated/tech/20210222 A friendly guide to the syntax of C-- method pointers.md +++ b/published/20210222 A friendly guide to the syntax of C-- method pointers.md @@ -1,35 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13498-1.html) [#]: subject: (A friendly guide to the syntax of C++ method pointers) [#]: via: (https://opensource.com/article/21/2/ccc-method-pointers) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) C++ 类成员函数指针语法的友好指南 ====== -一旦您理解了一般原则,C++ 类成员函数指针不再那么令人生畏。 -![Person drinking a hot drink at the computer][1] +> 一旦你理解了一般原则,C++ 类成员函数指针不再那么令人生畏。 -如果您正在寻找性能、复杂性或许多可能的解决方法来解决问题,那么 [C++][2] 总是一个很好的选择。当然,功能通常伴随着复杂性,但是一些 C++ 的特性几乎难以分辨。根据我的观点,C++ 的 [类成员函数指针](3) 也许是我接触过的最复杂的表达式,但是我会先从一些较简单的开始。 +![](https://img.linux.net.cn/data/attachment/album/202106/18/104200rm48h22eghehg2p3.jpg) + +如果你正在寻找性能、复杂性或许多可能的解决方法来解决问题,那么在涉及到极端的情况下,[C++][2] 总是一个很好的选择。当然,功能通常伴随着复杂性,但是一些 C++ 的特性几乎难以分辨。根据我的观点,C++ 的 [类成员函数指针][3] 也许是我接触过的最复杂的表达式,但是我会先从一些较简单的开始。 文章中的例子可以在我的 [Github 仓库][4] 里找到。 ### C 语言:函数指针 -让我们先从一些基础开始:假设您有一个函数接收两个整数作为参数返回一个整数: +让我们先从一些基础开始:假设你有一个函数接收两个整数作为参数返回一个整数: -```c +``` int sum(int a, int b) { return a+b; } ``` -在纯 C 语言中,您可以创建一个指向这个函数的指针,将其分配给您的 `sum(...)` 函数,通过解引用来调用它。函数的签名(参数、返回类型)必须符合指针的签名。除此之外,一个函数指针表现和普通的指针相同: +在纯 C 语言中,你可以创建一个指向这个函数的指针,将其分配给你的 `sum(...)` 函数,通过解引用来调用它。函数的签名(参数、返回类型)必须符合指针的签名。除此之外,一个函数指针表现和普通的指针相同: -```c +``` int (*funcPtrOne)(int, int); funcPtrOne = ∑ @@ -37,9 +38,9 @@ funcPtrOne = ∑ int resultOne = funcPtrOne(2, 5); ``` -如果您使用指针作为参数并返回一个指针,这会显得很丑陋: +如果你使用指针作为参数并返回一个指针,这会显得很丑陋: -```c +``` int *next(int *arrayOfInt){ return ++arrayOfInt; } @@ -55,9 +56,9 @@ C 语言中的函数指针存储着子程序的地址。 ### 指向类成员函数的指针 -让我们来进入 C++:好消息是您也许不需要使用类成员函数指针,除非在一个特别罕见的情况下,像接下来的例子。首先,您已经知道定义一个类和其中一个成员函数: +让我们来进入 C++:好消息是你也许不需要使用类成员函数指针,除非在一个特别罕见的情况下,比如说接下来的例子。首先,你已经知道定义一个类和其中一个成员函数: -```cpp +``` class MyClass { public: @@ -69,42 +70,42 @@ public: }; ``` -#### 1\. 定义一个指针指向某一个类中一个成员函数 +#### 1、定义一个指针指向某一个类中一个成员函数 -声明一个指针指向 `MyClass` 类成员函数。在此时,您并不知道想调用的具体函数。您仅仅声明了一个指向 `MyClass` 类中任意成员函数的指针。当然,签名(参数、返回值类型)需要匹配您接下想要调用的 `sum(...)` 函数: +声明一个指针指向 `MyClass` 类成员函数。在此时,你并不知道想调用的具体函数。你仅仅声明了一个指向 `MyClass` 类中任意成员函数的指针。当然,签名(参数、返回值类型)需要匹配你接下想要调用的 `sum(...)` 函数: -```cpp +``` int (MyClass::*methodPtrOne)(int, int); ``` -#### 2\. 赋值给一个具体的函数 +#### 2、赋值给一个具体的函数 为了和 C 语言(或者 [静态成员函数][5])对比,类成员函数指针不需要指向绝对地址。在 C++ 中,每一个类中都有一个虚拟函数表(vtable)用来储存每个成员函数的地址偏移量。一个类成员函数指针指向 vtable 中的某个条目,因此它也只存储偏移值。这样的原则使得 [多态][6] 变得可行。 -因为 `sum(...)` 函数的签名和您的指针声明匹配,您可以赋值签名给它: +因为 `sum(...)` 函数的签名和你的指针声明匹配,你可以赋值签名给它: -```cpp +``` methodPtrOne = &MyClass::sum; ``` -#### 3\. 调用成员函数 +#### 3、调用成员函数 -如果您想使用指针调用一个类成员函,您必须提供一个类的实例: +如果你想使用指针调用一个类成员函,你必须提供一个类的实例: -```cpp +``` MyClass clsInstance; int result = (clsInstance.*methodPtrOne)(2,3); ``` -您可以使用 `.` 操作符来访问,使用 `*` 对指针解引用,通过提供两个整数作为调用函数时的参数。这是丑陋的,对吧?但是您可以进一步应用。 +你可以使用 `.` 操作符来访问,使用 `*` 对指针解引用,通过提供两个整数作为调用函数时的参数。这是丑陋的,对吧?但是你可以进一步应用。 ### 在类内使用类成员函数指针 -假设您正在创建一个带有后端和前端的 [客户端/服务器][7] 原理架构的应用程序。您现在并不需要关心后端,相反的,您将基于 C++ 类的前端。前端依赖于后端提供的数据完成初始化,所以您需要一个额外的初始化机制。同时,您希望通用地实现此机制,以便将来可以使用其他初始化函数(可能是动态的)来拓展您的前端。 +假设你正在创建一个带有后端和前端的 [客户端/服务器][7] 原理架构的应用程序。你现在并不需要关心后端,相反的,你将基于 C++ 类的前端。前端依赖于后端提供的数据完成初始化,所以你需要一个额外的初始化机制。同时,你希望通用地实现此机制,以便将来可以使用其他初始化函数(可能是动态的)来拓展你的前端。 首先定义一个数据类型用来存储初始化函数(`init`)的指针,同时描述何时应调用此函数的信息(`ticks`): -```cpp +``` template struct DynamicInitCommand { void (T::*init)(); // 指向额外的初始化函数 @@ -114,7 +115,7 @@ struct DynamicInitCommand { 下面一个 `Frontend` 类示例代码: -```cpp +``` class Frontend { public: @@ -131,8 +132,6 @@ public: m_dynamicInit.push_back(init3); } - - void tick(){ std::cout << "tick: " << ++m_ticks << std::endl; @@ -174,9 +173,9 @@ private: }; ``` -在 `Frontend` 完成实例化后,`tick()` 函数会被后端以固定的时间时间调用。例如,您可以每 200 毫秒调用一次: +在 `Frontend` 完成实例化后,`tick()` 函数会被后端以固定的时间时间调用。例如,你可以每 200 毫秒调用一次: -```cpp +``` int main(int argc, char* argv[]){ Frontend frontendInstance; @@ -187,7 +186,7 @@ int main(int argc, char* argv[]){ } ``` -`Fronted` 有三个额外的初始化函数,它们必须根据 `m_ticks` 的值来选择调用哪个。在 tick 等于何值调用哪个初始化函数的信息存储在数组 `m_dynamicInit` 中。在构造函数(`Frontend()`)中,将此信息附加到数组中,以便在 5、10 和 15 个 tick 后调用其他初始化函数。当后端调用 `tick()` 函数时,`m_ticks` 值会递增,同时遍历数组 `m_dynamicInit` 以检查是否必须调用初始化函数。 +`Fronted` 有三个额外的初始化函数,它们必须根据 `m_ticks` 的值来选择调用哪个。在 ticks 等于何值调用哪个初始化函数的信息存储在数组 `m_dynamicInit` 中。在构造函数(`Frontend()`)中,将此信息附加到数组中,以便在 5、10 和 15 个 tick 后调用其他初始化函数。当后端调用 `tick()` 函数时,`m_ticks` 值会递增,同时遍历数组 `m_dynamicInit` 以检查是否必须调用初始化函数。 如果是这种情况,则必须通过引用 `this` 指针来取消引用成员函数指针: @@ -197,9 +196,9 @@ int main(int argc, char* argv[]){ ### 总结 -如果您并不熟悉类成员函数指针,它们可能会显得有些复杂。我做了很多尝试和经历了很多错误,花了一些时间来找到正确的语法。然而,一旦你理解了一般原理后,方法指针就变得不那么可怕了。 +如果你并不熟悉类成员函数指针,它们可能会显得有些复杂。我做了很多尝试和经历了很多错误,花了一些时间来找到正确的语法。然而,一旦你理解了一般原理后,方法指针就变得不那么可怕了。 -这是迄今为止我在 C++ 中发现的最复杂的语法。 您还知道更糟糕的吗? 在评论中发布您的观点! +这是迄今为止我在 C++ 中发现的最复杂的语法。 你还知道更糟糕的吗? 在评论中发布你的观点! -------------------------------------------------------------------------------- @@ -208,7 +207,7 @@ via: https://opensource.com/article/21/2/ccc-method-pointers 作者:[Stephan Avenwedde][a] 选题:[lujun9972][b] 译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d76be10b0667b9a4c01535497be5b098cf495ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Fri, 18 Jun 2021 14:10:47 +0800 Subject: [PATCH 110/870] translating apply for translation --- sources/talk/20210606 How Real-World Apps Lose Data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210606 How Real-World Apps Lose Data.md b/sources/talk/20210606 How Real-World Apps Lose Data.md index 6750837e98..71f5569c8c 100644 --- a/sources/talk/20210606 How Real-World Apps Lose Data.md +++ b/sources/talk/20210606 How Real-World Apps Lose Data.md @@ -2,7 +2,7 @@ [#]: via: (https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html) [#]: author: (Simon Arneaud https://theartofmachinery.com) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (PearFL) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6ed54b792ffd6b1d987c4b9f03ded3000c77c266 Mon Sep 17 00:00:00 2001 From: Hilton Chain <26847027+rakino@users.noreply.github.com> Date: Fri, 18 Jun 2021 17:55:57 +0800 Subject: [PATCH 111/870] translating --- ...20200320 Run a command on binary files with this script.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200320 Run a command on binary files with this script.md b/sources/tech/20200320 Run a command on binary files with this script.md index 2d6f0b6f26..d2ec19fd62 100644 --- a/sources/tech/20200320 Run a command on binary files with this script.md +++ b/sources/tech/20200320 Run a command on binary files with this script.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (rakino) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -761,7 +761,7 @@ via: https://opensource.com/article/20/3/run-binaries-script 作者:[Nick Clifton][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[rakino](https://github.com/rakino) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From da791dcf807a24a9fbf188695d43bf8f84195ad6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 19 Jun 2021 05:03:16 +0800 Subject: [PATCH 112/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210618=20?= =?UTF-8?q?Systemd=20Timers=20for=20Scheduling=20Tasks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210618 Systemd Timers for Scheduling Tasks.md --- ...618 Systemd Timers for Scheduling Tasks.md | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 sources/tech/20210618 Systemd Timers for Scheduling Tasks.md diff --git a/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md b/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md new file mode 100644 index 0000000000..944d84332e --- /dev/null +++ b/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md @@ -0,0 +1,230 @@ +[#]: subject: (Systemd Timers for Scheduling Tasks) +[#]: via: (https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/) +[#]: author: (Richard England https://fedoramagazine.org/author/rlengland/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Systemd Timers for Scheduling Tasks +====== + +![][1] + +Systemd has provided timers for a while and it is worth taking a look at this feature as an alternative to _cron_. This article will show you how to use timers with _systemd_ to run a task after the system has booted and on a recurring basis after that. This is not a comprehensive discussion of _systemd_, only an introduction to this one feature. + +### Cron vs anacron vs systemd: a quick review + +_Cron_ can schedule a task to be run at a granularity ranging from minutes to months or more. It is relatively simple to set up, requiring a single configuration file. Although the configuration line is somewhat esoteric. It can also be used by general users. + +_Cron_, however, fails if your system happens to not be running when the appropriate execution time occurs. + +_Anacron_, overcomes the “system not running” issue. It insures that the task will be executed when your system is again active. While it was intended to be used by administrators, some systems give general users access. + +However, the _anacron_ frequency of execution can be no less than daily. + +Both _cron_ and _anacron_ have issues with consistency in execution context. Care must be taken that the environment in effect when the task runs is exactly that used when testing. The same shell, environment variables and paths must be provided. This means that testing and debugging can sometimes be difficult. + +_Systemd_ timers offer the best of both _cron_ and _anacron_. Allows scheduling down to minute granularity. Assures that the task will be executed when the system is again running even if it was off during the expected execution time. Is available to all users. You can test and debug the execution in the environment it will run in. + +However, the configuration is more involved, requiring at least two configuration files. + +If your _cron_ and _anacron_ configuration is serving you well then there may not be a reason to change. But _systemd_ is at least worth investigating since it may simplify any current _cron_ /_anacron_ work-arounds. + +### Configuration + +_Systemd_ timer executed functions require, at a minimum, two files. These are the “timer unit” and the “service unit”. Actions consisting of more than a simple command, you will also need a “job” file or script to perform the necessary functions. + +The timer unit file defines the schedule while the service unit file defines the task(s) performed. More details on the .timer unit is available in “man systemd.timer”. Details on the service unit are available in “man systemd.service”. + +There are several locations where unit files exist (listed in the man page). Perhaps the easiest location for the general user, however, is “~/.config/systemd/user”. Note that “user” here, is the literal string “user”. + +### Demo + +This demo is a simple example creating a user scheduled job rather than a system schedule job (which would run as root). It prints a message, date, and time to a file. + + 1. Start by creating a shell script that will perform the task. Create this in your local “bin” directory, for example, in +“~/bin/schedule-test.sh” + + + +``` +To create the file: +``` + +touch  ~/bin/schedule-test.sh +``` + +``` + +Then add the following content to the file you just created. + +``` +#!/bin/sh +echo "This is only a test: $(date)" >> "$HOME/schedule-test-output.txt" +``` + +Remember to make your shell script executable. + + 2. Create the .service unit that will call the script above. Create the directory and file in: +“~/.config/systemd/user/schedule-test.service”: + + + +``` +[Unit] +Description=A job to test the systemd scheduler + +[Service] +Type=simple +ExecStart=/home//bin/schedule-test.sh + +[Install] +WantedBy=default.target +``` + +Note that <user> should be your @HOME address but the “user” in the path name for the unit file is literally the string “user”. + +The _ExecStart_ line should provide an absolute address with no variables. An exception to this is that for _user_ units you may substitute “%h” for $HOME. In other words you can use: + +``` +ExecStart=%h/bin/schedule-test.sh +``` + +This is only for user unit file use. It is not good for system units since “%h” will always return “/root” when run in the system environment. Other substitutions are found in “man systemd.unit” under the heading “SPECIFIERS”. As it is outside the scope of this article, that’s all we need to know about SPECIFIERS for now. + +3\. Create a .timer unit file which actually schedules the .service unit you just created. Create it in the same location as the .service file “~/.config/systemd/user/schedule-test.timer”. Note that the file names differ only in their extensions, that is ,”.service” versus “.timer” + +``` +[Unit] +Description=Schedule a message every 1 minute +RefuseManualStart=no # Allow manual starts +RefuseManualStop=no # Allow manual stops + +[Timer] +#Execute job if it missed a run due to machine being off +Persistent=true +#Run 120 seconds after boot for the first time +OnBootSec=120 +#Run every 1 minute thereafter +OnUnitActiveSec=60 +#File describing job to execute +Unit=schedule-test.service + +[Install] +WantedBy=timers.target +``` + +Note that the .timer file has used “OnUnitActiveSec” to specify the schedule. Much more flexible is the “OnCalendar” option. For example: + +``` +# run on the minute of every minute every hour of every day + OnCalendar=*-*-* *:*:00 +# run on the hour of every hour of every day + OnCalendar=*-*-* *:00:00 +# run every day + OnCalendar=*-*-* 00:00:00 +# run 11:12:13 of the first or fifth day of any month of the year +# 2012, but only if that day is a Thursday or Friday + OnCalendar=Thu,Fri 2012-*-1,5 11:12:13 +``` + +More information on “OnCalendar” is available [here][2]. + +4\. All the pieces are in place but you should test to make certain everything works. First, enable the user service: + +``` +$ systemctl --user enable schedule-test.service +``` + +This should result in output similar to this: + +``` +Created symlink /home//.config/systemd/user/default.target.wants/schedule-test.service → /home//.config/systemd/user/schedule-test.service. +``` + +Now do a test run of the job: + +``` +$ systemctl --user start schedule-test.service +``` + +Check your output file ( $HOME/schedule-test-output.txt ) to insure that your script is +performing correctly. There should be a single entry since we have not started the timer yet. Debug as necessary. Don’t forget to enable the service again if you needed to change your .service file as opposed to the shell script it invokes. + +5\. Once the job works correctly, schedule it for real by enabling and starting the user timer for your service: + +``` +$ systemctl --user enable schedule-test.timer +$ systemctl --user start schedule-test.timer +``` + +Note that you have already started and enabled the service in step 4, above, so it is only necessary to enable and start the timer for it. + +The “enable” command will result in output similar to this: + +``` +Created symlink /home//.config/systemd/user/timers.target.wants/schedule-test.timer → /home//.config/systemd/user/schedule-test.timer. +``` + +and the “start” will simply return you to a CLI prompt. + +### Other operations + +You can check and monitor the service. The first command below is particularly useful if you receive an error from the service unit: + +``` +$ systemctl --user status schedule-test +$ systemctl --user list-unit-files +``` + +Manually stop the service: + +``` +$ systemctl --user stop schedule-test.service +``` + +Permanently stop and disable the timer and the service, reload the daemon config and reset any failure notifications: + +``` +$ systemctl --user stop schedule-test.timer +$ systemctl --user disable schedule-test.timer +$ systemctl --user stop schedule-test.service +$ systemctl --user disable schedule-test.service +$ systemctl --user daemon-reload +$ systemctl --user reset-failed +``` + +### Summary + +This article will jump-start you with _systemd_ timers, however, there is much more to _systemd_ than covered here. This article should provide you with a foundation on which to build. You can explore more about it starting in the [Fedora Magazine systemd series][3] . + +References – Further reading: + + * man systemd.timer + * man systemd.service + * [Use systemd timers instead of cronjobs][4] + * [Understanding and administering systemd][5] + * Also, has a good systemd cheatsheet + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/ + +作者:[Richard England][a] +选题:[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/rlengland/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/schedule_with_systemd_timer-816x345.jpg +[2]: https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events +[3]: https://fedoramagazine.org/what-is-an-init-system/ +[4]: https://opensource.com/article/20/7/systemd-timers +[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/ From 15476fb9458a6333d9c94a5e858b6005590f040c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 19 Jun 2021 05:04:15 +0800 Subject: [PATCH 113/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210618=20?= =?UTF-8?q?5=20more=20reasons=20to=20run=20Kubernetes=20in=20your=20Linux?= =?UTF-8?q?=20homelab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210618 5 more reasons to run Kubernetes in your Linux homelab.md --- ...to run Kubernetes in your Linux homelab.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210618 5 more reasons to run Kubernetes in your Linux homelab.md diff --git a/sources/tech/20210618 5 more reasons to run Kubernetes in your Linux homelab.md b/sources/tech/20210618 5 more reasons to run Kubernetes in your Linux homelab.md new file mode 100644 index 0000000000..dd5ec7ed2c --- /dev/null +++ b/sources/tech/20210618 5 more reasons to run Kubernetes in your Linux homelab.md @@ -0,0 +1,100 @@ +[#]: subject: (5 more reasons to run Kubernetes in your Linux homelab) +[#]: via: (https://opensource.com/article/21/6/kubernetes-linux-homelab) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 more reasons to run Kubernetes in your Linux homelab +====== +Kubernetes' advantages aren't just what it can do, they're also what +knowing it can do for you. +![Working from home at a laptop][1] + +In [5 reasons to run Kubernetes on your Raspberry Pi homelab][2], I explain why you might want to use Kubernetes at home. Those reasons are relatively arbitrary, and they mostly focus on outcomes. Aside from what Kubernetes can do, there are several other good reasons to look at Kubernetes as an important next step in your personal computing experience. + +### 1\. It's built on the foundation of Linux + +![T-shirt reading "Containers are Linux"][3] + +(Seth Kenlon, [CC BY-SA 4.0][4]) + +Kubernetes has a certain reputation. More accurately, it has several reputations. For some people, it's a mysterious technology with an unpronounceable name. To other people, it's a sheepdog helping them herd an over-abundance of containers. For others, it's a kind of operating system for the cloud, a useful interface to effective cloud development. And for most people, probably, it's back-end software they've never even heard of. As you might expect, it's all of these things and more. + +Not everyone interacts with Kubernetes the same way, but if you have an inclination toward systems administration, you'll find that Kubernetes is _just another Linux command_. + +I have a t-shirt that reads "Containers are Linux," which states what is, upon reflection, obvious. Container technology uses cgroups to run images of a minimal Linux operating system containing an application or set of applications. From start to finish, when you choose to run a container, you're choosing to run Linux. While Kubernetes commands run on many platforms, it's managing Linux containers, and when you interact with Kubernetes through a terminal, it's Linux business as usual: command, options, args, syntax. Running `kubeadm` or (on OKD or OpenShift) `oc` commands feels familiar because they work like any other Linux command you're used to running. What starts out seeming foreign feels natural in no time, and any Linux user interested in spending time in the terminal can find plenty of fun things to explore in Kubernetes. + +### 2\. Flexible + +Kubernetes used to be a little rigid. It supported, essentially, one container runtime—so stringently, in fact, that there's a hardcoded shim to this day to get around that legacy. Luckily, today Kubernetes has become flexible enough to allow for admins' many diverse needs. There's [Podman][5] and [CRI-O][6] available as container engines, both of which can integrate with [systemd][7]. (I meant what I said when I told you it was all Linux underneath.) You have choices of filesystems, cluster size and construction, monitoring tools, images, programming languages, and much more. Frankly, some people say there's _too much_ choice, which is usually when I suspect that after a few more years, it'll have just enough choice for me. + +### 3\. Personal development + +Containers are a fruitful business, and they have the habit of multiplying rapidly. That's by design. Containers are meant to scale, and they scale by spawning clones. Stick the containers into groups (call them _pods_), and automate how pod lifecycles are managed. That's all Kubernetes really is, and it's changing how servers can run. + +You might not need an infinitely scaleable collection of containers, and you may not need anything to help you manage the one or two containers you do run. However, if you're looking to profit from your ability to wrangle pods, then Kubernetes is exactly the tool you want. As more and more companies and organizations go global and embrace [digital transformation][8], Kubernetes is becoming a required skill in IT. If that's the path you're on, it's a good investment to learn it now and get familiar with common problems and their solutions. + +### 4\. Make containers make sense + +You may remember several years ago when open source projects started distributing their code as container images. For many, it was puzzling at the time. Not many admins really [understood what a container was][9], or where the boundaries of the imaginary container were, or how to get into the container, or why data couldn't live inside the container. + +Now, the IT world—including developers—is comfortable with the concept of containers. Delivery to containers just makes sense for a modern [CI/CD workflow][10]. For the sysadmin, though, the advantages of containers are twofold: installation is (theoretically) easier than waiting for a distro to update its packages, and containers scale. Yet it's very likely that neither of these benefits really manifests for you until you've used Kubernetes. Once you start managing containers with Kubernetes and related tools, the benefits of continuous delivery and the ability to scale are probably merely ideas you've read about. Integrate containers into how you manage your servers, and you suddenly understand what the excitement is all about. + +![Apache JMeter][11] + +(Seth Kenlon, [CC BY-SA 4.0][4]) + +The most basic of tests makes it pretty clear. Just spin up your favorite web server in a container, create a pod, then hit your server with traffic from [Apache JMeter][12], and watch containers respond. + +### 5\. Cloud-native + +If you do more development than systems administration, Kubernetes provides an excellent platform for what has easily become the biggest target of all: web apps. We all use web apps now, even though most people just think of them as "websites." The web has a hugely significant user base (to say the least), so it makes sense to provide open source applications through the browser. There are some great open source applications that run over a network, and many of those are delivered as containers to provide easy installation and a consistent user experience. + +### Bonus: It's fun + +Remember when you were still new to Linux? For some people, that might have been decades ago, and for others, it's still around the corner. For all of us, though, learning something new can be a fun challenge. If you've reached the point that Linux installs are more a bother than a challenge, you might want to try building a Kubernetes cluster in your broom closet. It will reintroduce you to all kinds of concepts you'd forgotten about. Hacking on plain-text ([YAML][13] specifically) configuration files, configuring network interfaces and networks, routing traffic, poring over the advantages and disadvantages of one backend over another, running `--dry-run` after `--dry-run` tests, tentatively pressing Return to find out whether you got everything right. Honestly, Kubernetes is just fun. + +If you want to build your own infrastructure, there's nothing quite like building your own Kubernetes cluster. A whole new world will open to you. You quickly become a cloud architect, perfecting your open cloud, installing amazing open source web applications in containers, and maybe even offering access to your family and friends. + +You become the solution. It's so very satisfying. + +### Explore Kubernetes + +Kubernetes might seem out of reach at first. It's new, a little scary, and worst yet, it apparently requires a cloud. However, there are a few ways to get started. + +First, install either [Minikube][14] or [Minishift][14]. Both of these allow you to run a local instance of Kubernetes on your personal computer. It's not quite as satisfying as building a cluster and opening it up to your friends, but it's a great, safe way to get familiar with the landscape, commands, and toolkit. + +Once you're ready for the real thing, read Chris Collins' article [Build a Kubernetes cluster with the Raspberry Pi][15]. After that, download our free ebook [Running Kubernetes on your Raspberry Pi homelab][16]. Before you know it, you'll find yourself wearing Kubernetes t-shirts, too. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/kubernetes-linux-homelab + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/article/20/8/kubernetes-raspberry-pi +[3]: https://opensource.com/sites/default/files/uploads/containers-are-linux.jpg (T-shirt reading "Containers are Linux") +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: http://podman.io +[6]: http://cri-o.io +[7]: https://opensource.com/article/21/5/systemd +[8]: https://enterprisersproject.com/what-is-digital-transformation +[9]: https://opensource.com/article/18/11/behind-scenes-linux-containers +[10]: https://opensource.com/article/18/8/what-cicd +[11]: https://opensource.com/sites/default/files/uploads/jmeter.png (Apache JMeter) +[12]: https://jmeter.apache.org +[13]: https://www.redhat.com/sysadmin/yaml-beginners +[14]: https://opensource.com/article/18/10/getting-started-minikube +[15]: https://opensource.com/article/20/6/kubernetes-raspberry-pi +[16]: https://opensource.com/downloads/kubernetes-raspberry-pi From 0b5f50e6d58efbf461cc4581cb2e50ea3bb8b8b4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 19 Jun 2021 05:04:29 +0800 Subject: [PATCH 114/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210618=20?= =?UTF-8?q?DevSecOps:=20An=20open=20source=20story?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210618 DevSecOps- An open source story.md --- ...0210618 DevSecOps- An open source story.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20210618 DevSecOps- An open source story.md diff --git a/sources/tech/20210618 DevSecOps- An open source story.md b/sources/tech/20210618 DevSecOps- An open source story.md new file mode 100644 index 0000000000..f8429bd53e --- /dev/null +++ b/sources/tech/20210618 DevSecOps- An open source story.md @@ -0,0 +1,106 @@ +[#]: subject: (DevSecOps: An open source story) +[#]: via: (https://opensource.com/article/21/6/open-sourcing-devsecops) +[#]: author: (Will Kelly https://opensource.com/users/willkelly) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +DevSecOps: An open source story +====== +DevSecOps brings culture changes, frameworks, and tools into open source +software. To understand DevSecOps, you must understand its relationship +with open source. +![A lock on the side of a building][1] + +Recent supply chain breaches, plus President Biden's new [Cybersecurity executive order][2], are bringing renewed attention to DevSecOps' value for the enterprise. DevSecOps brings culture changes, frameworks, and tools into open source software (OSS). To understand DevSecOps, you must understand its relationship with OSS. + +### What is DevSecOps? + +In its purest form, DevOps (which is an amalgamation of development and operations) is a methodology for breaking down the traditional silos between programmers and system administrators during the software delivery lifecycle. Corporations and government agencies adopt DevOps for various reasons, including improving software delivery velocity to serve customers better. + +DevSecOps adds security into DevOps, further refining the concept to address code quality, security, and reliability assurance through automation, enabling continuous security and compliance. Organizations seeking to comply with Sarbanes Oxley (SOX), Payment Card Industry Data Security Standard (PCI DSS), FedRAMP, and similar programs are candidates for implementing DevSecOps. + +For example, a federal government agency seeking [FedRAMP compliance][3] should use DevSecOps, because it enables them to bake security automation into each stage of their software development process. Likewise, a healthcare institution entrusted with sensitive personal healthcare information (PHI) needs DevSecOps to ensure its cloud applications meet HIPAA compliance requirements. + +The more you move security mitigation to the left to tackle these issues in development, the more money you save. You also avoid potential negative headlines because your teams don't have to respond to issues in production, where remediation costs can soar way higher than if you caught them in your development environment. + +You can treat the move from DevOps to DevSecOps as another step in the DevOps journey. But it's more like a transformation for your development organization and your entire business. Here's a typical framework: + + 1. **Analyze, communicate, and educate:** This includes analyzing your development process maturity; defining DevSecOps for your organization; and fostering a DevSecOps culture with continuous feedback and interaction, team autonomy, and automation and architecture. + 2. **Integrate security into your DevOps lifecycle:** Ensure your DevOps and security teams work together. + 3. **Introduce automation into your DevOps lifecycle:** Start on small dev projects and gradually expand your automation strategy. + 4. **Collaborate on security changes to your DevOps toolchains:** Get your development and security teams working jointly on projects to harden your DevOps toolchain. + 5. **Execute on DevSecOps:** Get your teams fully engaged with your DevSecOps toolchains and new processes. + 6. **Encourage continuous learning and iteration:** Offer your developers and sysadmins training and feedback mechanisms to support developer performance and the health of your toolchains. + + + +We're at a unique point in the history of software development, where the need to increase security and speed software development velocity is at a crossroads. While DevOps has done a lot to increase velocity, there was always more to do. + +### Growth of DevSecOps + +The growth of DevSecOps has been visible in compliance and security-conscious arenas. For example, it has a growing following inside the security-conscious US Department of Defense. Projects such as [Platform One][4] are setting an example of how DevSecOps practices can protect open source and cloud technologies in the most security-conscious government missions. + +DevSecOps has a 20% to 50% penetration within industry, according to [Gartner's Hype Cycle for Agile and DevOps, 2020][5]. The pandemic has acted as a catalyst for DevSecOps as organizations have moved application development to the cloud. + +### Challenges of DevSecOps + +Even if you treat DevSecOps as another step in your DevOps journey, you can expect changes to your toolchain, roles on your DevOps and security teams, and how your groups interact. Over 60% of the respondents to [GitLab's 2021 Global DevSecOps Survey][6] report new roles and responsibilities because of DevOps, so prepare your people upfront and keep surprises to a minimum. + +There is a variety of open source DevSecOps tools you can adopt to build out your DevOps pipeline, including: + + * [Alerta][7] consolidates and deduplicates alerts from multiple sources to provide quick visualizations. It integrates with Prometheus, Riemann, Nagios, and other monitoring tools and services for developers. You can use Alerta to customize alerts to meet your requirements. + * [StackStorm][8] offers event-driven automation providing scripted remediations and responses. Some users affectionately call it the "[IFTTT][9] for ops." + * [Grafana][10] allows you to create custom dashboards that aggregate all relevant data to visualize and query security data. + * [OWASP Threat Dragon][11] is a web-based tool that offers system diagramming and a rules engine for modeling and mitigating threats automatically. Threat Dragon touts an easy-to-use interface and seamless integration with other software development tools. + + + +DevSecOps brings a culture, much in the same way that DevOps does. Fostering a DevSecOps culture is about putting security first and making it everybody's job. DevSecOps organizations need to go beyond the mandatory corporate-wide online security training with canned dialogue and bring security into development and business processes. + +### DevSecOps and open source risk mitigation + +Businesses and even government agencies use as much as [90% open source code][12]. That sometimes accounts for hundreds of discrete libraries in a single application. There's no doubt that OSS saves DevOps teams time and money, but it may take a DevSecOps security model to mitigate OSS risk and licensing complexities. + +Forty-six percent of respondents to Synopsys' [DevSecOps Practices and Open Source Management in 2020][13] survey said that media coverage of open source issues affects how they implement controls in their OSS projects. Continuing coverage of the recent supply chain breaches are amping up tech leaders' concerns about the stringency of their controls. + +OSS risk mitigation strategies and DevSecOps go together in many ways, such as: + + * Begin generating a software bill of materials (SBOM) as a quality gate before OSS enters your software supply chain. + * Give [OSS procurement][14] the same attention as you do the vetting, purchase, and intake of enterprise software by bringing in talent from your development, security, and corporate back-office teams. You can adapt your DevSecOps lifecycle to factor in your OSS procurement strategy. + + + +### Final thoughts + +DevSecOps is a noisy topic right now. Plenty of marketers are trying to put their spin on defining it to sell more products to commercial and public-sector enterprises. Even so, the relationship between OSS and DevSecOps remains clean because DevSecOps tools and strategies offer a security gate to bring OSS into the software supply chain and your DevSecOps pipeline while maintaining security and compliance from the first step in the process. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/open-sourcing-devsecops + +作者:[Will Kelly][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) +[2]: https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity/ +[3]: https://www.fedramp.gov/faqs/ +[4]: https://software.af.mil/team/platformone/ +[5]: https://www.gartner.com/en/documents/3987588/hype-cycle-for-agile-and-devops-2020 +[6]: https://about.gitlab.com/developer-survey/ +[7]: https://alerta.io/ +[8]: https://stackstorm.com/ +[9]: https://ifttt.com/ +[10]: https://grafana.com/ +[11]: https://www.owasp.org/index.php/OWASP_Threat_Dragon +[12]: https://www.contrastsecurity.com/security-influencers/how-to-identify-remediate-oss-library-risks +[13]: https://www.synopsys.com/software-integrity/resources/analyst-reports/devsecops-practices-open-source-management.html +[14]: https://thenewstack.io/how-to-standardize-open-source-procurement-and-lower-risk-without-slowing-your-developers/ From dbc94f326be8d3b44b31ab9ac99282a41a24fda2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 19 Jun 2021 05:04:42 +0800 Subject: [PATCH 115/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210618=20?= =?UTF-8?q?Use=20this=20nostalgic=20text=20editor=20on=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210618 Use this nostalgic text editor on FreeDOS.md --- ...e this nostalgic text editor on FreeDOS.md | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 sources/tech/20210618 Use this nostalgic text editor on FreeDOS.md diff --git a/sources/tech/20210618 Use this nostalgic text editor on FreeDOS.md b/sources/tech/20210618 Use this nostalgic text editor on FreeDOS.md new file mode 100644 index 0000000000..384e6f9a9b --- /dev/null +++ b/sources/tech/20210618 Use this nostalgic text editor on FreeDOS.md @@ -0,0 +1,191 @@ +[#]: subject: (Use this nostalgic text editor on FreeDOS) +[#]: via: (https://opensource.com/article/21/6/edlin-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use this nostalgic text editor on FreeDOS +====== +Edlin is a joy to use when I want to edit text the "old school" way. +![Old UNIX computer][1] + +In the very early days of DOS, the standard editor was a no-frills _line editor_ called Edlin. Tim Paterson wrote the original Edlin for the first version of DOS, then called 86-DOS and later branded PC-DOS and MS-DOS. Paterson has commented that he meant to replace Edlin eventually, but it wasn't until ten years later that MS-DOS 5 (1991) replaced Edlin with Edit, a full-screen editor. + +You may know that FreeDOS is an open source DOS-compatible operating system that you can use to play classic DOS games, run legacy business software, or develop embedded systems. FreeDOS has very good compatibility with MS-DOS, and the "Base" package group includes those utilities and programs that replicate the behavior of MS-DOS. One of those classic programs is an open source implementation of the venerable Edlin editor; Edlin is distributed under the GNU General Public License version 2. + +Written by Gregory Pietsch, Edlin is a well-designed, portable editor. You can even compile Edlin on Linux. As Gregory described Edlin in the free ebook 23 Years of FreeDOS, “The top tier parses the input and calls the middle tier, a library called `edlib`, which calls the string and array-handling code to do the dirty work.” But aside from its technical merits, I find Edlin is a joy to use when I want to edit text the "old school" way. + +FreeDOS 1.3 RC4 includes Edlin 2.18. That's actually one revision out of date, but you can download [Edlin 2.19][2] from the FreeDOS files archive on [Ibiblio][3]. You'll find two files there—_edlin-2.19.zip_ contains the source code, and _edlin-219exe.zip_ is just the DOS executable. Download the _edlin-219exe.zip_ file, and extract it to your FreeDOS system. I've unzipped my copy in `C:\EDLIN`. + +Edlin takes a little practice to "get into" it, so let's edit a new file to show a few common actions in Edlin. + +### A walkthrough + +Start editing a file by typing `EDLIN` and then the name of the file to edit. For example, to edit a C programming source file called `HELLO.C`, you might type: + + +``` +`C:\EDLIN> edlin hello.c` +``` + +I've typed the FreeDOS commands in all lowercase here. FreeDOS is actually _case insensitive_, so you can type commands and files in uppercase or lowercase. Typing `edlin` or `EDLIN` or `Edlin` would each run the Edlin editor. Similarly, you can identify the source file as `hello.c` or `HELLO.C` or `Hello.C`. + + +``` +C:\EDLIN> edlin hello.c +edlin 2.19, copyright (c) 2003 Gregory Pietsch +This program comes with ABSOLUTELY NO WARRANTY. +It is free software, and you are welcome to redistribute it +under the terms of the GNU General Public License -- either +version 2 of the license, or, at your option, any later +version. + +hello.c: 0 lines read +* +``` + +Once inside Edlin, you'll be greeted by a friendly `*` prompt. The interface is pretty minimal; no shiny "menu" or mouse support here. Just type a command at the `*` prompt to start editing, revise lines, search and replace, save your work, or exit the editor. + +Since this is a new file, we'll need to add new lines. We'll do this with the _insert_ command, by typing `i` at the `*` prompt. The Edlin prompt changes to `:` where you'll enter your new text. When you are done adding new text, type a period (`.`) on a line by itself. + + +``` +*i + : #include <stdio.h> + : + : int + : main() + : { + :   puts("Hello world"); + : } + : . +* +``` + +To view the text you've entered so far, use the _list_ command by entering `l` at the `*` prompt. Edlin will display lines one screenful at a time, assuming 25 rows on the display. But for this short "Hello world" program, the source code fits on one screen: + + +``` +*l +1: #include <stdio.h> +2: +3: int +4: main() +5: { +6:   puts("Hello world"); +7:*} +* +``` + +Did you notice the `*` on line 7, the last line in the file? That's a special mark indicating your place in the file. If you inserted new text in the file, Edlin would add it at this location. + +Let's update the C source file to return a code to the operating system. To do that, we'll need to add a line _above_ line 7. Since that's where Edlin has the mark, we can use `i` to insert next text before this line. Don't forget to enter `.` on a line by itself to stop entering the new text. + +By listing the file contents afterwards, you can see that we inserted the new text in the correct place, before the closing "curly brace" in the program. + + +``` +*i + :   return 0; + : . +*l +1: #include <stdio.h> +2: +3: int +4: main() +5: { +6:   puts("Hello world"); +7:   return 0; +8:*} +* +``` + +But what if you need to edit a single line in the file? At the `*` prompt,simply type the line number that you want to edit. Edlin works one line at a time, so you'll need to re-enter the full line. In this case, let's update the `main()` function definition to use a slightly different programming syntax. That's on line 4, so type `4` at the prompt, and re-type the line in full. + +Listing the file contents afterwards shows the updated line 4. + + +``` +*4 +4:*main() +4: main(void) +*l +1: #include <stdio.h> +2: +3: int +4:*main(void) +5: { +6:   puts("Hello world"); +7:   return 0; +8: } +* +``` + +When you've made all the changes you need to make, don't forget to save the updated file. Enter `w` at the prompt to _write_ the file back to disk, then use `q` to _quit_ Edlin and return to DOS. + + +``` +*w +hello.c: 8 lines written +*q +C:\EDLIN> +``` + +### Quick reference guide + +That walkthrough shows the basics of using Edlin to edit files. But Edlin does more than just "insert, edit, and save." Here's a handy cheat sheet showing all the Edlin functions, where _text_ indicates a text string, _filename_ is the path and name of a file, and _num_ is a number (use `.` for the current line number, `$` for the last line number). + +`?` | Show help +---|--- +_num_ | Edit a single line +`a` | Append a line below the mark +[_num_]`i` | Insert new lines before the mark +[_num_][`,`_num_]`l` | List the file (starting 11 lines above the mark) +[_num_][`,`_num_]`p` | Page (same as List, but starting at the mark) +[_num_]`,`[_num_]`,`_num_`,`[_num_]`c` | Copy lines +[_num_]`,`[_num_]`,`_num_`m` | Move lines +[_num_][`,`_num_][`?`]`s`_text_ | Search for text +[_num_][`,`_num_][`?`]`r`_text_`,`_text_ | Replace text +[_num_][`,`_num_]`d` | Delete lines +[_num_]`t`_filename_ | Transfer (insert the contents of a new file at the mark) +[_num_]`w`[_filename_] | Write the file to disk +`q` | Quit Edlin +`e`[_filename_] | End (write and quit) + +Programmers will be interested to know they can enter special characters in Edlin, using these special codes: + +`\a` | alert +---|--- +`\b` | backspace +`\e` | escape +`\f` | formfeed +`\t` | horizontal tab +`\v` | vertical tab +`\"` | double quote +`\'` | single quote +`\.` | period +`\\` | backslash +`\x`_XX_ | hexadecimal number +`\d`_NNN_ | decimal number +`\`_OOO_ | octal number +`\^`_C_ | control character + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/edlin-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/retro_old_unix_computer.png?itok=SYAb2xoW (Old UNIX computer) +[2]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/edlin/2.19/ +[3]: https://www.ibiblio.org/ From 516428188daef888e57372406cd41ffdc5d89c10 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 19 Jun 2021 08:42:01 +0800 Subject: [PATCH 116/870] PRF&PUB @geekpi https://linux.cn/article-13501-1.html --- ...210610 Use cpulimit to free up your CPU.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) rename {translated/tech => published}/20210610 Use cpulimit to free up your CPU.md (57%) diff --git a/translated/tech/20210610 Use cpulimit to free up your CPU.md b/published/20210610 Use cpulimit to free up your CPU.md similarity index 57% rename from translated/tech/20210610 Use cpulimit to free up your CPU.md rename to published/20210610 Use cpulimit to free up your CPU.md index 6f90bb03ed..9276c0dd58 100644 --- a/translated/tech/20210610 Use cpulimit to free up your CPU.md +++ b/published/20210610 Use cpulimit to free up your CPU.md @@ -3,24 +3,22 @@ [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13501-1.html) 使用 cpulimit 来释放你的 CPU ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202106/19/084002xuwuuqfww8xvfem7.jpg) -由 [Henning Witzel][2] 拍摄,发布于 [Unsplash][3] +在 Linux 系统上管理系统资源的推荐工具是 [cgroups][4]。虽然在可以调整的限制方面(CPU、内存、磁盘 I/O、网络等)非常强大,但配置 cgroups 并不简单。[nice][5] 命令从 1973 年起就可以使用了。但它只是调整在一个处理器上竞争时间的进程之间的调度优先级。`nice` 命令不会限制一个进程在单位时间内所能消耗的 CPU 周期的百分比。[cpulimit][6] 命令提供了两个世界的最佳方案。它限制了一个进程在每单位时间内可以分配的 CPU 周期的百分比,而且相对容易调用。 -在 Linux 系统上管理系统资源的推荐工具是 [cgroups][4]。虽然在可以调整的限制方面(CPU、内存、磁盘I/O、网络等)非常强大,但配置 cgroups 并不简单。[_nice_][5] 命令从 1973 年起就可以使用了。但它只是调整在一个处理器上竞争时间的进程之间的调度优先级。_nice_ 命令不会限制一个进程在单位时间内所能消耗的 CPU 周期的百分比。_[cpulimit][6]_ 命令提供了两个世界的最佳方案。它限制了一个进程在每单位时间内可以分配的 CPU 周期的百分比,而且相对容易调用。 - -_cpulimit_ 命令主要对长期运行的和 CPU 密集型的进程有用。编译软件和转换视频是长期运行的进程的常见例子,它们可以使计算机的 CPU 使用率达到最大。限制这类进程的 CPU 使用率将释放出处理器时间,供计算机上可能运行的其他任务使用。限制 CPU 密集型进程也将减少功耗及热输出,并可能减少系统的风扇噪音。限制一个进程的 CPU 使用率的代价是,它需要更多的时间来完成运行。 +`cpulimit` 命令主要对长期运行的和 CPU 密集型的进程有用。编译软件和转换视频是长期运行的进程的常见例子,它们可以使计算机的 CPU 使用率达到最大。限制这类进程的 CPU 使用率将释放出处理器时间,供计算机上可能运行的其他任务使用。限制 CPU 密集型进程也将减少功耗及热输出,并可能减少系统的风扇噪音。限制一个进程的 CPU 使用率的代价是,它需要更多的时间来完成运行。 ### 安装 cpulimit -_cpulimit_ 命令在默认的 Fedora Linux 仓库中可用。运行下面的命令,在 Fedora Linux 系统上安装 _cpulimit_: +`cpulimit` 命令在默认的 Fedora Linux 仓库中可用。运行下面的命令,在 Fedora Linux 系统上安装 `cpulimit`: ``` $ sudo dnf install cpulimit @@ -28,7 +26,7 @@ $ sudo dnf install cpulimit ### 查看 cpulimit 的文档 -cpulimit 软件包并没有附带的手册页。使用下面的命令来查看 cpulimit 的内置文档。输出结果在下面提供。但你可能想在你自己的系统上运行该命令,以防止自本文编写以来选项发生变化。 +`cpulimit` 软件包并没有附带的手册页。使用下面的命令来查看 `cpulimit` 的内置文档。输出结果在下面提供。但你可能需要在你自己的系统上运行该命令,以防止自本文编写以来选项发生变化。 ``` $ cpulimit --help @@ -47,7 +45,7 @@ Usage: cpulimit [OPTIONS…] TARGET ### 演示 -为了演示 _cpulimit_ 命令的使用,下面提供了一个精心设计的、计算量很大的 Python 脚本。该脚本首先在没有限制的情况下运行,然后在限制为 50% 的情况下运行。它计算的是第 42 个[斐波那契数][7]的值。该脚本在两种情况下都作为 _time_ 命令的子进程运行,以显示计算答案所需的总时间。 +为了演示 `cpulimit` 命令的使用方式,下面提供了一个精心设计的、计算量很大的 Python 脚本。该脚本首先在没有限制的情况下运行,然后在限制为 50% 的情况下运行。它计算的是第 42 个 [斐波那契数][7] 的值。该脚本在这两种情况下都作为 `time` 命令的子进程运行,以显示计算答案所需的总时间。 ``` $ /bin/time -f '(computed in %e seconds)' /bin/python -c 'f = lambda n: n if n<2 else f(n-1)+f(n-2); print(f(42), end=" ")' @@ -56,15 +54,15 @@ $ /bin/cpulimit -i -l 50 /bin/time -f '(computed in %e seconds)' /bin/python -c 267914296 (computed in 127.38 seconds) ``` -当运行第一个版本的命令时,你可能会听到电脑上的 CPU 风扇转动起来。但在运行第二个版本时,你应该不会。第一个版本的命令不受 CPU 的限制,但它不应该导致你的电脑陷入瘫痪。它是以这样一种方式编写的,它最多只能使用一个 CPU 核心。大多数现代 PC 都有多个 CPU 核心,当其中一个 CPU 100% 繁忙时,可以毫无困难地同时运行其他任务。为了验证第一条命令是否使你的一个处理器达到最大,在一个单独的终端窗口中运行 _top_ 命令并按下 **1**键。按 **Q** 键,退出 _top_ 命令。 +当运行第一个版本的命令时,你可能会听到电脑上的 CPU 风扇转动起来。但在运行第二个版本时,你应该不会。第一个版本的命令不受 CPU 的限制,但它不应该导致你的电脑陷入瘫痪。它是以这样一种方式编写的:它最多只能使用一个 CPU 核心。大多数现代 PC 都有多个 CPU 核心,当其中一个 CPU 100% 繁忙时,可以毫无困难地同时运行其他任务。为了验证第一条命令是否使你的一个处理器达到最大,在一个单独的终端窗口中运行 `top` 命令并按下 `1` 键。要退出 `top` 命令可以按 `Q` 键。 -设置高于 100% 的限制只对能够进行[任务并行化][8]的程序有意义。对于这样的程序,高于 100% 的增量代表一个 CPU 的全部利用率(200%=2 个CPU,300%=3 个CPU,等等)。 +设置高于 100% 的限制只对能够进行 [任务并行化][8] 的程序有意义。对于这样的程序,高于 100% 的增量代表一个 CPU 的全部利用率(200%=2 个CPU,300%=3 个CPU,等等)。 -注意,在上面的例子中,**-i** 选项已经传递给 _cpulimit_ 命令。这是必要的,因为要限制的命令不是 _cpulimit_ 命令的直接子进程。相反,它是_time_命令的一个子进程,而后者又是 _cpulimit_ 命令的一个子进程。如果没有 **-i** 选项,_cpulimit_ 将只限制 _time_ 命令。 +注意,在上面的例子中,`-i` 选项已经传递给 `cpulimit` 命令。这是必要的,因为要限制的命令不是 `cpulimit` 命令的直接子进程。相反,它是 `time` 命令的一个子进程,而后者又是 `cpulimit` 命令的一个子进程。如果没有 `-i` 选项,`cpulimit` 将只限制 `time` 命令。 ### 最后说明 -如果你想限制一个从桌面图标启动的图形程序,请将该程序的 _.desktop_ 文件(通常位于 _/usr/share/applications_ 目录下)复制到你的 _~/.local/share/applications_ 目录下,并相应修改 _Exec_ 行。然后运行下面的命令来应用这些变化。 +如果你想限制一个从桌面图标启动的图形程序,请将该程序的 `.desktop` 文件(通常位于 `/usr/share/applications` 目录下)复制到你的 `~/.local/share/applications` 目录下,并相应修改 `Exec` 行。然后运行下面的命令来应用这些变化: ``` $ update-desktop-database ~/.local/share/applications @@ -76,8 +74,8 @@ via: https://fedoramagazine.org/use-cpulimit-to-free-up-your-cpu/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] -译者:[geekpi](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ab51b5dec2ab0813893734cd2fa370552965873b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 20 Jun 2021 05:03:11 +0800 Subject: [PATCH 117/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210619=20?= =?UTF-8?q?Try=20quantum=20computing=20with=20this=20open=20source=20softw?= =?UTF-8?q?are=20development=20kit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210619 Try quantum computing with this open source software development kit.md --- ...is open source software development kit.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20210619 Try quantum computing with this open source software development kit.md diff --git a/sources/tech/20210619 Try quantum computing with this open source software development kit.md b/sources/tech/20210619 Try quantum computing with this open source software development kit.md new file mode 100644 index 0000000000..a36b70ca20 --- /dev/null +++ b/sources/tech/20210619 Try quantum computing with this open source software development kit.md @@ -0,0 +1,119 @@ +[#]: subject: (Try quantum computing with this open source software development kit) +[#]: via: (https://opensource.com/article/21/6/qiskit) +[#]: author: (Gordon Haff https://opensource.com/users/ghaff) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Try quantum computing with this open source software development kit +====== +Qiskit is an open source software development kit for accessing quantum +simulators and hardware for free. +![Tips and gears turning][1] + +Classical computing is based on bits. Zeros and ones. This isn't because there's some inherent advantage to a binary logic system over logic systems with more states—or even over analog computers. But on-off switches are easy to make and, with modern semiconductor technology, we can make them very small and very cheap. + +But they're not without limits. Some problems just can't be efficiently solved by a classical computer. These tend to be problems where the cost, in time or memory, increases exponentially with the scale (`n`) of the problem. We say such problems are `O(2n)` in [Big O notation][2]. + +Much of modern cryptography even depends on this characteristic. Multiplying two, even large, prime numbers together is fairly cheap computationally (`O(n2)`). But reversing the operation takes exponential time. Use large enough numbers, and decryption that depends on such a factoring attack is infeasible. + +### Enter quantum + +A detailed primer on the mathematical and quantum mechanical underpinnings of quantum computing is beyond the scope of this article. However, here are some basics. + +A quantum computer replaces bits with [qubits][3]—controllable units of computing that display quantum properties. Qubits are typically made out of either an engineered superconducting component or a naturally occurring quantum object such as an electron. Qubits can be placed into a "superposition" state that is a complex combination of the 0 and 1 states. You sometimes hear that qubits are _both_ 0 and 1, but that's not really accurate. What is true is that, when a measurement is made, the qubit state will collapse into a 0 or 1. Mathematically, the (unmeasured) quantum state of the qubit is a point on a geometric representation called the [Bloch sphere][4]. + +While superposition is a novel property for anyone used to classical computing, one qubit by itself isn't very interesting. The next unique quantum computational property is "interference." Real quantum computers are essentially statistical in nature. Quantum algorithms encode an interference pattern that increases the probability of measuring a state encoding the solution. + +While novel, superposition and interference do have some analogs in the physical world. The quantum mechanical property "entanglement" doesn't, and it's the real key to exponential quantum speedups. With entanglement, measurements on one particle can affect the outcome of subsequent measurements on any entangled particles—even ones not physically connected. + +### What can quantum do? + +Today's quantum computers are quite small in terms of the number of qubits they contain—tens to hundreds. Thus, while algorithms are actively being developed, the hardware needed to run them faster than their classical equivalents doesn't exist. + +But there's considerable interest in quantum computing in many fields. For example, quantum computers may offer a good way to simulate natural quantum systems, like molecules, whose complexity rapidly exceeds the ability of classical computers to model them accurately. Quantum computing is also tied mathematically to linear algebra, which underpins machine learning and many other modern optimization problems. Therefore, it's reasonable to think quantum computing could be a good fit there as well. + +One commonly cited example of an existing quantum algorithm likely to outperform classical algorithms is [Shor's algorithm][5], which can do the factoring mentioned earlier. Invented by MIT mathematician Peter Shor in 1994, quantum computers can't yet run the algorithm on larger than trivially sized problems. But it's been demonstrated to work in polynomial `O(n3)` time rather than the exponential time required by classical algorithms. + +### Getting started with Qiskit + +At this point, you may be thinking: "But I don't have a quantum computer, and I really like to get hands-on. Is there any hope?" + +Enter an open source (Apache 2.0 licensed) project called [Qiskit][6]. It's a software development kit (SDK) for accessing both the quantum computing simulators and the actual quantum hardware (for free) in the IBM Quantum Experience. You just need to sign up for an API key. + +Certainly, a deep dive into Qiskit, to say nothing of the related linear algebra, is far beyond what I can get into here. If you seek such a dive, there are [many free resources online][7], including a complete textbook. However, dipping a toe in the water is straightforward, requiring only some surface-level knowledge of Python and Jupyter Notebooks. + +To give you a taste, let's do a "Hello, World!" program entirely within the [Qiskit textbook][8]. + +Begin by installing some tools and widgets specific to the textbook: + + +``` +`pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src` +``` + +Next, do the imports: + + +``` +from qiskit import QuantumCircuit, assemble, Aer +from math import pi, sqrt +from qiskit.visualization import plot_bloch_multivector, plot_histogram +``` + +Aer is the local simulator. Qiskit consists of four components: **Aer**, the **Terra** foundation, **Ignis** for dealing with noise and errors on real quantum systems, and **Aqua** for algorithm development. + + +``` +# Let's do an X-gate on a |0> qubit +qc = QuantumCircuit(1) +qc.x(0) +qc.draw() +``` + +An **X-gate** in quantum computing is similar to a **Not gate** in classical computing, although the underlying math actually involves matrix multiplication. (It is, in fact, often called a **NOT-gate**.) + +Now, run it and do a measurement. The result is as you would expect because the qubit was initialized in a `|0>` state, then inverted, and measured. (Use `|0>` and `|1>` to distinguish from classic bits.) + + +``` +# Let's see the result +svsim = Aer.get_backend('statevector_simulator') +qobj = assemble(qc) +state = svsim.run(qobj).result().get_statevector() +plot_bloch_multivector(state) +``` + +![Bloch sphere showing the expected result][9] + +Bloch sphere showing the expected result. (Gordon Haff, [CC-BY-SA 4.0][10]) + +### Conclusion + +In some respects, you can think of quantum computing as a sort of exotic co-processor for classical computers in the same manner as graphics processing units (GPUs) and field-programmable gate arrays (FPGAs). One difference is that quantum computers will be accessed almost entirely as network resources for the foreseeable future. Another is that they work fundamentally differently, which makes them unlike most other accelerators you might be familiar with. That's why there's so much interest in algorithm development and significant resources going in to determine where and when quantum fits best. It wouldn't hurt to see what all the fuss is about. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/qiskit + +作者:[Gordon Haff][a] +选题:[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/ghaff +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://en.wikipedia.org/wiki/Big_O_notation +[3]: https://en.wikipedia.org/wiki/Qubit +[4]: https://en.wikipedia.org/wiki/Bloch_sphere +[5]: https://en.wikipedia.org/wiki/Shor%27s_algorithm +[6]: https://qiskit.org/ +[7]: https://qiskit.org/learn +[8]: https://qiskit.org/textbook/preface.html +[9]: https://opensource.com/sites/default/files/uploads/bloch-sphere.png (Bloch sphere showing the expected result) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ From 65812e934a56d1934e190cbc31d3a79ffe19c436 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 20 Jun 2021 05:03:37 +0800 Subject: [PATCH 118/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210619=20?= =?UTF-8?q?Here=E2=80=99s=20Why=20Switching=20to=20Linux=20Makes=20Sense?= =?UTF-8?q?=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md --- ... Switching to Linux Makes Sense in 2021.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/news/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md diff --git a/sources/news/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/sources/news/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md new file mode 100644 index 0000000000..495995f82a --- /dev/null +++ b/sources/news/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md @@ -0,0 +1,131 @@ +[#]: subject: (Here’s Why Switching to Linux Makes Sense in 2021) +[#]: via: (https://news.itsfoss.com/switch-to-linux-in-2021/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Here’s Why Switching to Linux Makes Sense in 2021 +====== + +Linux does have several benefits over Windows and macOS in certain areas. People are realizing it, and it is slowly gaining popularity in the desktop OS market. + +Of course, the majority of desktop users still swear by Windows or macOS, but a greater number of users are trying out new Linux distributions to see if they can switch to Linux. + +They may have heard good things about [Linux as a desktop choice][1], or just want to try something different while confined to their homes. Who knows? + +Here, I will be presenting you all the good reasons why Linux makes more sense in 2021. + +### Linux is Great, But What Makes it Relevant in 2021? + +If you already know the [advantages of using Linux][2], you may have an idea what follows next. + +#### 1\. You Do Not Need to Purchase a License + +![][3] + +You do have to pay to get a Windows 10 license. + +While there are cheaper options available, such as getting an OEM key. But, if you want to avoid visiting shady websites and get a license from the official website instead, it will cost you at least **$140** for the **Home edition** that authorizes just 1 PC. + +Of course, macOS is an entirely different story (you need to purchase premium hardware to access macOS) — so we will stick to Microsoft’s Windows here. + +The point is – amid the pandemic with several people jobless, setting up a new computer is a challenge. Moreover, you need to spend money for an operating system’s license while you can use Linux for free on multiple computers. + +Yes, you do not need to get a license key for Linux. You can easily download a [Linux distribution][4] and install it on as many devices as you want. + +Fret not, if you did not know about Linux distros, you can take a look at our list of the [best Linux distributions][5]. + +#### 2\. Revive Your Existing PC and Save Money + +The [global chip shortage situation][6] has significantly affected the price of PC components, especially the **graphics card**. Not just any hike, but you will have to **pay 2-5x times** of the retail price to get a graphics card for your computer. + +Of course, if you do not have a PC, it is incredibly challenging to build one now but what if you have an old system that cannot run Windows 10 without crashing or stuttering? + +If you do not want a Windows-powered system, what about macOS? Well, the entry-level Mac system will cost you upwards of **$1100** or more depending on where you live. It is definitely an expensive endeavor for many. + +You surely need an upgrade – but what if I say that Linux can revive your old system and save you money as well? + +You will be able to run Linux on the very same system that you think is incapable of running the latest version of Microsoft’s Windows. Yes, that is correct. + +Linux is resource-efficient and can run on a variety of older system configurations. + +All you need to do is simply refer to our list of [lightweight Linux distributions][7] and pick one that you like. + +#### 3\. Reduces e-waste by Reviving Systems + +![][8] + +Considering that e-waste is being constantly generated all over the globe, especially by the miners, we can try not to follow the suit? Unless you really need new hardware, it is best to reuse and repurpose existing hardware for new tasks. + +And, thanks to Linux, you can turn your old PC or a single board computer to a media server or your personal [Nextcloud][9] server. + +You can do so much more with Linux on your existing hardware. + +So, this will drop the need for new hardware significantly and let you efficiently reuse your existing system. + +#### 4\. Stay Safe from Viruses and Malware + +![][10] + +In a time where remote work is a thing everywhere, there has been a significant rise in viruses and malware. So, even if you wanted to work peacefully, you might end up getting affected by a malware. + +Both Windows and macOS are susceptible to malware more than ever. But, for Linux? It is highly unlikely. + +Linux distributions are regularly patched to ensure the best security. + +Also, just because the userbase is small, the attackers do not spend much time crafting ways to fool Linux users. So, less chances of you to meet some form of malware while using Linux. + +#### 5\. No Forced Updates + +![][8] + +In a time where everyone is stressed out, getting a forced update and finding your computer to not boot can be a major annoyance. + +At least, this is the case for Windows users. + +But, with Linux, you can keep using your system without any updates forced to download in the background. + +Your operating system, your decision. + +Only if you want to update your Linux distro, you can – or else, it stays that way and will not bother you unless you haven’t updated in a long time. + +### Wrapping Up + +These are only some of the few reasons that I can think of where Linux as a choice of operating system makes sense in 2021 more than ever. + +Of course, depending on your requirements, the benefits may not reflect with your use-case. But, if you did not know about Linux, at least, now you have a choice to make and evaluate your needs. + +What else can you think of in addition to the points mentioned above? Please don’t hesitate to let me know in the comments below. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/switch-to-linux-in-2021/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/ +[2]: https://itsfoss.com/reasons-switch-linux-windows-xp/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://itsfoss.com/what-is-linux-distribution/ +[5]: https://itsfoss.com/best-linux-distributions/ +[6]: https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html +[7]: https://itsfoss.com/lightweight-linux-beginners/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[9]: https://itsfoss.com/nextcloud/ +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= From 752cc35f13434f58ce5763f576585f4e1d23f598 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Sun, 20 Jun 2021 09:50:57 +0800 Subject: [PATCH 119/870] translating --- sources/tech/20210618 Systemd Timers for Scheduling Tasks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md b/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md index 944d84332e..2df167b7fc 100644 --- a/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md +++ b/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/) [#]: author: (Richard England https://fedoramagazine.org/author/rlengland/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (dcoliversun) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9da4ecb83b9449a34cb267ce0fe42afab965297f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 20 Jun 2021 13:38:21 +0800 Subject: [PATCH 120/870] Rename sources/news/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md to sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md --- .../20210619 Here-s Why Switching to Linux Makes Sense in 2021.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md (100%) diff --git a/sources/news/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md similarity index 100% rename from sources/news/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md rename to sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md From 78227e0c82667a310b8af631a0070b4d49828cff Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 20 Jun 2021 14:08:44 +0800 Subject: [PATCH 121/870] PRF @geekpi --- translated/tech/20210608 How FreeDOS boots.md | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210608 How FreeDOS boots.md b/translated/tech/20210608 How FreeDOS boots.md index e041bebf0f..69253de54c 100644 --- a/translated/tech/20210608 How FreeDOS boots.md +++ b/translated/tech/20210608 How FreeDOS boots.md @@ -3,28 +3,30 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) FreeDOS 如何启动 ====== -概述你的计算机如何启动和启动一个像 FreeDOS 的简单操作系统。 -![Code going into a computer.][1] -在使用 DOS 计算机的过程中,我很欣赏的一点是,启动过程相对容易理解。在 DOS 中没有太多的变动组件。而今天,我想和大家分享一下电脑是如何启动和启动像 FreeDOS 这样的简单操作系统的概况。 +> 概述你的计算机如何引导和启动一个像 FreeDOS 这样的简单操作系统。 + +![](https://img.linux.net.cn/data/attachment/album/202106/20/140809fpkrcnow8npnow8p.jpg) + +在使用 DOS 计算机的过程中,我很欣赏的一点是,引导过程相对容易理解。在 DOS 中没有太多的变动组件。而今天,我想和大家分享一下电脑是如何引导和启动像 FreeDOS 这样的简单操作系统的概况。 ### 初始引导 -当你打开计算机的电源时,系统会进行一些自我检查,如验证内存和其他组件。这被称为**开机自检** (Power On Self Test) 或 “POST”。POST 之后,计算机使用一个硬编码指令,告诉它在哪里找到加载操作系统的指令。这就是“引导加载程序”,通常它将试图找到硬盘上的主启动记录 (MBR)。然后,MBR 加载主操作系统。在这里就是 FreeDOS。 +当你打开计算机的电源时,系统会进行一些自我检查,如验证内存和其他组件。这被称为开机自检Power On Self Test(POST)。POST 之后,计算机使用一个硬编码指令,告诉它在哪里找到加载操作系统的指令。这就是“引导加载程序boot loader”,通常它将试图找到硬盘上的主引导记录Master Boot Record(MBR)。然后,MBR 加载主操作系统,在这里就是 FreeDOS。 -这个定位一个信息以便计算机能够加载操作系统的下一个部分的过程被称为“引导” (bootstrapping),来自于“通过引导程序启动自己”的古老说法。正是从这个用法中,我们采用了“启动” (boot) 一词来表示启动你的计算机。 +这个定位一个信息以便计算机能够加载操作系统的下一个部分的过程被称为“引导bootstrapping”,来自于“通过你自己的努力振作起来picking yourself up by your bootstraps”的古老说法。正是从这个用法中,我们采用了“引导boot”一词来表示启动你的计算机。 ### 内核 当计算机加载 FreeDOS 内核时,内核所做的第一件事就是识别用户所表示要使用的任何参数。它被保存在一个叫做 `FDCONFIG.SYS` 的文件中,与内核保存在同一个根目录下。如果 `FDCONFIG.SYS` 不存在,那么 FreeDOS 的内核就会寻找一个叫做 `CONFIG.SYS` 的替代文件。 -如果你在 20 世纪 80 年代或 90 年代使用过 DOS,你可能对 `CONFIG.SYS` 文件很熟悉。从 1999 年起,FreeDOS 首先寻找 `FDCONFIG.SYS`,以防你的 DOS 系统与其他 DOS(如 MS-DOS)有_双启动_。请注意,MS-DOS 只使用 `CONFIG.SYS` 文件。因此,如果你用同一个硬盘同时启动 FreeDOS 和 MS-DOS,MS-DOS 使用 `CONFIG.SYS` 来配置自己,而 FreeDOS 则使用 `FDCONFIG.SYS`。这样一来,双方都可以使用自己的配置。 +如果你在 20 世纪 80 年代或 90 年代使用过 DOS,你可能对 `CONFIG.SYS` 文件很熟悉。从 1999 年起,FreeDOS 首先寻找 `FDCONFIG.SYS`,以防你的 DOS 系统与其他 DOS(如 MS-DOS)做了 _双启动_。请注意,MS-DOS 只使用 `CONFIG.SYS` 文件。因此,如果你用同一个硬盘同时启动 FreeDOS 和 MS-DOS,MS-DOS 使用 `CONFIG.SYS` 来配置自己,而 FreeDOS 则使用 `FDCONFIG.SYS`。这样一来,双方都可以使用自己的配置。 `FDCONFIG.SYS` 可以包含一些配置设置,其中之一是 `SHELL=` 或 `SHELLHIGH=`。任何一个都会指示内核加载这个程序作为用户的交互式 shell。 @@ -32,15 +34,13 @@ FreeDOS 如何启动 ![Bad or missing Command Interpreter][2] -Jim Hall,CC-BY SA 4.0 - 你可以通过查看 `SHELL=` 或 `SHELLHIGH=` 行来调试这个问题。如果做不到这一点,请确保你在 FreeDOS 系统的根目录下有一个名为 `COMMAND.COM` 的程序。它就是 _shell_,我接下来会讲到它。 ### shell 在 DOS 系统中,“shell” 一词通常是指一个命令行解释器:一个交互式程序,它从用户那里读取指令,然后执行它们。在这里,FreeDOS 的 shell 与 Linux 的 Bash shell 相似。 -除非你用 `SHELL=` 或 `SHELLHIGH=` 要求内核加载一个不同的 shell,否则 DOS 上的标准命令行 shell 被称为 `COMMAND.COM`。当 `COMMAND.COM`启动时,它也寻找一个文件来配置自己。默认情况下,`COMMAND.COM` 会在根目录下寻找一个名为 `AUTOEXEC.BAT` 的文件。`AUTOEXEC.BAT` 是一个“批处理文件”,它包含一组启动时运行的指令,大致类似于 Linux 上 Bash 启动时读取的 `~/.bashrc` “资源文件”。 +除非你用 `SHELL=` 或 `SHELLHIGH=` 要求内核加载一个不同的 shell,否则 DOS 上的标准命令行 shell 被称为 `COMMAND.COM`。当 `COMMAND.COM` 启动时,它也寻找一个文件来配置自己。默认情况下,`COMMAND.COM` 会在根目录下寻找一个名为 `AUTOEXEC.BAT` 的文件。`AUTOEXEC.BAT` 是一个“批处理文件”,它包含一组启动时运行的指令,大致类似于 Linux 上 Bash 启动时读取的 `~/.bashrc` “资源文件”。 你可以在 `FDCONFIG.SYS` 文件中用 `SHELL=` 或 `SHELLHIGH=` 改变 shell 以及 shell 的启动文件。FreeDOS 1.3 RC4 安装程序将系统设置为读取 `FDAUTO.BAT` 而不是 `AUTOEXEC.BAT`。这与内核读取另一个配置文件的原因相同;你可以在硬盘上用另一个 DOS 双启动 FreeDOS。FreeDOS 将使用 `FDAUTO.BAT` 而 MS-DOS 将使用 `AUTOEXEC.BAT`。 @@ -48,14 +48,10 @@ Jim Hall,CC-BY SA 4.0 ![Without AUTOEXEC.BAT, the shell will prompt for date and time][3] -Jim Hall, CC-BY SA 4.0 - 就是这些了。当 FreeDOS 加载了内核,而内核也加载了 shell,FreeDOS 就准备好让用户输入命令了。 ![FreeDOS is ready for you to enter your first command][4] -Jim Hall, CC-BY SA 4.0 - -------------------------------------------------------------------------------- via: https://opensource.com/article/21/6/freedos-boots @@ -63,7 +59,7 @@ via: https://opensource.com/article/21/6/freedos-boots 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3f481c5d3b63d5a44b3e5266dd80280ae1dffe99 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 20 Jun 2021 14:09:37 +0800 Subject: [PATCH 122/870] PUB @geekpi https://linux.cn/article-13503-1.html --- {translated/tech => published}/20210608 How FreeDOS boots.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210608 How FreeDOS boots.md (98%) diff --git a/translated/tech/20210608 How FreeDOS boots.md b/published/20210608 How FreeDOS boots.md similarity index 98% rename from translated/tech/20210608 How FreeDOS boots.md rename to published/20210608 How FreeDOS boots.md index 69253de54c..bbad79b7e3 100644 --- a/translated/tech/20210608 How FreeDOS boots.md +++ b/published/20210608 How FreeDOS boots.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13503-1.html) FreeDOS 如何启动 ====== From 1c61ad9ecee008c526e4a398d1e2a4395355421a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 20 Jun 2021 15:20:38 +0800 Subject: [PATCH 123/870] PRF @alim0x --- ...ith CircuitPython and open source tools.md | 70 +++++++++---------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md b/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md index c5447e39b9..804770742f 100644 --- a/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md +++ b/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md @@ -3,55 +3,53 @@ [#]: author: (Darin London https://opensource.com/users/dmlond) [#]: collector: (lujun9972) [#]: translator: (alim0x) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 我如何用 CircuitPython 和开源工具监控温室 ====== -使用微控制器、传感器、Python 以及 MQTT 持续追踪温室的温度、湿度以及环境光。 + +> 使用微控制器、传感器、Python 以及 MQTT 持续追踪温室的温度、湿度以及环境光。 + ![种有西红柿的温室花园][1] -CircuitPython 提供了一种革命性的方式来和微控制器板进行交互。这篇文章介绍了如何使用 CircuitPython 来监测温室的温度、湿度以及环境光,并且使用 CircuitPython MQTT 客户端将结果发布到一个 [MQTT][2] broker。你可以在若干个程序中订阅 MQTT 队列并进一步处理信息。 +CircuitPython 提供了一种和微控制器板进行交互的革命性方式。这篇文章介绍了如何使用 CircuitPython 来监测温室的温度、湿度以及环境光,并且使用 CircuitPython MQTT 客户端将结果发布到一个 [MQTT][2] 中介broker。你可以在若干个程序中订阅 MQTT 队列并进一步处理信息。 -这个项目使用一个简单的 Python 程序来运行 web 服务器,它发布一个 Prometheus 格式的采集端点,拉取监控指标到 [Prometheus][3] 进行不间断的监控。 +这个项目使用一个简单的 Python 程序来运行 Web 服务器,它发布一个 Prometheus 格式的采集端点,拉取监控指标到 [Prometheus][3] 进行不间断的监控。 ### 关于 CircuitPython -[CircuitPython][4] 是一个由 [Adafruit][5] 创建的开源 Python 发行版,用于在低成本微控制器开发板上运行。CircuitPython 在与[兼容的开发板][6]的交互上,提供了一个简单的开发体验。你可以在连接你的开发板时挂载的 `CIRCUITPYTHON` 根驱动器上创建一个 `code.py` 文件来开始你的程序。CircuitPython 还为开发板提供了一个串行连接,包含一个交互式解释器(REPL)会话,你可以使用 Python 代码实时和开发板进行交互。 +[CircuitPython][4] 是一个由 [Adafruit][5] 创建的开源 Python 发行版,用于运行在低成本微控制器开发板上。CircuitPython 为与 [兼容的开发板][6] 的交互提供了简单的开发体验。你可以在连接你的开发板时挂载的 `CIRCUITPYTHON` 根驱动器上创建一个 `code.py` 文件来启动你的程序。CircuitPython 还为开发板提供了一个串行连接,包含一个交互式解释器(REPL)会话,你可以使用 Python 代码实时和开发板进行交互。 -Adafruit 的网站提供了更广泛的文档来帮助你开始使用 CircuitPython。首先,考虑看下这份指南:[欢迎来到 CircuitPython][7]。这份指南能够帮助你开始使用 CircuitPython 在开发板上运行代码以及和 REPL 交互。它还记录了如何安装 Adafruit 的 CircuitPython 库文件包,以及出售的开发板和传感器的一些示例。接下来,阅读 [CircuitPython 基础][8]来学习更多关于它的能力的信息,里面还有链接指向在特定及兼容的开发板上使用 CircuitPython 的相关信息。最后,就如所有开源软件一样,你可以深入 [CircuitPython 的源码][9],发布 issue,以及做出贡献。 +Adafruit 的网站提供了大量的文档,可以帮助你开始使用 CircuitPython。首先,参考下《[欢迎来到 CircuitPython][7]》指南。这份指南能够帮助你开始使用 CircuitPython 在开发板上运行代码以及和 REPL 交互。它还记录了如何安装 Adafruit 的 CircuitPython 库合集和范例,可以用在它出售的许多开发板和传感器上。接下来,阅读《[CircuitPython 基础][8]》指南来学习更多关于其功能的信息,里面还有链接指向在特定及兼容的开发板上使用 CircuitPython 的相关信息。最后,就如所有开源软件一样,你可以深入 [CircuitPython 的源码][9],发布议题,以及做出贡献。 ### 微控制器设置 微控制器系统非常简单。要完成这个示例项目,你会需要: - * **Raspberry Pi 4:**你需要一台电脑来给微控制器系统编程,我用的是树莓派 4。 - * **CircuitPython 兼容的微控制器:**我用的是 [Adafruit FeatherS2][10],带有内置,环境光传感器,Qwiic 线缆输入。 - * **微控制器 WiFi:**FeatherS2 内置了 WiFi。如果你的微控制器没有,你需要给开发板找个 WiFi 扩展板。 - * **传感器:**Feather S2 有个内置的环境光传感器,所以我还需要一个温湿度传感器。有很多不同厂商的产品可以选择,包括 Adafruit、SparkFun、亚马逊。我用的是一个 [Adafruit 传感器][11],带有 Feather S2 输入兼容的 Qwiic 线缆。尽管多数 SparkFun 传感器可以在 Adafruit 库下工作,但如果你不是从 Adafruit 购买的传感器,你可能还是需要自己去找到它兼容 CircuitPython 的 Python 库。 - * **跳线和线缆:**为了避免使用面包板或焊接,我使用 [Adafruit Qwiic 线缆][12]。SparkFun 销售的包含不同长度的[线缆套装][13]中也有它。 - - + * **树莓派 4**:你需要一台电脑来给微控制器系统编程,我用的是树莓派 4。 + * **CircuitPython 兼容的微控制器**:我用的是 [Adafruit Feather S2][10],带有内置 WiFi,环境光传感器,Qwiic 线缆输入。 + * **微控制器 WiFi**:Feather S2 内置了 WiFi。如果你的微控制器没有,你需要给开发板找个 WiFi 扩展板。 + * **传感器**:Feather S2 有个内置的环境光传感器,所以我还需要一个温湿度传感器。有很多不同厂商的产品可以选择,包括 Adafruit、SparkFun、亚马逊。我用的是一个 [Adafruit 传感器][11],带有 Feather S2 输入兼容的 Qwiic 线缆。尽管多数 SparkFun 传感器可以在 Adafruit 库下工作,但如果你不是从 Adafruit 购买的传感器,你可能还是需要自己去找到它兼容 CircuitPython 的 Python 库。 + * **跳线和线缆**:为了避免使用面包板或焊接,我使用 [Adafruit Qwiic 线缆][12]。SparkFun 销售的包含不同长度的[线缆套装][13]中也有它。 在将微控制器连接到你的电脑之前,将传感器连接到微控制器上。 ![将传感器连接到微控制器上][14] -(Darin London, [CC BY-SA 4.0][15]) - 现在你可以将微控制器用 USB 数据线连接到你的电脑。 -### MQTT Broker +### MQTT 中介 -你可以使用[这份说明][16]来在树莓派的系统上安装 [Mosquitto MQTT broker][17] 和 Mosquitto 客户端。如果你想把树莓派做为长期服务器使用,在你的网络上给树莓派 4 设置一个静态 IP 地址。Mosquitto broker 运行起来之后,创建一份[用户名/密码文件][18],设置客户端向 broker 发布和订阅消息时用的认证信息。 +你可以使用 [这份说明][16] 来在树莓派的系统上安装 [Mosquitto MQTT 中介][17] 和 Mosquitto 客户端。如果你想把树莓派做为长期服务器使用,在你的网络上给树莓派 4 设置一个静态 IP 地址。Mosquitto 中介运行起来之后,创建一份 [用户名/密码文件][18],设置客户端向中介发布和订阅消息时用的认证信息。 -你可以用树莓派上的 Mosquitto 客户端来测试 MQTT broker。打开两个终端(如果你是无界面运行的话打开两个 SSH 会话): +你可以用树莓派上的 Mosquitto 客户端来测试 MQTT 中介。打开两个终端(如果你是无界面运行的话打开两个 SSH 会话): 在终端一输入: ``` -`mosquitto_sub -h localhost -u $user -P $pass -t "mqtt/test"` +mosquitto_sub -h localhost -u $user -P $pass -t "mqtt/test" ``` 这条命令会启动一个持续运行的进程,监听发布到 `mqtt/test` 队列的消息。 @@ -59,14 +57,14 @@ Adafruit 的网站提供了更广泛的文档来帮助你开始使用 CircuitPyt 在终端二输入: ``` -`mosquitto_pub -h localhost -u $user -P $pass -t "mqtt/test" -m hello` +mosquitto_pub -h localhost -u $user -P $pass -t "mqtt/test" -m hello` ``` 这条命令会向 `mqtt/test` 队列发布一条消息,它应该会显示在终端一的输出里。 现在你可以中止终端一运行的 `sub` 命令了。 -Mosquitto broker 允许客户端发布消息到任何队列,甚至没有任何订阅的队列也可以。这些消息会永久丢失,但这不会阻止客户端继续发布消息。 +Mosquitto 中介允许客户端发布消息到任何队列,甚至没有任何订阅的队列也可以。这些消息会永久丢失,但这不会阻止客户端继续发布消息。 打开第三个终端,订阅下列队列(你的控制器会发布消息到这些队列上): @@ -74,24 +72,22 @@ Mosquitto broker 允许客户端发布消息到任何队列,甚至没有任何 * greenhouse/light * greenhouse/humidity - ### 给微控制器编码 -现在你已经准备好给微控制器编码,发布它的监测指标到树莓派 4 上运行的 MQTT broker 上了。 +现在你已经准备好给微控制器编码,发布它的监测指标到树莓派 4 上运行的 MQTT 中介上了。 -Adafruit 有[出色的文档][19],指导你使用 [CircuitPython Library Bundle][20] 的库来将你的微控制器连接到 WiFi 路由器,并发布监测指标到 MQTT broker 上。 +Adafruit 有 [出色的文档][19],指导你使用 [CircuitPython 库合集][20] 的库来将你的微控制器连接到 WiFi 路由器,并发布监测指标到 MQTT 中介上。 -安装下列库到 `CIRCUITPYTHON/lib` 目录,温室监控会用到它们。这些库在 Adafruit 的 CircuitPython Library Bundle 中都有提供: +安装下列库到 `CIRCUITPYTHON/lib` 目录,温室监控会用到它们。这些库在 Adafruit 的 CircuitPython 库合集中都有提供: - * **adafruit_bus_device:**一个带有多个 .mpy 文件的 Python 包文件夹(.mpy 是经过压缩的 Python 文件,用以节省空间) - * **adafruit_requests:**单个 .mpy 文件 - * **adafruit_register:**一个包文件夹 - * **adafruit_minimqtt:**一个包文件夹 - * **adafruit_si7021:**单个 .mpy 文件,用来支持温湿度传感器 + * `adafruit_bus_device`:一个带有多个 .mpy 文件的 Python 包文件夹(.mpy 是经过压缩的 Python 文件,用以节省空间) + * `adafruit_requests`:单个 .mpy 文件 + * `adafruit_register`:一个包文件夹 + * `adafruit_minimqtt`:一个包文件夹 + * `adafruit_si7021`:单个 .mpy 文件,用来支持温湿度传感器 库装好了之后,将以下代码写入 `CIRCUITPYTHON` 文件夹的 `code.py` 文件中: - ``` import time import ssl @@ -177,15 +173,15 @@ while True:         time.sleep(0.5) ``` -保存你的代码。然后连接到串行监视器,看程序连接到你的 MQTT broker。你还可以将树莓派 4 上的终端切换到订阅了它的发布队列的终端来查看输出。 +保存你的代码。然后连接到串行监视器,看程序连接到你的 MQTT 中介。你还可以将树莓派 4 上的终端切换到订阅了它的发布队列的终端来查看输出。 ### 处理监测指标 -像 MQTT 的发布/订阅工作流给微控制器系统提供了诸多好处。你可以有多个微控制器+传感器来回报同一个系统的不同指标或并行回报相同指标的若干读数。你还可以有多个不同进程订阅各个队列,并行地对这些消息进行回应。甚至还可以有多个进程订阅相同的队列,对消息做出不同的动作,比如数值过高时发送通知邮件或将消息发送到另一个 MQTT 队列上去。 +像 MQTT 这样的发布/订阅工作流给微控制器系统提供了诸多好处。你可以有多个微控制器 + 传感器来回报同一个系统的不同指标或并行回报相同指标的若干读数。你还可以有多个不同进程订阅各个队列,并行地对这些消息进行回应。甚至还可以有多个进程订阅相同的队列,对消息做出不同的动作,比如数值过高时发送通知邮件或将消息发送到另一个 MQTT 队列上去。 另一个选项是让一个微控制器订阅一个外部队列,可以发送信号告诉微控制器做出动作,比如关闭或开始一个新会话。最后,发布/订阅工作流对低功耗微控制器系统更佳(比如那些使用电池或太阳能的系统),因为这些设备可以在更长的延迟周期后批量发布监测指标,并在回报的间隔期间关闭大量消耗电量的 WiFi 广播。 -要处理这些监测指标,我创建了一个 Python 客户端,使用 [Paho Python MQTT 客户端][21]订阅监测指标队列。我还使用官方的 [Prometheus Python 客户端][22] 创建了一个 web 服务器,它产生一个符合 Prometheus 标准的采集端点,使用这些监测指标作为面板信息。[Prometheus 服务器][23]和 Mosquitto MQTT broker 我都是运行在同一个树莓派 4 上的。 +要处理这些监测指标,我创建了一个 Python 客户端,使用 [Paho Python MQTT 客户端][21] 订阅监测指标队列。我还使用官方的 [Prometheus Python 客户端][22] 创建了一个 Web 服务器,它产生一个符合 Prometheus 标准的采集端点,使用这些监测指标作为面板信息。[Prometheus 服务器][23]和 Mosquitto MQTT 中介我都是运行在同一个树莓派 4 上的。 ``` from prometheus_client import start_http_server, Gauge @@ -237,9 +233,9 @@ if __name__ == '__main__':         client.loop_forever() ``` -然后我配置 Prometheus 服务器采集端点数据到 localhost:8000。 +然后我配置 Prometheus 服务器采集端点数据到 `localhost:8000`。 -你可以在 Github 上访问 [Greenhouse MQTT Microcontroller][24] 这个项目的代码,项目采用 MIT 许可证授权。 +你可以在 Github 上访问 [温室 MQTT 微控制器][24] 这个项目的代码,项目采用 MIT 许可证授权。 -------------------------------------------------------------------------------- @@ -248,7 +244,7 @@ via: https://opensource.com/article/21/5/monitor-greenhouse-open-source 作者:[Darin London][a] 选题:[lujun9972][b] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fb81fcc799afa4a4e54cbc3557ca088fd9eaf3d9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 20 Jun 2021 15:21:26 +0800 Subject: [PATCH 124/870] PUB @alim0x https://linux.cn/article-13504-1.html --- ... my greenhouse with CircuitPython and open source tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md (99%) diff --git a/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md b/published/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md similarity index 99% rename from translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md rename to published/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md index 804770742f..1248ca1e70 100644 --- a/translated/tech/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md +++ b/published/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (alim0x) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13504-1.html) 我如何用 CircuitPython 和开源工具监控温室 ====== From d9f4db284634f22a9572c9942012ce1a8098c9f4 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Sun, 20 Jun 2021 16:35:47 +0800 Subject: [PATCH 125/870] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0210619 Here-s Why Switching to Linux Makes Sense in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md index 495995f82a..afb24fb728 100644 --- a/sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md +++ b/sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/switch-to-linux-in-2021/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 44a9b4acd2543021b904eb5b2a50fcdb8f81cab5 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Sun, 20 Jun 2021 20:40:28 +0800 Subject: [PATCH 126/870] translated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第52行由代码格式更改为正文格式,第55行由正文改为代码,我理解是原文格式错误。 第93、132、152行标号格式与第50、67行不同,不知是否需要统一,烦请留意。 --- ...618 Systemd Timers for Scheduling Tasks.md | 230 ------------------ ...618 Systemd Timers for Scheduling Tasks.md | 227 +++++++++++++++++ 2 files changed, 227 insertions(+), 230 deletions(-) delete mode 100644 sources/tech/20210618 Systemd Timers for Scheduling Tasks.md create mode 100644 translated/tech/20210618 Systemd Timers for Scheduling Tasks.md diff --git a/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md b/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md deleted file mode 100644 index 2df167b7fc..0000000000 --- a/sources/tech/20210618 Systemd Timers for Scheduling Tasks.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: subject: (Systemd Timers for Scheduling Tasks) -[#]: via: (https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/) -[#]: author: (Richard England https://fedoramagazine.org/author/rlengland/) -[#]: collector: (lujun9972) -[#]: translator: (dcoliversun) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Systemd Timers for Scheduling Tasks -====== - -![][1] - -Systemd has provided timers for a while and it is worth taking a look at this feature as an alternative to _cron_. This article will show you how to use timers with _systemd_ to run a task after the system has booted and on a recurring basis after that. This is not a comprehensive discussion of _systemd_, only an introduction to this one feature. - -### Cron vs anacron vs systemd: a quick review - -_Cron_ can schedule a task to be run at a granularity ranging from minutes to months or more. It is relatively simple to set up, requiring a single configuration file. Although the configuration line is somewhat esoteric. It can also be used by general users. - -_Cron_, however, fails if your system happens to not be running when the appropriate execution time occurs. - -_Anacron_, overcomes the “system not running” issue. It insures that the task will be executed when your system is again active. While it was intended to be used by administrators, some systems give general users access. - -However, the _anacron_ frequency of execution can be no less than daily. - -Both _cron_ and _anacron_ have issues with consistency in execution context. Care must be taken that the environment in effect when the task runs is exactly that used when testing. The same shell, environment variables and paths must be provided. This means that testing and debugging can sometimes be difficult. - -_Systemd_ timers offer the best of both _cron_ and _anacron_. Allows scheduling down to minute granularity. Assures that the task will be executed when the system is again running even if it was off during the expected execution time. Is available to all users. You can test and debug the execution in the environment it will run in. - -However, the configuration is more involved, requiring at least two configuration files. - -If your _cron_ and _anacron_ configuration is serving you well then there may not be a reason to change. But _systemd_ is at least worth investigating since it may simplify any current _cron_ /_anacron_ work-arounds. - -### Configuration - -_Systemd_ timer executed functions require, at a minimum, two files. These are the “timer unit” and the “service unit”. Actions consisting of more than a simple command, you will also need a “job” file or script to perform the necessary functions. - -The timer unit file defines the schedule while the service unit file defines the task(s) performed. More details on the .timer unit is available in “man systemd.timer”. Details on the service unit are available in “man systemd.service”. - -There are several locations where unit files exist (listed in the man page). Perhaps the easiest location for the general user, however, is “~/.config/systemd/user”. Note that “user” here, is the literal string “user”. - -### Demo - -This demo is a simple example creating a user scheduled job rather than a system schedule job (which would run as root). It prints a message, date, and time to a file. - - 1. Start by creating a shell script that will perform the task. Create this in your local “bin” directory, for example, in -“~/bin/schedule-test.sh” - - - -``` -To create the file: -``` - -touch  ~/bin/schedule-test.sh -``` - -``` - -Then add the following content to the file you just created. - -``` -#!/bin/sh -echo "This is only a test: $(date)" >> "$HOME/schedule-test-output.txt" -``` - -Remember to make your shell script executable. - - 2. Create the .service unit that will call the script above. Create the directory and file in: -“~/.config/systemd/user/schedule-test.service”: - - - -``` -[Unit] -Description=A job to test the systemd scheduler - -[Service] -Type=simple -ExecStart=/home//bin/schedule-test.sh - -[Install] -WantedBy=default.target -``` - -Note that <user> should be your @HOME address but the “user” in the path name for the unit file is literally the string “user”. - -The _ExecStart_ line should provide an absolute address with no variables. An exception to this is that for _user_ units you may substitute “%h” for $HOME. In other words you can use: - -``` -ExecStart=%h/bin/schedule-test.sh -``` - -This is only for user unit file use. It is not good for system units since “%h” will always return “/root” when run in the system environment. Other substitutions are found in “man systemd.unit” under the heading “SPECIFIERS”. As it is outside the scope of this article, that’s all we need to know about SPECIFIERS for now. - -3\. Create a .timer unit file which actually schedules the .service unit you just created. Create it in the same location as the .service file “~/.config/systemd/user/schedule-test.timer”. Note that the file names differ only in their extensions, that is ,”.service” versus “.timer” - -``` -[Unit] -Description=Schedule a message every 1 minute -RefuseManualStart=no # Allow manual starts -RefuseManualStop=no # Allow manual stops - -[Timer] -#Execute job if it missed a run due to machine being off -Persistent=true -#Run 120 seconds after boot for the first time -OnBootSec=120 -#Run every 1 minute thereafter -OnUnitActiveSec=60 -#File describing job to execute -Unit=schedule-test.service - -[Install] -WantedBy=timers.target -``` - -Note that the .timer file has used “OnUnitActiveSec” to specify the schedule. Much more flexible is the “OnCalendar” option. For example: - -``` -# run on the minute of every minute every hour of every day - OnCalendar=*-*-* *:*:00 -# run on the hour of every hour of every day - OnCalendar=*-*-* *:00:00 -# run every day - OnCalendar=*-*-* 00:00:00 -# run 11:12:13 of the first or fifth day of any month of the year -# 2012, but only if that day is a Thursday or Friday - OnCalendar=Thu,Fri 2012-*-1,5 11:12:13 -``` - -More information on “OnCalendar” is available [here][2]. - -4\. All the pieces are in place but you should test to make certain everything works. First, enable the user service: - -``` -$ systemctl --user enable schedule-test.service -``` - -This should result in output similar to this: - -``` -Created symlink /home//.config/systemd/user/default.target.wants/schedule-test.service → /home//.config/systemd/user/schedule-test.service. -``` - -Now do a test run of the job: - -``` -$ systemctl --user start schedule-test.service -``` - -Check your output file ( $HOME/schedule-test-output.txt ) to insure that your script is -performing correctly. There should be a single entry since we have not started the timer yet. Debug as necessary. Don’t forget to enable the service again if you needed to change your .service file as opposed to the shell script it invokes. - -5\. Once the job works correctly, schedule it for real by enabling and starting the user timer for your service: - -``` -$ systemctl --user enable schedule-test.timer -$ systemctl --user start schedule-test.timer -``` - -Note that you have already started and enabled the service in step 4, above, so it is only necessary to enable and start the timer for it. - -The “enable” command will result in output similar to this: - -``` -Created symlink /home//.config/systemd/user/timers.target.wants/schedule-test.timer → /home//.config/systemd/user/schedule-test.timer. -``` - -and the “start” will simply return you to a CLI prompt. - -### Other operations - -You can check and monitor the service. The first command below is particularly useful if you receive an error from the service unit: - -``` -$ systemctl --user status schedule-test -$ systemctl --user list-unit-files -``` - -Manually stop the service: - -``` -$ systemctl --user stop schedule-test.service -``` - -Permanently stop and disable the timer and the service, reload the daemon config and reset any failure notifications: - -``` -$ systemctl --user stop schedule-test.timer -$ systemctl --user disable schedule-test.timer -$ systemctl --user stop schedule-test.service -$ systemctl --user disable schedule-test.service -$ systemctl --user daemon-reload -$ systemctl --user reset-failed -``` - -### Summary - -This article will jump-start you with _systemd_ timers, however, there is much more to _systemd_ than covered here. This article should provide you with a foundation on which to build. You can explore more about it starting in the [Fedora Magazine systemd series][3] . - -References – Further reading: - - * man systemd.timer - * man systemd.service - * [Use systemd timers instead of cronjobs][4] - * [Understanding and administering systemd][5] - * Also, has a good systemd cheatsheet - - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/ - -作者:[Richard England][a] -选题:[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/rlengland/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/schedule_with_systemd_timer-816x345.jpg -[2]: https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events -[3]: https://fedoramagazine.org/what-is-an-init-system/ -[4]: https://opensource.com/article/20/7/systemd-timers -[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/ diff --git a/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md b/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md new file mode 100644 index 0000000000..f6d756b5aa --- /dev/null +++ b/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md @@ -0,0 +1,227 @@ +[#]: subject: (Systemd Timers for Scheduling Tasks) +[#]: via: (https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/) +[#]: author: (Richard England https://fedoramagazine.org/author/rlengland/) +[#]: collector: (lujun9972) +[#]: translator: (dcoliversun) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用于调度任务的 Systemd 定时器 +====== + +![][1] + +Systemd 提供定时器有一段时间了,定时器替代了 _cron_ 功能,这一特性值得看看。本文将向你介绍在系统启动后如何使用 _systemd_ 中的定时器来运行任务,此后重复运行。这不是对 _systemd_ 的全面讨论,只是介绍这一特性。 + +### Cron、anacron 与 systemd:快速回顾 + +_Cron_ 可以将任务调度以几分钟到几个月或更长时间的粒度运行。设置起来相对简单,只需要一个配置文件。虽然配置过程有些深奥,但一般用户也可以使用。 + + +然而,如果您的系统在需要执行的时间没有运行,那么 _Cron_ 会失败。 + +_Anacron_ 克服了“系统不运行”问题。它确保你的系统再次启动时,任务将执行。虽然它旨在管理员使用,但有些系统允许普通用户访问 _Anacron_。 + +但是,_anacron_ 的执行频率不能低于每天一次。 + +_cron_ 和 _anacron_ 都存在执行上下文一致性的问题。必须注意任务运行时有效的环境与测试时使用的环境完全相同。必须提供相同的 shell、环境变量和路径。这意味着测试和调试有时会很困难。 + +_Systemd_ 定时器提供了 _cron_ 和 _anacron_ 的优点,允许调度到分钟粒度。确保在系统再次运行时执行任务,即使在预期的执行时间内任务处于关闭状态。对所有用户都可用。你可以在它将要运行的环境中测试和调试执行。 + +但是,配置更加复杂,至少需要两个配置文件。 + +如果你的 _cron_ and _anacron_ 配置很好地为你服务,那么可能没有理由改变。但是 _systemd_ 至少值得研究,因为它可以简化任何当前的 _cron_/_anacron_ 工作方式。 + +### 配置 + +_Systemd_ 定时器执行的函数至少需要两个文件。这两个是“定时器timer unit”和“系统服务service unit”。动作不仅仅是简单的命令,你还需要一个“作业”文件或脚本来执行必要的功能。 + +定时器文件定义调度表,而系统服务文件定义执行的任务。有关的更多详细信息参考 “man systemd.timer” 中提供的 .timer unit。服务单元的详细信息可在 “man systemd.service” 中找到。 + +There are several locations where unit files exist (listed in the man page). Perhaps the easiest location for the general user, however, is “~/.config/systemd/user”. Note that “user” here, is the literal string “user”. +单元文件存在于几个位置(在 man page 中列出)。然而,对于普通用户来说,最容易找到的位置可能是 “~/.config/systemd/user”。请注意,这里的“用户”是字符串“用户”。 + +### 示例 + +此示例是一个创建用户调度作业而不是系统调度作业(以root用户身份运行)的简单示例。它将消息、日期和时间打印到文件中。 + + + 1. 首先创建一个执行任务的 shell 脚本。在你的本地 “bin” 目录中创建它,例如在 “~/bin/schedule-test.sh” 中。 + +创建文件: + +``` +touch ~/bin/schedule-test.sh +``` + +然后将以下内容添加到你刚刚创建的文件中。 + +``` +#!/bin/sh +echo "This is only a test: $(date)" >> "$HOME/schedule-test-output.txt" +``` + +记住赋予你的 shell 脚本执行权限。 + + 2. 创建 .service 调用上面的脚本。在以下位置创建目录与文件:“~/.config/systemd/user/schedule-test.service + + + +``` +[Unit] +Description=A job to test the systemd scheduler + +[Service] +Type=simple +ExecStart=/home//bin/schedule-test.sh + +[Install] +WantedBy=default.target +``` + +请注意<用户>应该是你的 @HOME 地址,但是资源文件路径名中的“用户”实际上是字符串“用户”。 + +_ExecStart_ 应该提供一个没有变量的绝对地址。例外情况是,对于 _用户_,您可以用 “%h” 替换 $HOME。换句话说,你可以使用: + +``` +ExecStart=%h/bin/schedule-test.sh +``` + +这仅用于用户文件。这不适用于系统服务,因为在系统环境中运行时 “%h” 总是返回 “/root”。其他替换可在“说明符”下的 “man systemd.unit” 中找到。因为它超出了本文的范围,所以这就是我们目前需要了解的关于说明符的全部内容。 + +3\. 创建一个 .timer 文件,该文件实际上调度你创建的 .service。在 .service 文件相同位置 “~/.config/systemd/user/schedule-test.timer” 创建它。请注意,文件名仅在拓展名上有所不同,例如一个是 “.service”,一个是 ".timer"。 + +``` +[Unit] +Description=Schedule a message every 1 minute +RefuseManualStart=no # Allow manual starts +RefuseManualStop=no # Allow manual stops + +[Timer] +#Execute job if it missed a run due to machine being off +Persistent=true +#Run 120 seconds after boot for the first time +OnBootSec=120 +#Run every 1 minute thereafter +OnUnitActiveSec=60 +#File describing job to execute +Unit=schedule-test.service + +[Install] +WantedBy=timers.target +``` + +请注意,.timer 文件使用了 “OnUnitActiveSec” 来指定调度表。“OnCalendar” 选项更加灵活。例如: + + +``` +# run on the minute of every minute every hour of every day + OnCalendar=*-*-* *:*:00 +# run on the hour of every hour of every day + OnCalendar=*-*-* *:00:00 +# run every day + OnCalendar=*-*-* 00:00:00 +# run 11:12:13 of the first or fifth day of any month of the year +# 2012, but only if that day is a Thursday or Friday + OnCalendar=Thu,Fri 2012-*-1,5 11:12:13 +``` + +有关 “OnCalendar” 的更多信息参见[这里][2]。 + +4\. 所有的部件都已就位,但你应该进行测试,以确保一切正常。首先,启用用户服务: + +``` +$ systemctl --user enable schedule-test.service +``` + +这将导致类似如下的输出: + +``` +Created symlink /home//.config/systemd/user/default.target.wants/schedule-test.service → /home//.config/systemd/user/schedule-test.service. +``` + +现在执行测试工作: + +``` +$ systemctl --user start schedule-test.service +``` + +检查你的输出文件($HOME/schedule-test-output.txt),确保你的脚本运行正常。应该只有一个条目,因为我们还没有启动定时器。必要时进行调试。如果你需要更改 .service 文件,而不是更改它调用的 shell 脚本,请不要忘记再次启用该服务。 + +5\. 一旦作业正常运行,通过为服务启用、启动用户定时器来实时调度作业: + +``` +$ systemctl --user enable schedule-test.timer +$ systemctl --user start schedule-test.timer +``` + +请注意,你已经在上面的步骤4中启动、启用了服务,因此只需要为它启用、启动定时器。 + +启用命令会产生如下输出: + +``` +Created symlink /home//.config/systemd/user/timers.target.wants/schedule-test.timer → /home//.config/systemd/user/schedule-test.timer. +``` + +启动命令将返回命令行界面提示。 + + +### 其他操作 + +你可以检查和监控服务。如果你从系统服务收到错误,下面的第一个命令特别有用: + +``` +$ systemctl --user status schedule-test +$ systemctl --user list-unit-files +``` + +手动停止服务: + +``` +$ systemctl --user stop schedule-test.service +``` + +永久停止并禁用定时器和服务,重新加载守护程序配置并重置任何失败通知: + +``` +$ systemctl --user stop schedule-test.timer +$ systemctl --user disable schedule-test.timer +$ systemctl --user stop schedule-test.service +$ systemctl --user disable schedule-test.service +$ systemctl --user daemon-reload +$ systemctl --user reset-failed +``` + +### 总结 + +本文以 _systemd_ 定时器为出发点,但是 _systemd_ 的内容远不止于此。这篇文章应该为你提供一个基础。你可以从[Fedora Magazine systemd系列][3]开始探索更多。 + +参考 —— 更多阅读: + + * man systemd.timer + * man systemd.service + * [Use systemd timers instead of cronjobs][4] + * [Understanding and administering systemd][5] + * 内有 systemd 快捷查询列表 + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/ + +作者:[Richard England][a] +选题:[lujun9972][b] +译者:[dcoliversun](https://github.com/dcoliversun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/rlengland/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/schedule_with_systemd_timer-816x345.jpg +[2]: https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events +[3]: https://fedoramagazine.org/what-is-an-init-system/ +[4]: https://opensource.com/article/20/7/systemd-timers +[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/ From 3722b8dea4ba27920df01795ff3a8c0997bc23be Mon Sep 17 00:00:00 2001 From: littlebirdnest <63171986+littlebirdnest@users.noreply.github.com> Date: Mon, 21 Jun 2021 00:11:04 +0800 Subject: [PATCH 127/870] Update and rename sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md to translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md --- ...e a long-term boost for 5G availability.md | 87 -------------- ...e a long-term boost for 5G availability.md | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 87 deletions(-) delete mode 100644 sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md create mode 100644 translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md diff --git a/sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md b/sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md deleted file mode 100644 index 8ecf24ea36..0000000000 --- a/sources/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (littlebirdnest) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (FCC auctions should be a long-term boost for 5G availability) -[#]: via: (https://www.networkworld.com/article/3584072/fcc-auctions-should-be-a-long-term-boost-for-5g-availability.html) -[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - -FCC auctions should be a long-term boost for 5G availability -====== -Federal Communications Commission policymaking targets creation of new services by making more spectrum available -[FCC][1] - -As the march towards 5G progresses, it’s apparent that more spectrum will be needed to fully enable it as a service, and the Federal Communications Commission has clearly taken the message to heart. - -### 5G resources - - * [What is 5G? Fast wireless technology for enterprises and phones][2] - * [How 5G frequency affects range and speed][3] - * [Private 5G can solve some problems that Wi-Fi can’t][4] - * [Private 5G keeps Whirlpool driverless vehicles rolling][5] - * [5G can make for cost-effective private backhaul][6] - * [CBRS can bring private 5G to enterprises][7] - - - -The FCC recently finished [auctioning off priority-access licenses for Citizen’s Broadband Radio Service (CBRS)][8] spectrum for 5G, representing 70MHz swath of new bandwidth within the 3.5GHz band. It took in $4.58 billion and is one of several such auctions in recent  years aimed at freeing up more channels for wireless data. In 2011, 2014 and 2015 the FCC auctioned off 65MHz in the low- to mid-band, between roughly 1.7GHz and 2.2GHz, for example, and the 700MHz band. - -But the operative part of the spectrum now is the sub-6GHz or mid-band spectrum, in the same area as that sold off in the [CBRS][9] auction. A forthcoming C-Band auction will be the big one, according to experts, with a whopping 280MHz of spectrum on the table. - -“The big money’s coming with the C-band auction,” said Jason Leigh, a research manager with IDC. “Mid-band spectrum in the U.S. is scarce— that’s why you’re seeing this great urgency.” - -[[Get regularly scheduled insights by signing up for Network World newsletters.]][10] - -While the major mobile-data providers are still expected to snap up the lion’s share of the available licenses in that auction, some of the most innovative uses of the spectrum will be implemented by the enterprise, which will compete against the carriers for some of the available frequencies. - -Specialist networks for [IoT][11], asset tracking and other private networking applications are already possible via private LTE, but the maturation of 5G substantially broadens their scope, thanks to that technology’s advanced spectrum sharing, low-latency and multi-connectivity features. That, broadly, means a lot of new wire-replacement applications, including industrial automation, facilities management and more. - -## Reallocating spectrum means negotiation - -It hasn’t been a simple matter to shift America’s spectrum priorities around, and few would know that better than former FCC chair Tom Wheeler. Much of the spectrum that the government has been pushing to reallocate to mobile broadband over the past decade was already licensed out to various stakeholders, frequently government agencies and satellite network operators. - -Those stakeholders have to be moved to different parts of the spectrum, often compensated at taxpayer expense, and getting the various players to share and share alike has frequently been a complicated process, Wheeler said. - -“One of the challenges the FCC faces is that the allocation of spectrum was first made from analog assumptions that have been rewritten as a result of digital technology,” he pointed out, citing the transition from analog to digital TV as an example. Where an analog TV signal took up 6MHz of spectrum and required guard bands on either side to avoid interference, four or five digital signals can be fit into that one channel. - -Those assumptions have proved challenging to confront. Incumbents have publicly protested the FCC’s moves in the mid-band, arguing that insufficient precautions have been taken to avoid interference with existing services, and that changing frequency assignments often means they have to buy new equipment. - -“I went through it with the [Department of Defense], with the satellite companies, and the fact of the matter is that one of the big regulatory challenges is that nobody wants to give up the nice secure position that they have based on analog assumptions,” said Wheeler. “I think you also have to pay serious consideration, but I found that claims of interference were the first refuge of people who didn’t like the threat of competition or anything else.” - -## The future: more services - -The broader point of the opening of the mid-band to carrier and enterprise use will be potentially major advantages for U.S. businesses, regardless of the exact manner in which that spectrum is opened, according to Leigh. While the U.S. is sticking to the auction format for allocating wireless spectrum, other countries, like Germany, have set aside mid-band spectrum specifically for enterprise use. - -For a given company trying to roll its own private 5G network, that could push spectrum auction prices higher. But, ultimately, the services are going to be available, whether they’re provisioned in-house or sold by a mobile carrier or vendor, as long as there’s enough spectrum available to them. - -“The things you can do on the enterprise side for 5G are what’s going to drive the really futuristic stuff,” he said. - -Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3584072/fcc-auctions-should-be-a-long-term-boost-for-5g-availability.html - -作者:[Jon Gold][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Jon-Gold/ -[b]: https://github.com/lujun9972 -[1]: https://www.flickr.com/photos/fccdotgov/4808818548/ -[2]: https://www.networkworld.com/article/3203489/what-is-5g-fast-wireless-technology-for-enterprises-and-phones.html -[3]: https://www.networkworld.com/article/3568253/how-5g-frequency-affects-range-and-speed.html -[4]: https://www.networkworld.com/article/3568614/private-5g-can-solve-some-enterprise-problems-that-wi-fi-can-t.html -[5]: https://www.networkworld.com/article/3488799/private-5g-keeps-whirlpool-driverless-vehicles-rolling.html -[6]: https://www.networkworld.com/article/3570724/5g-can-make-for-cost-effective-private-backhaul.html -[7]: https://www.networkworld.com/article/3529291/cbrs-wireless-can-bring-private-5g-to-enterprises.html -[8]: https://www.networkworld.com/article/3572564/cbrs-wireless-yields-45b-for-licenses-to-support-5g.html -[9]: https://www.networkworld.com/article/3180615/faq-what-in-the-wireless-world-is-cbrs.html -[10]: https://www.networkworld.com/newsletters/signup.html -[11]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html -[12]: https://www.facebook.com/NetworkWorld/ -[13]: https://www.linkedin.com/company/network-world diff --git a/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md b/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md new file mode 100644 index 0000000000..5f9fb4fd11 --- /dev/null +++ b/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (littlebirdnest) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (FCC auctions should be a long-term boost for 5G availability) +[#]: via: (https://www.networkworld.com/article/3584072/fcc-auctions-should-be-a-long-term-boost-for-5g-availability.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + + + +美国联邦通讯委员的拍卖是长期的有助于5G普及 + +====== + +美国联邦通讯委员新的决策——让更多的频段能够被用于通信 + +在5G的竞争当中,为了让5G的能力完全发挥出来,增加频谱是非常有必要的, 美国联邦通讯委员也知晓这一点 + +什么是5G 给企业和手机更快的传输速度 + + + +5G频率是如何影响5G范围和5G的速度的 + + + +5G能够解决哪些,WiFi无法解决的问题 + + + +5G能够让Whirlpool无人驾驶汽车继续运转 + + + +5G能够让网络回传更有效率 + + + +公民的宽带无线服务将5G带给企业 + +美国联邦通讯委员近日完成了对公民的宽带无线服务5G频谱的拍卖---3.5GHz中的70MHz + +砸进去了45.8个亿的目的,和以往的拍卖不同的地方在于,能腾出更多的频段用于无线传输 + + + +FCC 在 2011 2014和2015年拍卖了 65MHz 的低中频,大致在1.7GHz至2.2GHz,例如现在的700MHz。但是现在可操作的范围的频段是低于6GHz频段或中间频段,刚好是CMRS拍卖的部分,即将到来的C频段拍卖将会是重要一环,根据专家猜测,将会有巨大的280MHz频段进行拍卖 + +C频段的拍卖,将会很有价值” IDC的研究主管Jasom leigh说到 + +中频段在美国是极稀有的,这也就是为什么人们会如此积极 + +然而主要的移动数据提供商仍然希望抢到这次拍卖中的最大份额, + +企业会对新的频段实施一系列的创新,同样将会与运营商竞争一系列可用的频率 + +特别是物联网,资产追踪以及其他的个人应用早已通过LTE网络实现,而5G网络将会有扩大他们的范围,这多亏了 5G的频谱共享,低延迟,多连接的特性。广义讲,能替代更多当前需要线的设备,如工业上的自动化,设备的管理等等 + +重新分配频段就意味着谈判 + +对于想要改变美国的频段优先事项上的问题绝非小事,FCC此前的主席Tom Wheeler对此绝对深有体会,过去10年里,政府一直在推动重新分配频段,而享有频段者的大多是政府机构或者是卫星网络运营商商 + +这些频段享有者被分配到不同频段,常以纳税人的税进行补偿,然后让更多的人进行享用,然而这一过程通常是困难的 + +并指出“ FCC现在要面临的其中一个挑战就是分配频段从原本的模拟信号变成数字信号” 类似于模拟电视变成数字电视 + +当模拟电视要求上到6MHz频段以及要求更宽的宽带去避免冲突,数字信号却能够在一个频率里有5个信号 + +这一系列变革是具有挑战性的,反对者义不容辞公开反对FCC进入中频宽带,并说明这样做会干涉他们原有的设备和服务,也意味着更换频率就等于买新的设备 + +公司讨论过,事实上其中一个较大的原因是监管层的问题,没人想放弃现有体系下基于模拟信号的工作岗位” Wheeler说到,“我觉得你应该考虑周全,但我发现那些所谓宣称信号冲突的人,其实并不关心来自竞争的威胁或者其他事物的威胁。 + +未来:更多的服务 + +将中频段开放给企业和运营商对美国商业将会有更多潜在的优势,无论是具体是哪一个频段开放,根据Leigh的说法,美国应该根据拍卖的形式来分配无线频段,像德国就早已设立专门的中频段来给企业使用 + +对于一家试图推出自己的私有 5G 网络的公司,就可能推高拍卖的价格,但最终,一定要让这项服务存在,无论是内部供应服务还是移动运营商贩卖服务,只要他们有足够的频段使用 + +“企业能够围绕5G做更加有科技含量的事物”他说到 + + +via: https://www.networkworld.com/article/3584072/fcc-auctions-should-be-a-long-term-boost-for-5g-availability.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/littlebirdnest) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.flickr.com/photos/fccdotgov/4808818548/ +[2]: https://www.networkworld.com/article/3203489/what-is-5g-fast-wireless-technology-for-enterprises-and-phones.html +[3]: https://www.networkworld.com/article/3568253/how-5g-frequency-affects-range-and-speed.html +[4]: https://www.networkworld.com/article/3568614/private-5g-can-solve-some-enterprise-problems-that-wi-fi-can-t.html +[5]: https://www.networkworld.com/article/3488799/private-5g-keeps-whirlpool-driverless-vehicles-rolling.html +[6]: https://www.networkworld.com/article/3570724/5g-can-make-for-cost-effective-private-backhaul.html +[7]: https://www.networkworld.com/article/3529291/cbrs-wireless-can-bring-private-5g-to-enterprises.html +[8]: https://www.networkworld.com/article/3572564/cbrs-wireless-yields-45b-for-licenses-to-support-5g.html +[9]: https://www.networkworld.com/article/3180615/faq-what-in-the-wireless-world-is-cbrs.html +[10]: https://www.networkworld.com/newsletters/signup.html +[11]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world From 92a4a09c52daab9b1f40ab8fa88de2aa4e44e777 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 21 Jun 2021 05:03:36 +0800 Subject: [PATCH 128/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210620=20?= =?UTF-8?q?8=20books=20open=20source=20technologists=20should=20read=20thi?= =?UTF-8?q?s=20summer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210620 8 books open source technologists should read this summer.md --- ...e technologists should read this summer.md | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 sources/tech/20210620 8 books open source technologists should read this summer.md diff --git a/sources/tech/20210620 8 books open source technologists should read this summer.md b/sources/tech/20210620 8 books open source technologists should read this summer.md new file mode 100644 index 0000000000..b8fc177bee --- /dev/null +++ b/sources/tech/20210620 8 books open source technologists should read this summer.md @@ -0,0 +1,243 @@ +[#]: subject: (8 books open source technologists should read this summer) +[#]: via: (https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +8 books open source technologists should read this summer +====== +The 2021 Opensource.com summer reading list features eight recommended +books for you to kick back, relax, and learn by reading. +![Reading a book, selfcare][1] + +Welcome to the 2021 Opensource.com summer reading list. This year's list contains eight wonderful book recommendations from members of the Opensource.com community. From classics like Frank Herbert's _Dune_ and a new translation of _Beowulf_ to non-fiction books about the history of tech industry culture, this list has books for readers with different tastes and interests. + +Each recommendation provides valuable insight into why the person who recommended the book thinks it is worth reading. As always, the book selections and reviews shared by my peers are insightful and inspiring. I always learn so much from what they share, and I always enjoy seeing what new and interesting books I will invariably add to my "to read" list. I hope that you will also find something to add to your "to read" pile. + +Enjoy! + +* * * + +## [Beowulf: A New Translation][2] + +[![Beowulf book cover][3]][2] + +**by Maria Dahvana Headley** (recommendation written by [Kevin Sonney][4]) + +From the first line, you know this isn't the same "Beowulf" you slogged through in grade school. + +> Bro! Tell me we still know how to speak of kings! + +Before I fell into the IT field, I was an English major with a deep, abiding love of _Beowulf_. It can be difficult to read, and (at least here in the United States) it is required reading in high school, but many people remember it as a boring read where the language and structure get in the way of the story. In this translation, Headley puts the story first while maintaining a modern translation that is accurate in structure and meaning with the original text. From the opening "Bro!" to the occasional (and appropriate!) vulgarity, to the description of the "Hashtag: Blessed" Queen, readers will find themselves hanging on every line to find out what happens next. Headley's translation, more than any other, is also a joy to read out loud, just as it was for the bards who told it in the mead halls and longhouses of long ago. + +This is a well-researched, well-written, and most importantly, engaging translation of one of the most important historical works of English literature. Headley makes _Beowulf_ FUN to read, and the reader gets immersed in the story, just like the listeners did over their drinks and meals long ago. + +## [Competing on Internet Time: Lessons From Netscape and Its Battle With Microsoft][5] + +[![Competing on Internet Time book cover][6]][5] + +**by Michael A. Cusumano and David B. Yoffie** (recommendation written by [Gaurav Kamathe][7]) + +If you are reading this right now, chances are you are using a web browser. In fact, if you use a computer today in any form, can you imagine computing without a web browser? We spend the majority of time in it today—doing work, connecting with friends, surfing the web, watching movies, playing music, finding directions, ordering food, etc. Sure, apps have replaced some of these functions on mobile devices; however, the browser has in many ways become the operating system when it comes to the internet and the web. + +There was a time when the web was taking root, and browsers were not mainstream. Few people could have imagined the potential of the web and the impact it would have on humankind. The browser is what made the web truly accessible to everybody, beyond just the technically savvy. If you are curious about what went into developing this exciting technology, the company that created it, and the battles it had to fight along the way against a mighty adversary, well, then keep reading. + +_Competing on Internet Time_ traces events between the years 1994 and 1998. It mostly revolves around two companies: Netscape (today known as Mozilla), then a new, up and coming startup with a radical new product (the web browser) that came out of nowhere and grew rapidly to capture 90% of the browser market, and Microsoft, a well-known giant (even then) known for its dominance in the operating system market. The authors interviewed many key figures at both companies and provided their analysis of the events that transpired. This book is an interesting read from both a technology and a business standpoint. It goes in-depth on business strategy, decision-making, the benefits of speed, technology choice, and, more importantly, the culture of these two diverse organizations. + +One key takeaway from the book is how Netscape truly embraced and utilized the internet as a competitive advantage at a time when other companies, including Microsoft, had ignored it for too long. Another takeaway is that Netscape, being the smaller of the two, had the advantage of flexibility, allowing it to introduce new products rapidly. A third lesson is how Microsoft fully utilized its operating system-market monopoly to beat Netscape at its browser game. Netscape tried to counter this by becoming a champion of cross-platform technology and introducing and pushing open standards to keep Microsoft on its back foot. In the face of stiff competition, Netscape turned its business strategy and went from being just a browser company and made forays into intranet, extranet, and enterprise software markets, ultimately losing this battle. All of this and more happened in a span of just four (internet) years. + +## [Dune][8] + +* * * + +* * * + +* * * + +**[![Dune book cover][9]][8]** + +* * * + +**by Frank Herbert** (recommendation written by [Matthew Broberg][10]) + +My first review of _Dune_ was that it was an inventive, solid read. That was [not received well][11] by friends on Twitter. On reflection, I don't think that assessment does it justice. _Dune_ is an exceptionally influential piece of art from the mid-1960s that interweaves futuristic cultures, empires, and religions. It also plays with timelines. Every chapter weaves the future in as the present unfolds. The layers of foreshadowing while the world of Arrakis comes into focus are a joy to read. + +I have since finished the second book in the series and plan to go on to the third. This world is massive, thoughtful, and feels as modern as it is timeless. + +## [Hacking Diversity: The Politics of Inclusion in Open Technology Cultures][12] + +* * * + +* * * + +* * * + +**[![Hacking Diversity book cover][13]][12]** + +* * * + +**by Christina Dunbar-Hester** (recommendation written by [Bryan Behrenshausen][14]) + +What motivates this critical anthropology of open source technology communities isn't the question: _Why aren't open source communities more diverse?_ or even _How do we involve more underrepresented minorities in open source?_ Instead, Dunbar-Hester seeks answers to a more complex question: _How do the ways open source communities discuss diversity and inclusion inadvertently constrain their ability to make these communities more inclusive and diverse?_ + +By embedding herself inside various open technology communities—visiting their makerspaces, attending their meetups, listening at their conferences—Dunbar-Hester offers numerous insights that help readers understand how well-meaning and good-faith diversity, equity, and inclusion initiatives might produce results antithetical to their own aspirations. If you're at all interested in making open source communities more welcoming and inclusive, you'll want to read this book. + +## [Letters to a New Developer: What I Wish I Had Known When Starting My Development Career][15] + +* * * + +* * * + +* * * + +**[![Letters to a New Developer book cover][16]][15]** + +* * * + +**by Dan Moore** (recommendation written by [Joshua Allen Holm][17]) + +If you found yourself entering (or re-entering) the job market during the last year, you found that much of the traditional mentoring structure for starting a new job was seriously disrupted. It is harder to get solid career advice when meetups and meetings are virtual, so, as an alternative, I suggest reading _Letters to a New Developer: What I Wish I Had Known When Starting My Development Career._ + +The book is divided into 10 chapters, covering Your First Month, Questions, Writing, Tools to Learn, Practices, Understanding the Business, Learning, Mistakes, Your Career, and Community. Each chapter begins with a brief introduction followed by a series of letters addressed to the reader about the chapter's subject. The letters are all interesting and engaging to read. + +Having almost the entire book in epistolary format makes this book feel more personal than other career guidance books. After a year of being disconnected because of COVID-19, the human touch of the letter-based approach makes this book a pleasure to read. No book, not even one as excellent as _Letters to a New Developer,_ can replace a few good human mentors who can adjust their advice to specific circumstances, but this is a solid alternative to having ready access to a mentor in the next cubicle. + +I highly recommend picking up a copy, even if you do not think you need career advice. There are many insightful things in _Letters to a New Developer_ that would benefit even someone well-established in their career. + +## [The All-Consuming World][18] + +* * * + +* * * + +* * * + +**[![The All-Consuming World book cover][19]][18]** + +* * * + +**by Cassandra Khaw** (recommendation written by [Kevin Sonney][4]) +Release date: September 7, 2021; review based on an advance review copy + +Khaw, author of the Lovecraftian _Hammers on Bone_ and the hilarious and visceral _Rupert Wong: Canibal Chef_ series, brings her distinctive style to a far-future space cyberpunk thriller. In _The All-Consuming World_, a band of criminals comes out of retirement to return to the mythical planet that once almost destroyed them. Khaw excels at writing realistic, messy characters whose flaws are their greatest strengths. At times visceral and profane, Khaw builds a complex universe with complex people, where those people can be artificial intelligences, rogue hackers, cyborgs, clones, heavily modified humans, and more. + +_The All-Consuming World_ is a fast, violent, and complex ride from the opening heist onward. Khaw adds her voice to the amazing array of recent modern cyberpunk authors with her unique combination of style, wit, and mayhem. This book may not be for everyone, but I enjoyed the heck out of it. + +## [The Language Lover's Puzzle Book: Lexical Perplexities and Cracking Conundrums From Across the Globe][20] + +* * * + +* * * + +* * * + +**[![The Language Lover's Puzzle Book cover][21]][20]** + +* * * + +**by Alex Bellos** (recommendation written by [Joshua Allen Holm][17]) + +Are you a word nerd? Do you love puzzles? If the answer to both those questions is "yes," then _The Language Lover's Puzzle Book_ is the book for you. This book explores interesting facts about language through a series of puzzles and anecdotes. + +Each of the book's 10 chapters covers different aspects of language like numbers and familial relations. You will find puzzles about ancient languages, like Babylonian and Egyptian, modern languages, and even constructed languages like [Dothraki][22]. Each puzzle is a brain teaser that makes you think about how languages work. The puzzles vary in difficulty, but each presents an interesting challenge for the reader to solve. + +A book full of complex puzzles about languages certainly has a niche audience; still, the anecdotes contained within are interesting enough to make _The Language Lover's Puzzle Book_ something enjoyable even to a reader not interested in solving the puzzles for themselves. Solving the puzzles is very much the point of the book, but the information in the book is still fascinating and informative, even to readers who do not want to challenge themselves with puzzle solving. + +You can watch Alex Bellos' [talk at the Royal Institution][23] for a preview of the puzzles and anecdotes contained in _The Language Lover's Puzzle Book_. + +This review was based on the UK edition of _The Language Lover's Puzzle Book_. A [US edition][24] with the title _The Language Lover's Puzzle Book: Perple_ing Le_ical Patterns to Unmi_ and Ve_ing Synta_ to Outfo__ is due out in November and available now for preorder. + +## [Understanding the Digital World: What You Need to Know about Computers, the Internet, Privacy, and Security, Second Edition][25] + +* * * + +* * * + +* * * + +**[![Understanding the Digital World book cover][26]][25]** + +* * * + +**by Brian W. Kernighan** (recommendation written by [Jim Hall][27]) + +I loved reading _Understanding the Digital World_. While it's listed as a textbook on Amazon, I didn't find it an "academic" text. It's almost a casual introduction to technology, from basic ideas such as "what is a computer" and "analog versus digital" to more advanced topics including mobile devices, internet communication, artificial intelligence, and cryptography. + +Kernighan introduces each topic in a conversational way, so you don't feel like you're stepping up to a more advanced topic. Rather, it's a natural progression or flow from one topic to the next. + +I especially appreciated his demonstration of the Toy Computer, a hypothetical computer model you can experiment with in a web browser. With the Toy, Kernighan explains the fundamentals of Assembly programming without getting lost in the details of macro assembly and specific registers. I found this an approachable way to discuss the topic. + +I also appreciated Kernighan's discussion about operating systems further into the book. Kernighan explains this technical concept in clear terms, breaking down the components into easily understood sections. + +_Understanding the Digital World_ would make a great gift for anyone interested in technology at almost any age level. + +* * * + +Not seeing something that piques your interest? Check out our previous lists for more suggestions: + + * [2020 Opensource.com summer reading list][28] + * [2019 Opensource.com summer reading list][29] + * [2018 Open Organization summer reading list][30] + * [2016 Opensource.com summer reading list][31] + * [2015 Opensource.com summer reading list][32] + * [2014 Opensource.com summer reading list][33] + * [2013 Opensource.com summer reading list][34] + * [2012 Opensource.com summer reading list][35] + * [2011 Opensource.com summer reading list][36] + * [2010 Opensource.com summer reading list][37] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list + +作者:[Joshua Allen Holm][a] +选题:[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/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/reading_book_selfcare_wfh_learning_education_520.png?itok=H6satV2u (Reading a book, selfcare) +[2]: https://us.macmillan.com/books/9780374110031 +[3]: https://opensource.com/sites/default/files/uploads/beowulf.jpg (Beowulf book cover) +[4]: https://opensource.com/users/ksonney +[5]: https://www.simonandschuster.com/books/Competing-On-Internet-Time/David-B-Yoffie/9780684831121 +[6]: https://opensource.com/sites/default/files/uploads/competing_on_internet_time.jpg (Competing on Internet Time book cover) +[7]: https://opensource.com/users/gkamathe +[8]: https://dunenovels.com/dune/ +[9]: https://opensource.com/sites/default/files/uploads/dune.jpg (Dune book cover) +[10]: https://opensource.com/users/mbbroberg +[11]: https://twitter.com/mbbroberg/status/1372323276802961408 +[12]: https://press.princeton.edu/books/hardcover/9780691182070/hacking-diversity +[13]: https://opensource.com/sites/default/files/uploads/hacking_diversity.jpg (Hacking Diversity book cover) +[14]: https://opensource.com/users/bbehrens +[15]: https://letterstoanewdeveloper.com/the-book/ +[16]: https://opensource.com/sites/default/files/uploads/letters_to_a_new_developer_150.jpg (Letters to a New Developer book cover) +[17]: https://opensource.com/users/holmja +[18]: https://www.erewhonbooks.com/books/the-all-consuming-world-cassandra-khaw +[19]: https://opensource.com/sites/default/files/uploads/the_all-consuming_world.jpg (The All-Consuming World book cover) +[20]: https://www.alexbellos.com/language +[21]: https://opensource.com/sites/default/files/uploads/the_language_lover_s_puzzle_book.jpg (The Language Lover's Puzzle Book cover) +[22]: https://en.wikipedia.org/wiki/Dothraki_language +[23]: https://www.youtube.com/watch?v=2NLquktkdqk +[24]: https://www.amazon.com/dp/B08WK5X45V/ +[25]: https://press.princeton.edu/books/hardcover/9780691219097/understanding-the-digital-world +[26]: https://opensource.com/sites/default/files/uploads/understanding_the_digital_world.jpg (Understanding the Digital World book cover) +[27]: https://opensource.com/users/jim-hall +[28]: https://opensource.com/article/20/6/summer-reading-list +[29]: https://opensource.com/article/19/6/summer-reading-list +[30]: https://opensource.com/open-organization/18/6/summer-reading-2018 +[31]: https://opensource.com/life/16/6/2016-summer-reading-list +[32]: https://opensource.com/life/15/6/2015-summer-reading-list +[33]: https://opensource.com/life/14/6/annual-reading-list-2014 +[34]: https://opensource.com/life/13/6/summer-reading-list-2013 +[35]: https://opensource.com/life/12/7/your-2012-open-source-summer-reading +[36]: https://opensource.com/life/11/7/summer-reading-list +[37]: https://opensource.com/life/10/8/open-books-opensourcecom-summer-reading-list From f69bea1f14d2f42be33a45adae61131ca30012bd Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 21 Jun 2021 08:48:34 +0800 Subject: [PATCH 129/870] translated --- ...15 Build a static website with Eleventy.md | 145 ------------------ ...15 Build a static website with Eleventy.md | 142 +++++++++++++++++ 2 files changed, 142 insertions(+), 145 deletions(-) delete mode 100644 sources/tech/20210615 Build a static website with Eleventy.md create mode 100644 translated/tech/20210615 Build a static website with Eleventy.md diff --git a/sources/tech/20210615 Build a static website with Eleventy.md b/sources/tech/20210615 Build a static website with Eleventy.md deleted file mode 100644 index f23d477ffd..0000000000 --- a/sources/tech/20210615 Build a static website with Eleventy.md +++ /dev/null @@ -1,145 +0,0 @@ -[#]: subject: (Build a static website with Eleventy) -[#]: via: (https://opensource.com/article/21/6/static-site-builder) -[#]: author: (Nwokocha Wisdom https://opensource.com/users/wise4rmgod) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Build a static website with Eleventy -====== -Eleventy is a JavaScript-based alternative to Jekyll and Hugo for -building static websites. -![Digital images of a computer desktop][1] - -A static site generator is a tool that generates a full, static HTML website based on raw data and a set of templates. It automates the task of coding individual HTML pages and gets those pages ready to serve to users. Because the HTML pages are prebuilt, they load very quickly in users' browsers. - -Static sites work particularly well for documentation, too, because static sites are easy to scale, and they're an easy way to generate, maintain, and deploy your project's documentation. For these reasons, organizations often use them to document application programming interfaces (APIs), database schemas, and other information. Documentation is an important part of software development, design, and other aspects of tech. All codebases require some form of documentation, with options ranging from a simple README to full documentation. - -### Eleventy: A static site generator - -[Eleventy][2] (11ty) is a simple static site generator and an alternative to [Jekyll][3] and [Hugo][4]. It's written in JavaScript and transforms a directory of templates (of varying types) into HTML. It's also open source, released under the MIT License. - -Eleventy works with HTML, Markdown, Liquid, Nunjucks, Handlebars, Mustache, EJS, Haml, Pug, and JavaScript Template Literals. - -Its features include: - - * Easy setup - * Supports multiple template languages (e.g., Nunjucks, HTML, JavaScript, Markdown, Liquid) - * Customizable - * Based on JavaScript, which is familiar to many web developers and easy for new users to learn - - - -### Install Eleventy - -Eleventy requires Node.js. On Linux, you can install Node.js using your package manager: - - -``` -`$ sudo dnf install nodejs` -``` - -If your package manager doesn't have Node.js available, or if you're not on Linux, you can [install it][5] from the Node.js website. - -Once Node.js is installed, use it to install Eleventy: - - -``` -`$ npm install -g @11ty/eleventy` -``` - -That's it! - -### Build a static site for your documentation - -Now you can start using Eleventy to build your static documentation site. Here are the steps to follow. - -#### 1\. Create a package.json file - -To install Eleventy into your project, you need a package.json file: - - -``` -`$ npm init -y` -``` - -#### 2\. Install Eleventy into package.json - -Install and save Eleventy into your project's `package.json` by running: - - -``` -`$ npm install-save-dev @11ty/eleventy` -``` - -#### 3\. Run Eleventy - -Use the `npx` command to run your local project's version of Eleventy. After you verify installation went as expected, try to run Eleventy: - - -``` -`$ npx @11ty/eleventy` -``` - -#### 4\. Create some templates - -Now run two commands to create two new template files (an HTML and a Markdown file): - - -``` -$ cat << EOF >> index.html -<!doctype html><html> -<head> -<title>Page title</title> -</head><body> -<p>Hello world</p> -</body></html> -EOF -$ echo '# Page header' > index.md -``` - -This compiles any content templates in the current directory or subdirectories into the output folder (which defaults to `_site`). - -Run `eleventy --serve` to start a development web server. - - -``` -`$ npx @11ty/eleventy-serve` -``` - -Open `http://localhost:8080/README/` in the web browser of your choice to see your Eleventy output. - -Then upload the files in `_site` to your web server to publish your site for the world to see. - -### Try Eleventy - -Eleventy is a static site generator that's easy to use, template, and theme. If you're already using Node.js in your development workflow, Eleventy may be a more natural fit than Jekyll or Hugo. It provides great results quickly and saves you from complex site design and maintenance. To learn more about using Eleventy, read through its [documentation][6]. - -* * * - -_This is based on [Building a technical documentation static site for open source projects][7], which first appeared on Nwokocha Wisdom Maduabuchi's Medium site, and is republished with permission._ - -See how Jekyll, an open source generator of static HTML files, makes running a blog as easy as... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/static-site-builder - -作者:[Nwokocha Wisdom][a] -选题:[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/wise4rmgod -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop) -[2]: https://www.11ty.dev/ -[3]: https://opensource.com/article/17/4/getting-started-jekyll -[4]: https://opensource.com/article/18/3/start-blog-30-minutes-hugo -[5]: https://nodejs.org/en/ -[6]: https://www.11ty.dev/docs/getting-started/ -[7]: https://wise4rmgodadmob.medium.com/building-a-technical-documentation-static-site-for-open-source-projects-7af4e73d77f0 diff --git a/translated/tech/20210615 Build a static website with Eleventy.md b/translated/tech/20210615 Build a static website with Eleventy.md new file mode 100644 index 0000000000..8d75bc81f2 --- /dev/null +++ b/translated/tech/20210615 Build a static website with Eleventy.md @@ -0,0 +1,142 @@ +[#]: subject: (Build a static website with Eleventy) +[#]: via: (https://opensource.com/article/21/6/static-site-builder) +[#]: author: (Nwokocha Wisdom https://opensource.com/users/wise4rmgod) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Eleventy 建立一个静态网站 +====== +Eleventy 是一个基于 JavaScript 的 Jekyll 和 Hugo 的替代品,用于构建静态网站。 +![Digital images of a computer desktop][1] + +静态网站生成器是一种基于原始数据和一组模板生成完整的静态 HTML 网站的工具。它自动完成单个 HTML 页面的编码任务,并让这些页面准备好为用户服务。由于 HTML 页面是预先建立的,它们在用户的浏览器中加载得非常快。 + +静态网站对文档也很友好,因为静态网站很容易扩展,而且它们是生成、维护和部署项目文档的一种简单方法。由于这些原因,企业经常使用它们来记录应用编程接口 (API)、数据库模式和其他信息。文档是软件开发、设计和其他方面技术的一个重要组成部分。所有的代码库都需要某种形式的文档,选择范围从简单的 README 到完整的文档。 + +### Eleventy: 一个静态网站生成器 + +[Eleventy][2] (11ty) 是一个简单的静态网站生成器,是 [Jekyll][3] 和 [Hugo][4] 的替代品。它是用 JavaScript 编写的,它将一个模板目录(不同类型)转化为 HTML。它也是开源的,在 MIT 许可下发布。 + +Eleventy 可以与 HTML、Markdown、Liquid、Nunjucks、Handlebars、Mustache、EJS、Haml、Pug 和 JavaScript Template Literals 协同工作。 + +它的特点包括: + + * 易于设置 + * 支持多种模板语言(如 Nunjucks、HTML、JavaScript、Markdown、Liquid) + * 可定制 + * 基于 JavaScript,这是许多网络开发者所熟悉的,新用户也容易学习 + + + +### 安装 Eleventy + +Eleventy 需要 Node.js。在 Linux 上,你可以使用你的包管理器安装 Node.js: + + +``` +`$ sudo dnf install nodejs` +``` + +如果你的包管理器没有 Node.js,或者你不在 Linux 上,你可以从 Node.js 网站[安装它][5]。 + +Node.js 安装完毕后,就用它来安装 Eleventy: + + +``` +`$ npm install -g @11ty/eleventy` +``` + +这就完成了! + +### 为你的文档建立一个静态网站 + +现在你可以开始使用 Eleventy 来建立你的静态文档网站。以下是需要遵循的步骤。 + +#### 1\. 创建一个 package.json 文件 + +要将 Eleventy 安装到你的项目中,你需要一个 package.json 文件: + + +``` +`$ npm init -y` +``` + +#### 2\. 将 Eleventy 安装到 package.json 中 + +安装 Eleventy 并保存到你的项目的 `package.json` 中,通过运行: + + +``` +`$ npm install-save-dev @11ty/eleventy` +``` + +#### 3\. 运行 Eleventy + +使用 `npx` 命令来运行你本地项目的 Eleventy 版本。在你确认安装完成后,尝试运行 Eleventy: + + +``` +`$ npx @11ty/eleventy` +``` + +#### 4\. 创建一些模板 + +现在运行两个命令来创建两个新的模板文件(一个 HTML 和一个 Markdown 文件): + + +``` +$ cat << EOF >> index.html +<!doctype html><html> +<head> +<title>Page title</title> +</head><body> +<p>Hello world</p> +</body></html> +EOF +$ echo '# Page header' > index.md +``` + +这就把当前目录或子目录中的任何内容模板编译到输出文件夹中(默认为 `_site`)。 + +运行 `eleventy --serve` 来启动一个开发网络服务器。 + + +``` +`$ npx @11ty/eleventy-serve` +``` + +在你的网络浏览器中打开 `http://localhost:8080/README/`,看你的 Eleventy 输出。 + +然后把 `_site` 中的文件上传到你的网络服务器,发布你的网站给世界看。 + +### 尝试 Eleventy + +Eleventy 是一个静态网站生成器,它易于使用,有模板和主题。如果你已经在你的开发流程中使用 Node.js,Eleventy 可能比 Jekyll 或 Hugo 更自然。它能快速提供很好的结果,并使你免于复杂的网站设计和维护。要了解更多关于使用 Eleventy 的信息,请仔细阅读它的[文档][6]。 + +* * * + +_本文基于[为开源项目建立技术文档静态网站][7],首次发布在 Nwokocha Wisdom Maduabuchi 的 Medium 上,经授权转载。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/static-site-builder + +作者:[Nwokocha Wisdom][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/wise4rmgod +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop) +[2]: https://www.11ty.dev/ +[3]: https://opensource.com/article/17/4/getting-started-jekyll +[4]: https://opensource.com/article/18/3/start-blog-30-minutes-hugo +[5]: https://nodejs.org/en/ +[6]: https://www.11ty.dev/docs/getting-started/ +[7]: https://wise4rmgodadmob.medium.com/building-a-technical-documentation-static-site-for-open-source-projects-7af4e73d77f0 From 12a165bfbcb388b2b0722a643df59c86fc04fdfc Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 21 Jun 2021 08:52:40 +0800 Subject: [PATCH 130/870] translating --- ...Migrate virtual machines to Kubernetes with this new tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md b/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md index 6cca2c61a8..9c0a793f62 100644 --- a/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md +++ b/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift) [#]: author: (Miguel Perez Colino https://opensource.com/users/mperezco) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4dd26ba2c397b53001df8c9d5bda86a6f61c1a76 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 21 Jun 2021 16:26:48 +0800 Subject: [PATCH 131/870] PRF @geekpi --- ...xplore the Kubernetes ecosystem in 2021.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md b/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md index f6194aaa18..d755047e3a 100644 --- a/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md +++ b/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md @@ -3,38 +3,40 @@ [#]: author: (Chris Collins https://opensource.com/users/clcollins) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -在 2021 年探索 Kubernetes 生态系统 +探索 Kubernetes 生态系统(2021 版) ====== -这份可下载的指南充满了有用的教程,让 SRE 和系统管理员使用 Kubernetes 获得便利。 -![A ship wheel with someone steering][1] + +> 这份可下载的指南充满了有用的教程,让 SRE 和系统管理员使用 Kubernetes 获得便利。 + +![](https://img.linux.net.cn/data/attachment/album/202106/21/162617ikidrw6q8i6nif2n.jpg) Kubernetes 是容器编排的事实标准,在基础设施管理和应用开发方面已经迅速发展成为容器环境的主导。作为一个拥有庞大的爱好者和专业人士社区的开源平台,以及作为云原生计算基金会的一部分,Kubernetes 不仅成为一个强大而令人印象深刻的编排系统本身,而且它还促进了一个庞大的相关工具和服务的生态系统,使其更容易使用,并通过更强大和复杂的组件扩展其功能。 -在这本新的电子书中,[给 SRE 和系统管理员的 Kubernetes 指导_][2],[Jess Cherry][3](Ben Finkel 也有贡献)涵盖了一系列相关的工具和服务,用于管理和整合 Kubernetes。Cherry 和 Finkel 提供了一些有用的_入门_指南,包括 Kubernetes 和一些工具。他们甚至还分享了面试问题,以帮助读者为在这个快速增长的大规模生态系统中工作做好准备。 +在这本新的电子书《[给 SRE 和系统管理员的 Kubernetes 指导][2]》中,[Jess Cherry][3](Ben Finkel 也有贡献)涵盖了一系列用于管理和整合 Kubernetes 的工具和服务。Cherry 和 Finkel 提供了一些有用的 _入门_ 指南,包括 Kubernetes 和一些工具。他们甚至还分享了面试问题,以帮助读者为在这个快速增长的大规模生态系统中工作做好准备。 ### 了解 Kubernetes -如果你刚开始接触 Kubernetes 和容器,Ben Finkel 的 _[Kubernetes 入门][4]_既是恰当的标题,也是对你需要了解的相关概念的出色介绍。它也是一本轻量级的快速入门指南,用于设置和使用单节点集群进行测试。没有什么比亲身体验技术并直接进入学习更好的方法了。什么是 Pod? 如何在集群上部署一个应用程序? Ben 为你介绍。 +如果你刚开始接触 Kubernetes 和容器,Ben Finkel 的 《[Kubernetes 入门][4]》文如其题,也是一篇对你需要了解的相关概念的出色介绍。它也是一本轻量级的快速入门指南,用于设置和使用单节点集群进行测试。没有什么比亲身体验技术并直接进入学习更好的方法了。什么是吊舱Pod? 如何在集群上部署一个应用程序? Ben 一一为你做了介绍。 -与集群交互的主要方式是 [**kubectl**][5] 命令,一种 CLI 工具,它提供了一种人类可以访问的方式,与管理集群本身的 API 服务器交互。例如,你可以使用 **kubectl get** 来列出上述的 Pod 和部署,但正如你对 Kubernetes 这样复杂的东西所期望的那样,它的 CLI 界面有很强的功能和灵活性。Jess Cherry 的 [_9 个系统管理员需要知道的 kubectl 命令_][6]速记是一个很好的介绍,是开始使用 **kubectl** 的好方法。 +与集群交互的主要方式是 [kubectl][5] 命令,这是一种 CLI 工具,它提供了一种与管理集群本身的 API 服务器交互的适合方式。例如,你可以使用 `kubectl get` 来列出上述的吊舱和部署,但正如你对 Kubernetes 这样复杂的东西所期望的那样,它的 CLI 界面有很强的功能和灵活性。Jess Cherry 的《[9 个系统管理员需要知道的 kubectl 命令][6]》速查表是一个很好的介绍,是使用 `kubectl` 的入门好方法。 -同样,Cherry 的_[给初学者的 Kubernetes 命令空间[7]_也很好地解释了什么是命名空间以及它们在 Kubernetes 中的使用方式。 +同样,Cherry 的《[给初学者的 Kubernetes 命令空间][7]》也很好地解释了什么是命名空间以及它们在 Kubernetes 中的使用方式。 -### 简化与 Kubernetes 的工作 +### 简化 Kubernetes 的工作 -在一个复杂的系统中工作是很困难的,尤其是像 **kubectl** 这样强大但最小的 CLI 工具。幸运的是,在围绕 Kubernetes 的生态系统中,有许多工具可用于简化事情,使扩展服务和集群管理更容易。 +在一个复杂的系统中工作是很困难的,尤其是使用像 `kubectl` 这样强大而极简的 CLI 工具。幸运的是,在围绕 Kubernetes 的生态系统中,有许多工具可用于简化事情,使扩展服务和集群管理更容易。 -**kubectl** 命令可用于在 Kubernetes 上部署和维护应用和服务,主要是使用 YAML 和 JSON。 一旦你开始管理超过几个应用,然而,用 YAML 的大型仓库这样做会变得既重复又乏味。一个好的解决方案是采用一个模板化的系统来处理你的部署。[Helm][8]就是这样一个工具,被称为 _Kubernetes 的包管理器_,Helm 提供了一种方便的方式来打包和共享应用。Cherry 写了很多关于 Helm 的有用文章:创建有效的 [Helm 图表][9]和有用的 [Helm 命令][10]。 +可用于在 Kubernetes 上部署和维护应用和服务的 `kubectl` 命令主要使用的是 YAML 和 JSON。然而,一旦你开始管理更多应用,用 YAML 的大型仓库这样做会变得既重复又乏味。一个好的解决方案是采用一个模板化的系统来处理你的部署。[Helm][8] 就是这样一个工具,被称为 “Kubernetes 的包管理器”,Helm 提供了一种方便的方式来打包和共享应用。Cherry 写了很多关于 Helm 的有用文章:创建有效的 《[Helm 海图][9]》和有用的《[Helm 命令][10]》。 -**kubectl** 也为你提供了很多关于集群本身的信息:上面运行的是什么,以及正在发生的事件。这些信息可以通过 **kubectl** 来查看和交互,但有时有一个更直观的 GUI 来进行交互是有帮助的。[K9s][11] 符合这两个世界的要求。虽然它仍然是一个终端应用,但它提供了视觉反馈和一种与集群交互的方式,而不需要长长的 **kubectl** 命令。Cherry 也写了一份很好的[开始使用 k9s][12] 的指南。 +`kubectl` 也为你提供了很多关于集群本身的信息:上面运行的是什么,以及正在发生的事件。这些信息可以通过 `kubectl` 来查看和交互,但有时有一个更直观的 GUI 来进行交互是有帮助的。[K9s][11] 符合这两个世界的要求。虽然它仍然是一个终端应用,但它提供了视觉反馈和一种与集群交互的方式,而不需要长长的 `kubectl` 命令。Cherry 也写了一份很好的《[k9s 使用入门][12]》的指南。 ### 建立在 Kubernetes 的强大和灵活性之上的扩展 -幸运的是,尽管 Kubernetes 是复杂而强大的,但它惊人的灵活和开源。它专注于其核心优势:容器编排,并允许围绕它的爱好者和专业人士社区扩展其能力,以承担不同类型的工作负载。其中一个例子是 [Knative][13],在 Kubernetes 之上提供组件,它为无服务器和事件驱动的服务提供工具,并利用 Kubernetes 的编排能力在容器中运行最小的微服务。事实证明,这样做非常高效,既能提供在容器中开发小型、易于测试和维护的应用的好处,又能提供仅在需要时运行这些应用的成本优势,在特定事件中被触发,但在其他时候处于休眠。 +幸运的是,尽管 Kubernetes 是复杂而强大的,但它惊人的灵活并且开源。它专注于其核心优势:容器编排,并允许围绕它的爱好者和专业人士的社区扩展其能力,以承担不同类型的工作负载。其中一个例子是 [Knative][13],在 Kubernetes 之上提供组件,它为无服务器和事件驱动的服务提供工具,并利用 Kubernetes 的编排能力在容器中运行最小化的微服务。事实证明,这样做非常高效,既能提供在容器中开发小型、易于测试和维护的应用的好处,又能提供仅在需要时运行这些应用的成本优势,可以在特定事件中被触发,但在其他时候处于休眠。 在这本电子书中,Cherry 介绍了 Knative 和它的事件系统,以及为什么值得自己研究使用 Knative。 @@ -49,7 +51,7 @@ via: https://opensource.com/article/21/6/kubernetes-ebook 作者:[Chris Collins][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ccd0bc1bd58bcaae03244d2630789ed6e845f61 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 21 Jun 2021 16:27:30 +0800 Subject: [PATCH 132/870] PUB @geekpi https://linux.cn/article-13506-1.html --- .../20210603 Explore the Kubernetes ecosystem in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210603 Explore the Kubernetes ecosystem in 2021.md (98%) diff --git a/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md b/published/20210603 Explore the Kubernetes ecosystem in 2021.md similarity index 98% rename from translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md rename to published/20210603 Explore the Kubernetes ecosystem in 2021.md index d755047e3a..d7c2ba19d1 100644 --- a/translated/tech/20210603 Explore the Kubernetes ecosystem in 2021.md +++ b/published/20210603 Explore the Kubernetes ecosystem in 2021.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13506-1.html) 探索 Kubernetes 生态系统(2021 版) ====== From 5a7d16ae0f3d6b7204648093e6aa5b7341bb8330 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 21 Jun 2021 16:54:12 +0800 Subject: [PATCH 133/870] PRF @geekpi --- ...our Linux Computer Screen to Any Device.md | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md b/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md index 4e37ff0115..20d250d83a 100644 --- a/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md +++ b/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md @@ -3,14 +3,14 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -有了 Deskreen,你可以将你的 Linux 屏幕镜像或串流到任何设备上 +用 Deskreen 将你的 Linux 屏幕镜像或串流到任何设备上 ====== -外面的屏幕共享或屏幕镜像应用并不那么好。尽管大多数选项仅适用于 Windows/Mac,但你可能很难找到一个适用于 Linux 的开源解决方案。 +其它平台上的屏幕共享或屏幕镜像应用并不那么好。尽管大多数选项仅适用于 Windows/Mac,而你可能很难找到一个适用于 Linux 的开源解决方案。 有了这个应用,你可以与连接到网络的任何设备共享你的屏幕。 @@ -20,7 +20,7 @@ ![我把我的 Linux Mint 桌面镜像到我的 Android 手机上][1] -[Deskreen][2] 是一个免费开源的应用,可以让你使用任何带有网络浏览器的设备来作为电脑的副屏。 +[Deskreen][2] 是一个自由开源的应用,可以让你使用任何带有 Web 浏览器的设备来作为电脑的副屏。 如果你愿意,它还支持多个设备连接。 @@ -41,20 +41,17 @@ Deskreen 的功能包括以下要点: * 最小的系统要求 * 黑暗模式 - - -这里没有一个冗长的功能列表,但对大多数用户来说应该是足够的。 +没有一个冗长的功能列表,但对大多数用户来说应该是足够的。 ### 如何使用 Deskreen 应用? Deskreen 使用分为三个简单的步骤,让我为你强调一下,以便你开始使用: -首先,当你启动该应用时,它会显示一个二维码和一个 IP 地址,以帮助你用网络浏览器连接其他设备,以串流你的屏幕。 - +首先,当你启动该应用时,它会显示一个二维码和一个 IP 地址,以帮助你用 Web 浏览器连接其他设备,以串流你的屏幕。 ![][4] -你可以去做任何你喜欢的事情,在你的辅助设备上的网络浏览器的帮助下建立连接。 +你可以按你喜欢的方式,在你的辅助设备上的 Web 浏览器的帮助下建立连接。 当你扫描二维码或在浏览器的地址栏中输入 IP 地址,你会在 Deskreen 应用上得到一个提示,允许或拒绝连接。除非是你不认识它,否则就允许吧。 @@ -66,11 +63,11 @@ Deskreen 使用分为三个简单的步骤,让我为你强调一下,以便 你可以选择串流整个屏幕或选择你想串流的窗口。然而,并不是每个应用窗口都能被检测到。 -在我的快速测试中,我没有得到 Rocket.Chat 应用窗口,但它似乎也能检测到 Slack 窗口、Deskscreen 窗口和终端。 +在我的快速测试中,我没有检测到 Rocket.Chat 应用窗口,但它似乎能检测到 Slack 窗口、Deskscreen 窗口和终端。 ![][7] -你只需要选择源并确认,就可以了。你应该注意到它在你的副屏(手机/桌面)上串流。 +你只需要选择源并确认,就可以了。你应该注意到它在你的副屏(手机/桌面)上开始串流。 ![][8] @@ -82,11 +79,11 @@ Deskreen 还为你提供了管理连接设备的能力。因此,如果你需 ### 在 Linux 中安装 Deskreen -你会得到一个用于 Linux 机器的 DEB 包和 AppImage 文件。如果你不知道,可以通过我们的[安装 DEB 包][10]和[使用 AppImage 文件][11]指南来安装它。 +你会找到一个用于 Linux 机器的 DEB 包和 AppImage 文件。如果你不知道,可以通过我们的 [安装 DEB 包][10] 和 [使用 AppImage 文件][11] 指南来安装它。 -你可以从[官方网站][2]下载它,或者从它的 [GitHub 页面][12]探索更多的信息。 +你可以从 [官方网站][2] 下载它,或者从它的 [GitHub 页面][12]探索更多的信息。 -[Deskreen][2] +- [Deskreen][2] ### 结束语 @@ -94,7 +91,7 @@ Deskreen 还为你提供了管理连接设备的能力。因此,如果你需 当然,它不能取代你的电脑的第二个显示器的优势,但在一些使用情况下,你可能不需要第二个屏幕。 -现在,我想问你一些事情。你能想到哪些实际应用可以用到 Deskreen? +现在,我想问你,你能想到哪些实际应用可以用到 Deskreen? -------------------------------------------------------------------------------- @@ -103,7 +100,7 @@ via: https://itsfoss.com/deskreen/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 624075d0b6f98e1909aeb5098404d96f44f19d20 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 21 Jun 2021 16:54:39 +0800 Subject: [PATCH 134/870] PUB @geekpi https://linux.cn/article-13507-1.html --- ...rror or Stream Your Linux Computer Screen to Any Device.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md (98%) diff --git a/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md b/published/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md similarity index 98% rename from translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md rename to published/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md index 20d250d83a..27c26b9203 100644 --- a/translated/tech/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md +++ b/published/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13507-1.html) 用 Deskreen 将你的 Linux 屏幕镜像或串流到任何设备上 ====== From 6dce27c5da68c39d3fd2d9022ac9846de532abf3 Mon Sep 17 00:00:00 2001 From: alex <37013819+baddate@users.noreply.github.com> Date: Mon, 21 Jun 2021 20:37:28 +0800 Subject: [PATCH 135/870] Update 20200428 Learn Bash with this book of puzzles.md --- sources/tech/20200428 Learn Bash with this book of puzzles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200428 Learn Bash with this book of puzzles.md b/sources/tech/20200428 Learn Bash with this book of puzzles.md index 08a07b93c5..2a56979faf 100644 --- a/sources/tech/20200428 Learn Bash with this book of puzzles.md +++ b/sources/tech/20200428 Learn Bash with this book of puzzles.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (baddate) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 76227aca69b348044d2d12d729d007dd2fbe776e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 22 Jun 2021 05:03:16 +0800 Subject: [PATCH 136/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210621=20?= =?UTF-8?q?Jim=20Hall:=20How=20Do=20You=20Fedora=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210621 Jim Hall- How Do You Fedora.md --- .../20210621 Jim Hall- How Do You Fedora.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210621 Jim Hall- How Do You Fedora.md diff --git a/sources/tech/20210621 Jim Hall- How Do You Fedora.md b/sources/tech/20210621 Jim Hall- How Do You Fedora.md new file mode 100644 index 0000000000..24c2219ffc --- /dev/null +++ b/sources/tech/20210621 Jim Hall- How Do You Fedora.md @@ -0,0 +1,84 @@ +[#]: subject: (Jim Hall: How Do You Fedora?) +[#]: via: (https://fedoramagazine.org/jim-hall-how-do-you-fedora/) +[#]: author: (Karimi Hari Priya https://fedoramagazine.org/author/haripriya21/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Jim Hall: How Do You Fedora? +====== + +![][1] + +We recently interviewed Jim Hall on how he uses Fedora. This is part of a [series][2] on the Fedora Magazine. The series profiles Fedora users and how they use Fedora to get things done. Contact us on the [feedback form][3] if you are interested in being interviewed for a further installment of this series. + +## **Who is Jim Hall?** + +Jim Hall served as Chief Information Officer in higher education and government for over eight years and has recently started the consulting company [Hallmentum][4]. Most of his work includes training, workshops, and coaching to help new IT leaders develop leadership skills, also to help current IT leaders get better at leadership. Apart from consulting, Jim also serves as adjunct faculty at the university level, currently teaching courses in Management Information Systems (MIS) and Technical & Professional Writing. + +How did Jim grow up? Jim’s childhood heroes were from TV and movies, including Batman and Han Solo. Jim’s long-time favorite go-to movie is Star Wars: A New Hope. Jim says, “I am a big Star Wars nerd.” Jim’s favorite meals are Italian. “I love Italian food! Probably my favorite Italian dish is chicken cacciatore.” Jim’s opinion is that Honesty, Creativity, Imagination, Curiosity, and Openness are the five greatest qualities someone can possess. + +He loves writing, which is good because most of his day job is about writing. He spends a lot of time writing “how-to” articles for places like OpenSource.com, CloudSavvy IT, and Linux Magazine, and right now he is writing a book about C programming. Apart from writing, he also relaxes by playing video games. He owns a PlayStation 4 and can be found most Saturday afternoons in front of his TV playing a game. + +## **Fedora Community** + +Jim started using Linux in 1993. His first Linux distribution was Softlanding Linux System (SLS) 1.03, running Linux kernel 0.99 patch level 11. “I’ve been a full-time Linux user at home ever since”. Jim became more involved in Fedora after attending a Linux conference long ago in the Fedora Core days. Jim met Tom “Spot” Callaway there, and they got talking about Fedora. “Spot encouraged me to contribute another way: by finding bugs and reporting them. And that’s how I got involved in testing for all the Beta releases”. + +What would Jim like to change in Fedora? He would like to see a countdown on the getfedora.org website, that tells when the new Beta release or new full release is due out as a change in Fedora Project. And Jim wishes that other people know how easy it is to use Fedora. ”The most challenging thing in contributing to open source is to figure out how to make their first contribution.” Jim adds, “I don’t know that I’m a ‘Fedora Project member’ like other developers would be. I’m just a user. But as someone who’s been involved in developing open-source software since 1993 or 1994, I try to be a helpful member of the community. So I take every opportunity to experiment with new Fedora releases, even the Beta releases, and let people know if I find problems.” + +## **What hardware do you use?** + +Jim is currently running a ThinkCentre M720 Tiny. It’s configured with 8th Generation Intel Core i3-8100T (3.10GHz, 6MB Cache), 32GB (16GB + 16GB) DDR4 2666MHz, Intel graphics, 256GB Solid State Drive PCIe-NVME Opal M.2, Intel 8265 802.11AC, and Bluetooth 4.2. His monitor is an Asus VE248H. “It all works great with Fedora!” says Jim. + +He uses the Perixx Periboard-512 Ergonomic Classic Split Keyboard which replaced his original Microsoft Natural Keyboard Elite PS/2 keyboard from 1998. Jim says “I sometimes swap out the Perixx keyboard for my USB clone of the original IBM Model M keyboard, from Unicomp. I do love the clicky keyboard with the buckling spring action. And mine is in the ‘putty white’ color so it has that classic look and feel.” + +## **What software do you use?** + +Jim is currently running Fedora 33 and previously Fedora 33 Beta, and Fedora 32. “I use GNOME 3 as my desktop. I find the defaults suit most of my needs, so I don’t have any GNOME Extensions loaded, but I do adjust a few things using Settings and GNOME Tweaks. So I’m not making any big changes. For example, I changed my default user interface font to use Droid Sans Regular. And I used Settings to change the keyboard shortcut so Alt-Tab switches windows instead of switching applications. I grew up with the Alt-Tab workflow, so I’m used to that,” says Jim. He uses Firefox and Google Chrome as his web browsers. + +To run his consultancy business, Jim relies on a suite of applications: + + * [LibreOffice][5] to write his books. For example, he published [Coaching Buttons][6] last year. He wrote this book entirely using LibreOffice. More recently, he wrote a book about [Writing Free DOS Programs in C][7] and used LibreOffice for that too. + * [INKSCAPE][8] for creating his company logo in vector format. His logo scales up and down perfectly—from a small corner image on a document to a large-format poster or banner. And INKSCAPE lets him export to a variety of common formats. Jim says that his advertising partners appreciate that INKSCAPE can export to EPS (Encapsulated Postscript), which makes it a snap to print his logo on products. + * [GIMP][9] for other graphics, such as a splash image. “My splash image is my company logo placed over a background image, and I use that in place of a plain logo where I need extra pizzazz, such as on printed materials. I also use a version of the splash image on my website.” + * [QEMU][10] to run a virtual machine where he can boot [FreeDOS][11]. “I like using QEMU because I can set all the options I need at the command line, which gives me a lot of extra flexibility in configuring the virtual machine. To make this easier, I put all the options into a script, and use that to run QEMU with the same options every time.” + * [Scribus][12] to print products. Scribus is easy to use to create print-ready materials with _full bleed_, meaning any color backgrounds overlap the edge of the paper. Full bleed requires a special print-ready file that overlaps the print area . It even provides cut marks so that the printer knows exactly where to trim. + + + +![Scribus – Postcard][13] + +![QEMU – running as easy as in FreeDOS][14] + +![Libre Office Writer][15] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/jim-hall-how-do-you-fedora/ + +作者:[Karimi Hari Priya][a] +选题:[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/haripriya21/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/12/PXL_20200929_205044670.PORTRAIT-01.COVER_-816x345.jpg +[2]: https://fedoramagazine.org/tag/how-do-you-fedora +[3]: https://fedoramagazine.org/submit-an-idea-or-tip +[4]: https://hallmentum.com/ +[5]: https://www.libreoffice.org/ +[6]: https://www.amazon.com/Coaching-Buttons-Jim-Hall/dp/0359834930 +[7]: https://www.freedos.org/books/ +[8]: https://inkscape.org/ +[9]: https://www.gimp.org/ +[10]: https://www.qemu.org/ +[11]: https://www.freedos.org/ +[12]: https://www.scribus.net/ +[13]: https://fedoramagazine.org/wp-content/uploads/2021/03/Scribus-postcard-1024x576.png +[14]: https://fedoramagazine.org/wp-content/uploads/2021/03/QEMU-running-AsEasyAs-in-FreeDOS.png +[15]: https://fedoramagazine.org/wp-content/uploads/2021/03/LibreOffice-Writer-book-1-1024x576.png From f2f54ae655ed163c9ecf075a1c1246b7bee5b45e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 22 Jun 2021 05:03:39 +0800 Subject: [PATCH 137/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210622=20?= =?UTF-8?q?KTorrent:=20An=20Incredibly=20Useful=20BitTorrent=20Application?= =?UTF-8?q?=20by=20KDE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md --- ...ly Useful BitTorrent Application by KDE.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md diff --git a/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md b/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md new file mode 100644 index 0000000000..3ade725b4c --- /dev/null +++ b/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md @@ -0,0 +1,110 @@ +[#]: subject: (KTorrent: An Incredibly Useful BitTorrent Application by KDE) +[#]: via: (https://itsfoss.com/ktorrent/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +KTorrent: An Incredibly Useful BitTorrent Application by KDE +====== + +There are a variety of BitTorrent applications available for Linux. But finding a good application that offers many features should save you some time. + +KTorrent by KDE is one such BitTorrent app built for Linux. + +While there are [several torrent clients for Linux][1], I recently found KTorrent interesting for my use-case. + +### KTorrent: Open Source BitTorrent Client for Linux + +![][2] + +KTorrent is a full-fledged torrent client primarily tailored for KDE desktop. It should work simply fine no matter what desktop environment you use. + +Of course, with KDE desktop, you may get a seamless user experience. + +Let us look at the all the features offered. + +### Features of KTorrent + +![][3] + +For regular torrent users, having an extensive set of features makes things easy. And KTorrent is no exception. Here, I’ll highlight the key highlights of KTorrent: + + * Adding torrent downloads in a queue + * Ability to control the speed limits per download (or overall) + * Video and audio file preview option + * Supports importing of downloaded files (partial/full) + * Ability to prioritize torrent downloads when downloading multiple files + * Selection of specific files to download for multi-file torrents + * IP filter with the option of kicking/banning peers + * UDP tracker support + * µTorrent peer support + * Support for protocol encryption + * Ability to create trackerless torrent + * Scripting support + * System tray integration + * Connection through a proxy + * Added plugin support + * Supports IPv6 + + + +KTorrent sounds something useful as a torrent client that you can use daily with control to manage all your torrent downloads at one place. + +![][4] + +In addition to the features mentioned above, it offers great control over the behavior of the client as well. For instance, tweaking the color that indicates downloads/pause/trackers. + +You also get the ability to set the notification if you want to disable the sound of completing a torrent download or getting notified of the activity. + +![][5] + +While features like protocol encryption support may not be able to replace some of the [best VPN][6] services, it is an important addition for desktop clients. + +### Installing KTorrent in Linux + +KTorrent should be available through your package managers like [Synaptic][7] or the default repositories. You can also find it listed in your software center for easy installation. + +In addition to this, it also offers a [Flatpak][8] official package on [Flathub][9] for any Linux distribution. If you need help with that, we have a [Flatpak guide][10] for reference. + +You can also try the [snap package][11] available if you prefer that. + +To explore more about it and the source code, head to its [official KDE app page][12]. + +[KTorrent][12] + +### Closing Thoughts + +KTorrent is a phenomenal torrent client for Linux. I tried it on my Linux Mint system on top of Cinnamon desktop, and it worked great. + +I like how simple, yet configurable it is. Even though I don’t use a torrent client every day, I did not see anything weird with KTorrent in my brief testing. + +What do you think about KTorrent as a torrent client for Linux? What do you prefer to use it instead? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ktorrent/ + +作者:[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-torrent-ubuntu/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-download.png?resize=850%2C582&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-configure.png?resize=850%2C656&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-speed-limit.png?resize=850%2C585&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-plugins.png?resize=850%2C643&ssl=1 +[6]: https://itsfoss.com/best-vpn-linux/ +[7]: https://itsfoss.com/synaptic-package-manager/ +[8]: https://itsfoss.com/what-is-flatpak/ +[9]: https://flathub.org/apps/details/org.kde.ktorrent +[10]: https://itsfoss.com/flatpak-guide/ +[11]: https://snapcraft.io/ktorrent +[12]: https://apps.kde.org/ktorrent/ From d2330a5d45bc47950b2b4ce9f2b561a0f28f9ef2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 22 Jun 2021 05:04:04 +0800 Subject: [PATCH 138/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210621=20?= =?UTF-8?q?Replace=20man=20pages=20with=20Tealdeer=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210621 Replace man pages with Tealdeer on Linux.md --- ...eplace man pages with Tealdeer on Linux.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20210621 Replace man pages with Tealdeer on Linux.md diff --git a/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md b/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md new file mode 100644 index 0000000000..84d05d99cd --- /dev/null +++ b/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md @@ -0,0 +1,138 @@ +[#]: subject: (Replace man pages with Tealdeer on Linux) +[#]: via: (https://opensource.com/article/21/6/tealdeer-linux) +[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Replace man pages with Tealdeer on Linux +====== +Tealdeer is a Rust implementation of tldr, which provides +easy-to-understand information about common commands. +![computer screen ][1] + +Man pages were my go-to resource when I started exploring Linux. Certainly, `man` is the most frequently used command when a beginner starts getting familiar with the world of the command line. But man pages, with their extensive lists of options and arguments, can be hard to decipher, which makes it difficult to understand whatever you wanted to know. If you want an easier solution with example-based output, I think [tldr][2] is the best option. + +### What's Tealdeer? + +[Tealdeer][3] is a wonderful implementation of tldr in Rust. It's a community-driven man page that gives very simple examples of how commands work. The best part about Tealdeer is that it has virtually every command you would normally use. + +### Install Tealdeer + +On Linux, you can install Tealdeer from your software repository. For example, on [Fedora][4]: + + +``` +`$ sudo dnf install tealdeer` +``` + +On macOS, use [MacPorts][5] or [Homebrew][6]. + +Alternately, you can build and install the tool with Rust's Cargo package manager: + + +``` +`$ cargo install tealdeer` +``` + +### Use Tealdeer + +Entering `tldr --list` returns the list of man pages tldr supports, like `touch`, `tar`, `dnf`, `docker`, `zcat`, `zgrep`, and so on: + + +``` +$ tldr --list +2to3 +7z +7za +7zr +[ +a2disconf +a2dismod +a2dissite +a2enconf +a2enmod +a2ensite +a2query +[...] +``` + +Using `tldr` with a specific command (like `tar`) shows example-based man pages that describe all the options that you can do with that command: + + +``` +$ tldr tar + +  Archiving utility. +  Often combined with a compression method, such as gzip or bzip2. +  More information: <[https://www.gnu.org/software/tar\>][7]. + +  [c]reate an archive and write it to a [f]ile: + +      tar cf target.tar file1 file2 file3 + +  [c]reate a g[z]ipped archive and write it to a [f]ile: + +      tar czf target.tar.gz file1 file2 file3 + +  [c]reate a g[z]ipped archive from a directory using relative paths: + +      tar czf target.tar.gz --directory=path/to/directory . + +  E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely: + +      tar xvf source.tar[.gz|.bz2|.xz] + +  E[x]tract a (compressed) archive [f]ile into the target directory: + +      tar xf source.tar[.gz|.bz2|.xz] --directory=directory + +  [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program: + +      tar caf target.tar.xz file1 file2 file3 +``` + +To control the cache: + + +``` +    $ tldr --update +    $ tldr --clear-cache +``` + +You can give Tealdeer output some color with the `--color` option, setting it to `always`, `auto`, and `never`. The default is `auto`, but I like the added context color provides, so I make mine permanent with this addition to my `~/.bashrc` file: + + +``` +`alias tldr='tldr --color always'` +``` + +### Conclusion + +The beauty of Tealdeer is you don't need a network connection to use it, except when you're updating the cache. So, even if you are offline, you can still search for and learn about your new favorite command. For more information, consult the tool's [documentation][8]. + +Would you use Tealdeer? Or are you already using it? Let us know what you think in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/tealdeer-linux + +作者:[Sudeshna Sur][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/features_solutions_command_data.png?itok=4_VQN3RK (computer screen ) +[2]: https://github.com/tldr-pages/tldr +[3]: https://github.com/dbrgn/tealdeer +[4]: https://src.fedoraproject.org/rpms/rust-tealdeer +[5]: https://opensource.com/article/20/11/macports +[6]: https://opensource.com/article/20/6/homebrew-mac +[7]: https://www.gnu.org/software/tar\> +[8]: https://dbrgn.github.io/tealdeer/intro.html From 38b918e7536d04bb240a9392d69941608e3b39bb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 22 Jun 2021 05:04:22 +0800 Subject: [PATCH 139/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210621=20?= =?UTF-8?q?Why=20I=20love=20programming=20on=20FreeDOS=20with=20GW-BASIC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md --- ...ve programming on FreeDOS with GW-BASIC.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md diff --git a/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md b/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md new file mode 100644 index 0000000000..d36b04e6db --- /dev/null +++ b/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md @@ -0,0 +1,141 @@ +[#]: subject: (Why I love programming on FreeDOS with GW-BASIC) +[#]: via: (https://opensource.com/article/21/6/freedos-gw-basic) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why I love programming on FreeDOS with GW-BASIC +====== +BASIC was my entry into computer programming. I haven't written BASIC +code in years, but I'll always have a fondness for BASIC and GW-BASIC. +![Old UNIX computer][1] + +When I was growing up, it seemed every "personal computer" from the TRS-80 to the Commodore to the Apple let you write your own programs in the Beginners' All-purpose Symbolic Instruction Code ([BASIC][2]) programming language. Our family had a clone of the Apple II called the Franklin ACE 1000, which—as a clone—also ran AppleSoft BASIC. I took to AppleSoft BASIC right away and read books and magazines to teach myself about BASIC programming. + +Later, our family upgraded to an IBM PC running DOS. Just like every personal computer before it, the IBM PC also ran its own version of DOS, called BASICA. Later versions of DOS replaced BASIC with an updated interpreter called GW-BASIC. + +BASIC was my entry into computer programming. As I grew up, I learned other programming languages. I haven't written BASIC code in years, but I'll always have a fondness for BASIC and GW-BASIC. + +### Microsoft open-sources GW-BASIC + +In May 2020, Microsoft surprised everyone (including me) by releasing the source code to GW-BASIC. Rich Turner (Microsoft) wrote in the [announcement][3] on the Microsoft Developer Blog: + +“Since re-open-sourcing MS-DOS 1.25 & 2.0 on GitHub last year, we’ve received numerous requests to also open-source Microsoft BASIC. Well, here we are! As clearly stated in the repo's readme, these sources are the 8088 assembly language sources from 10th Feb 1983 and are being open-sourced for historical reference and educational purposes. This means we will not be accepting PRs (Pull Requests) that modify the source in any way.” + +You can find the GW-BASIC source code release at the [GW-BASIC GitHub][4]. And yes, Microsoft used the [MIT License][5], which makes this open source software. + +Unfortunately, the GW-BASIC code was entirely in Assembly, which wouldn't build with modern tools. But open source developers got to work on that and adjusted the code to assemble with updated DOS assemblers. One project is [TK Chia's GitHub][6] project to update GW-BASIC to assemble with JWASM or other assemblers. You can find several [source and binary releases][7] on TK Chia's project. The notes from the latest version (October 2020) mention that this is “a 'pre-release' binary of GW-BASIC as rebuilt in 2020” and that “support for serial port I/O is missing. Light pen input, joystick input, and printer (parallel port) output need more testing.”  But if you don't need those extra features in GW-BASIC, you should be able to use this latest release to get back into BASIC programming with an open-sourced GW-BASIC. + +FreeDOS 1.3 RC4 doesn't include GW-BASIC, but installing it is pretty easy. Just download the `gwbas-20201025.zip` archive file from TK Chia's October 2020 GW-BASIC release, and extract it (unzip it) on your FreeDOS system. The binary archive uses a default path of `\DEVEL\GWBASIC`. + +### Getting started with GW-BASIC + +To start GW-BASIC, run the `GWBASIC.EXE` program from the DOS command line. Note that DOS is _case insensitive_ so you don't actually need to type that in all uppercase letters. Also, DOS will run any `EXE` or `COM` or `BAT` programs automatically, so you don't need to provide the extension, either. Go into the `\DEVEL\GWBASIC` and type `GWBASIC` to run BASIC. + +![GW-BASIC][8] + +The GW-BASIC interpreter +(Jim Hall, [CC-BY SA 4.0][9]) + +GW-BASIC is an _interpreted_ programming language. The GW-BASIC environment is a "shell" that parses each line in your BASIC program _as it runs the code_. This is a little slower than _compiled_ languages like C but makes for an easier coding-debugging cycle. You can test your code as you go, just by entering it into the interpreter. + +Each line in a GW-BASIC program needs to start with a line number. GW-BASIC uses the line numbers to make sure it executes your program statements in the correct order. With these line numbers, you can later "insert" new program statements between two other statements by giving it a line number that's somewhere in between the other line numbers. For this reason, most BASIC programmers wrote line numbers that went up by tens so that line numbers would go like 10, 20, 30, and so on. + +New to GW-BASIC? You can learn about the programming language by reading an online GW-BASIC reference. Microsoft didn't release a programming guide with the GW-BASIC source code, but you can search for one. [Here's one reference][10] that seems to be a copy of the original Microsoft GW-BASIC User's Guide. + +Let's start with a simple program to print out a list of random numbers. The `FOR` statement creates a loop over a range of numbers, and `RND(1)` prints a random value between 0 and 1. + +![GW-BASIC][11] + +Entering our first program +(Jim Hall, [CC-BY SA 4.0][9]) + +Do you see those highlighted words at the bottom of the screen? Those are keyboard shortcuts that you can access using the "F" keys (or _function_ keys) on your keyboard. For example, F1 will insert the word `LIST` into the GW-BASIC interpreter. The "left arrow" indicates that the shortcut will hit Enter for you, so F2 will enter the `RUN` command and immediately execute it. Let's run the program a few times to see what happens. + +![GW-BASIC][12] + +The two lists of random numbers are the same +(Jim Hall, [CC-BY SA 4.0][9]) + +Interestingly, the list of random numbers is the same every time we run the BASIC program. That's because the GW-BASIC random number generator resets every time you execute a BASIC program. + +To generate new random numbers every time, we need to "seed" the random number generator with a value. One way to do this is by prompting the user to enter their own seed, then use that value with the `RANDOMIZE` instruction. We can insert those two statements at the top of the program using line numbers 1 and 2. GW-BASIC will automatically add those statements before line 10. + +![GW-BASIC][13] + +Updating the program +(Jim Hall, [CC-BY SA 4.0][9]) + +With the random number generator using a new seed, we get a different list of random numbers every time we run our program. + +![GW-BASIC][14] + +Now the lists of random numbers are different +(Jim Hall, [CC-BY SA 4.0][9]) + +### "Guess the number" game in GW-BASIC + +Whenever I start learning a new programming language, I focus on defining variables, writing a statement, and evaluating expressions. Once I have a general understanding of those concepts, I can usually figure out the rest on my own. Most programming languages have some similarities, so once you know one programming language, learning the next one is a matter of figuring out the unique details and recognizing the differences. + +To help me practice a new programming language, I like to write a few test programs. One sample program I often write is a simple "guess the number" game, where the computer picks a number between one and 100 and asks me to guess it. The program loops until I guess correctly. + +Let's write a version of this "guess the number" game in GW-BASIC. To start, enter the `NEW` instruction to tell GW-BASIC to forget the previous program and start a new one. + +My "guess the number" program first prompts the user to enter a random number seed, then generates a random number between 1 and 100. The `RND(1)` function actually generates a random value between 0 and 1 (actually 0.9999…) so I first multiply `RND(1)` by 100 to get a value between 0 and 99.9999…, then I turn that into an integer (remove everything after the decimal point). Adding 1 gives a number that's between 1 and 100. + +The program then enters a simple loop where it prompts the user for a guess. If the guess is too low or too high, the program lets the user know to adjust their guess. The loop continues as long as the user's guess is _not_ the same as the random number picked earlier. + +![GW-BASIC][15] + +Entering a "guess the number" program +(Jim Hall, [CC-BY SA 4.0][9]) + +We can run the program by tapping the F2 key. Using a random seed of 1234 generates a completely new random number. It took me six guesses to figure out the secret number was 49. + +![GW-BASIC][16] + +Guessing the secret number +(Jim Hall, [CC-BY SA 4.0][9]) + +And that's your first introduction to GW-BASIC programming! Thanks to Microsoft for releasing this great piece of history as open source software, and thanks also to the many open source developers who assembled GW-BASIC so we can run it. + +One more thing before I go—It's not obvious how to exit GW-BASIC. The interpreter had a special instruction for that—to quit, enter `SYSTEM` and GW-BASIC will exit back to DOS. + +![GW-BASIC][17] + +Enter SYSTEM to quit GW-BASIC +(Jim Hall, [CC-BY SA 4.0][9]) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-gw-basic + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/retro_old_unix_computer.png?itok=SYAb2xoW (Old UNIX computer) +[2]: https://en.wikipedia.org/wiki/BASIC#:~:text=BASIC%20(Beginners'%20All%2Dpurpose,at%20Dartmouth%20College%20in%201964. +[3]: https://devblogs.microsoft.com/commandline/microsoft-open-sources-gw-basic/ +[4]: https://github.com/microsoft/GW-BASIC +[5]: https://github.com/microsoft/GW-BASIC/blob/master/LICENSE +[6]: https://github.com/tkchia/GW-BASIC +[7]: https://github.com/tkchia/GW-BASIC/releases +[8]: https://opensource.com/sites/default/files/uploads/gwbasic1.png (The GW-BASIC interpreter) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: http://www.antonis.de/qbebooks/gwbasman/index.html +[11]: https://opensource.com/sites/default/files/uploads/gwbasic2.png (Entering our first program) +[12]: https://opensource.com/sites/default/files/uploads/gwbasic3.png (The two lists of random numbers are the same) +[13]: https://opensource.com/sites/default/files/uploads/gwbasic4.png (Updating the program) +[14]: https://opensource.com/sites/default/files/uploads/gwbasic5.png (Now the lists of random numbers are different) +[15]: https://opensource.com/sites/default/files/uploads/guessnum1.png (Entering a "guess the number" program) +[16]: https://opensource.com/sites/default/files/uploads/guessnum2.png (Guessing the secret number) +[17]: https://opensource.com/sites/default/files/uploads/guessnum3.png (Enter SYSTEM to quit GW-BASIC) From 9c818d15b31845aed20ee8603ebac4681226ec88 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 22 Jun 2021 05:04:39 +0800 Subject: [PATCH 140/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210621=20?= =?UTF-8?q?Why=20transparency=20is=20critical=20to=20your=20open=20source?= =?UTF-8?q?=20project's=20security?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210621 Why transparency is critical to your open source project-s security.md --- ... to your open source project-s security.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20210621 Why transparency is critical to your open source project-s security.md diff --git a/sources/tech/20210621 Why transparency is critical to your open source project-s security.md b/sources/tech/20210621 Why transparency is critical to your open source project-s security.md new file mode 100644 index 0000000000..1a0f806da7 --- /dev/null +++ b/sources/tech/20210621 Why transparency is critical to your open source project-s security.md @@ -0,0 +1,82 @@ +[#]: subject: (Why transparency is critical to your open source project's security) +[#]: via: (https://opensource.com/article/21/6/security-transparency) +[#]: author: (Ana Jimenez Santamaria https://opensource.com/users/anajs) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why transparency is critical to your open source project's security +====== +A community's health and transparency are good measures of a project's +security. +![Lock][1] + +The Biden Administration's recent [executive order on cybersecurity][2] aims to improve [security assurance][3] and the use of best practices. Transparency and project health are two factors that help to support security across the entire software industry—especially now. + +### Software security is now open source software security + +Because [92% of modern applications][4] contain open source components, improving software security generally means improving open source software security. + +According to the Biden executive order: + +> "The trust we place in our digital infrastructure should be proportional to how trustworthy and transparent that infrastructure is." + +Transparency is a cornerstone of security assurance because it helps establish trust and confidence in the technology. Indeed, without transparency, trust and security evaporate. Therefore, one of the ways we can help improve security is by enhancing the transparency of our projects. + +Transparency through open source can provide information about a project that allows users to assess its health in at least two ways: + + * **Cross-community environments:** Cross-team and community collaboration are keys to meeting constantly evolving security, privacy, and safety standards. Security is a complex process involving multiple teams across a single organization and multiple organizations (i.e., cross-community), given its open source nature. + * **Public disclosure:** Transparency also enables organizations to quickly build and issue public security reports to identify potential threats and vulnerabilities. + + + +### How to measure transparency to achieve security assurance + +Open source should be in the DNA of every modern organization that wants to achieve a high level of transparency. However, transparency involves more than simply allowing access to code, products, designs, services, or APIs. Transparency is a **commitment to total clarity**. + +Open source has evolved into a complex ecosystem of projects and organizations with different kinds of relationships. [Open source program offices][5] (OSPOs) enable companies, public institutions, governments, and other organizations to keep tabs on the size and health of their open source ecosystems. They take care of not only the projects the organization is using but also the ones it's releasing or contributing to. + +One of the ways to measure transparency across open source ecosystems is by assessing the answers to the following questions about a community's health: + + * **How many maintainers are needed to keep the project sustainable?** The [Bus Factor][6] is a way to determine how many contributors a project can lose before it stalls. The metric (which hypothesizes what would happen if certain contributors got run over by a bus) calculates the smallest number of people who make 50% of contributions and visualizes the answer. + * **Who are the core developers?** The [Onion Model][7] is an approach to identifying the most committed developers and the ones the project relies upon most. + * **What organizations are involved in the software development process?** In addition to analyzing the number of companies whose employees make commits, issues, or code contributions, the [Elephant Factor][8] determines the minimum number of companies doing half of the work. + * **Does the software have security certifications?** Possessing well-known security certifications, such as the [Core Infrastructure Initiative Best Practices Badge][9], indicates that open source projects follow best practices and meet required certification criteria. + * **How active is the community?** There are various ways to assess whether a community is active. One way is to look at the community's reaction speed, including how fast issues are resolved vs. how many are ignored. + + + +Most of these questions are part of the [CHAOSS metrics][10] definition. Community Health Analytics Open Source Software (CHAOSS) is a Linux Foundation project focused on creating a standard set of metrics and software to help define open source community health. Its GrimoireLab tool makes it [easier][11] for projects to analyze and report their community health metrics. + +### Closing thoughts + +Open source software [took over the world][12] a long time ago. The Biden administration's new executive order is another reason to take the open source ecosystem seriously, as both public entities and private companies rely upon it. But open source innovation has a unique methodology that doesn't follow traditional business processes. Using open source involves [investing in OSPOs][13] and measuring transparency by looking at a project's health based on its activity to achieve the required security assurance. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/security-transparency + +作者:[Ana Jimenez Santamaria][a] +选题:[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/anajs +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity/ +[3]: https://www.igi-global.com/dictionary/quantitative-security-assurance/70165 +[4]: https://blog.tidelift.com/open-source-is-everywhere-survey-results-part-1 +[5]: https://opensource.com/article/20/5/open-source-program-office +[6]: https://chaoss.community/metric-bus-factor/ +[7]: https://chaoss.github.io/grimoirelab-sigils/common/onion_analysis/ +[8]: https://chaoss.community/metric-elephant-factor/ +[9]: https://chaoss.community/metric-cii-best-practices-badge/ +[10]: https://chaoss.community/metrics/ +[11]: https://opensource.com/article/21/6/health-metrics-cauldron +[12]: https://techcrunch.com/2019/01/12/how-open-source-software-took-over-the-world/ +[13]: https://todogroup.org/guides/create-program/ From 251e9b92459b6023188194eb387841c6e0bdcfe9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 22 Jun 2021 08:57:28 +0800 Subject: [PATCH 141/870] translated --- ...new open source tool for data analytics.md | 84 ------------------- ...new open source tool for data analytics.md | 84 +++++++++++++++++++ 2 files changed, 84 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20210615 Try this new open source tool for data analytics.md create mode 100644 translated/tech/20210615 Try this new open source tool for data analytics.md diff --git a/sources/tech/20210615 Try this new open source tool for data analytics.md b/sources/tech/20210615 Try this new open source tool for data analytics.md deleted file mode 100644 index 00d140a470..0000000000 --- a/sources/tech/20210615 Try this new open source tool for data analytics.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: subject: (Try this new open source tool for data analytics) -[#]: via: (https://opensource.com/article/21/6/cubejs) -[#]: author: (Ray Paik https://opensource.com/users/rpaik) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Try this new open source tool for data analytics -====== -Cube.js is an open source analytical platform that acts as a layer -between data sources and applications. -![metrics and data shown on a computer screen][1] - -Data analytics is a trendy field with many solutions available. One of them is [Cube.js][2], an open source analytical platform. You can think of Cube.js as a layer between your data sources and applications. - -As the diagram below shows, Cube.js supports serverless data warehouses and most modern relational database management systems (RDBMS). You can work with any JavaScript front-end library for data visualization, and Cube.js will take care of the rest, including access control, performance, concurrency, and more. - -![Cube.js architecture][3] - -(©2021, [Cube Dev, Inc.][2]) - -### Key benefits - -When I ask our community members about Cube.js's key benefits, they frequently mention: - - * **Its abstraction layer:** After configuring Cube.js, people say they no longer have to worry about performance optimization, resource management, SQL expertise, etc. Many refer to Cube.js as a "black box" because its abstraction layer helps them focus on understanding the data rather than the implementation details. - * **Ease of customization:** Since Cube.js is visualization-agnostic, it's easy to integrate with front-end frameworks to build solutions that look like a user's own platform. Most commercial platforms (e.g., Looker, Tableau, etc.) require a lot more customization work to integrate with their infrastructure. Many users say that the ease of customization combined with the abstraction layer enables them to reduce development time for their data analytics platforms. - * **Community support:** When getting started with Cube.js, people usually get help from fellow community members (especially on our [Slack][4]), and many mention community support as a key onboarding resource. - - - -Visit the [user stories page][5] to read more about people's experience with Cube.js and how they use it. - -### Get started - -If you want to check out Cube.js: - - * Go to our [Documentation page][6], click on **Getting started**, and follow the instructions to get Cube.js up and running on your laptop or workstation. - * Once you get to the [developer playground][7], you will be able to generate the data schema, execute queries, and build dashboards to see Cube.js in action. - - - -After you get Cube.js up and running, here are some helpful resources: - - * [Documentation][6]: We put a lot of focus on our documentation because it is a critical resource for open source communities. We're also adding video clips to our documentation pages and the [getting started playlist][8] on our YouTube channel. - * [Discourse][9]: The Cube.js forum is a recent addition where community members can share their use cases, tips & tricks, etc. so that we can build a community knowledge base. - * [GitHub][10]: You'll find the Cube.js code here, and community members file bugs or feature requests via [issues][11]. We also publish our [quarterly roadmaps][12] on GitHub so that everyone can see what we're working on. - * [Monthly community calls][13]: We have calls on the second Wednesday of each month to discuss community updates, showcase feature demos, and invite community members to share their use cases. You will find call logistics on the [community calls page][13], and you can find recordings of past calls on the [community calls playlist][14] on our YouTube channel. - - - -As with any good open source project, Cube.js has many contributors to the software. If you want to look at pull requests (PRs) from the community, search for PRs with the label `pr:community`. If you are eager to look for issues that you can work on, search for issues with the labels `good first issue` or `help wanted`. - -I hope you will give Cube.js a try. If you have any questions, please feel free to leave comments below or find me on the [Cube.js Slack][4]! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/cubejs - -作者:[Ray Paik][a] -选题:[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/rpaik -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://cube.dev/ -[3]: https://opensource.com/sites/default/files/uploads/cubejs-architecture.png (Cube.js architecture) -[4]: https://slack.cube.dev/ -[5]: https://cube.dev/blog/category/user-stories/ -[6]: https://cube.dev/docs/ -[7]: https://cube.dev/docs/dev-tools/dev-playground -[8]: https://www.youtube.com/playlist?list=PLtdXl_QTQjpaXhVEefh7JCIdtYURoyWo9 -[9]: https://forum.cube.dev/ -[10]: https://github.com/cube-js/cube.js -[11]: https://github.com/cube-js/cube.js/issues -[12]: https://github.com/cube-js/cube.js/projects -[13]: https://cube.dev/community-call/ -[14]: https://www.youtube.com/playlist?list=PLtdXl_QTQjpb1dHZCM09qKTsgvgqjSvc9 diff --git a/translated/tech/20210615 Try this new open source tool for data analytics.md b/translated/tech/20210615 Try this new open source tool for data analytics.md new file mode 100644 index 0000000000..f26fe0edb9 --- /dev/null +++ b/translated/tech/20210615 Try this new open source tool for data analytics.md @@ -0,0 +1,84 @@ +[#]: subject: (Try this new open source tool for data analytics) +[#]: via: (https://opensource.com/article/21/6/cubejs) +[#]: author: (Ray Paik https://opensource.com/users/rpaik) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +试试这个新的数据分析开源工具吧 +====== +Cube.js 是一个开源的分析平台,作为数据源和应用之间的一层。 +![metrics and data shown on a computer screen][1] + +数据分析是一个时髦的领域,有许多解决方案可供选择。其中之一是 [Cube.js][2],一个开源的分析平台。你可以把 Cube.js 看作是你的数据源和应用之间的一个层。 + +如下图所示,Cube.js 支持无服务器数据仓库和大多数现代关系型数据库管理系统 (RDBMS)。你可以使用任何用于数据可视化的 JavaScript 前端库,而 Cube.js 将负责其他工作,包括访问控制、性能、并发性等。 + +![Cube.js architecture][3] + +(©2021, [Cube Dev, Inc.][2]) + +### 主要优点 + +当我向我们的社区成员询问 Cube.js 的主要优点时,他们经常提到: + + + **它的抽象层:**配置 Cube.js 后,人们说他们不再需要担心性能优化、资源管理、SQL 专业知识等问题。许多人把 Cube.js 称为 “黑盒”,因为它的抽象层帮助他们专注于理解数据,而不是实施细节。 + **易于定制:**由于 Cube.js 是可视化的,它很容易与前端框架集成,建立看起来像用户自己平台的解决方案。大多数商业平台(如 Looker、Tableau 等)需要更多的定制工作来与他们的基础设施整合。许多用户说,定制的便利性与抽象层相结合,使他们能够减少数据分析平台的开发时间。 + **社区支持:**在开始使用 Cube.js 时,人们通常会从社区成员那里得到帮助(特别是在我们的 [Slack][4]),许多人提到社区支持是一个关键的入门资源。 + + + +访问[用户故事页面][5],阅读更多关于人们使用 Cube.js 的经验以及他们如何使用它。 + +### 开始使用 + +如果你想了解 Cube.js: + + * 进入我们的[文档页面][6],点击**开始**,并按照指示在你的笔记本电脑或工作站上启动和运行 Cube.js。 + * 当你进入 [Developer Playground][7],你将能够生成数据模式,执行查询,并建立仪表盘,以看到 Cube.js 的运行。 + + + +在你启动和运行 Cube.js 之后,这里有一些有用的资源: + + * [文档][6]:我们把大量的精力放在我们的文档上,因为它是开源社区的重要资源。我们还在我们的文档页面和 YouTube 频道的[入门播放列表][8]中添加了视频剪辑。 + * [Discourse][9]:Cube.js 论坛是最近增加的,社区成员可以在这里分享他们的使用案例、技巧和窍门等,这样我们就可以建立一个社区知识库。 + * [GitHub][10]: 你可以在这里找到 Cube.js 的代码,社区成员可以通过[问题页面][11]提交错误或功能请求。我们还在 GitHub 上发布了我们的[季度路线图][12],以便每个人都能看到我们正在进行的工作。 + * [每月社区电话会议][13]:我们在每个月的第二个星期三举行电话会议,讨论社区更新,展示功能演示,并邀请社区成员分享他们的使用案例。你可以在[社区电话会议页面][13]上找到电话会议的日程,你也可以在我们 YouTube 频道的[社区电话会议播放列表][14]上找到过去的电话会议录音。 + + + +就像任何好的开源项目一样,Cube.js 有许多软件贡献者。如果你想查看社区的拉取请求 (PR),请搜索带有 `pr:community` 标签的 PR。如果你想寻找你可以回答的问题,请搜索带有 `good first issue` 或者 `help wanted` 标签的问题。 + +我希望你试试 Cube.js。如果你有任何问题,请随时在下面留言或在 [Cube.js Slack][4] 上找我! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/cubejs + +作者:[Ray Paik][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/rpaik +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://cube.dev/ +[3]: https://opensource.com/sites/default/files/uploads/cubejs-architecture.png (Cube.js architecture) +[4]: https://slack.cube.dev/ +[5]: https://cube.dev/blog/category/user-stories/ +[6]: https://cube.dev/docs/ +[7]: https://cube.dev/docs/dev-tools/dev-playground +[8]: https://www.youtube.com/playlist?list=PLtdXl_QTQjpaXhVEefh7JCIdtYURoyWo9 +[9]: https://forum.cube.dev/ +[10]: https://github.com/cube-js/cube.js +[11]: https://github.com/cube-js/cube.js/issues +[12]: https://github.com/cube-js/cube.js/projects +[13]: https://cube.dev/community-call/ +[14]: https://www.youtube.com/playlist?list=PLtdXl_QTQjpb1dHZCM09qKTsgvgqjSvc9 From 5fe7711463213e0d559dbfc70b7b76c556538e6c Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 22 Jun 2021 09:02:26 +0800 Subject: [PATCH 142/870] translating --- ...es on Linux for Lighting Effects and Other Configurations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md b/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md index d58655251b..8e6d18aeae 100644 --- a/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md +++ b/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/set-up-razer-devices-linux/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 024088b0da8b16967ce689a459e210571f76537d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 22 Jun 2021 09:36:43 +0800 Subject: [PATCH 143/870] Rename sources/tech/20210621 Why transparency is critical to your open source project-s security.md to sources/talk/20210621 Why transparency is critical to your open source project-s security.md --- ...sparency is critical to your open source project-s security.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210621 Why transparency is critical to your open source project-s security.md (100%) diff --git a/sources/tech/20210621 Why transparency is critical to your open source project-s security.md b/sources/talk/20210621 Why transparency is critical to your open source project-s security.md similarity index 100% rename from sources/tech/20210621 Why transparency is critical to your open source project-s security.md rename to sources/talk/20210621 Why transparency is critical to your open source project-s security.md From bad004cf6d240eeac5e45ea187ef071274196f61 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 22 Jun 2021 09:50:14 +0800 Subject: [PATCH 144/870] Rename sources/tech/20210621 Jim Hall- How Do You Fedora.md to sources/talk/20210621 Jim Hall- How Do You Fedora.md --- sources/{tech => talk}/20210621 Jim Hall- How Do You Fedora.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210621 Jim Hall- How Do You Fedora.md (100%) diff --git a/sources/tech/20210621 Jim Hall- How Do You Fedora.md b/sources/talk/20210621 Jim Hall- How Do You Fedora.md similarity index 100% rename from sources/tech/20210621 Jim Hall- How Do You Fedora.md rename to sources/talk/20210621 Jim Hall- How Do You Fedora.md From 429f76fa716d3afbc8e48ae09f72c106c7615a64 Mon Sep 17 00:00:00 2001 From: charain <42235952+chai-yuan@users.noreply.github.com> Date: Tue, 22 Jun 2021 12:58:42 +0800 Subject: [PATCH 145/870] Update 20210621 Why I love programming on FreeDOS with GW-BASIC.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译 --- .../20210621 Why I love programming on FreeDOS with GW-BASIC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md b/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md index d36b04e6db..a8d4ef7b1e 100644 --- a/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md +++ b/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/freedos-gw-basic) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chai-yuan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5d6f7eddfdd028ec52762f6588c4a06073f12b00 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 22 Jun 2021 14:59:42 +0800 Subject: [PATCH 146/870] PUB @geekpi https://linux.cn/article-13510-1.html --- ...ss-Platform Open-Source Subtitle Editor.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) rename {translated/tech => published}/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md (58%) diff --git a/translated/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md b/published/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md similarity index 58% rename from translated/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md rename to published/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md index ef4ce7a8fb..69832b7d35 100644 --- a/translated/tech/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md +++ b/published/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md @@ -3,79 +3,79 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13510-1.html) Subtitld: 一个跨平台的开源字幕编辑器 ====== -字幕使观看视频的体验更加完美。你不需要一定理解视频的语言,字幕可以帮助你用你喜欢的文字来弄清楚正在发生什么。 +![](https://img.linux.net.cn/data/attachment/album/202106/22/145800rejjtp9exvd7zvpn.jpg) -你在流媒体平台上获得了大部分内容的字幕,你可能需要为一些你在本地收藏的视频添加字幕。 +字幕可以使观看视频的体验更加完美。你不需要一定理解视频的语言,字幕可以帮助你用你喜欢的文字来弄清楚正在发生什么。 + +你在流媒体平台上找到的大部分内容都有字幕,你可能需要为一些你在本地收藏的视频添加字幕。 虽然你可以通过简单地下载 SRT 文件并使用视频播放器加载它来做到这一点,但你如何编辑它,删除它,或转录一个视频?Subtitld 是一个开源的字幕编辑器,它可以帮助你。 ### Subtitld: 创建、删除、切分和转录字幕 -Subtitld 是一个免费的开源项目,让你充分利用你的字幕。 +Subtitld 是一个自由开源的项目,可以让你充分利用你的字幕。 ![][1] -如果你没有字幕,就创建一个,如果你需要编辑它,就去吧。有了这个开源工具,你会有许多选项来处理字幕。 +如果你没有字幕,就创建一个,如果你需要编辑它,就用这个吧。有了这个开源工具,你会有许多选项来处理字幕。 -换句话说,它是一个成熟的字幕编辑器,也是同类产品中的一个(就我所遇到的而言)。 +换句话说,它是字幕编辑器之一,也是一个成熟的字幕编辑器(就我所遇到的而言)。 在你决定试用它之前,让我强调一些关键功能。 -### Subtitld 的特点 +### Subtitld 的功能 ![][2] -它提供了大量的功能,虽然不是每个人都需要所有的功能,但如果你是一个经常创建、编辑和处理字幕的人,它应该会很方便。 +它提供了大量的功能,虽然不是每个人都需要所有的功能,但如果你是一个经常需要创建、编辑和处理字幕的人,它应该会很方便。 -下面是它们的列表: +下面是它的功能列表: * 创建字幕 * 编辑字幕 * 使用时间轴移动字幕,手动同步 * 放大/缩小功能,帮助处理拥挤的时间线 -* 支持保存为SRT文件格式 +* 支持保存为 SRT 文件格式 * 支持各种其他格式的导入和导出(SSA、TTML、SBV、DFXP、VTT、XML、SCC 和 SAMI) -* 易于调整大小或从时间轴上调整字幕的持续时间 -* 与其他字幕合并,或只是在项目中切分字幕 +* 易于调整字幕大小或从时间轴上调整字幕的持续时间 +* 与其他字幕合并,或从项目中切分字幕 * 能够启用网格,按帧、场景或秒进行可视化 * 在编辑器中回放以检查字幕情况 * 在时间轴上捕捉字幕以避免重叠 * 在字幕中添加/删除 -* 启用安全间隙,以确保字幕不会看起来不妥当 +* 启用安全边界,以确保字幕不会看起来不妥当 * 调整播放速度 -* 可用的键盘快捷键 +* 键盘快捷键 * 自动转录 -* 输出刻录了字幕的视频 +* 输出加入了字幕的视频 * 无限次撤消 - - -除了这些功能外,音频波形的视觉线索也有一定的帮助。 +除了这些功能外,音频波形的视觉提示也有一定的帮助。 ![][3] -总的来说,如果你是一个转录视频的人,想一次性地编辑视频,你可以做很多事情也可以专业地使用它, +总的来说,如果你是一个转录视频的人,想一次性地编辑视频,你可以用它做很多事情,也可以专业地使用它。 ### 在 Linux 中安装 Subtitld -虽然它也适用于 Windows,但你可以使用 [snap 包][6]轻松地在 Linux 上安装它。你不会发现有任何二进制包或 Flatpak 可用,但你应该能够在任何 Linux 发行版上[使用 snap][7] 安装它。 +虽然它也适用于 Windows,但你可以在 Linux 上使用 [snap 包][6] 轻松地安装它。你不会找到二进制包或 Flatpak,但你应该能够在任何 Linux 发行版上 [使用 snap][7] 安装它。 -[Subtitld][8] +- [Subtitld][8] -如果你想探索,你可以在 [GitLab][9] 上找到源代码。 +如果你想深入探索,你可以在 [GitLab][9] 上找到源代码。 -### 结尾的想法 +### 总结 它有视频同步或添加字幕的精细设置,我只是测试了一些导入、导出、添加或删除字幕的基本功能。 -自动转录功能仍处于测试阶段(截至发布时),但用户界面可以有一些改进。例如,当我把鼠标悬停在编辑器内的按钮上时,它没有告诉我它是做什么的。 +自动转录功能仍处于测试阶段(截至发布时),但用户界面可以再做一些改进。例如,当我把鼠标悬停在编辑器内的按钮上时,它没有告诉我它是做什么的。 总的来说,它是一个在 Linux 上的有用工具。你对它有什么看法?请不要犹豫,在下面的评论中让我知道你的想法。 @@ -86,7 +86,7 @@ via: https://itsfoss.com/subtitld/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0870c48a5ab2b07ce2bd3402901619ae45596fbe Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Tue, 22 Jun 2021 21:22:03 +0800 Subject: [PATCH 147/870] Update and rename sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md to sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md --- ... Switching to Linux Makes Sense in 2021.md | 131 ----------------- ... Switching to Linux Makes Sense in 2021.md | 133 ++++++++++++++++++ 2 files changed, 133 insertions(+), 131 deletions(-) delete mode 100644 sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md create mode 100644 sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md diff --git a/sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md deleted file mode 100644 index afb24fb728..0000000000 --- a/sources/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: subject: (Here’s Why Switching to Linux Makes Sense in 2021) -[#]: via: (https://news.itsfoss.com/switch-to-linux-in-2021/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Here’s Why Switching to Linux Makes Sense in 2021 -====== - -Linux does have several benefits over Windows and macOS in certain areas. People are realizing it, and it is slowly gaining popularity in the desktop OS market. - -Of course, the majority of desktop users still swear by Windows or macOS, but a greater number of users are trying out new Linux distributions to see if they can switch to Linux. - -They may have heard good things about [Linux as a desktop choice][1], or just want to try something different while confined to their homes. Who knows? - -Here, I will be presenting you all the good reasons why Linux makes more sense in 2021. - -### Linux is Great, But What Makes it Relevant in 2021? - -If you already know the [advantages of using Linux][2], you may have an idea what follows next. - -#### 1\. You Do Not Need to Purchase a License - -![][3] - -You do have to pay to get a Windows 10 license. - -While there are cheaper options available, such as getting an OEM key. But, if you want to avoid visiting shady websites and get a license from the official website instead, it will cost you at least **$140** for the **Home edition** that authorizes just 1 PC. - -Of course, macOS is an entirely different story (you need to purchase premium hardware to access macOS) — so we will stick to Microsoft’s Windows here. - -The point is – amid the pandemic with several people jobless, setting up a new computer is a challenge. Moreover, you need to spend money for an operating system’s license while you can use Linux for free on multiple computers. - -Yes, you do not need to get a license key for Linux. You can easily download a [Linux distribution][4] and install it on as many devices as you want. - -Fret not, if you did not know about Linux distros, you can take a look at our list of the [best Linux distributions][5]. - -#### 2\. Revive Your Existing PC and Save Money - -The [global chip shortage situation][6] has significantly affected the price of PC components, especially the **graphics card**. Not just any hike, but you will have to **pay 2-5x times** of the retail price to get a graphics card for your computer. - -Of course, if you do not have a PC, it is incredibly challenging to build one now but what if you have an old system that cannot run Windows 10 without crashing or stuttering? - -If you do not want a Windows-powered system, what about macOS? Well, the entry-level Mac system will cost you upwards of **$1100** or more depending on where you live. It is definitely an expensive endeavor for many. - -You surely need an upgrade – but what if I say that Linux can revive your old system and save you money as well? - -You will be able to run Linux on the very same system that you think is incapable of running the latest version of Microsoft’s Windows. Yes, that is correct. - -Linux is resource-efficient and can run on a variety of older system configurations. - -All you need to do is simply refer to our list of [lightweight Linux distributions][7] and pick one that you like. - -#### 3\. Reduces e-waste by Reviving Systems - -![][8] - -Considering that e-waste is being constantly generated all over the globe, especially by the miners, we can try not to follow the suit? Unless you really need new hardware, it is best to reuse and repurpose existing hardware for new tasks. - -And, thanks to Linux, you can turn your old PC or a single board computer to a media server or your personal [Nextcloud][9] server. - -You can do so much more with Linux on your existing hardware. - -So, this will drop the need for new hardware significantly and let you efficiently reuse your existing system. - -#### 4\. Stay Safe from Viruses and Malware - -![][10] - -In a time where remote work is a thing everywhere, there has been a significant rise in viruses and malware. So, even if you wanted to work peacefully, you might end up getting affected by a malware. - -Both Windows and macOS are susceptible to malware more than ever. But, for Linux? It is highly unlikely. - -Linux distributions are regularly patched to ensure the best security. - -Also, just because the userbase is small, the attackers do not spend much time crafting ways to fool Linux users. So, less chances of you to meet some form of malware while using Linux. - -#### 5\. No Forced Updates - -![][8] - -In a time where everyone is stressed out, getting a forced update and finding your computer to not boot can be a major annoyance. - -At least, this is the case for Windows users. - -But, with Linux, you can keep using your system without any updates forced to download in the background. - -Your operating system, your decision. - -Only if you want to update your Linux distro, you can – or else, it stays that way and will not bother you unless you haven’t updated in a long time. - -### Wrapping Up - -These are only some of the few reasons that I can think of where Linux as a choice of operating system makes sense in 2021 more than ever. - -Of course, depending on your requirements, the benefits may not reflect with your use-case. But, if you did not know about Linux, at least, now you have a choice to make and evaluate your needs. - -What else can you think of in addition to the points mentioned above? Please don’t hesitate to let me know in the comments below. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/switch-to-linux-in-2021/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/ -[2]: https://itsfoss.com/reasons-switch-linux-windows-xp/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://itsfoss.com/what-is-linux-distribution/ -[5]: https://itsfoss.com/best-linux-distributions/ -[6]: https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html -[7]: https://itsfoss.com/lightweight-linux-beginners/ -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[9]: https://itsfoss.com/nextcloud/ -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= diff --git a/sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md new file mode 100644 index 0000000000..09d1231df7 --- /dev/null +++ b/sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md @@ -0,0 +1,133 @@ +[#]: subject: "Here’s Why Switching to Linux Makes Sense in 2021" +[#]: via: "https://news.itsfoss.com/switch-to-linux-in-2021/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +为什么在2021年我仍然推荐你使用Linux +====== + +在某些领域,Linux确实要比Windows和macOS要更加优秀。人们也开始意识到这一点,而且Linux也在桌面操作系统应用市场中也在变得愈发流行。 + +当然,目前大多数桌面操作系统用户仍然使用的是 Windows 或者 macOS, 但是也有着越来越多的用户开始尝试新的 Linux 发行版本,看看他们是否可以从原来的系统切换到 Linux 系统。 + +他们可能已经听过[用 Linux 作为桌面操作系统](https://news.itsfoss.com/linux-foundation-linux-desktop/)的一些优秀案例,又或者是仅仅想要去尝试一些与原先不同的事物,谁知道呢? + +在这里,我将为你解释为什么在2021年我仍然推荐你使用Linux。 + +### Linux 是伟大的,但是究竟是什么让其在 2021 年更被推荐呢? + +如果已经知道了[使用 Linux 的优点](https://itsfoss.com/reasons-switch-linux-windows-xp/),你可能就知道接下来我会说些什么。 + +#### 1\. 你不需要购买一个许可证 + +![][3] + +你必须支付购买才能获得 Windows 10 许可证。 + +虽然有更便宜的选择,如获得OEM密钥。但是,如果您不愿意通过一些特别的网站,而是从官方网站获得许可证,那么仅授权使用 1 台 PC 的**家庭版**就至少需要花费 **140 美元**. + +当然,macOS是一个完全不同的模式(你需要购买高级硬件才能使用macOS)——所以我们才会一直使用微软的 Windows。 + +关键是——在失业的浪潮中,组件一台新电脑是一个挑战。此外,您还需要花钱购买操作系统的许可证,但是你却可以在多台计算机上免费使用 Linux。 + +是的,您不需要为 Linux 获取许可证密钥。您可以轻松下载 [Linux 发行版][4],并根据需要将其安装在尽可能多的设备上。 + +不要担心, 如果你不知道 Linux 发行, 你可以看看我们的[最好的 Linux 发行版](https://itsfoss.com/best-linux-distributions/)的列表。 + +#### 2\. 恢复现有的PC并节省资金 + +[全球芯片短缺](https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html)已经严重影响了电脑组件的价格,特别是**显卡**。并不是简单的价格上升,而是你不得不支付 **2 到 5 倍**的零售价来购得显卡。 + +当然,如果你没有电脑,现在组建一个新的电脑可能是难以置信的挑战,但如果你有一个旧电脑的话,选择在上面运行 Windows 10 将会是十分卡顿的。 + +如果你不想要一个 Windows 的系统,那 macOS 呢?入门级 Mac 系统将会花费至少 **1100** 美金,这取决于你住在哪里。对许多人来说,这会是一笔昂贵的开销。 + +你肯定需要升级你的系统——但是如果我说 Linux 可以让你的旧电脑重新派上用场,也能为你省钱呢? + +您将能够在您认为无法运行最新版本的 Microsoft Windows 的电脑上运行 Linux。是的,这是正确的。 + +Linux 是一个资源高效型的操作系统,可在各种较旧的系统配置上运行。 + +所有你需要做的只是参考我们的列表 [轻量级 Linux 分布][7], 并选择一个你喜欢的。 + +#### 3\. 通过恢复系统减少电子浪费 + +![][8] + +考虑到电子废物正在全球不断产生,尤其是矿工,我们可以尽量减少浪费。除非您真正需要新的硬件,否则最好将现有硬件设备重新用于新任务。 + +而且,多亏了 Linux,您可以将旧电脑或单片机转到媒体服务器或个人[Nextcloud][9] 服务器。 + +您可以在现有硬件上使用 Linux 做更多工作。 + +因此,这将显著降低对新硬件的需求,并让您高效地重复使用现有的设备。 + +#### 4\. 远离病毒和恶意软件 + +![][10] + +在远程工作无处不在的时代,病毒和恶意软件显著增加。因此,即使您想和平地工作,您最终也可能受到恶意软件的影响。 + +Windows 和 macOS 都比以往任何时候都更容易受到恶意软件的影响。但是,对于Linux?这是极不可能的。 + +Linux 发行版被定期修补,以确保最佳安全性。 + +此外,因为用户群很小,攻击者就不会花太多时间制作欺骗 Linux 用户的病毒或软件。因此,在使用 Linux 时遇到某种形式的恶意软件的机会较小。 + +#### 5\. 没有强制更新 + +![][8] + +在一个人们压力倍增的时代,强制更新和发现计算机无法启动可能是一大烦恼。 + +至少,Windows 用户的情况就是这样。 + +但是,使用 Linux,您可以继续使用您的系统,而无需在后台强制下载任何更新。 + +你的操作系统只有你能决定。 + +当你想要更新你的 Linux 发行版本时,你可以选择更新,也可以不更新,它可以一直保持不更新的状态并且不会打扰你,除非你有很长一段时间没有更新。 + +### 总结 + +这些只是我能想到的几个原因之一, Linux 作为操作系统的选择在 2021 年比以往任何时候都更值得被推荐。 + +Of course, depending on your requirements, the benefits may not reflect with your use-case. But, if you did not know about Linux, at least, now you have a choice to make and evaluate your needs. + +当然,这也取决于您的要求,这些好处可能不会体现在在您的用例中。但是,如果你确实不了解 Linux,至少,现在你可以评估你的需求,重新作出选择。 + +除了上述要点之外,您还能想到什么?请在下面的评论中告诉我。 + +### 大型科技网站获得数百万收入,It's FOSS 为您服务! + +如果您喜欢我们在 It's FOSS 所做的工作,请考虑捐款以支持我们的独立出版物。 您的支持将帮助我们继续发布专注于桌面 Linux 和开源软件的内容。 + +谢谢各位。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/switch-to-linux-in-2021/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[zepoch](https://github.com/zepoch) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/ +[2]: https://itsfoss.com/reasons-switch-linux-windows-xp/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://itsfoss.com/what-is-linux-distribution/ +[5]: https://itsfoss.com/best-linux-distributions/ +[6]: https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html +[7]: https://itsfoss.com/lightweight-linux-beginners/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[9]: https://itsfoss.com/nextcloud/ +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= From 45dfe190cc9f993c378a47bfd387c4abe2141af9 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Tue, 22 Jun 2021 21:40:38 +0800 Subject: [PATCH 148/870] Rename sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md to translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md --- .../210619 Here-s Why Switching to Linux Makes Sense in 2021.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated => translated}/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md (100%) diff --git a/sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md similarity index 100% rename from sources/talk/20https:/github.com/zEpoch/TranslateProject/tree/master/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md rename to translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md From a817f724dfabebd6d4a069af63facbc3ac149c8e Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Tue, 22 Jun 2021 21:43:38 +0800 Subject: [PATCH 149/870] Update 210619 Here-s Why Switching to Linux Makes Sense in 2021.md --- .../210619 Here-s Why Switching to Linux Makes Sense in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md index 09d1231df7..e819bd4e6d 100644 --- a/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md +++ b/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md @@ -106,7 +106,7 @@ Of course, depending on your requirements, the benefits may not reflect with you 如果您喜欢我们在 It's FOSS 所做的工作,请考虑捐款以支持我们的独立出版物。 您的支持将帮助我们继续发布专注于桌面 Linux 和开源软件的内容。 -谢谢各位。 +感谢各位。 -------------------------------------------------------------------------------- From c3a7004147a240c1f2304260810bb5c02991ba76 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Tue, 22 Jun 2021 21:51:57 +0800 Subject: [PATCH 150/870] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E5=88=9A?= =?UTF-8?q?=E5=88=9A=E5=86=99=E9=94=99=E4=BA=86=E6=B7=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20210619 Here-s Why Switching to Linux Makes Sense in 2021.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/talk/{210619 Here-s Why Switching to Linux Makes Sense in 2021.md => 20210619 Here-s Why Switching to Linux Makes Sense in 2021.md} (100%) diff --git a/translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md similarity index 100% rename from translated/talk/210619 Here-s Why Switching to Linux Makes Sense in 2021.md rename to translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md From 20afc885681dc68d99ff4dcadcda009c2bbd3e29 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Wed, 23 Jun 2021 00:18:06 +0800 Subject: [PATCH 151/870] Update 20210619 Here-s Why Switching to Linux Makes Sense in 2021.md --- ...0210619 Here-s Why Switching to Linux Makes Sense in 2021.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md index e819bd4e6d..589f75f280 100644 --- a/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md +++ b/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md @@ -96,8 +96,6 @@ Linux 发行版被定期修补,以确保最佳安全性。 这些只是我能想到的几个原因之一, Linux 作为操作系统的选择在 2021 年比以往任何时候都更值得被推荐。 -Of course, depending on your requirements, the benefits may not reflect with your use-case. But, if you did not know about Linux, at least, now you have a choice to make and evaluate your needs. - 当然,这也取决于您的要求,这些好处可能不会体现在在您的用例中。但是,如果你确实不了解 Linux,至少,现在你可以评估你的需求,重新作出选择。 除了上述要点之外,您还能想到什么?请在下面的评论中告诉我。 From 9483502f31afacffb3a03fdabc5597a645ea7568 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Wed, 23 Jun 2021 00:34:24 +0800 Subject: [PATCH 152/870] =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20200914 Use Python to solve a charity-s business problem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200914 Use Python to solve a charity-s business problem.md b/sources/tech/20200914 Use Python to solve a charity-s business problem.md index febc102037..f0803cbb17 100644 --- a/sources/tech/20200914 Use Python to solve a charity-s business problem.md +++ b/sources/tech/20200914 Use Python to solve a charity-s business problem.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3b66f46e3c90e1b438b937bf3e55a891c5272818 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Wed, 23 Jun 2021 00:36:52 +0800 Subject: [PATCH 153/870] Update 20200914 Use Python to solve a charity-s business problem.md --- ...20200914 Use Python to solve a charity-s business problem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200914 Use Python to solve a charity-s business problem.md b/sources/tech/20200914 Use Python to solve a charity-s business problem.md index f0803cbb17..febc102037 100644 --- a/sources/tech/20200914 Use Python to solve a charity-s business problem.md +++ b/sources/tech/20200914 Use Python to solve a charity-s business problem.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (zepoch) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1f43cff5161ba88a74141fbe6e8f4e439fb8ad04 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 23 Jun 2021 03:50:23 +0800 Subject: [PATCH 154/870] Revert "Translating" This reverts commit 971de3a0d0c03e3c8e58c0764c3a14977ab45df1. --- sources/tech/20200629 Scaling a GraphQL Website.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200629 Scaling a GraphQL Website.md b/sources/tech/20200629 Scaling a GraphQL Website.md index 5434cc1032..5389594701 100644 --- a/sources/tech/20200629 Scaling a GraphQL Website.md +++ b/sources/tech/20200629 Scaling a GraphQL Website.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (MjSeven) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From de929f06277c3821d86943c6ad238b7200c973d1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 23 Jun 2021 05:04:14 +0800 Subject: [PATCH 155/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210622=20?= =?UTF-8?q?Replace=20du=20with=20dust=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210622 Replace du with dust on Linux.md --- .../20210622 Replace du with dust on Linux.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sources/tech/20210622 Replace du with dust on Linux.md diff --git a/sources/tech/20210622 Replace du with dust on Linux.md b/sources/tech/20210622 Replace du with dust on Linux.md new file mode 100644 index 0000000000..a877d52a46 --- /dev/null +++ b/sources/tech/20210622 Replace du with dust on Linux.md @@ -0,0 +1,152 @@ +[#]: subject: (Replace du with dust on Linux) +[#]: via: (https://opensource.com/article/21/6/dust-linux) +[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Replace du with dust on Linux +====== +The dust command is a more intuitive implementation of the du command +written in Rust. +![Sand dunes][1] + +If you work on the Linux command line, you will be familiar with the `du` command. Knowing commands like `du`, which returns information about disk usage quickly, is one of the ways the command line makes programmers more productive. Yet if you're looking for a way to save even more time and make your life even easier, take a look at [dust][2], which is `du` rewritten in Rust with more intuitiveness. + +In short, `dust` is a tool that provides a file's type and metadata. If you trigger `dust` in a directory, it will report that directory's disk utilization in a couple of ways. It provides a very informative graph that tells you which folder is using the most disk space. If there is a nested folder, you can see the percentage of space used by each folder. + +### Install dust + +You can install `dust` using Rust's Cargo package manager: + + +``` +`$ cargo install du-dust` +``` + +Alternately, you might find it in your software repository on Linux, and on macOS, use [MacPorts][3] or [Homebrew][4]. + +### Explore dust + +Issuing the `dust` command on a directory returns a graph that shows its contents and what percentage each item holds in a tree format. + + +``` +$ dust + 5.7M   ┌── exa                                                           │                                                ██ │   2% + 5.9M   ├── tokei                                                         │                                                ██ │   2% + 6.1M   ├── dust                                                          │                                                ██ │   2% + 6.2M   ├── tldr                                                          │                                                ██ │   2% + 9.4M   ├── fd                                                            │                                                ██ │   4% + 2.9M   │ ┌── exa                                                         │                                              ░░░█ │   1% +  15M   │ ├── rustdoc                                                     │                                              ░███ │   6% +  18M   ├─┴ bin                                                           │                                              ████ │   7% +  27M   ├── rg                                                            │                                            ██████ │  11% + 1.3M   │     ┌── libz-sys-1.1.3.crate                                    │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   0% + 1.4M   │     ├── libgit2-sys-0.12.19+1.1.0.crate                         │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   1% + 4.5M   │   ┌─┴ github.com-1ecc6299db9ec823                               │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   2% + 4.5M   │ ┌─┴ cache                                                       │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   2% + 1.0M   │ │   ┌── git2-0.13.18                                            │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   0% + 1.4M   │ │   ├── exa-0.10.1                                              │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 1.5M   │ │   │ ┌── src                                                   │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 2.2M   │ │   ├─┴ idna-0.2.3                                              │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 1.2M   │ │   │       ┌── linux                                           │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   0% + 1.6M   │ │   │     ┌─┴ linux_like                                        │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 2.6M   │ │   │   ┌─┴ unix                                                │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 3.1M   │ │   │ ┌─┴ src                                                   │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 3.1M   │ │   ├─┴ libc-0.2.94                                             │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 1.2M   │ │   │     ┌── test                                              │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   0% + 2.6M   │ │   │   ┌─┴ zlib-ng                                             │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 904K   │ │   │   │   ┌── vstudio                                         │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   0% + 2.0M   │ │   │   │ ┌─┴ contrib                                           │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 3.4M   │ │   │   ├─┴ zlib                                                │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 6.1M   │ │   │ ┌─┴ src                                                   │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │   2% + 6.1M   │ │   ├─┴ libz-sys-1.1.3                                          │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │   2% + 1.6M   │ │   │     ┌── pcre                                              │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 2.5M   │ │   │   ┌─┴ deps                                                │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 3.8M   │ │   │   ├── src                                                 │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% + 7.4M   │ │   │ ┌─┴ libgit2                                               │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │   3% + 7.6M   │ │   ├─┴ libgit2-sys-0.12.19+1.1.0                               │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │   3% +  26M   │ │ ┌─┴ github.com-1ecc6299db9ec823                               │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │  10% +  26M   │ ├─┴ src                                                         │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │  10% + 932K   │ │   ┌── .cache                                                  │               ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ │   0% +  11M   │ │   │     ┌── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.idx │               ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███ │   4% + 135M   │ │   │     ├── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.pack│               ░░░░░░▓▓███████████████████████████ │  53% + 147M   │ │   │   ┌─┴ pack                                                │               ░░░░░░█████████████████████████████ │  57% + 147M   │ │   │ ┌─┴ objects                                               │               ░░░░░░█████████████████████████████ │  57% + 147M   │ │   ├─┴ .git                                                    │               ░░░░░░█████████████████████████████ │  57% + 147M   │ │ ┌─┴ github.com-1ecc6299db9ec823                               │               ░░░░░░█████████████████████████████ │  57% + 147M   │ ├─┴ index                                                       │               ░░░░░░█████████████████████████████ │  57% + 178M   ├─┴ registry                                                      │               ███████████████████████████████████ │  69% + 257M ┌─┴ .                                                               │██████████████████████████████████████████████████ │ 100% +$ +``` + +To apply `dust` to a specific directory: + + +``` +`$ dust ~/Work/` +``` + +![Dust output from a specific directory][5] + +(Sudeshna Sur, [CC BY-SA 4.0][6]) + +The `-r` option shows the output in reverse order, with root at the bottom: + + +``` +`$ dust -r ~/Work/` +``` + +Using `dust -d 3` returns three levels of subdirectories and their disk utilization: + + +``` +`$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes`[/code] [code] + +$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes + 4.0K     ┌── jaxrs.xml                                                           │                                         █ │   1% + 4.0K   ┌─┴ subsystem-templates                                                   │                                         █ │   1% + 4.0K   │   ┌── org.jboss.as.controller.transform.ExtensionTransformerRegistration│                                         █ │   1% + 4.0K   │   ├── org.jboss.as.controller.Extension                                 │                                         █ │   1% + 8.0K   │ ┌─┴ services                                                            │                                         █ │   2% + 8.0K   ├─┴ META-INF                                                              │                                         █ │   2% + 4.0K   │ ┌── jboss-as-jaxrs_1_0.xsd                                              │                                        ░█ │   1% + 8.0K   │ ├── jboss-as-jaxrs_2_0.xsd                                              │                                        ░█ │   2% +  12K   ├─┴ schema                                                                │                                        ██ │   3% + 408K   │   ┌── as                                                                │  ████████████████████████████████████████ │  94% + 408K   │ ┌─┴ jboss                                                               │  ████████████████████████████████████████ │  94% + 408K   ├─┴ org                                                                   │  ████████████████████████████████████████ │  94% + 432K ┌─┴ classes                                                                 │██████████████████████████████████████████ │ 100% +$ +``` + +### Conclusion + +The beauty of `dust` lies in being a small, simple, and easy-to-understand command. It uses a color scheme to denote the largest subdirectories, making it easy to visualize your directory. It's a popular project, and contributions are welcome. + +Have you used or considered using `dust`? If so, please let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/dust-linux + +作者:[Sudeshna Sur][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/sand_dunes_desert_hills_landscape_nature.jpg?itok=wUByylBb +[2]: https://github.com/bootandy/dust +[3]: https://opensource.com/article/20/11/macports +[4]: https://opensource.com/article/20/6/homebrew-mac +[5]: https://opensource.com/sites/default/files/uploads/dust-work.png (Dust output from a specific directory) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ From 9a7cb56def888ea29ab447b9d3f976fb2498dfa0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 23 Jun 2021 05:04:30 +0800 Subject: [PATCH 156/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210622=20?= =?UTF-8?q?What=20is=20a=20config=20file=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210622 What is a config file.md --- .../tech/20210622 What is a config file.md | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 sources/tech/20210622 What is a config file.md diff --git a/sources/tech/20210622 What is a config file.md b/sources/tech/20210622 What is a config file.md new file mode 100644 index 0000000000..cadb9d3e7a --- /dev/null +++ b/sources/tech/20210622 What is a config file.md @@ -0,0 +1,184 @@ +[#]: subject: (What is a config file?) +[#]: via: (https://opensource.com/article/21/6/what-config-files) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What is a config file? +====== +There are several popular formats for configuration files, each with its +own strengths. Find what works best for you. +![Computer screen with files or windows open][1] + +There are thousands of configuration files on your computer. You may never directly interact with the bulk of them, but they're scattered throughout your `/etc` folder and in `~/.config` and `~/.local` and `/usr`. There are probably some in `/var` and possibly even in `/opt`. If you've ever opened one by accident or to make a change, you may have wondered why some configuration files look one way while others look completely different. + +Storing configurations is a flexible task because as long as developers know how their code puts data into a file, they can easily write code to extract that data as needed. However, the tech industry graciously favors well-documented standardization, so several well-known formats have evolved over the years to make configuration easy. + +### Why we need configuration + +Configuration files ("config files" for short) are important to modern computing. They allow you to customize how you interact with an application or how an application interacts with the rest of your system. It's thanks to config files that any time you launch an application, it has "memories" of how you like to use it. + +Configuration files can be, and often are, very simple in structure. For instance, if you were to write an application, and the only thing it ever needed to know was its user's preferred name, then its one and only config file could contain exactly one word: the name of the user. For example: + + +``` +`Tux` +``` + +Usually, though, an application needs to keep track of more than just one piece of information, so configuration often uses a key and a value: + + +``` +NAME='Tux' +SPECIES='Penguin' +``` + +Even without programming experience, you can imagine how code parses that data. Here are two simple examples, one using the [`awk` command][2] and the other using the [grep command][3], focusing on just the line containing the "key" of `NAME`, and returning the "value" appearing after the equal sign (`=`): + + +``` +$ awk -F'=' '/NAME/ { print $2; }' myconfig.ini +'Tux' +$ grep NAME fake.txt | cut -d'=' -f2 +'Tux' +``` + +The same principle applies to any programming language and any configuration file. As long as you have a consistent data structure, you can write simple code to extract and parse it when necessary. + +### Choose a format + +To be broadly effective, the most important thing about configuration files is that they are consistent and predictable. The last thing you want to do is dump information into a file under the auspices of saving user preferences and then spend days writing code to reverse-engineer the random bits of information that have ended up in the file. + +There are several popular formats for configuration files, each with its own strengths. + +#### INI + +INI files take the format of key and value pairs: + + +``` +[example] +name=Tux +style=widgety,fidgety +enabled=1 +``` + +This simple style of configuration can be intuitive, with the only point of confusion being poor key names (for example, cryptic names like `unampref` instead of `name`). They're easy to parse and easy to edit. + +The INI format features sections in addition to keys and values. In this sample code, `[example]` and `[demo]` are configuration sections: + + +``` +[example] +name=Tux +style=widgety,fidgety +enabled=1 + +[demo] +name=Beastie +fullscreen=1 +``` + +This is a little more complex to parse because there are _two_ `name` keys. You can imagine a careless programmer querying this config file for `name` and always getting back `Beastie` because that's the last name defined by the file. When parsing such a file, a developer must be careful to search within sections for keys, which can be tricky depending on the language used to parse the file. However, it's a popular enough format that most languages have an existing library to help programmers parse INI files. + +#### YAML + +[YAML files][4] are structured lists that can contain values or key and value pairs: + + +``` +\--- +Example: +  Name: 'Tux' +  Style: +   - 'widgety' +    - 'fidgety' +  Enabled: 1 +``` + +YAML is popular partly because it looks clean. It doesn't have much of a syntax aside from where you place the data in relation to previous data. What's a feature for some, though, is a bug for others, and many developers avoid YAML because of the significance it places on what is essentially _not there_. If you get indentation wrong in YAML, YAML parsers may see your file as invalid, and even if it's tolerated, it may return incorrect data. + +Most languages have YAML parsers, and there are good open source YAML linters (applications to validate syntax) to help you ensure the integrity of a YAML file. + +#### JSON + +JSON files are technically subsets of YAML, so its data structure is the same, although its syntax is completely different: + + +``` +{ +  "Example": { +    "Name": [ +      "Tux" +    ], +    "Style": [ +      "widgety", +      "fidgety" +    ], +    "Enabled": 1 +  } +} +``` + +JSON is popular among JavaScript programmers, which isn't surprising, given that JSON stands for JavaScript Object Notation. As a result of being strongly associated with web development, JSON is a common output format for web APIs. Most programming languages have libraries to parse JSON. + +#### XML + +XML uses tags as keys that surround a configuration value: + + +``` +<example> +  <name>Tux</name> +  <style priority="user">widgety</style> +  <style priority="fallback">fidgety</style> +  <enabled>1</enabled> +</example> +``` + +XML is often used by Java programmers, and Java has a rich set of XML parsers. While it has a reputation of being quite strict, XML is simultaneously very flexible. Unlike HTML, which has a set of tags you're allowed to use, you can arbitrarily invent your own XML tags. As long as you structure it consistently and have a good library to parse it, you can extract your data with precision and ease. + +There are some good open source linters to help you validate XML files, and most programming languages have a library to parse XML. + +#### Binary formats + +Linux prides itself on plain-text configuration. The advantage is that you can see configuration data using basic tools like [cat][5], and you can even edit a configuration with your [favorite text editor][6]. + +Some applications use binary formats, though, which means the data is encoded in some format that is not a natural language. These files usually require a special application (usually the application they're meant to configure) to interpret their data. +You can't view these files, at least not in a way that makes any sense, and you can't edit them outside of their host application. Some reasons for resorting to binary formats are: + + * **Speed:** A programmer can register specific bits of information at certain points within a binary's config file using custom notation. When the data is extracted, there's no searching involved because everything is already indexed. + * **Size:** Text files can get big, and should you choose to compress a text file, you're functionally turning it into a binary format. Binary files can be made smaller through tricks of encoding (the same is true of text files, but at some point, your optimizations make your data so obscure that it may as well be binary). + * **Obfuscation:** Some programmers don't want people even looking at their configuration files, so they encode them as binary data. This usually succeeds only in frustrating users. This is not a good reason to use binary formats. + + + +If you must use a binary format for configuration, use one that already exists as an open standard, such as [NetCDF][7]. + +### Find what works + +Configuration formats help developers store the data their applications need and help users store preferences for how they want applications to act. There's probably no wrong answer to the question of what format you should use, as long as you feel well supported by the language you're using. When developing your application, look at the formats available, model some sample data, review and evaluate the libraries and utilities your programming language provides, and choose the one you feel the most confident about. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/what-config-files + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://opensource.com/article/20/9/awk-ebook +[3]: https://opensource.com/downloads/grep-cheat-sheet +[4]: https://www.redhat.com/sysadmin/yaml-beginners +[5]: https://opensource.com/article/19/2/getting-started-cat-command +[6]: https://opensource.com/article/21/2/open-source-text-editors +[7]: https://www.unidata.ucar.edu/software/netcdf/ From efe97dd0ed3b9365c7b79663fae5a311c708f9e3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 23 Jun 2021 05:04:44 +0800 Subject: [PATCH 157/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210622=20?= =?UTF-8?q?Edit=20text=20like=20Emacs=20in=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210622 Edit text like Emacs in FreeDOS.md --- ...0210622 Edit text like Emacs in FreeDOS.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20210622 Edit text like Emacs in FreeDOS.md diff --git a/sources/tech/20210622 Edit text like Emacs in FreeDOS.md b/sources/tech/20210622 Edit text like Emacs in FreeDOS.md new file mode 100644 index 0000000000..53f5ce1356 --- /dev/null +++ b/sources/tech/20210622 Edit text like Emacs in FreeDOS.md @@ -0,0 +1,108 @@ +[#]: subject: (Edit text like Emacs in FreeDOS) +[#]: via: (https://opensource.com/article/21/6/freemacs) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Edit text like Emacs in FreeDOS +====== +If you're already familiar with GNU Emacs, you should feel right at home +in Freemacs. +![Typewriter in the grass][1] + +On Linux, I often use the GNU Emacs editor to write the source code for new programs. I learned GNU Emacs long ago when I was an undergraduate student, and I still have the "finger memory" for all the keyboard shortcuts. + +When I started work on FreeDOS in 1994, I wanted to include an Emacs-like text editor. You can find many editors similar to Emacs, such as MicroEmacs, but these all take some shortcuts to fit into the 16-bit address space on DOS. However, I was very pleased to find Freemacs, by Russell "Russ" Nelson. + +You can find Freemacs in FreeDOS 1.3 RC4, on the Bonus CD. You can use FDIMPLES to install the package, which will install to `\APPS\EMACS`. + +![installing Freemacs][2] + +Installing Freemacs from the FreeDOS 1.3 RC4 Bonus CD +(Jim Hall, [CC-BY SA 4.0][3]) + +### Initial setup + +The first time you run Freemacs, the editor will need to "compile" all of the setup files into a form that Freemacs can quickly process. This will take a few minutes to run, depending on your system's speed and memory, but fortunately, you only need to do it once. + +![Running Freemacs for the first time][4] + +Press Y to build the Freemacs MINT files +(Jim Hall, [CC-BY SA 4.0][3]) + +Freemacs actually processes the editor files in two passes. When Freemacs has successfully completed the first pass, it prompts you to restart the editor so it can finish processing. So don't be surprised that the process seems to start up again—it's just "part 2" of the compilation process. + +### Using Freemacs + +To edit a file with Freemacs, start the program with the text file as an argument on the command line. For example, `emacs readme.doc` will open the Readme file for editing in Freemacs. Typing `emacs` at the command line, without any options, will open an empty "scratch" buffer in Freemacs. + +![Freemacs][5] + +Starting Freemacs without any files opens a "scratch" buffer +(Jim Hall, [CC-BY SA 4.0][3]) + +Or, you can start Freemacs without any command-line options, and use the Emacs shortcuts C-x C-f (or M-x `find-file`). Freemacs then prompts you for a new file to load into the editor. The shortcut prefix C- means you should press the Ctrl key and some other key, so C-x is Ctrl and the x key together. And M-x is shorthand for "press the 'Meta' key (usually Esc) then hit x." + +![Freemacs][6] + +Opening a new file with C-x C-f +(Jim Hall, [CC-BY SA 4.0][3]) + +Freemacs automatically detects the file type and attempts to load the correct support. For example, opening a C source file will also set Freemacs to "C-mode." + +![Freemacs][7] + +Editing a C source file in Freemacs +(Jim Hall, [CC-BY SA 4.0][3]) + +If you also use GNU Emacs (like me), then you are probably curious to get Freemacs to match the C indentation that GNU Emacs uses (2 spaces.) Here is how to set Freemacs to use 2 spaces in C-mode: + + 1. Open a C source file in Freemacs. + 2. Enter M-x `edit-options` to edit Freemacs settings. + 3. Use the settings to change both "C-brace-offset" and "C-indent-level" to 2. + 4. Save and exit Freemacs; you'll be prompted to save settings. + + + +### A few limitations + +Much of the rest of Freemacs operates like GNU Emacs. If you're already familiar with GNU Emacs, you should feel right at home in Freemacs. However, Freemacs does have a few limitations that you might need to know: + +**The extension language is not LISP.** The biggest difference between GNU Emacs on Linux and Freemacs on FreeDOS is that Freemacs uses a different extension language. Where GNU Emacs implements a LISP-like interpreter, Freemacs implements a different extension language called MINT—based on the string processing language, TRAC. The name "MINT" is an acronym, meaning "MINT Is Not TRAC." + +You shouldn't expect to evaluate LISP code in Freemacs. The MINT language is completely different from LISP. For more information on MINT, see the reference manual. We provide the full documentation via the FreeDOS files archive on Ibiblio, at [/freedos/files/edit/emacs/docs][8]. In particular, the MINT language is defined in [mint.txt][9] and [mint2.txt][10]. + +**Freemacs cannot open files larger than 64 kilobytes.** This is a common limitation in many programs. 64kb is the maximum size of the data space for programs that do not leverage extended memory. + +**There is no "Undo" feature.** Be careful in editing. If you make a mistake, you will have to re-edit your file to get it back to the old version. Also, save early and often. For very large mistakes, your best path might be to abandon the version you're editing in Freemacs, and load the last saved version. + +The rest is up to you! You can find more information about Freemacs on Ibiblio, at [/freedos/files/edit/emacs/docs][8]. For a quick-start guide to Freemacs, read [quickie.txt][11]. The full manual is in [tutorial.txt][12]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freemacs + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead.png?itok=h3fCkVmU (Typewriter in the grass) +[2]: https://opensource.com/sites/default/files/uploads/install1.png (Installing Freemacs from the FreeDOS 1.3 RC4 Bonus CD) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/first-run1_0.png (Press Y to build the Freemacs MINT files) +[5]: https://opensource.com/sites/default/files/uploads/freemacs1.png (Starting Freemacs without any files opens a "scratch" buffer) +[6]: https://opensource.com/sites/default/files/uploads/freemacs2.png (Opening a new file with C-x C-f) +[7]: https://opensource.com/sites/default/files/uploads/freemacs3.png (Editing a C source file in Freemacs) +[8]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/edit/emacs/docs/ +[9]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/edit/emacs/docs/mint.txt +[10]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/edit/emacs/docs/mint2.txt +[11]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/edit/emacs/docs/quickie.txt +[12]: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/edit/emacs/docs/tutorial.txt From 1329057d78ff10038f2894bcdac6c6c5a68ce0ad Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 23 Jun 2021 05:05:05 +0800 Subject: [PATCH 158/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210622=20?= =?UTF-8?q?Security-Focused=20Tutanota=20Mail=E2=80=99s=20Linux=20Desktop?= =?UTF-8?q?=20Application=20is=20Now=20Available?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md --- ...ux Desktop Application is Now Available.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md diff --git a/sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md b/sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md new file mode 100644 index 0000000000..244e434df5 --- /dev/null +++ b/sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md @@ -0,0 +1,90 @@ +[#]: subject: (Security-Focused Tutanota Mail’s Linux Desktop Application is Now Available) +[#]: via: (https://news.itsfoss.com/tutanota-desktop/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Security-Focused Tutanota Mail’s Linux Desktop Application is Now Available +====== + +Tutanota is an open-source privacy-oriented email service. It is an impressive [secure email service][1] as an alternative to Gmail. + +In fact, our ethical web portal [LinuxHandbook][2] hosts emails on Tutanota. + +While it is already a full-fledged service with constant improvements added regularly, the desktop client was something in beta since 2018. + +Now, they have finally [announced][3] the availability of their desktop client for Linux, Windows, and macOS for every Tutanota user. + +### Access Tutanota Using the Desktop Client + +The desktop client features all the goodies that you get with the web version. The announcement mentions that they have had rigorous tests and review to ensure that you get the best security while using the desktop version. + +![][4] + +You can also go through the [security review on GitHub][5]. + +To walk you through, let me highlight some of the key features that the desktop version offers: + + * Encrypted mailbox + * Encrypted calendar + * Secure Contact and Address book + * Ability to search encrypted data locally + * Supports email and calendar notifications + * Two-factor authentication + * Supports opening different windows + + + +In addition to these, you can also set out-of-the-office notifications, spellcheck your emails before sending, use filters, and do great deal of things that you normally find in the web version. + +If needed, you can set it up to run on startup, disable its background activity, choose the storage path for downloads, and several other options. + +The desktop client should give you a great level of control for a good experience. + +I also noticed that it offers a desktop integration option when you first launch the desktop app. This should integrate the client with the system tray. + +To enhance security, the desktop client uses caching of the web client. This will make sure that you don’t have to re-login and load up the correct version needed for access. + +![][6] + +### Download Tutanota Desktop + +It is available as an AppImage file for Linux. You may want to refer to our [AppImage guide][7] to get started. + +You can download it from the official website. Tutanota also gives you the [option to verify the signature][8] to check if you did not download a tampered file. + +[Download Tutanota][9] + +_A desktop client is something many users prefer over the web version, what about you? What do you think about Tutanota’s desktop version?_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/tutanota-desktop/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/secure-private-email-services/ +[2]: https://linuxhandbook.com/about/ +[3]: https://tutanota.com/blog/posts/desktop-clients-end-beta/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://github.com/tutao/tutanota/issues/2787 +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://itsfoss.com/use-appimage-linux/ +[8]: https://tutanota.com/faq/#verify-desktop +[9]: https://tutanota.com/#download From 6294863de276059bf12659b0160b535fb135bc01 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 23 Jun 2021 08:38:52 +0800 Subject: [PATCH 159/870] translated --- ...chines to Kubernetes with this new tool.md | 95 ------------------- ...chines to Kubernetes with this new tool.md | 95 +++++++++++++++++++ 2 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md create mode 100644 translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md diff --git a/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md b/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md deleted file mode 100644 index 9c0a793f62..0000000000 --- a/sources/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: subject: (Migrate virtual machines to Kubernetes with this new tool) -[#]: via: (https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift) -[#]: author: (Miguel Perez Colino https://opensource.com/users/mperezco) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Migrate virtual machines to Kubernetes with this new tool -====== -Transition your virtualized workloads to Kubernetes with Forklift. -![Containers on a ship on the ocean][1] - -In 2017, the [KubeVirt][2] team [launched][3] the project to manage virtual machines (VMs) alongside containers in [Kubernetes][4]. The open source project's intent was to make VMs first-class citizens in this environment. - -Since its introduction at [Open Source Summit 2018][5], KubeVirt has continued maturing and growing. It's reached more than 200 stars on GitHub and even introduced its own event, [KubeVirt Summit][6], in February 2021. - -![KubeVirt architecture][7] - -KubeVirt architecture (© 2020, [Red Hat OpenShift][8]) - -KubeVirt is the foundation underneath [OpenShift Virtualization][9], which helps developers bring VMs into containerized workflows. - -### Leveraging VMs in Kubernetes - -KubeVirt enables you to use Kubernetes natives on VMs. This means they can connect to pod networks that are accessible using standard Kubernetes methods, including Service, Route, Pipelines, etc. Network policies apply to VM pods the same way they apply to application pods, providing a consistent model to manage VM-to-pod (and vice-versa) communication. - -A real-world example of this is the way an aeronautical company leveraged old simulator software. It injected models with artificial intelligence and machine learning (AI/ML), then automatically deployed and tested them on a VM-based simulator. This allowed it to fully automate obtaining test results and new telemetry training data using Kubernetes and [Kubeflow][10]. - -![VM-creation workflow][11] - -(Konveyor, [CC BY-SA 4.0][12]) - -[Konveyor.io][13] is an open source project that helps transition existing workloads (development, test, and production) to Kubernetes. Its tools include [Crane][14], to move containers from one Kubernetes platform to another; [Move2Kube][15], to bring workloads from Cloud Foundry to Kubernetes; and [Tackle][16], to analyze Java applications to modernize them by making them more standard and portable for the runtimes available in containerized platforms like Kubernetes. - -These tools are useful in transformation patterns, but many projects want to utilize Kubernetes at earlier stages to become more agile and productive. On the infrastructure side, these benefits can include blue/green load balancing, route management, declarative deployments, or (depending on how you deploy) easier upgrades due to immutable infrastructure. On the development side, they may include integrating continuous integration/continuous development (CI/CD) pipelines with the platform, getting apps to production faster, self-provisioning resources, or integrating health checks and monitoring. - -KubeVirt can help you by running workloads as VMs in a Kubernetes environment. It enables you to onboard your workloads to Kubernetes quickly, enjoy its benefits, and steadily modernize your workloads over time. But, you still have the issue of bringing your VMs from your traditional virtualization platform to the modern Kubernetes platform. This is where Konveyor's [Forklift][17] project comes in. - -### About Forklift - -Forklift migrates virtualized workloads from different sources to Kubernetes using KubeVirt. It is designed to make the task simple so that you can migrate anything from one or two machines to hundreds of them. - -Migration is a simple, three-stage process: - - 1. Connect to an existing virtualization platform (known as a "source provider") and to a Kubernetes environment (a "target provider"). - 2. Map network and storage resources from the source provider to the target provider, looking for equivalent resources in both. - 3. Select virtual machines to migrate and assign the network and storage mappings to formulate a migration plan. Then run it. - - - -### How to get started - -To get started with Forklift, first, you need a compatible source provider. You also need a Kubernetes environment with KubeVirt 0.40 or newer and bare-metal nodes (although for testing, you can use nested virtualization). Configure your storage classes with read-write-execute (RWX) capabilities, and use [Multus][18] to configure your networks to match the ones your VMs are using in the source provider. (If you can't do this, no worries; you also have the option to rearrange IP addressing.) - -Finally, [install Forklift][19] on your Kubernetes using the provided operator, and access the user interface to start running your first test migrations. - -Forklift is the upstream version of Red Hat's [Migration Toolkit for Virtualization][20]. Therefore, if you want to use it in a production environment, you may wish to consider using that supported version of the tool. - -Happy migrating! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift - -作者:[Miguel Perez Colino][a] -选题:[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/mperezco -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-1-osdc-lead.png?itok=VEB4zwza (Containers on a ship on the ocean) -[2]: http://kubevirt.io/ -[3]: https://kubevirt.io/2017/This-Week-in-Kube-Virt-1.html -[4]: https://opensource.com/resources/what-is-kubernetes -[5]: https://ossna18.sched.com/event/FAOR/kubevirt-cats-and-dogs-living-together-stephen-gordon-red-hat -[6]: https://kubevirt.io/summit/ -[7]: https://opensource.com/sites/default/files/uploads/image1_1.png (KubeVirt architecture) -[8]: https://www.openshift.com/learn/topics/virtualization/ -[9]: https://openshift.com/virtualization/ -[10]: https://www.kubeflow.org/ -[11]: https://opensource.com/sites/default/files/uploads/image2_0_6.png (VM-creation workflow) -[12]: https://creativecommons.org/licenses/by-sa/4.0/ -[13]: https://www.konveyor.io/ -[14]: https://www.konveyor.io/crane -[15]: https://move2kube.konveyor.io/ -[16]: https://www.konveyor.io/tackle -[17]: https://www.konveyor.io/forklift -[18]: https://github.com/k8snetworkplumbingwg/multus-cni -[19]: https://www.youtube.com/watch?v=RnoIP3QjHww&t=1693s -[20]: https://access.redhat.com/documentation/en-us/migration_toolkit_for_virtualization/2.0/ diff --git a/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md b/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md new file mode 100644 index 0000000000..f0cc8023f3 --- /dev/null +++ b/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md @@ -0,0 +1,95 @@ +[#]: subject: (Migrate virtual machines to Kubernetes with this new tool) +[#]: via: (https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift) +[#]: author: (Miguel Perez Colino https://opensource.com/users/mperezco) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用这个新工具将虚拟机迁移到 Kubernetes 上 +====== +用 Forklift 将你的虚拟化工作负载过渡到 Kubernetes。 +![Containers on a ship on the ocean][1] + +2017 年,[KubeVirt][2] 团队[发起][3]了一个在 [Kubernetes][4] 中与容器一起管理虚拟机 (VM) 的项目。这个开源项目的意图是让虚拟机成为这个环境中的一等公民。 + +自从在 [2018 年开源峰会][5]上推出以来,KubeVirt 一直在不断成熟和发展。它在 GitHub 上已经达到了 200 多颗星,甚至在 2021 年 2 月推出了自己的活动:[KubeVirt 峰会][6]。 + +![KubeVirt architecture][7] + +KubeVirt架构(© 2020,[Red Hat OpenShift][8]) + +KubeVirt 是 [OpenShift 虚拟化][9]的基础,它帮助开发者将虚拟机带入容器化工作流程。 + +### 在 Kubernetes 中使用虚拟机 + +KubeVirt 使你能够在虚拟机上原生使用 Kubernetes。这意味着它们可以连接到使用标准 Kubernetes 方法访问的 pod 网络,包括服务、路由、管道等。应用于虚拟机 pod 的网络策略与应用于应用的 pod 方式相同,它提供一个一致的模型来管理虚拟机到 pod (反之亦然)的通信。 + +这方面的一个真实例子是一家航空公司利用旧的模拟器软件的方式。它注入了人工智能和机器学习 (AI/ML) 的模型,然后在基于虚拟机的模拟器上自动部署和测试它们。这使得它能够使用 Kubernetes 和 [Kubeflow][10] 完全自动化地获得测试结果和新的遥测训练数据。 + +![VM-creation workflow][11] + +(Konveyor, [CC BY-SA 4.0][12]) + +[Konveyor.io][13] 是一个开源项目,帮助现有工作负载(开发、测试和生产)过渡到 Kubernetes。其工具包括 [Crane][14],将容器从一个 Kubernetes 平台转移到另一个平台、[Move2Kube][15],将工作负载从 Cloud Foundry 带到 Kubernetes,以及 [Tackle][16],分析 Java 应用,使其对 Kubernetes 等容器化平台中的运行时更加标准和便携,从而使其现代化。 + +这些工具在转化模式中很有用,但许多项目希望在早期阶段利用 Kubernetes,以变得更加敏捷和富有成效。在基础设施方面,这些好处可能包括蓝/绿负载均衡、路由管理、声明式部署,或(取决于你的部署方式)由于不可变的基础设施而更容易升级。在开发方面,它们可能包括将持续集成/持续开发 (CI/CD) 管道与平台整合,使应用更快地投入生产,自我提供资源,或整合健康检查和监控。 + +KubeVirt 可以通过在 Kubernetes 环境中作为虚拟机运行工作负载来帮助你。它能让你的工作负载迅速使用 Kubernetes,享受它的好处,并随着时间的推移稳步实现工作负载的现代化。但是,你仍然有一个问题,就是把你的虚拟机从传统的虚拟化平台带到现代的 Kubernetes 平台。这就是 Konveyor 的 [Forklift][17] 项目的意义所在。 + +### 关于 Forklift + +Forklift 使用 KubeVirt 将不同来源的虚拟化工作负载迁移到 Kubernetes。它被设计成使任务变得简单,以便你可以从一两台机器到数百台机器迁移任何东西。 + +迁移是一个简单的、三阶段的过程: + + 1. 连接到一个现有的虚拟化平台(称为“源提供者”)和一个 Kubernetes 环境(“目标提供者”)。 + 2. 将网络和存储资源从源提供者映射到目标提供者,在两者中寻找相同的资源。 + 3. 选择要迁移的虚拟机,分配网络和存储映射,制定迁移计划。然后运行它。 + + + +### 如何开始 + +要开始使用 Forklift,首先,你需要一个兼容的源提供商。你还需要一个带有 KubeVirt 0.40 或更新版本的 Kubernetes 环境和裸机节点(尽管为了测试,你可以使用嵌套虚拟化)。用读-写-执行 (RWX) 功能配置你的存储类,并使用 [Multus][18] 配置你的网络,以匹配你的虚拟机在源提供者中使用的网络。(如果你不能这样做,也不用担心。你也可以选择重新分配 IP 地址。) + +最后,使用提供的操作者在你的 Kubernetes 上[安装 Forklift][19],并进入用户界面,开始运行你的第一次测试迁移。 + +Forklift 是 Red Hat 的[虚拟化迁移工具套件][20]的上游版本。因此,如果你想在生产环境中使用它,你可以考虑使用该工具的支持版本。 + +迁移愉快! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift + +作者:[Miguel Perez Colino][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/mperezco +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-1-osdc-lead.png?itok=VEB4zwza (Containers on a ship on the ocean) +[2]: http://kubevirt.io/ +[3]: https://kubevirt.io/2017/This-Week-in-Kube-Virt-1.html +[4]: https://opensource.com/resources/what-is-kubernetes +[5]: https://ossna18.sched.com/event/FAOR/kubevirt-cats-and-dogs-living-together-stephen-gordon-red-hat +[6]: https://kubevirt.io/summit/ +[7]: https://opensource.com/sites/default/files/uploads/image1_1.png (KubeVirt architecture) +[8]: https://www.openshift.com/learn/topics/virtualization/ +[9]: https://openshift.com/virtualization/ +[10]: https://www.kubeflow.org/ +[11]: https://opensource.com/sites/default/files/uploads/image2_0_6.png (VM-creation workflow) +[12]: https://creativecommons.org/licenses/by-sa/4.0/ +[13]: https://www.konveyor.io/ +[14]: https://www.konveyor.io/crane +[15]: https://move2kube.konveyor.io/ +[16]: https://www.konveyor.io/tackle +[17]: https://www.konveyor.io/forklift +[18]: https://github.com/k8snetworkplumbingwg/multus-cni +[19]: https://www.youtube.com/watch?v=RnoIP3QjHww&t=1693s +[20]: https://access.redhat.com/documentation/en-us/migration_toolkit_for_virtualization/2.0/ From 1d5aa2526a812a43cf90220c9fd6761102af3220 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 23 Jun 2021 08:43:20 +0800 Subject: [PATCH 160/870] translating --- ...rrent- An Incredibly Useful BitTorrent Application by KDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md b/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md index 3ade725b4c..7f32c470e4 100644 --- a/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md +++ b/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/ktorrent/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2a1801d1bca4f1fe586ef40b06b28ee83f1d5cb2 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Wed, 23 Jun 2021 11:20:51 +0800 Subject: [PATCH 161/870] Zz air patch 1 (#22288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Update 20210613 How Free - Open Source Software Can Save Online Privacy.md * Rename sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md to translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md * 完成翻译 --- ...Source Software Can Save Online Privacy.md | 154 ------------------ ...Source Software Can Save Online Privacy.md | 147 +++++++++++++++++ 2 files changed, 147 insertions(+), 154 deletions(-) delete mode 100644 sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md create mode 100644 translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md diff --git a/sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md b/sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md deleted file mode 100644 index 7ee1d14d11..0000000000 --- a/sources/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md +++ /dev/null @@ -1,154 +0,0 @@ -[#]: subject: (How Free & Open Source Software Can Save Online Privacy) -[#]: via: (https://news.itsfoss.com/save-privacy-with-foss/) -[#]: author: (Team It's FOSS https://news.itsfoss.com/author/team/) -[#]: collector: (lujun9972) -[#]: translator: (zz-air) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How Free & Open Source Software Can Save Online Privacy -====== - -_I have used services from tech giants for years. Most were free of charge, at the expense of my privacy. But those days are over. Now I browse, chat and work without anyone tracking, monetizing or censoring my data. Thanks to free (libre) and open source software._ - -### I start to worry about Big Tech - -![][1] - -I’ve always felt machines should be doing what I want them to do, not the other way round. That’s why Google’s Android operating system immediately appealed to me when it first hit the market in 2008. At the time, Google’s open-source approach was genuinely refreshing. I spent hours customizing my HTC Hero phone. Little did I care that it was uglier than my friends’ iPhones or Symbian devices. My new gadget was infinitely more versatile. - -Fast forward a decade. Google has become a tech giant, dwarfed iOS and killed Symbian OS. Today, the company captures over 90% of search traffic and dominates the browser market. This stellar growth came at a cost, as illustrated by the removal of Google’s “don’t be evil” clause. The search giant is entangled in court cases, such as the one over [data collection and tracking malpractices][2]. Researchers also found [privacy flaws][3] in Google’s contact tracing app. To top it off, the tech giant announced a controversial new algorithm that [tracks browsing behaviour][4] to better serve ads. - -Now, I don’t want to pass the buck to Google. Amazon just created the largest civilian [surveillance network][5] in US history. It provides the police with unwarranted access to millions of home security cameras. Meanwhile, Europe probes into Amazon’s compliance with [privacy rules][6]. Same goes for Microsoft, which incidentally also apologized for having facilitated [workplace surveillance][7] feature. - -One might think that users can at least count on Apple to protect their privacy. The tech giant recently gave them the choice to know whether apps track their behavior. As it turns out that [only 5%][8] of US users opt into this new app-tracking transparency. Meanwhile, the company [hugely benefits][9] from doing business with data brokers like Google. Not to mention the [antitrust trial][10] raging between Fortnite developer Epic Games and Apple, which claims to protect the privacy of its App Store. And of course, there’s Facebook. The company’s privacy misconducts culminated in a Senate hearing over the [Cambridge Analytica][11] scandal, wiping out what was left of user trust. - -Yet in spite – or because – of these questionable practices, the total value of these companies reached over [7.5 trillion dollars][12] in March 2021. “Big Tech” is now worth more than Germany’s and the UK gross domestic product – combined! - -### Why privacy matters - -![][13] - -We all use Big Tech’s services. We are part of [Surveillance Capitalism][14], a term coined by Harvard professor Shoshana Zuboff and discussed in Cory Doctorow’s [latest book][15], Surveillance Capitalism. It’s an economic system centered around tech monopolies which harvest personal data to maximize profit. This system threatens the very core of democracy, as it gives rise to mass surveillance, polarizes the political debate, interferes with the electoral process and drives uniformity of thought as well as censorship. - -Surveillance Capitalism is based on a deeply troubling invasion of our lives. We tend to forget that privacy is a fundamental right. It’s enshrined by the UN Human Rights Council, the International Covenant on Civil and Political Rights and a number of treaties. I think we can all relate: there are more than a few aspects in our lives we’d like to keep private, even without wrongdoing. Whether it is to freely express ourselves and explore our personality without being judged by others. Or to shield us from surveillance, censorship and manipulation. That’s why curtains were invented. And things like banking secrecy, attorney-client privilege, secrecy of correspondence, secrecy of the ballot, confessional secret or medical confidentiality. - -Tackling online privacy is a broad issue. It requires comprehensive changes to our legal systems and social conventions. Regulation of tech monopolies is one of the main challenges of this decade. As illustrated by the recent standoffs between tech giants and governments: [Australia vs. Facebook][16], [China vs. Tencent][17], [India vs. WhatsApp][18], the [EU vs. Facebook][19] or the [US vs. Big Tech][20]. For years, digital rights groups and software foundations have been advocating for better privacy laws, user rights and the freedom to innovate. Let’s only name a few: the Electronic Frontier Foundation, the Free Software Foundation, the Freedom of the Press Foundation, Privacy International, the Open Rights Group or the European Digital Rights. - -### What’s this got to do with FOSS? - -![][21] - -Since its inception in 1983, the [Free Software movement][22] has become quite a diverse community. Free and open source software is often referred to as FOSS, FLOSS, Libre Software or Free Software. It includes a whole range of licenses that give users the right to [use, study, share and improve][23] the software. As well as the [right to repair][24]. Free Software is “free” as in “[free speech][25]” — and sometimes as in “free beer”. As such, FOSS is not only about technology. It’s about social, political and economic emancipation. - -A few years back, a privacy controversy shook up the Free Software community. Ubuntu 12.10 – one of the various GNU/Linux flavours – started establishing Internet connections for local searches on people’s computers. It served Amazon ads and shared private data with Facebook or Twitter. The [backlash was massive][26]. A few years later, Canonical – the firm behind Ubuntu – ended up removing online searches and the Amazon web app. The more recent [Audacity drama][27] is another example of how FOSS protects privacy. The new project management decided to add Google Analytics and Yandex to the audio software, but ended up renouncing to its plans after public outcry. - -For all its merits, Free Software is not free from criticism. One claim is that FOSS projects often get abandoned. A recent [Cornell University study][28] however suggests otherwise: out of 1.932 popular open source projects, 7% (128 projects) were taken over by new developers after being neglected, reducing the dropout rate to less than 10% (187 projects). - -Another common criticism is that FOSS exposes potential security vulnerabilities by publishing the code. On the flip side, keeping the source code a secret [doesn’t necessarily increase security][29]. Arguing that closed source code is vastly more secure than FOSS conveniently omits the fact that proprietary stacks are increasingly built [on top of open source code][30]. Free Software also tends to be decentralized, which helps with resilience against surveillance, single points of failure or massive data leaks. So sure, FOSS is not immune to security breaches. But neither are proprietary solutions, as illustrated by the latest [leaks of a billion people’s data][31] from Facebook, LinkedIn and Clubhouse. Or the spectacular [security attacks][32] against SolarWind and Colonial Pipeline. - -All in all, Free Software is instrumental in promoting online privacy. For nearly forty years, FOSS has been encouraging developers to audit the code, fix issues and ensure nothing shady goes on in the background. - -### Seven steps to online privacy with FOSS - -![][33] - -While waiting for better privacy laws, there’s a lot you can do to make your devices more private. Here are seven steps to replace Big Tech with privacy-respecting, free and open source software. Depending on your [threat model][34], you’ll likely want to consider steps 1 through 4 first, as they already provide a reasonable level of privacy. If you have some tech skills and want to go further, take a look at steps 5 to 7. - - 1. **[Get involved in privacy][35]**. There is much to be said and learned about online privacy, data exploitation, filter bubbles, surveillance and censorship. Get involved and spread the word. - 2. **[Choose a safe and private browser][36]**. Switch to Firefox. Block trackers, cookies and ads. Use privacy-respecting search engines. Possibly encrypt your traffic with Tor or VPN. - 3. **[Keep your conversations private][37]**. Use end-to-end encryption to secure your emails, messages and calls. Ditch classic social media and discover the Fediverse, a federated family of various online services. - 4. **[Protect your data][38]**. Use long and unique passphrases. Choose a different one for each of your accounts and devices. Keep them safe in an encrypted password manager. Consider using two-factor authentication. Create a regular backup routine. And encrypt sensitive data. - 5. **[Free your computer][39]**. Switch to GNU/Linux and favor free and open source apps. Depending on your needs, choose a beginner friendly distribution like Linux Mint or Ubuntu. For more experienced users, pick Debian, Manjaro, openSUSE, Fedora or Gentoo Linux. And for privacy buffs, have a look at Qubes OS, Whonix or Tails. - 6. **[Free your phone][40]**. Switch to a custom mobile operating system like LineageOS, CalyxOS, GrapheneOS or /e/. Favor tracker-free open source apps from community maintained app stores. - 7. **[Free your cloud][41]**. Choose privacy-respecting cloud providers. Or set up your own secure server and self host services such as cloud storage, photo galleries, task and contact management, or media streaming. - - - -### Wrapping Up - -![][42] - -There is no one-click solution for online privacy. Replacing Big Tech with free and open source software is a process. Some changes are simple – like installing Firefox or Signal. Other methods require more time and skills. But they are definitely worth it. And you’re not alone, you can count on the support of a wonderful community. So allow me to conclude by quoting [Geoffrey A. Fowler][43] from the Washington Post: “_Online privacy is not dead, but you have to be angry enough to demand it_“. - -* * * - -### About the author - -![][42] - -_Georg Jerska is an open source enthusiast with a special interest in protecting the privacy of citizens. With his small team he runs [GoFOSS][44][][45], a comprehensive guide on how to replace Big Tech with privacy-respecting, free and open source software._ - -* * * - -_[Open source][46] illustrations by [Katerina Limpitsouni][47]._ - -_The views and opinions expressed are those of the authors and do not necessarily reflect the official policy or position of It’s FOSS._ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/save-privacy-with-foss/ - -作者:[Team It's FOSS][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/team/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI3MCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://www.gizmodo.com.au/2021/05/google-location-services-lawsuit -[3]: https://blog.appcensus.io/2021/04/27/why-google-should-stop-logging-contact-tracing-data -[4]: https://news.itsfoss.com/google-floc -[5]: https://www.theguardian.com/commentisfree/2021/may/18/amazon-ring-largest-civilian-surveillance-network-us -[6]: https://edps.europa.eu/press-publications/press-news/press-releases/2021/edps-opens-two-investigations-following-schrems_en -[7]: https://www.theguardian.com/technology/2020/dec/02/microsoft-apologises-productivity-score-critics-derided-workplace-surveillance -[8]: https://www.flurry.com/blog/ios-14-5-opt-in-rate-att-restricted-app-tracking-transparency-worldwide-us-daily-latest-update -[9]: https://www.nytimes.com/2020/10/25/technology/apple-google-search-antitrust.html -[10]: https://www.nytimes.com/2021/05/25/business/dealbook/apple-epic-case.html -[11]: https://en.wikipedia.org/wiki/Cambridge_Analytica -[12]: https://en.wikipedia.org/wiki/List_of_public_corporations_by_market_capitalization#2021 -[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0OCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[14]: https://en.wikipedia.org/wiki/Surveillance_capitalism -[15]: https://www.goodreads.com/book/show/55134785-how-to-destroy-surveillance-capitalism -[16]: https://www.bbc.com/news/world-australia-56163550 -[17]: https://www.nytimes.com/2021/06/02/technology/china-tencent-monopoly.html -[18]: https://www.theguardian.com/world/2021/may/26/whatsapp-sues-indian-government-over-mass-surveillance-internet-laws -[19]: https://nypost.com/2021/05/26/eu-reportedly-set-to-open-formal-antitrust-probe-into-facebook -[20]: https://www.nytimes.com/interactive/2020/10/06/technology/house-antitrust-report-big-tech.html -[21]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2OCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[22]: https://itsfoss.com/what-is-foss -[23]: https://fsfe.org/freesoftware/freesoftware.en.html -[24]: https://framatube.org/videos/watch/99069c5c-5a00-489e-97cb-fd5cc76de77c -[25]: https://www.eff.org/deeplinks/2015/04/remembering-case-established-code-speech -[26]: https://itsfoss.com/canonical-targets-website-crictical-ubuntu-privacy -[27]: https://github.com/audacity/audacity/pull/835 -[28]: https://arxiv.org/abs/1906.08058 -[29]: https://www.schneier.com/crypto-gram/archives/2002/0515.html#1 -[30]: https://www.bcg.com/publications/2021/open-source-software-strategy-benefits -[31]: https://www.politico.eu/article/how-to-leak-data-and-get-away-with-it -[32]: https://theconversation.com/the-colonial-pipeline-ransomware-attack-and-the-solarwinds-hack-were-all-but-inevitable-why-national-cyber-defense-is-a-wicked-problem-160661 -[33]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[34]: https://www.eff.org/files/2015/11/24/3mod_threat-modeling-ssd_9-3-15.pdf -[35]: https://www.gofoss.today/nothing-to-hide -[36]: https://www.gofoss.today/intro-browse-freely -[37]: https://www.gofoss.today/intro-speak-freely -[38]: https://www.gofoss.today/intro-store-safely -[39]: https://www.gofoss.today/intro-free-your-computer -[40]: https://www.gofoss.today/intro-free-your-phone -[41]: https://www.gofoss.today/intro-free-your-cloud -[42]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1MCIgd2lkdGg9IjE1MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[43]: https://www.washingtonpost.com/technology/2019/12/31/how-we-survive-surveillance-apocalypse -[44]: https://gofoss.today/ -[45]: https://gofoss.today -[46]: https://undraw.co/license -[47]: https://undraw.co diff --git a/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md b/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md new file mode 100644 index 0000000000..b5706e3d76 --- /dev/null +++ b/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md @@ -0,0 +1,147 @@ +[#]: subject: (How Free & Open Source Software Can Save Online Privacy) +[#]: via: (https://news.itsfoss.com/save-privacy-with-foss/) +[#]: author: (Team It's FOSS https://news.itsfoss.com/author/team/) +[#]: collector: (lujun9972) +[#]: translator: (zz-air) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +自由/开源软件如何保护在线隐私 +====== + +_多年来,我一直使用科技巨头提供的服务。大部分都是自由的, 以牺牲我的隐私为代价。 但是那些日子已经过去了,现在我浏览、聊天、工作,没有任何人跟踪,变现和审查我的数据。多亏了自由/开源软件。_ + +### 我开始担心大型科技公司了 + +![][1] + +我一直觉得机器应该按照我的意愿行事,而不是反过来。这就是为什么谷歌的 Android 操作系统在 2008 年首次上市时就立刻吸引了我。在当时,谷歌的开源方式确实令人耳目一新。我花了几个小时定制了我的 HTC Hero 手机。我一定也不关心它比我朋友的 iphone 或塞班设备丑。我的新玩意功能要多的多。 + +一跃十年。谷歌已经成为了科技巨头,使ios相形见绌并且淘汰了塞班操作系统。 如今,这个公司占据了 90% 以上的搜索流量,并主导着浏览器市场。这种惊人的增长是有代价的,谷歌删除了“不作恶”条款。 这家搜索巨头目前正陷入官司之中,比如 [数据收集和追踪不当行为][2]。研究人员还在谷歌的联系人追踪应用程序中发现了[隐私法][3]。更重要的是,这家科技巨头宣布了一个颇具争议的[可以追踪用户浏览行为][4]的新算法,从而更好地提供广告服务。 + +现在,我不想把责任推给谷歌。亚马逊刚刚建立了美国历史上最大的民用[监控网络][5] 。它让警方可以在未经许可的情况下使用数百万个家庭监控摄像头。于此同时,欧洲对亚马逊遵守 [隐私规定][6]的情况进行了调查。微软也是如此。它也顺带着为促进 [工作场所监控][7] 功能而道歉。 + +有人可能认为,用户至少可以指望苹果来保护他们的隐私。这家科技巨头最近让他们选择,看看应用程序是否会追踪他们的行为。事实证明,[只有 5%][8] 的美国用户选择这种新的透明追踪应用。 与此同时,该公司从谷歌这样的数据代理公司的业务中获得了[巨大的利益][9]。更别提《堡垒之夜》开发商Epic Games和苹果之间的 [反垄断审判][10] ,后者声称要保护其 App Stere 的隐私。当然,还有Facebook。 该公司的隐私不正当行为在参议院就 [剑桥分析][11] 丑闻举行的听证会上达到了高潮,失去了用户仅存的信任。 + +尽管如此 – 或者因为 – 这些有问题的做法, 这些公司的总价值在 2011 年三月超过了[ 7.5 万亿美元][12]。“科技巨头” 现在超过了德国和英国国内生产总值的总和! + +### 为什么隐私很重要 + +![][13] + +我都在使用大科技公司的服务。我们是 [监视资本主义][14]的一部分,哈佛大学教授舒沙娜·祖波夫创造的一个术语,并且在科利·多克托罗的 [最新的书][15]里讨论监视资本主义。我们将通过技术手段来获取利润最大化。这一制度威胁到民主的核心,因为它导致了大规模监视,扰乱了选举程序,推动了思想的一致性和审查制度。 + +监视资本主义是基于对我们生活的一种令人深感不安的入侵。我们往往忘记隐私是一项基本权利。它被联合国人权理事会、公民与政治国际公约奉为神圣。我认为我们都可以联系起来:在我们的生活中有很多方面我们想要保持隐私,即使没有错误。无论是在不被他人评判的情况下,自由地探索我们的个性。或者保护我们不受监视,审查和操纵。 这就是窗帘被发明的原因。还有银行秘书律师特权,通信保密,投票保密,告解室保密或医疗保密。 + +解决网络隐私问题是对我们法律体系和社会习俗的全面改变所带来的广泛问题。 对技术垄断的监管是这一法案的主要挑战之一。 最近科技巨头和政府之间的对峙就说明了这一点:[美国 vs. Facebook][16], [中国 vs. 腾讯][17], [印度 vs. WhatsApp][18], [美国 vs. Facebook][19] 或者是[美国 vs. 科技巨头][20]。多年来,数字权利组织和软件基金会一直在倡导更好的隐私法、用户权利和创新自由。我们只举几个例子:电子前沿基金会、自由软件基金会、新闻自由基金会、隐私国际、开放权利组织或欧洲数字权利。 +### 这和自由/开源软件有什么关系? +![][21] + +自 1983 年成立以来, [自由软件运动][22] 已经成为一个相当多样化的社区。 自由和开源软件通常是简称为 FLOSS , FLOSS , Libre 软件 或 自由软件。 他包括一系列授权给用户 [使用,学习,分享并提高][23] 这个软件的权力。 还有 [修理][24]的权利。 自由软件的自由是指 “[言论自由][25]” — 有时也指 “免费啤酒”. 像这样,自由/开源软件不仅仅是技术。 它是关于社会、政治和经济解放。 + +几年前,一场隐私争议震动了自由软件社区。 Ubuntu 12.10 ——各种不同的 GHU/Linux 风格之一——开始在人们的电脑上建立互联网连接,进行本地搜索。 它为亚马逊提供广告服务,并与 Facebook 或 Twitter 共享私人数据。[强烈反对][26]。几年后, Canonical——Ubuntu 背后的公司——最终取消了在线搜索和亚马逊网络应用程序。 最近 [大胆的戏剧][27] 是自由/开源软件如何保护隐私的另一个例子。新的项目管理层决定将谷歌的 Analytics 和 Yandex 添加到音频软件中,但由于公众的强烈抗议,最终放弃了这一计划。 +尽管自由软件有很多优点,但它也不能免于批评。一种说法是自由/开源软件项目经常被放弃。 然而最近 [康奈尔大学研究][28] 表明在 1.932 个流行的开源项目中,有 7% ( 128 个项目)在被忽视后被新的开发人员接管,辍学率降低到不到 10% ( 187 个项目)。 +另一个常见的批评是 FOSS 通过发布代码暴露了潜在的安全漏洞。另一方面,将源代码保密 [不一定会提高安全性][29]. 认为封闭源代码要比自由/开源软件安全得多的观点,很方便地忽略了一个事实,即私有堆栈越来越多地构建在 [开放源代码之上][30]。 自由软件也倾向于去中心化,这有助于增强抵御监视、单点故障或大规模数据泄露的弹性。所以可以肯定的是,自由/开源软件并不能避免安全漏洞。 但也没有专有的解决方案,正如来自 Facebook、Linkedin 和 Clubhouse 的最新 [10亿人的数据泄露][31]。 或者是对太阳风和殖民管道公司( Colonial Pipeline )的大规模 [安全攻击][32] 。 + +总之,自由软件在促进网上隐私方面发挥了重要作用。近四十年来,自由/开源软件一直鼓励开发人员审计代码、修复问题并确保幕后没有任何可疑的事情发生。 +### 使用自由/开源软件实现在线隐私的七个步骤 + +![][33] + +在等待更好的隐私法律出台的同时,还有很多事情可以让你的设备更隐私。以下是用尊重隐私、自由/开源软件取代大型科技公司的七个步骤。 根据您的 [威胁模型][34], 您可能想首先考虑步骤1到步骤4, 因为他们已经提供了一个合理的隐私水平。如果你有一些技术技能,想要更进一步,看看步骤5到步骤7. + + 1. **[参与隐私][35]**. 关于网络隐私、数据利用、过滤泡沫、监控和审查,还有很多值得我们说和学的地方。参与进来,传播信息。 + 2. **[选择一个安全的私人浏览器][36]**. 切换到 Firefox 。阻止追踪器、cookie和广告。 使用尊重隐私的搜索引擎。 可能用 Tor 或 VPN 加密你的通信。 + 3. **[保持谈话的私密性][37]**. 使用端到端加密保护您的电子邮件,消息和电话。 抛弃传统的社交媒体,探索 fediversity ,一个由各种在线服务组成的联合家庭。 + 4. **[保护您的数据][38]**. 使用长且唯一的密码。为你的每个账户和设备选择一个不同的。在加密密码管理器中保存它们的安全。考虑使用双因素身份验证。创建一个常规备份例程。并对敏感数据进行加密。 + 5. **[释放您的电脑][39]**. 切换到 GNU/Linux ,喜欢免费并且开源的应用程序。根据您的需要, 选择一个初学者友好的发行版,如 Linux Mint 或 Ubuntu 对于更有经验的用户,选择 Debian, Manjaro, openSUSE, Fedora 或 Gentoo Linux。 对于隐私爱好者,可以看看 Qubes OS, Whonix 或 Tails. + 6. **[释放您的手机][40]**. 切换到定制的移动操作系统,如 LineageOS, CalyxOS, GrapheneOS 或 /e/。 喜欢社区维护的应用商店提供的免费开源应用。 + 7. **[释放您的云][41]**. 选择尊重隐私的云提供商。或设置您自己的安全服务器和自我主机服务, 例如 云存储、图库、任务和联系人管理,或媒体流。 + +### 结束 + +![][42] + +没有针对在线隐私的一键式解决方案。 用自由和开源软件取代大型科技公司是一个过程。有些改动很简单,比如安装 Firefox 或 Signal。 其他方法需要更多的时间和技能。但它们绝对值得。你并不孤单, 你可以依靠一个很棒的社区的支持。 所以,请允许我引用《华盛顿邮报》在线专栏的[杰弗里 a 福勒][43] 的话作为总结: “_隐私没有消亡,但你必须足够愤怒才能要求它_“. + +* * * + +### 关于作者 + +![][42] + +_Georg Jerska 是一个对保护公民隐私特别感兴趣的开源爱好者。 他和他的小团队要求运营 [GoFOSS][44][][45],这是一个关于如何尊重隐私、自由和开源软件取代大型科技公司的全面指南。_ + +* * * + +_[开源][46] 插图 [Katerina Limpitsouni][47]._ + +_所表达的观点只是作者的观点,并不一定反应其自由/开源软件的官方政策或立场。_ + +#### 大型科技网址获得数百万的收入,它的自由/开源软件得到了你! + +如果你喜欢我们的自由/开源软件,请考虑捐款支持我们的独立出版。您的支持将帮助我们发布内容集中在桌面 Linux 和开源软件上 + +我不感兴趣 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/save-privacy-with-foss/ + +作者:[Team It's FOSS][a] +选题:[lujun9972][b] +译者:[zz-air](https://github.com/zz-air) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/team/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI3MCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://www.gizmodo.com.au/2021/05/google-location-services-lawsuit +[3]: https://blog.appcensus.io/2021/04/27/why-google-should-stop-logging-contact-tracing-data +[4]: https://news.itsfoss.com/google-floc +[5]: https://www.theguardian.com/commentisfree/2021/may/18/amazon-ring-largest-civilian-surveillance-network-us +[6]: https://edps.europa.eu/press-publications/press-news/press-releases/2021/edps-opens-two-investigations-following-schrems_en +[7]: https://www.theguardian.com/technology/2020/dec/02/microsoft-apologises-productivity-score-critics-derided-workplace-surveillance +[8]: https://www.flurry.com/blog/ios-14-5-opt-in-rate-att-restricted-app-tracking-transparency-worldwide-us-daily-latest-update +[9]: https://www.nytimes.com/2020/10/25/technology/apple-google-search-antitrust.html +[10]: https://www.nytimes.com/2021/05/25/business/dealbook/apple-epic-case.html +[11]: https://en.wikipedia.org/wiki/Cambridge_Analytica +[12]: https://en.wikipedia.org/wiki/List_of_public_corporations_by_market_capitalization#2021 +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0OCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[14]: https://en.wikipedia.org/wiki/Surveillance_capitalism +[15]: https://www.goodreads.com/book/show/55134785-how-to-destroy-surveillance-capitalism +[16]: https://www.bbc.com/news/world-australia-56163550 +[17]: https://www.nytimes.com/2021/06/02/technology/china-tencent-monopoly.html +[18]: https://www.theguardian.com/world/2021/may/26/whatsapp-sues-indian-government-over-mass-surveillance-internet-laws +[19]: https://nypost.com/2021/05/26/eu-reportedly-set-to-open-formal-antitrust-probe-into-facebook +[20]: https://www.nytimes.com/interactive/2020/10/06/technology/house-antitrust-report-big-tech.html +[21]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2OCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[22]: https://itsfoss.com/what-is-foss +[23]: https://fsfe.org/freesoftware/freesoftware.en.html +[24]: https://framatube.org/videos/watch/99069c5c-5a00-489e-97cb-fd5cc76de77c +[25]: https://www.eff.org/deeplinks/2015/04/remembering-case-established-code-speech +[26]: https://itsfoss.com/canonical-targets-website-crictical-ubuntu-privacy +[27]: https://github.com/audacity/audacity/pull/835 +[28]: https://arxiv.org/abs/1906.08058 +[29]: https://www.schneier.com/crypto-gram/archives/2002/0515.html#1 +[30]: https://www.bcg.com/publications/2021/open-source-software-strategy-benefits +[31]: https://www.politico.eu/article/how-to-leak-data-and-get-away-with-it +[32]: https://theconversation.com/the-colonial-pipeline-ransomware-attack-and-the-solarwinds-hack-were-all-but-inevitable-why-national-cyber-defense-is-a-wicked-problem-160661 +[33]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[34]: https://www.eff.org/files/2015/11/24/3mod_threat-modeling-ssd_9-3-15.pdf +[35]: https://www.gofoss.today/nothing-to-hide +[36]: https://www.gofoss.today/intro-browse-freely +[37]: https://www.gofoss.today/intro-speak-freely +[38]: https://www.gofoss.today/intro-store-safely +[39]: https://www.gofoss.today/intro-free-your-computer +[40]: https://www.gofoss.today/intro-free-your-phone +[41]: https://www.gofoss.today/intro-free-your-cloud +[42]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1MCIgd2lkdGg9IjE1MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[43]: https://www.washingtonpost.com/technology/2019/12/31/how-we-survive-surveillance-apocalypse +[44]: https://gofoss.today/ +[45]: https://gofoss.today +[46]: https://undraw.co/license +[47]: https://undraw.co From f05a53e0ca5368db54ec8f99929b78ddaed998e7 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Wed, 23 Jun 2021 13:04:13 +0800 Subject: [PATCH 162/870] =?UTF-8?q?=E8=AE=A4=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20200914 Use Python to solve a charity-s business problem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200914 Use Python to solve a charity-s business problem.md b/sources/tech/20200914 Use Python to solve a charity-s business problem.md index febc102037..f0803cbb17 100644 --- a/sources/tech/20200914 Use Python to solve a charity-s business problem.md +++ b/sources/tech/20200914 Use Python to solve a charity-s business problem.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 22f3efecb84ce692a822f150cab91350ef402f37 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 23 Jun 2021 15:42:20 +0800 Subject: [PATCH 163/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zz-air 感谢你完成了第一篇贡献!确实用心了。 --- ...Source Software Can Save Online Privacy.md | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md b/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md index b5706e3d76..7cc12b6499 100644 --- a/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md +++ b/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md @@ -3,87 +3,86 @@ [#]: author: (Team It's FOSS https://news.itsfoss.com/author/team/) [#]: collector: (lujun9972) [#]: translator: (zz-air) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 自由/开源软件如何保护在线隐私 ====== -_多年来,我一直使用科技巨头提供的服务。大部分都是自由的, 以牺牲我的隐私为代价。 但是那些日子已经过去了,现在我浏览、聊天、工作,没有任何人跟踪,变现和审查我的数据。多亏了自由/开源软件。_ +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/online-privacy.png?w=1200&ssl=1) + +_多年来,我一直使用科技巨头提供的服务。大部分都是免费的,但是是以牺牲我的隐私为代价的。但那些日子已经过去了,现在我浏览、聊天、工作,没有任何人能跟踪、变现和审查我的数据。多亏了自由/开源软件。_ ### 我开始担心大型科技公司了 ![][1] -我一直觉得机器应该按照我的意愿行事,而不是反过来。这就是为什么谷歌的 Android 操作系统在 2008 年首次上市时就立刻吸引了我。在当时,谷歌的开源方式确实令人耳目一新。我花了几个小时定制了我的 HTC Hero 手机。我一定也不关心它比我朋友的 iphone 或塞班设备丑。我的新玩意功能要多的多。 +我一直觉得机器应该按照我的意愿行事,而不是反过来。这就是为什么谷歌的 Android 操作系统在 2008 年首次上市时就立刻吸引了我。在当时,谷歌的开源方式确实令人耳目一新。我花了几个小时定制了我的 HTC Hero 手机。我对它是不是比我朋友的 iPhone 或塞班设备更丑并不在意。我的新玩意具有无限的通用性。 -一跃十年。谷歌已经成为了科技巨头,使ios相形见绌并且淘汰了塞班操作系统。 如今,这个公司占据了 90% 以上的搜索流量,并主导着浏览器市场。这种惊人的增长是有代价的,谷歌删除了“不作恶”条款。 这家搜索巨头目前正陷入官司之中,比如 [数据收集和追踪不当行为][2]。研究人员还在谷歌的联系人追踪应用程序中发现了[隐私法][3]。更重要的是,这家科技巨头宣布了一个颇具争议的[可以追踪用户浏览行为][4]的新算法,从而更好地提供广告服务。 +一跃十年,谷歌已经成为了科技巨头,使 iOS 相形见绌并且淘汰了塞班操作系统。如今,这个公司占据了 90% 以上的搜索流量,并主导着浏览器市场。这种惊人的增长是有代价的,谷歌删除了“不作恶”条款就说明了这一点。这家搜索巨头目前正陷入官司之中,比如关于 [数据收集和追踪不当行为][2] 的案件。研究人员还在谷歌的联系人追踪应用程序中发现了 [隐私缺陷][3]。更重要的是,这家科技巨头宣布了一个颇具争议的 [可以追踪用户浏览行为][4] 的新算法,从而更好地提供广告服务。 -现在,我不想把责任推给谷歌。亚马逊刚刚建立了美国历史上最大的民用[监控网络][5] 。它让警方可以在未经许可的情况下使用数百万个家庭监控摄像头。于此同时,欧洲对亚马逊遵守 [隐私规定][6]的情况进行了调查。微软也是如此。它也顺带着为促进 [工作场所监控][7] 功能而道歉。 +现在,我不想把责任推给谷歌。亚马逊刚刚建立了美国历史上最大的民用 [监控网络][5] 。它让警方可以在未经许可的情况下使用数百万个家庭监控摄像头。于此同时,欧洲对亚马逊遵守 [隐私规定][6] 的情况进行了调查。微软也是如此。它也为顺带着促进 [工作场所监控][7] 功能而道歉。 -有人可能认为,用户至少可以指望苹果来保护他们的隐私。这家科技巨头最近让他们选择,看看应用程序是否会追踪他们的行为。事实证明,[只有 5%][8] 的美国用户选择这种新的透明追踪应用。 与此同时,该公司从谷歌这样的数据代理公司的业务中获得了[巨大的利益][9]。更别提《堡垒之夜》开发商Epic Games和苹果之间的 [反垄断审判][10] ,后者声称要保护其 App Stere 的隐私。当然,还有Facebook。 该公司的隐私不正当行为在参议院就 [剑桥分析][11] 丑闻举行的听证会上达到了高潮,失去了用户仅存的信任。 +有人可能认为,人们至少可以指望苹果来保护他们的隐私。这家科技巨头最近让他们选择知道应用程序是否会追踪他们的行为。事实证明,[只有 5%][8] 的美国用户选择接受这种新的应用追踪透明度。与此同时,该公司从谷歌这样的数据经纪商的业务中获得了 [巨大的利益][9]。更别提《堡垒之夜》开发商 Epic Games 和苹果之间的 [反垄断审判][10] ,后者声称要保护其应用商店的隐私。当然,还有 Facebook。该公司的隐私不当行为在参议院就 [剑桥分析公司][11] 丑闻举行的听证会上达到了高潮,失去了用户仅存的信任。 -尽管如此 – 或者因为 – 这些有问题的做法, 这些公司的总价值在 2011 年三月超过了[ 7.5 万亿美元][12]。“科技巨头” 现在超过了德国和英国国内生产总值的总和! +尽管如此 —— 或者因为 —— 这些有问题的做法,这些公司的总价值在 2021 年 3 月超过了 [7.5 万亿美元][12]。“科技巨头”们 现在超过了德国和英国国内生产总值的总和! ### 为什么隐私很重要 ![][13] -我都在使用大科技公司的服务。我们是 [监视资本主义][14]的一部分,哈佛大学教授舒沙娜·祖波夫创造的一个术语,并且在科利·多克托罗的 [最新的书][15]里讨论监视资本主义。我们将通过技术手段来获取利润最大化。这一制度威胁到民主的核心,因为它导致了大规模监视,扰乱了选举程序,推动了思想的一致性和审查制度。 +我们都在使用大科技公司的服务。我们是 [监控资本主义][14]Surveillance Capitalism 的一部分,这是哈佛大学教授 Shoshana Zuboff 创造的一个术语,在 Cory Doctorow 的 [新书][15]《监控资本主义》里也讨论了它。这是一个以技术垄断为中心的经济体系,通过收集个人数据来获取利润最大化。这一制度威胁到民主的核心,因为它导致了大规模监视,扰乱了选举程序,推动了思想的一致性和审查制度。 -监视资本主义是基于对我们生活的一种令人深感不安的入侵。我们往往忘记隐私是一项基本权利。它被联合国人权理事会、公民与政治国际公约奉为神圣。我认为我们都可以联系起来:在我们的生活中有很多方面我们想要保持隐私,即使没有错误。无论是在不被他人评判的情况下,自由地探索我们的个性。或者保护我们不受监视,审查和操纵。 这就是窗帘被发明的原因。还有银行秘书律师特权,通信保密,投票保密,告解室保密或医疗保密。 +监视资本主义的基础是对我们生活的侵犯,令人深感不安。我们往往忘记隐私是一项基本权利。它被联合国人权理事会UN Human Rights Council、《公民权利与政治权利国际公约International Covenant on Civil and Political Rights》和一些条约所规定。我认为我们都能体会到:在我们的生活中有很多方面我们想要保持隐私,即使没有错误的行为。无论是为了自由地表达自己,探索自己的个性,而不被他人评判。还是为了保护我们不受监视、审查和操纵。这就是窗帘被发明的原因。还有银行保密、律师-客户特权,通信保密,投票保密,告解室保密或医疗保密。 + +解决网络隐私问题是一个广泛问题,它需要对我们的法律体系和社会习俗的全面改变。对技术垄断的监管是这个十年的主要挑战之一。最近科技巨头和政府之间的对峙就说明了这一点:[澳大利亚 vs. Facebook][16]、 [中国 vs. 腾讯][17]、 [印度 vs. WhatsApp][18]、[欧盟 vs. Facebook][19] 或者是 [美国 vs. 科技巨头][20]。多年来,数字权利组织和软件基金会一直在倡导更好的隐私法律、用户权利和创新自由,如:电子前沿基金会Electronic Frontier Foundation自由软件基金会Free Software Foundation新闻自由基金会Freedom of the Press Foundation隐私国际Privacy International开放权利组织Open Rights Group欧洲数字权利European Digital Rights。 -解决网络隐私问题是对我们法律体系和社会习俗的全面改变所带来的广泛问题。 对技术垄断的监管是这一法案的主要挑战之一。 最近科技巨头和政府之间的对峙就说明了这一点:[美国 vs. Facebook][16], [中国 vs. 腾讯][17], [印度 vs. WhatsApp][18], [美国 vs. Facebook][19] 或者是[美国 vs. 科技巨头][20]。多年来,数字权利组织和软件基金会一直在倡导更好的隐私法、用户权利和创新自由。我们只举几个例子:电子前沿基金会、自由软件基金会、新闻自由基金会、隐私国际、开放权利组织或欧洲数字权利。 ### 这和自由/开源软件有什么关系? + ![][21] -自 1983 年成立以来, [自由软件运动][22] 已经成为一个相当多样化的社区。 自由和开源软件通常是简称为 FLOSS , FLOSS , Libre 软件 或 自由软件。 他包括一系列授权给用户 [使用,学习,分享并提高][23] 这个软件的权力。 还有 [修理][24]的权利。 自由软件的自由是指 “[言论自由][25]” — 有时也指 “免费啤酒”. 像这样,自由/开源软件不仅仅是技术。 它是关于社会、政治和经济解放。 +自 1983 年成立以来,[自由软件运动][22]Free Software movement 已经成为一个相当多样化的社区。自由和开源软件通常被称为 FOSS、FLOSS、Libre Software 或 Free Software。 它包括一系列许可证,授权给用户 [使用、学习、分享并提高][23] 这个软件的权力。以及 [维修][24] 的权利。 自由软件Free Software的“自由Free”是指 “[言论自由][25]”的“自由”,有时也指 “免费啤酒”的“免费”。因此,自由/开源软件(FOSS)不仅仅是技术。它是关于社会、政治和经济解放的。 -几年前,一场隐私争议震动了自由软件社区。 Ubuntu 12.10 ——各种不同的 GHU/Linux 风格之一——开始在人们的电脑上建立互联网连接,进行本地搜索。 它为亚马逊提供广告服务,并与 Facebook 或 Twitter 共享私人数据。[强烈反对][26]。几年后, Canonical——Ubuntu 背后的公司——最终取消了在线搜索和亚马逊网络应用程序。 最近 [大胆的戏剧][27] 是自由/开源软件如何保护隐私的另一个例子。新的项目管理层决定将谷歌的 Analytics 和 Yandex 添加到音频软件中,但由于公众的强烈抗议,最终放弃了这一计划。 -尽管自由软件有很多优点,但它也不能免于批评。一种说法是自由/开源软件项目经常被放弃。 然而最近 [康奈尔大学研究][28] 表明在 1.932 个流行的开源项目中,有 7% ( 128 个项目)在被忽视后被新的开发人员接管,辍学率降低到不到 10% ( 187 个项目)。 -另一个常见的批评是 FOSS 通过发布代码暴露了潜在的安全漏洞。另一方面,将源代码保密 [不一定会提高安全性][29]. 认为封闭源代码要比自由/开源软件安全得多的观点,很方便地忽略了一个事实,即私有堆栈越来越多地构建在 [开放源代码之上][30]。 自由软件也倾向于去中心化,这有助于增强抵御监视、单点故障或大规模数据泄露的弹性。所以可以肯定的是,自由/开源软件并不能避免安全漏洞。 但也没有专有的解决方案,正如来自 Facebook、Linkedin 和 Clubhouse 的最新 [10亿人的数据泄露][31]。 或者是对太阳风和殖民管道公司( Colonial Pipeline )的大规模 [安全攻击][32] 。 +几年前,一场隐私争议震动了自由软件社区。Ubuntu 12.10(各种不同的 GHU/Linux 风格之一)开始在人们的电脑上建立互联网连接进行本地搜索。它为亚马逊提供广告服务,并与 Facebook 或 Twitter 共享私人数据。遭到了 [剧烈反弹][26]。几年后, Canonical(Ubuntu 背后的公司)最终取消了在线搜索和亚马逊 Web 应用。最近 [Audacity 闹剧][27] 是自由/开源软件如何保护隐私的另一个例子。新的项目管理层决定将谷歌的 Analytics 和 Yandex 添加到音频软件中,但由于公众的强烈抗议,最终放弃了这一计划。 + +尽管自由软件有很多优点,但它也不能免于批评。一种说法是自由/开源软件项目经常被放弃。然而最近在 [实证软件工程和测量会议][28] 上提出的一项研究表明,情况并非如此:在 1932 个流行的开源项目中,有 7%(128 个项目)在被忽视后由新的开发人员接管,使烂尾率降低到不到 10%(187 个项目)。 + +另一个常见的批评是自由/开源软件通过公布代码暴露了潜在的安全漏洞。另一方面,将源代码保密 [不一定会提高安全性][29]。认为封闭源代码要比自由/开源软件安全得多的观点,却忽略了一个事实,即专有堆栈越来越多地构建在 [开放源代码之上][30]。自由软件也倾向于去中心化,这有助于增强抵御监视、单点故障或大规模数据泄露。所以可以肯定的是,自由/开源软件并不能避免安全漏洞。但专有的解决方案也是如此,正如来自 Facebook、Linkedin 和 Clubhouse 的最新 [10 亿人的数据泄露][31] 或者对 SolarWind 和 Colonial 管道公司的大规模 [安全攻击][32] 所说明的那样。 总之,自由软件在促进网上隐私方面发挥了重要作用。近四十年来,自由/开源软件一直鼓励开发人员审计代码、修复问题并确保幕后没有任何可疑的事情发生。 + ### 使用自由/开源软件实现在线隐私的七个步骤 ![][33] -在等待更好的隐私法律出台的同时,还有很多事情可以让你的设备更隐私。以下是用尊重隐私、自由/开源软件取代大型科技公司的七个步骤。 根据您的 [威胁模型][34], 您可能想首先考虑步骤1到步骤4, 因为他们已经提供了一个合理的隐私水平。如果你有一些技术技能,想要更进一步,看看步骤5到步骤7. +在等待更好的隐私法律出台的同时,还有很多事情可以让你的设备更隐私。以下是用尊重隐私、自由/开源软件取代大型科技公司的七个步骤。 根据你的 [威胁模型][34],你可能想首先考虑步骤 1 到步骤 4,因为它们已经提供了一个合理的隐私水平。如果你有一些技术技能,想要更进一步,看看步骤 5 到步骤 7。 - 1. **[参与隐私][35]**. 关于网络隐私、数据利用、过滤泡沫、监控和审查,还有很多值得我们说和学的地方。参与进来,传播信息。 - 2. **[选择一个安全的私人浏览器][36]**. 切换到 Firefox 。阻止追踪器、cookie和广告。 使用尊重隐私的搜索引擎。 可能用 Tor 或 VPN 加密你的通信。 - 3. **[保持谈话的私密性][37]**. 使用端到端加密保护您的电子邮件,消息和电话。 抛弃传统的社交媒体,探索 fediversity ,一个由各种在线服务组成的联合家庭。 - 4. **[保护您的数据][38]**. 使用长且唯一的密码。为你的每个账户和设备选择一个不同的。在加密密码管理器中保存它们的安全。考虑使用双因素身份验证。创建一个常规备份例程。并对敏感数据进行加密。 - 5. **[释放您的电脑][39]**. 切换到 GNU/Linux ,喜欢免费并且开源的应用程序。根据您的需要, 选择一个初学者友好的发行版,如 Linux Mint 或 Ubuntu 对于更有经验的用户,选择 Debian, Manjaro, openSUSE, Fedora 或 Gentoo Linux。 对于隐私爱好者,可以看看 Qubes OS, Whonix 或 Tails. - 6. **[释放您的手机][40]**. 切换到定制的移动操作系统,如 LineageOS, CalyxOS, GrapheneOS 或 /e/。 喜欢社区维护的应用商店提供的免费开源应用。 - 7. **[释放您的云][41]**. 选择尊重隐私的云提供商。或设置您自己的安全服务器和自我主机服务, 例如 云存储、图库、任务和联系人管理,或媒体流。 + 1. **[参与到隐私保护中来][35]**。关于在线隐私、数据利用、过滤泡沫、监控和审查,还有很多值得我们讨论和学习的地方。参与进来,传播信息。 + 2. **[选择一个安全和隐私的浏览器][36]**。切换到 Firefox。阻止追踪器、cookie 和广告。使用尊重隐私的搜索引擎。可能要用 Tor 或 VPN 加密你的通信。 + 3. **[保持交流的私密性][37]**。使用端到端加密保护你的电子邮件、消息和电话。抛弃传统的社交媒体,探索 fediversity ,这是一个由各种在线服务组成的联合家庭。 + 4. **[保护你的数据][38]**。使用长且独特的密码。为你的每个账户和设备选择一个不同的密码。将它们安全地保存在加密的密码管理器中。考虑使用双因素身份验证。创建一个常规备份例程。并对敏感数据进行加密。 + 5. **[解绑你的电脑][39]**。切换到 GNU/Linux ,并首选自由和开源的应用程序。根据你的需要,选择一个对初学者友好的发行版,如 Linux Mint 或 Ubuntu;对于更有经验的用户,选择 Debian、Manjaro、openSUSE、Fedora 或 Gentoo Linux。对于隐私爱好者,可以看看 Qubes OS、Whonix 或 Tails。 + 6. **[解绑你的手机][40]**。切换到一个定制的移动操作系统,如 LineageOS、CalyxOS、GrapheneOS 或 /e/。首选社区维护的应用商店提供的自由及开源应用。 + 7. **[解绑你的云][41]**。选择尊重隐私的云服务商。或设置你自己的安全服务器和自托管服务,例如云存储、图库、任务和联系人管理,或媒体流。 ### 结束 ![][42] -没有针对在线隐私的一键式解决方案。 用自由和开源软件取代大型科技公司是一个过程。有些改动很简单,比如安装 Firefox 或 Signal。 其他方法需要更多的时间和技能。但它们绝对值得。你并不孤单, 你可以依靠一个很棒的社区的支持。 所以,请允许我引用《华盛顿邮报》在线专栏的[杰弗里 a 福勒][43] 的话作为总结: “_隐私没有消亡,但你必须足够愤怒才能要求它_“. +面对在线隐私没有一键式解决方案。用自由及开源软件取代大型科技公司是一个过程。有些改动很简单,比如安装 Firefox 或 Signal。其他方法需要更多的时间和技能。但它们绝对值得。你并不孤单,你可以依靠一个很棒的社区的支持。所以,请允许我引用《华盛顿邮报》在线专栏的 [Geoffrey A. Fowler][43] 的话作为总结: “_隐私没有消亡,但你必须足够愤怒才能要求它_”。 * * * ### 关于作者 -![][42] +![][48] -_Georg Jerska 是一个对保护公民隐私特别感兴趣的开源爱好者。 他和他的小团队要求运营 [GoFOSS][44][][45],这是一个关于如何尊重隐私、自由和开源软件取代大型科技公司的全面指南。_ +_Georg Jerska 是一个对保护公民隐私特别感兴趣的开源爱好者。他和他的小团队运营着 [GoFOSS][44],这是一个关于如何用尊重隐私的自由和开源软件取代大型科技公司的全面指南。_ -* * * +_[开源][46] 插图 [Katerina Limpitsouni][47]。_ -_[开源][46] 插图 [Katerina Limpitsouni][47]._ - -_所表达的观点只是作者的观点,并不一定反应其自由/开源软件的官方政策或立场。_ - -#### 大型科技网址获得数百万的收入,它的自由/开源软件得到了你! - -如果你喜欢我们的自由/开源软件,请考虑捐款支持我们的独立出版。您的支持将帮助我们发布内容集中在桌面 Linux 和开源软件上 - -我不感兴趣 +_所表达的观点只是作者的观点,并不一定反应我们的官方政策或立场。_ -------------------------------------------------------------------------------- @@ -92,13 +91,13 @@ via: https://news.itsfoss.com/save-privacy-with-foss/ 作者:[Team It's FOSS][a] 选题:[lujun9972][b] 译者:[zz-air](https://github.com/zz-air) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://news.itsfoss.com/author/team/ [b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI3MCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[1]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/big_tech.png?resize=706%2C636&ssl=1 [2]: https://www.gizmodo.com.au/2021/05/google-location-services-lawsuit [3]: https://blog.appcensus.io/2021/04/27/why-google-should-stop-logging-contact-tracing-data [4]: https://news.itsfoss.com/google-floc @@ -110,7 +109,7 @@ via: https://news.itsfoss.com/save-privacy-with-foss/ [10]: https://www.nytimes.com/2021/05/25/business/dealbook/apple-epic-case.html [11]: https://en.wikipedia.org/wiki/Cambridge_Analytica [12]: https://en.wikipedia.org/wiki/List_of_public_corporations_by_market_capitalization#2021 -[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0OCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[13]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/privacy.png?resize=706%2C584&ssl=1 [14]: https://en.wikipedia.org/wiki/Surveillance_capitalism [15]: https://www.goodreads.com/book/show/55134785-how-to-destroy-surveillance-capitalism [16]: https://www.bbc.com/news/world-australia-56163550 @@ -118,7 +117,7 @@ via: https://news.itsfoss.com/save-privacy-with-foss/ [18]: https://www.theguardian.com/world/2021/may/26/whatsapp-sues-indian-government-over-mass-surveillance-internet-laws [19]: https://nypost.com/2021/05/26/eu-reportedly-set-to-open-formal-antitrust-probe-into-facebook [20]: https://www.nytimes.com/interactive/2020/10/06/technology/house-antitrust-report-big-tech.html -[21]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2OCIgd2lkdGg9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[21]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/foss.png?resize=706%2C631&ssl=1 [22]: https://itsfoss.com/what-is-foss [23]: https://fsfe.org/freesoftware/freesoftware.en.html [24]: https://framatube.org/videos/watch/99069c5c-5a00-489e-97cb-fd5cc76de77c @@ -130,7 +129,7 @@ via: https://news.itsfoss.com/save-privacy-with-foss/ [30]: https://www.bcg.com/publications/2021/open-source-software-strategy-benefits [31]: https://www.politico.eu/article/how-to-leak-data-and-get-away-with-it [32]: https://theconversation.com/the-colonial-pipeline-ransomware-attack-and-the-solarwinds-hack-were-all-but-inevitable-why-national-cyber-defense-is-a-wicked-problem-160661 -[33]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[33]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/steps.png?w=1054&ssl=1 [34]: https://www.eff.org/files/2015/11/24/3mod_threat-modeling-ssd_9-3-15.pdf [35]: https://www.gofoss.today/nothing-to-hide [36]: https://www.gofoss.today/intro-browse-freely @@ -139,9 +138,10 @@ via: https://news.itsfoss.com/save-privacy-with-foss/ [39]: https://www.gofoss.today/intro-free-your-computer [40]: https://www.gofoss.today/intro-free-your-phone [41]: https://www.gofoss.today/intro-free-your-cloud -[42]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1MCIgd2lkdGg9IjE1MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[42]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/gofoss.png?resize=300%2C300&ssl=1 [43]: https://www.washingtonpost.com/technology/2019/12/31/how-we-survive-surveillance-apocalypse [44]: https://gofoss.today/ [45]: https://gofoss.today [46]: https://undraw.co/license [47]: https://undraw.co +[48]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/georg.png?resize=300%2C300&ssl=1 \ No newline at end of file From 5a5979cbeee9b1711718e8920e65a38137be8bda Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 23 Jun 2021 15:43:23 +0800 Subject: [PATCH 164/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zz-air 本文首发地址:https://linux.cn/article-13512-1.html 你的 LCTT 专页地址:https://linux.cn/lctt/zz-air --- ...How Free - Open Source Software Can Save Online Privacy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210613 How Free - Open Source Software Can Save Online Privacy.md (99%) diff --git a/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md b/published/20210613 How Free - Open Source Software Can Save Online Privacy.md similarity index 99% rename from translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md rename to published/20210613 How Free - Open Source Software Can Save Online Privacy.md index 7cc12b6499..b1334ad866 100644 --- a/translated/talk/20210613 How Free - Open Source Software Can Save Online Privacy.md +++ b/published/20210613 How Free - Open Source Software Can Save Online Privacy.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (zz-air) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13512-1.html) 自由/开源软件如何保护在线隐私 ====== From f411a514c3bae573e8f2b74c701fc51b14237a67 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 23 Jun 2021 16:01:00 +0800 Subject: [PATCH 165/870] PUB @geekpi https://linux.cn/article-13513-1.html --- ...15 Build a static website with Eleventy.md | 71 +++++++++---------- 1 file changed, 32 insertions(+), 39 deletions(-) rename {translated/tech => published}/20210615 Build a static website with Eleventy.md (68%) diff --git a/translated/tech/20210615 Build a static website with Eleventy.md b/published/20210615 Build a static website with Eleventy.md similarity index 68% rename from translated/tech/20210615 Build a static website with Eleventy.md rename to published/20210615 Build a static website with Eleventy.md index 8d75bc81f2..2a78a7b3cb 100644 --- a/translated/tech/20210615 Build a static website with Eleventy.md +++ b/published/20210615 Build a static website with Eleventy.md @@ -3,22 +3,24 @@ [#]: author: (Nwokocha Wisdom https://opensource.com/users/wise4rmgod) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13513-1.html) 用 Eleventy 建立一个静态网站 ====== -Eleventy 是一个基于 JavaScript 的 Jekyll 和 Hugo 的替代品,用于构建静态网站。 -![Digital images of a computer desktop][1] -静态网站生成器是一种基于原始数据和一组模板生成完整的静态 HTML 网站的工具。它自动完成单个 HTML 页面的编码任务,并让这些页面准备好为用户服务。由于 HTML 页面是预先建立的,它们在用户的浏览器中加载得非常快。 +> Eleventy 是一个基于 JavaScript 的 Jekyll 和 Hugo 的替代品,用于构建静态网站。 + +![](https://img.linux.net.cn/data/attachment/album/202106/23/160000epjn313s1t5ja8wj.jpg) + +静态网站生成器是一种基于原始数据和一组模板生成完整的静态 HTML 网站的工具。它可以自动完成单个 HTML 页面的编码任务,并让这些页面准备好为用户服务。由于 HTML 页面是预先建立的,它们在用户的浏览器中加载得非常快。 静态网站对文档也很友好,因为静态网站很容易扩展,而且它们是生成、维护和部署项目文档的一种简单方法。由于这些原因,企业经常使用它们来记录应用编程接口 (API)、数据库模式和其他信息。文档是软件开发、设计和其他方面技术的一个重要组成部分。所有的代码库都需要某种形式的文档,选择范围从简单的 README 到完整的文档。 ### Eleventy: 一个静态网站生成器 -[Eleventy][2] (11ty) 是一个简单的静态网站生成器,是 [Jekyll][3] 和 [Hugo][4] 的替代品。它是用 JavaScript 编写的,它将一个模板目录(不同类型)转化为 HTML。它也是开源的,在 MIT 许可下发布。 +[Eleventy][2](11ty)是一个简单的静态网站生成器,是 [Jekyll][3] 和 [Hugo][4] 的替代品。它是用 JavaScript 编写的,它将一个(不同类型的)模板目录转化为 HTML。它也是开源的,在 MIT 许可下发布。 Eleventy 可以与 HTML、Markdown、Liquid、Nunjucks、Handlebars、Mustache、EJS、Haml、Pug 和 JavaScript Template Literals 协同工作。 @@ -29,24 +31,20 @@ Eleventy 可以与 HTML、Markdown、Liquid、Nunjucks、Handlebars、Mustache * 可定制 * 基于 JavaScript,这是许多网络开发者所熟悉的,新用户也容易学习 - - ### 安装 Eleventy Eleventy 需要 Node.js。在 Linux 上,你可以使用你的包管理器安装 Node.js: - ``` -`$ sudo dnf install nodejs` +$ sudo dnf install nodejs ``` 如果你的包管理器没有 Node.js,或者你不在 Linux 上,你可以从 Node.js 网站[安装它][5]。 Node.js 安装完毕后,就用它来安装 Eleventy: - ``` -`$ npm install -g @11ty/eleventy` +$ npm install -g @11ty/eleventy ``` 这就完成了! @@ -55,62 +53,57 @@ Node.js 安装完毕后,就用它来安装 Eleventy: 现在你可以开始使用 Eleventy 来建立你的静态文档网站。以下是需要遵循的步骤。 -#### 1\. 创建一个 package.json 文件 - -要将 Eleventy 安装到你的项目中,你需要一个 package.json 文件: +#### 1、创建一个 package.json 文件 +要将 Eleventy 安装到你的项目中,你需要一个 `package.json` 文件: ``` -`$ npm init -y` +$ npm init -y ``` -#### 2\. 将 Eleventy 安装到 package.json 中 - -安装 Eleventy 并保存到你的项目的 `package.json` 中,通过运行: +#### 2、将 Eleventy 安装到 package.json 中 +安装 Eleventy 并保存到你的项目的 `package.json` 中。运行: ``` -`$ npm install-save-dev @11ty/eleventy` +$ npm install-save-dev @11ty/eleventy ``` -#### 3\. 运行 Eleventy +#### 3、运行 Eleventy 使用 `npx` 命令来运行你本地项目的 Eleventy 版本。在你确认安装完成后,尝试运行 Eleventy: - ``` -`$ npx @11ty/eleventy` +$ npx @11ty/eleventy ``` -#### 4\. 创建一些模板 +#### 4、创建一些模板 现在运行两个命令来创建两个新的模板文件(一个 HTML 和一个 Markdown 文件): - ``` -$ cat << EOF >> index.html -<!doctype html><html> -<head> -<title>Page title</title> -</head><body> -<p>Hello world</p> -</body></html> +$ cat << EOF >> index.html + + +Page title + +

Hello world

+ EOF -$ echo '# Page header' > index.md +$ echo '# Page header' > index.md ``` 这就把当前目录或子目录中的任何内容模板编译到输出文件夹中(默认为 `_site`)。 运行 `eleventy --serve` 来启动一个开发网络服务器。 - ``` -`$ npx @11ty/eleventy-serve` +$ npx @11ty/eleventy-serve ``` 在你的网络浏览器中打开 `http://localhost:8080/README/`,看你的 Eleventy 输出。 -然后把 `_site` 中的文件上传到你的网络服务器,发布你的网站给世界看。 +然后把 `_site` 中的文件上传到你的 Web 服务器,发布你的网站给世界看。 ### 尝试 Eleventy @@ -118,7 +111,7 @@ Eleventy 是一个静态网站生成器,它易于使用,有模板和主题 * * * -_本文基于[为开源项目建立技术文档静态网站][7],首次发布在 Nwokocha Wisdom Maduabuchi 的 Medium 上,经授权转载。_ +_本文基于 [为开源项目建立技术文档静态网站][7],首次发布在 Nwokocha Wisdom Maduabuchi 的 Medium 上,经授权转载。_ -------------------------------------------------------------------------------- @@ -127,7 +120,7 @@ via: https://opensource.com/article/21/6/static-site-builder 作者:[Nwokocha Wisdom][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a643a97751ca759e2fcc39e9e986a1c414460a35 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Wed, 23 Jun 2021 16:49:48 +0800 Subject: [PATCH 166/870] Update 20200914 Use Python to solve a charity-s business problem.md --- ...20200914 Use Python to solve a charity-s business problem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200914 Use Python to solve a charity-s business problem.md b/sources/tech/20200914 Use Python to solve a charity-s business problem.md index f0803cbb17..febc102037 100644 --- a/sources/tech/20200914 Use Python to solve a charity-s business problem.md +++ b/sources/tech/20200914 Use Python to solve a charity-s business problem.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (zepoch) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b72ce16db15aa38b2fe7bd2fd5dfd94dd1eeba99 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Wed, 23 Jun 2021 16:55:35 +0800 Subject: [PATCH 167/870] Update 20200914 Use Python to solve a charity-s business problem.md --- ...20200914 Use Python to solve a charity-s business problem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200914 Use Python to solve a charity-s business problem.md b/sources/tech/20200914 Use Python to solve a charity-s business problem.md index febc102037..f0803cbb17 100644 --- a/sources/tech/20200914 Use Python to solve a charity-s business problem.md +++ b/sources/tech/20200914 Use Python to solve a charity-s business problem.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From de698f89d1d90377f6758c321b7b38d65e9bd853 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 24 Jun 2021 05:03:10 +0800 Subject: [PATCH 168/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210623=20?= =?UTF-8?q?Python=203.10=20beta=20in=20Fedora=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210623 Python 3.10 beta in Fedora Linux.md --- ...210623 Python 3.10 beta in Fedora Linux.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20210623 Python 3.10 beta in Fedora Linux.md diff --git a/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md b/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md new file mode 100644 index 0000000000..3cdae5cbc8 --- /dev/null +++ b/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md @@ -0,0 +1,115 @@ +[#]: subject: (Python 3.10 beta in Fedora Linux) +[#]: via: (https://fedoramagazine.org/python-3-10-beta-in-fedora-linux/) +[#]: author: (Miro Hrončok https://fedoramagazine.org/author/churchyard/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Python 3.10 beta in Fedora Linux +====== + +![][1] + +The Python developers have already released three beta versions of Python 3.10.0. You can try the latest one in Fedora Linux today! Test your Python code with 3.10 early to be ready for the final 3.10.0 release in October. + +### Install Python 3.10 on Fedora Linux + +If you run Fedora Linux, you can install Python 3.10 from the official software repository with _dnf_: + +``` +$ sudo dnf install python3.10 +``` + +You might need to enable the _updates-testing_ repository to get the very latest pre-release: + +``` +$ sudo dnf install --enablerepo=updates-testing python3.10 +``` + +As more betas and release candidates [will be released][2], the Fedora package will receive updates. No need to compile your own development version of Python, just install it and have it up to date. The Python developers will add no new features starting with the first beta; you can already enjoy all the new things. + +### Test your projects with Python 3.10 + +Run the _python3.10_ command to use Python 3.10 or create virtual environments with the [builtin _venv_ module, tox][3] or with [pipenv][4] and [poetry][5]. Here’s an example using _tox_: + +``` +$ git clone https://github.com/benjaminp/six.git +Cloning into 'six'... +$ cd six/ +$ tox -e py310 +py310 run-test: commands[0] | python -m pytest -rfsxX +================== test session starts =================== +platform linux -- Python 3.10.0b3, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 +collected 200 items + +test_six.py ...................................... [ 19%] +.................................................. [ 44%] +.................................................. [ 69%] +.................................................. [ 94%] +............ [100%] + +================== 200 passed in 0.43s =================== +________________________ summary _________________________ + py310: commands succeeded + congratulations :) +``` + +If you find a problem with Python 3.10 on Fedora Linux, please do [file bug reports at Fedora’s bugzilla][6] or in the [Python’s issue tracker][7]. If you aren’t sure if it is a problem in Python, you can [contact the Fedora’s Python maintainers][8] directly via email or IRC. + +### What’s new in Python 3.10 + +See the [full list of news in Python 3.10][9]. You can, for example, try out [structural pattern matching][10]: + +``` +$ python3.10 +Python 3.10.0b3 (default, Jun 17 2021, 00:00:00) +[GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> point = (3, 10) +>>> match point: +... case (0, 0): +... print("Origin") +... case (0, y): +... print(f"Y={y}") +... case (x, 0): +... print(f"X={x}") +... case (x, y): +... print(f"X={x}, Y={y}") +... case _: +... raise ValueError("Not a point") +... +X=3, Y=10 +>>> x +3 +>>> y +10 +``` + +And stay tuned for [Python 3.10 as _python3_ in Fedora Linux 35][11]! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/python-3-10-beta-in-fedora-linux/ + +作者:[Miro Hrončok][a] +选题:[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/churchyard/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/python310-beta-816x345.jpg +[2]: https://www.python.org/dev/peps/pep-0619/ +[3]: https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html +[4]: https://fedoramagazine.org/install-pipenv-fedora/ +[5]: https://python-poetry.org/ +[6]: https://bugzilla.redhat.com/buglist.cgi?component=python3.10&product=Fedora +[7]: https://bugs.python.org/ +[8]: https://fedoraproject.org/wiki/SIGs/Python#Communicate +[9]: https://docs.python.org/3.10/whatsnew/3.10.html +[10]: https://www.python.org/dev/peps/pep-0634/ +[11]: https://fedoraproject.org/wiki/Changes/Python3.10 From d912aa9d9c6705d0b3c2116515917a69871e3967 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 24 Jun 2021 05:03:38 +0800 Subject: [PATCH 169/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210623=20?= =?UTF-8?q?Replace=20find=20with=20fd=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210623 Replace find with fd on Linux.md --- .../20210623 Replace find with fd on Linux.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/tech/20210623 Replace find with fd on Linux.md diff --git a/sources/tech/20210623 Replace find with fd on Linux.md b/sources/tech/20210623 Replace find with fd on Linux.md new file mode 100644 index 0000000000..6e509c7e59 --- /dev/null +++ b/sources/tech/20210623 Replace find with fd on Linux.md @@ -0,0 +1,146 @@ +[#]: subject: (Replace find with fd on Linux) +[#]: via: (https://opensource.com/article/21/6/fd-linux) +[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Replace find with fd on Linux +====== +The fd command is a popular, user-friendly alternative to the find +command. +![Magnifying glass on code][1] + +Many Linux programmers use the `find` command every single day of their career. But `find` gives a limited set of filesystem entries, and if you have to do a large set of `find` operations, it's not even very fast. So instead, I prefer to use the Rust `fd` command because it provides sensible defaults that work for most use cases. + +As its [README][2] says, "`fd` is a program to find entries in your filesystem. It is a simple, fast, and user-friendly alternative to `find`." It features parallelized directory traversal, so it can search multiple directories at once. It supports regular expressions (regex) and glob-based patterns. + +### Install fd + +On Linux, you can install `fd` from your software repository (a list of available packages can be found on the [fd page on Repology][3].) For example, on Fedora: + + +``` +`$ sudo dnf install fd-find` +``` + +On macOS, use [MacPorts][4] or [Homebrew][5]. + +Alternately, you can use Rust's Cargo package manager: + + +``` +`$ cargo install fd-find` +``` + +### Use fd + +To do a simple search, run `fd` after any argument, such as: + + +``` +$ fd sh +registry/src/github.com-1ecc6299db9ec823/cc-1.0.67/src/bin/gcc-shim.rs +registry/src/github.com-1ecc6299db9ec823/exa-0.10.1/completions/completions.bash +registry/src/github.com-1ecc6299db9ec823/exa-0.10.1/completions/completions.fish +registry/src/github.com-1ecc6299db9ec823/exa-0.10.1/completions/completions.zsh +registry/src/github.com-1ecc6299db9ec823/exa-0.10.1/xtests/run.sh +registry/src/github.com-1ecc6299db9ec823/git2-0.13.18/src/stash.rs +registry/src/github.com-1ecc6299db9ec823/libc-0.2.94/src/unix/solarish +registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.12.19+1.1.0/libgit2/cmake/SelectHashes.cmake +registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.12.19+1.1.0/libgit2/include/git2/stash.h +registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.12.19+1.1.0/libgit2/include/git2/sys/hashsig.h +registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.12.19+1.1.0/libgit2/script/backport.sh +registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.12.19+1.1.0/libgit2/script/leaks.sh +registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.12.19+1.1.0/libgit2/script/valgrind.sh +registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.12.19+1.1.0/libgit2/src/config_snapshot.c +[...] +``` + +If you want to search for a specific directory, provide the directory path as a second argument to `fd`, such as: + + +``` +$ fd passwd /etc +/etc/pam.d/passwd +/etc/passwd +/etc/passwd- +/etc/security/opasswd +``` + +To search for a particular file extension, use `-e` as an option. For example: + + +``` +$ fd . '/home/ssur/exa' -e md +/home/ssur/exa/README.md +/home/ssur/exa/devtools/README.md +/home/ssur/exa/man/exa.1.md +/home/ssur/exa/man/exa_colors.5.md +/home/ssur/exa/xtests/README.md +$ +``` + +You can also execute a command by providing `-x` or `-X`. + + * The `-x/--exec` option runs an external command for each search result (in parallel). + * The `-X/--exec-batch` option launches the external command once with all search results as arguments. + + + +For example, to recursively find all ZIP archives and unpack them: + + +``` +`$ fd -e zip -x unzip` +``` + +Or, to list all files under a particular directory that were changed within the last _n_ number of days, use the `--changed-within` option: + + +``` +$ fd . '/home/ssur/Work/' --changed-within 10d +/home/ssur/Work/wildfly/connector/src/main/java/org/jboss/as/connector/subsystems/data_sources/JdbcDriverAdd.java +/home/ssur/Work/wildfly/connector/src/main/java/org/jboss/as/connector/subsystems/data_sources/JdbcExample.java +[...] +``` + +And to search all files that were changed before a specific number of days, use the `--changed-before` _n_ option: + + +``` +`$ fd . '/home/ssur/Work/' --changed-before 365d` +``` + +Here, `.` acts as a wildcard entry to instruct `fd` to return all files. + +To learn about more the functionalities of `fd`, consult its [documentation][2] on GitHub. + +### Conclusion + +One thing I especially like about `fd` is that the search pattern is case-insensitive by default, which makes it easier to find things even when you have imprecise knowledge about what you're looking for. Better yet, it _automatically_ switches to case-sensitive if the pattern contains an uppercase character. + +Another benefit is that it uses color-coding to highlight different file types. + +If you are already using this amazing Rust tool, please let us know your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/fd-linux + +作者:[Sudeshna Sur][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code) +[2]: https://github.com/sharkdp/fd +[3]: https://repology.org/project/fd-find/versions +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac From 386b810e3047c263f3713583c7f90c21bcc1884a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 24 Jun 2021 05:03:56 +0800 Subject: [PATCH 170/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210623=20?= =?UTF-8?q?Parsing=20config=20files=20with=20Lua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210623 Parsing config files with Lua.md --- .../20210623 Parsing config files with Lua.md | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 sources/tech/20210623 Parsing config files with Lua.md diff --git a/sources/tech/20210623 Parsing config files with Lua.md b/sources/tech/20210623 Parsing config files with Lua.md new file mode 100644 index 0000000000..50b47fa003 --- /dev/null +++ b/sources/tech/20210623 Parsing config files with Lua.md @@ -0,0 +1,231 @@ +[#]: subject: (Parsing config files with Lua) +[#]: via: (https://opensource.com/article/21/6/parsing-config-files-lua) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Parsing config files with Lua +====== +Configure persistent application settings with the Lua programming +language. +![Woman sitting in front of her computer][1] + +Not all applications need configuration files; many applications benefit from starting fresh each time they are launched. Simple utilities, for instance, rarely require preferences or settings that persist across uses. However, when you write a complex application, it's nice for users to be able to configure how they interact with it and how it interacts with their system. That's what configuration files are for, and this article discusses some of the ways you can implement persistent settings with the Lua programming language. + +### Choose a format + +The important thing about configuration files is that they are consistent and predictable. You do not want to dump information into a file under the auspices of saving user preferences and then spend days writing code to reverse-engineer the random bits of information that have ended up in the file. + +There are several popular [formats for configuration files][2]. Lua has libraries for most of the common configuration formats; in this article, I'll use the INI format. + +### Installing the library + +The central hub for Lua libraries is [Luarocks.org][3]. You can search for libraries on the website, or you can install and use the `luarocks` terminal command. + +On Linux, you can install it from your distribution's software repository. For example: + + +``` +`$ sudo dnf install luarocks` +``` + +On macOS, use [MacPorts][4] or [Homebrew][5]. On Windows, use [Chocolatey][6]. + +Once `luarocks` is installed, you can use the `search` subcommand to search for an appropriate library. If you don't know the name of a library, you can search for a keyword, like `ini` or `xml` or `json`, depending on what's relevant to what you're trying to do. In this case, you can just search for `inifile`, which is the library I use to parse text files in the INI format: + + +``` +$ luarocks search inifile +Search results: +inifile + 1.0-2 (rockspec) - + 1.0-2 (src) - + 1.0-1 (rockspec) - + [...] +``` + +A common trap programmers fall into is installing a library on their system and forgetting to bundle it with their application. This can create problems for users who don't have the library installed. To avoid this, use the `--tree` option to install the library to a local folder within your project directory. If you don't have a project directory, create one first, and then install: + + +``` +$ mkdir demo +$ cd demo +$ luarocks install --tree=local inifile +``` + +The `--tree` option tells `luarocks` to create a new directory, called `local` in this case, and install your library into it. With this simple trick, you can install all the dependency code your project uses directly into the project directory. + +### Code setup + +First, create some INI data in a file called `myconfig.ini`: + + +``` +[example] +name=Tux +species=penguin +enabled=false + +[demo] +name=Beastie +species=demon +enabled=false +``` + +Save the file as `myconfig.ini` into your home directory, _not_ into your project directory. You usually want configuration files to exist outside your application so that even when a user uninstalls your application, the data they generate while using the application remains on their system. Users might remove unnecessary config files manually, but many don't. As a result, if they reinstall an application, it will retain all of their preferences. + +Config file locations are technically unimportant, but each operating system (OS) has a specification or a tradition of where they ought to be placed. On Linux, this is defined by the [Freedesktop specification][7]. It dictates that configuration files are to be saved in a hidden folder named `~/.config`. For clarity during this exercise, just save the file in your home directory so that it's easy to find and use. + +Create a second file named `main.lua` and open it in your favorite text editor. + +First, you must tell Lua where you've placed the additional library you want it to use. The `package.path` variable determines where Lua looks for libraries. You can view Lua's default package path in a terminal: + + +``` +$ Lua +> print(package.path) +./?.lua;/usr/share/lua/5.3/?.lua;/usr/share/lua/5.3/?/init.lua;/usr/lib64/lua/5.3/?.lua;/usr/lib64/lua/5.3/?/init.lua +``` + +In your Lua code, append your local library location to `package.path`: + + +``` +`package.path = package.path .. ';local/share/lua/5.3/?.lua` +``` + +### Parsing INI files with Lua + +With the package location established, the next thing to do is to require the `inifile` library and then handle some OS logistics. Even though this is a simple example application, the code needs to get the user's home directory location from the OS and establish how to communicate filesystem paths back to the OS when necessary: + + +``` +package.path = package.path .. ';local/share/lua/5.3/?.lua +inifile = require('inifile') + +\-- find home directory +home = os.getenv('HOME') + +\-- detect path separator +\-- returns '/' for Linux and Mac +\-- and '\' for Windows +d = package.config:sub(1,1) +``` + +Now you can use `inifile` to parse data from the config file into a Lua table. Once the data has been placed into a table, you can query the table as you would any other Lua table: + + +``` +\-- parse the INI file and +\-- put values into a table called conf +conf = inifile.parse(home .. d .. 'myconfig.ini') + +\-- print the data for review +print(conf['example']['name']) +print(conf['example']['species']) +print(conf['example']['enabled']) +``` + +Run the code in a terminal to see the results: + + +``` +$ lua ./main.lua +Tux +penguin +false +``` + +That looks correct. Try doing the same for the `demo` block. + +### Saving data in the INI format + +Not all parser libraries read and write data (often called _encoding_ and _decoding_), but the `inifile` library does. That means you can use it to make changes to a configuration file. + +To change a value in a configuration file, you set the variable representing the value in the parsed table, and then you write the table back to the configuration file: + + +``` +\-- set enabled to true +conf['example']['enabled'] = true +conf['demo']['enabled'] = true + +\-- save the change +inifile.save(home .. d .. 'myconfig.ini', conf) +``` + +Take a look at the configuration file now: + + +``` +$ cat ~/myconfig.ini +[example] +name=Tux +species=penguin +enabled=true + +[demo] +name=Beastie +species=demon +enabled=true +``` + +### Config files + +The ability to save data about how a user wants to use an application is an important part of programming. Fortunately, it's a common task for programmers, so much of the work has probably already been done. Find a good library for encoding and decoding into an open format, and you can provide a persistent and consistent user experience. + +Here's the entire demo code for reference: + + +``` +package.path = package.path .. ';local/share/lua/5.3/?.lua' +inifile = require('inifile') + +\-- find home directory +home = os.[getenv][8]('HOME') + +\-- detect path separator +\-- returns '/' for Linux and Mac +\-- and '\' for Windows +d = package.config:sub(1,1) + +\-- parse the INI file and +\-- put values into a table called conf +conf = inifile.parse(home .. d .. 'myconfig.ini') + +\-- print the data for review +print(conf['example']['name']) +print(conf['example']['species']) +print(conf['example']['enabled']) + +\-- enable Tux +conf['example']['enabled'] = true + +\-- save the change +inifile.save(home .. d .. 'myconfig.ini', conf) +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/parsing-config-files-lua + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_2.png?itok=JPlR5aCA (Woman sitting in front of her computer) +[2]: https://opensource.com/article/21/6/config-files-and-their-formats +[3]: https://opensource.com/article/19/11/getting-started-luarocks +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey +[7]: https://www.freedesktop.org/wiki/Specifications +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/getenv.html From 64dcb557786d3d6028d65500500a2dc58b0f45a5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 24 Jun 2021 05:04:11 +0800 Subject: [PATCH 171/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210623=20?= =?UTF-8?q?Program=20on=20FreeDOS=20with=20Bywater=20BASIC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210623 Program on FreeDOS with Bywater BASIC.md --- ...3 Program on FreeDOS with Bywater BASIC.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210623 Program on FreeDOS with Bywater BASIC.md diff --git a/sources/tech/20210623 Program on FreeDOS with Bywater BASIC.md b/sources/tech/20210623 Program on FreeDOS with Bywater BASIC.md new file mode 100644 index 0000000000..4959c38af1 --- /dev/null +++ b/sources/tech/20210623 Program on FreeDOS with Bywater BASIC.md @@ -0,0 +1,83 @@ +[#]: subject: (Program on FreeDOS with Bywater BASIC) +[#]: via: (https://opensource.com/article/21/6/freedos-bywater-basic) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Program on FreeDOS with Bywater BASIC +====== +Install Bywater BASIC on your FreeDOS system and start experimenting +with BASIC programming. +![woman on laptop sitting at the window][1] + +In the early days of personal computing—from the late 1970s and through the 1980s—many people got their start with BASIC programming. BASIC was a universal programming language that came built into most personal computers, from Apple to IBM PCs. + +When we started the FreeDOS Project in June 1994, it seemed natural that we should include an open source BASIC environment. I was excited to discover one already existed in Bywater BASIC. + +The [Bywater BASIC website][2] reminds us that “Bywater BASIC implements a large superset of the ANSI Standard for Minimal BASIC (X3.60-1978) and a significant subset of the ANSI Standard for Full BASIC (X3.113-1987).” It's also distributed under the GNU General Public License version 2, which means it's open source software. We only want to include open source programs in FreeDOS, so Bywater BASIC was a great addition to FreeDOS in our early days. + +We've included Bywater BASIC since at least FreeDOS Alpha 5, in 1997. You can find Bywater BASIC in FreeDOS 1.3 RC4 in the "Development" package group on the Bonus CD. Load this: + +![Bywater BASIC][3] + +Installing Bywater BASIC on FreeDOS 1.3 RC4 +(Jim Hall, [CC-BY SA 4.0][4]) + +FreeDOS installs the Bywater BASIC package in the `\DEVEL\BWBASIC` directory. Change to this directory with `CD \DEVEL\BWBASIC` and type `BWBASIC` to run the Bywater BASIC interpreter. + +![Bywater BASIC][5] + +The Bywater BASIC intepreter +(Jim Hall, [CC-BY SA 4.0][4]) + +### Writing a sample program + +Let me demonstrate Bywater BASIC by writing a test program. We'll keep this simple—print five random numbers. This requires only a few constructs—a loop to iterate over five values and a random number generator. BASIC uses the `RND(1)` statement to generate a random value between 0 and 1. We can use `PRINT` to display the random number. + +One feature I like in Bywater BASIC is the integrated "help" system. There's nothing more frustrating than forgetting the syntax for a BASIC statement. For example, I always forget how to create BASIC loops. Do I use `FOR I IN 1 TO 10` or `FOR I = 1 TO 10`? Just type `help FOR` at the Bywater BASIC prompt and the interpreter displays the usage and a brief description. + +![Bywater BASIC][6] + +Use the "help" system as a quick-reference guide +(Jim Hall, [CC-BY SA 4.0][4]) + +Another neat feature in Bywater BASIC is how it reformats your BASIC instructions, so they are easier to read. After typing my brief program, I can type `list` to see the full source listing. Bywater BASIC automatically adds the `CALL` keyword to my `RANDOMIZE` statement on line 10 and indents the `PRINT` statement inside my loop. These small changes help me to see loops and other features in my program, which can aid in debugging. + +![Bywater BASIC][7] + +Bywater BASIC automatically reformats your code +(Jim Hall, [CC-BY SA 4.0][4]) + +If everything looks okay, then type `RUN` to execute the program. Because I used the `RANDOMIZE` statement at the start of my BASIC program, Bywater _seeds_ the random number generator with a random starting point. This ensures that my numbers are actually random values and don't repeat when I re-run my program. + +![Bywater BASIC][8] + +Generating lists of random numbers +(Jim Hall, [CC-BY SA 4.0][4]) + +Install Bywater BASIC on your FreeDOS system and start experimenting with BASIC programming. BASIC can be a great first programming language, especially if you are interested in getting back to the "roots" of personal computing. You can find more information about Bywater BASIC in the manual, installed in the `\DEVEL\BWBASIC` directory as `BWBASIC.DOC`. You can also explore the online "help" system by typing `HELP` at the Bywater BASIC prompt. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-bywater-basic + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://sourceforge.net/projects/bwbasic/ +[3]: https://opensource.com/sites/default/files/uploads/bwbasic1.png (Installing Bywater BASIC on FreeDOS 1.3 RC4) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/bwbasic3.png (The Bywater BASIC intepreter) +[6]: https://opensource.com/sites/default/files/uploads/randnum1.png (Use the "help" system as a quick-reference guide) +[7]: https://opensource.com/sites/default/files/uploads/randnum2.png (Bywater BASIC automatically reformats your code) +[8]: https://opensource.com/sites/default/files/uploads/randnum3.png (Generating lists of random numbers) From a87d1d12a875c1913bec8c8c0e0c838b9e9896f9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 24 Jun 2021 09:01:09 +0800 Subject: [PATCH 172/870] translated --- ...ghting Effects and Other Configurations.md | 142 ------------------ ...ghting Effects and Other Configurations.md | 129 ++++++++++++++++ 2 files changed, 129 insertions(+), 142 deletions(-) delete mode 100644 sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md create mode 100644 translated/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md diff --git a/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md b/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md deleted file mode 100644 index 8e6d18aeae..0000000000 --- a/sources/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: subject: (How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations) -[#]: via: (https://itsfoss.com/set-up-razer-devices-linux/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations -====== - -You have a shiny new Razer hardware, but you cannot find the Razer Synapse software for Linux. And you end up with no proper RGB sync and do not get to customize it. What do you do? - -Well, for certain functionalities, like adding macros to your mouse, you will still need access to Razer Synapse (on Windows or macOS). - -But, to tweak a few other options like macros for the keyboard, changing the DPI of your mouse, or lighting effects, you can easily set up your Razer peripherals on Linux. - -![My Razer Basilisk V2 with lighting effect][1] - -Here are sme pictures of both the mouse and the mouse pad. It’s the same setup but with different lighting schemes. Click on the images to see bigger images. - -![][2] - -![][3] - -![][4] - -Razer Basilisk is a good gaming mouse. If you want you can order it from Amazon or get it from your local store. - -SaleBestseller No. 1 - -![Razer Basilisk v2 Wired Gaming Mouse: 20K DPI Optical Sensor, Fastest Gaming Mouse Switch, Chroma RGB Lighting, 11 Programmable Buttons, Classic Black][5] - -![Razer Basilisk v2 Wired Gaming Mouse: 20K DPI Optical Sensor, Fastest Gaming Mouse Switch, Chroma RGB Lighting, 11 Programmable Buttons, Classic Black][5] - -[Razer Basilisk v2 Wired Gaming Mouse: 20K DPI Optical Sensor, Fastest Gaming Mouse Switch, Chroma RGB Lighting, 11 Programmable Buttons, Classic Black][6] - -$49.99 [][7] - -If you already own a Razer device, let me show the steps to configure it just like what I did here. - -### Step 1. Install OpenRazer - -**OpenRazer** is an open-source driver to make Razer hardware work on Linux. It supports several functionalities to customize and control your devices, including RGB mousemats. - -While this is not an official driver for Linux, it works quite well for a wide range of devices. - -**It offers support for a variety of Linux distributions that include Solus, openSUSE, Fedora, Debian, Arch Linux, Ubuntu, and a few others.** - -Here, I will be focusing on the steps to install it on any Ubuntu-based distro, you may want to refer to the [official instructions][8] for other distros. - -You need to install OpenRazer [using a PPA][9] on Ubuntu, here’s how to do that: - -``` -sudo apt install software-properties-gtk -sudo add-apt-repository ppa:openrazer/stable -sudo apt update -sudo apt install openrazer-meta -``` - -It also offers a [daemon][10] as well, you can choose to make it work, you will be adding your user to the **plugdev** group — which gives privileged access to the device: - -``` -sudo gpasswd -a $USER plugdev -``` - -I did not need to configure/add a daemon using the above command, but I can still use the devices just fine. The daemon mostly ensures that the driver stays active. - -[Download OpenRazer][11] - -### Stpe 2. Install a GUI to Manage and Tweak Options - -Now that the driver has been installed, all you need is a graphical user interface (GUI) to help you customize your Razer hardware. - -You can find a few options available out there, but I will recommend installing [Polychromatic][12], which offers an attractive UI and works well as well. - -![][13] - -Polychromatic app is the closest I could recommend to Razer Synapse, and it works good. - -For Ubuntu-based distros, all you need to do is install it using PPA: - -``` -sudo add-apt-repository ppa:polychromatic/stable -sudo apt update -sudo apt install polychromatic -``` - -You can find it listed in [AUR][14] for Arch Linux users. For more installation instructions, you can refer to the [official download page][15]. - -[Download Polychromatic][16] - -While you will get distinct set of options for various devices. Here, I tried changing the DPI, customizing the color cycle, and the polling rate of my Razer Basilisk v2 mouse and it worked completely fine. - -![Customization options for a mouse][17] - -It also offers you the ability to easily restart or stop the [daemon][10], change the applet icon, and perform advanced configuration options if you know what you want to do. - -Alternatively, you can try [RazerGenie][18], [Snake][19], or [OpenRGB][20] (meant for changing the colors) to tweak the mouse color or any other settings. - -### Wrapping Up - -Now that you can easily customize your Razer hardware, hope you have fun! - -While you may find some other options to configure your Razer devices, I did not find any other options that work very well. - -If you have come across something that works and that deserves a mention here for all the Razer users, let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/set-up-razer-devices-linux/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Razer-Basilisk-V2.jpg?resize=800%2C600&ssl=1 -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-3-com.jpg?resize=800%2C600&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-2-com.jpg?resize=800%2C600&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-1-com.jpg?resize=800%2C600&ssl=1 -[5]: https://i1.wp.com/m.media-amazon.com/images/I/31WrG8CTRHL._SL160_.jpg?ssl=1 -[6]: https://www.amazon.com/dp/B082G5BDNC?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1&keywords=Razer%20Basilisk%20V2 (Razer Basilisk v2 Wired Gaming Mouse: 20K DPI Optical Sensor, Fastest Gaming Mouse Switch, Chroma RGB Lighting, 11 Programmable Buttons, Classic Black) -[7]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) -[8]: https://openrazer.github.io/#download -[9]: https://itsfoss.com/ppa-guide/ -[10]: https://itsfoss.com/linux-daemons/ -[11]: https://openrazer.github.io/ -[12]: https://polychromatic.app -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/polychromatic-app-1.png?resize=800%2C500&ssl=1 -[14]: https://itsfoss.com/aur-arch-linux/ -[15]: https://polychromatic.app/download/ -[16]: https://polychromatic.app/ -[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-basilisk-polychromatic.png?resize=800%2C505&ssl=1 -[18]: https://github.com/z3ntu/RazerGenie -[19]: https://github.com/bithatch/snake -[20]: https://itsfoss.com/openrgb/ diff --git a/translated/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md b/translated/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md new file mode 100644 index 0000000000..1e35619f17 --- /dev/null +++ b/translated/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md @@ -0,0 +1,129 @@ +[#]: subject: (How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations) +[#]: via: (https://itsfoss.com/set-up-razer-devices-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Linux 上设置雷蛇设备的灯光效果和其他配置 +====== + +你有一个闪亮的新雷蛇硬件,但你找不到 Linux 的 Razer Synapse 软件。而你最终没有正确的 RGB 同步,也没有办法定制它。你会怎么做呢? + +好吧,对于某些功能,比如给你的鼠标添加宏,你仍然需要访问 Razer Synapse(在 Windows 或 MacOS上)。 + +但是,要调整其他一些选项,如键盘的宏,改变鼠标的 DPI,或灯光效果,你可以在 Linux 上轻松设置你的雷蛇外设。 + +![My Razer Basilisk V2 with lighting effect][1] + +这里有一些鼠标和鼠标垫的照片。这是同样的设置,但有不同的照明方案。点击图片可以看到更大的图片。 + +![][2] + +![][3] + +![][4] + +雷蛇 Basilisk 是一款不错的游戏鼠标。如果你想,你可以从亚马逊订购或从当地商店获得。 + +如果你已经拥有一个雷蛇设备,让我展示一下配置它的步骤,就像我在这里做的那样。 + +### 步骤 1:安装 OpenRazer + +**OpenRazer** 是一个开源的驱动程序,使雷蛇硬件在 Linux 上工作。它支持几种功能来定制和控制你的设备,包括 RGB 鼠标垫。 + +虽然这不是官方 Linux 驱动,但它在各种设备上工作良好。 + +**它为各种 Linux 发行版提供支持,包括 Solus、openSUSE、Fedora、Debian、Arch Linux、Ubuntu 和其他一些发行版。** + +在这里,我将重点介绍在任何基于 Ubuntu 的发行版上安装它的步骤,对于其他发行版,你可能想参考[官方说明][8]。 + +你需要在 Ubuntu 上[使用 PPA][9] 安装 OpenRazer,下面是如何做的: + +``` +sudo apt install software-properties-gtk +sudo add-apt-repository ppa:openrazer/stable +sudo apt update +sudo apt install openrazer-meta +``` + +它也提供了一个[守护进程][10],你可以选择让它工作,你要把你的用户加入到 **plugdev** 组,它给了设备的特权访问: + +``` +sudo gpasswd -a $USER plugdev +``` + +我不需要用上述命令中配置/添加一个守护程序,但我仍然可以很好地使用这些设备。守护进程主要是确保驱动保持活跃。 + +[下载 OpenRazer][11] + +### 步骤 2:安装一个 GUI 来管理和调整选项 + +现在驱动已经安装完毕,你所需要的是一个图形用户界面 (GUI) 来帮助你定制你的雷蛇硬件。 + +你可以找到一些可用的选择,但我将推荐安装 [Polychromatic][12],它提供了一个有吸引力的用户界面,而且运行良好。 + +![][13] + +Polychromatic 是我能推荐的最接近 Razer Synapse 的应用,而且效果不错。 + +对于基于 Ubuntu 的发行版,你需要做的就是使用 PPA 安装它: + +``` +sudo add-apt-repository ppa:polychromatic/stable +sudo apt update +sudo apt install polychromatic +``` + +对于 Arch Linux 用户,你可以在 [AUR][14] 中找到它。关于更多的安装说明,你可以参考[官方下载页面][15]。 + +[下载 Polychromatic][16] + +你会得到不同设备的不同选项。在这里,我试着改变 DPI,自定义颜色周期,以及我的雷蛇 Basilisk v2 鼠标的轮询率,它完全正常。 + +![Customization options for a mouse][17] + +如果你知道你想做什么,它还为你提供了轻松重启或停止[守护进程][10]、改变小程序图标和执行高级配置选项的能力。 + +另外,你可以试试 [RazerGenie][18]、[Snake][19] 或 [OpenRGB][20] (用于改变颜色)来调整鼠标的颜色或任何其他设置。 + +### 总结 + +现在你可以轻松地定制你的雷蛇硬件了,希望你能玩得开心! + +虽然你可能会找到一些其他的选择来配置你的雷蛇设备,但我没有找到任何其他效果这么好的选择。 + +如果你遇到了一些有用的东西,值得在这里为所有的雷蛇用户提一下,请在下面的评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/set-up-razer-devices-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Razer-Basilisk-V2.jpg?resize=800%2C600&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-3-com.jpg?resize=800%2C600&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-2-com.jpg?resize=800%2C600&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-mouse-pad-lighting-effect-1-com.jpg?resize=800%2C600&ssl=1 +[8]: https://openrazer.github.io/#download +[9]: https://itsfoss.com/ppa-guide/ +[10]: https://itsfoss.com/linux-daemons/ +[11]: https://openrazer.github.io/ +[12]: https://polychromatic.app +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/polychromatic-app-1.png?resize=800%2C500&ssl=1 +[14]: https://itsfoss.com/aur-arch-linux/ +[15]: https://polychromatic.app/download/ +[16]: https://polychromatic.app/ +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/razer-basilisk-polychromatic.png?resize=800%2C505&ssl=1 +[18]: https://github.com/z3ntu/RazerGenie +[19]: https://github.com/bithatch/snake +[20]: https://itsfoss.com/openrgb/ From 0307a4d769c928ff02c967bf85a6649e12184b8f Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 24 Jun 2021 09:04:44 +0800 Subject: [PATCH 173/870] translating --- sources/tech/20210622 Replace du with dust on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210622 Replace du with dust on Linux.md b/sources/tech/20210622 Replace du with dust on Linux.md index a877d52a46..b7cf2e65dc 100644 --- a/sources/tech/20210622 Replace du with dust on Linux.md +++ b/sources/tech/20210622 Replace du with dust on Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/dust-linux) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From af867ffe6d26897f9f5b0151af13e1dfc8c83cdf Mon Sep 17 00:00:00 2001 From: frstlis <48125063@qq.com> Date: Thu, 24 Jun 2021 10:15:39 +0800 Subject: [PATCH 174/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20200206 How key Python projects are maintained.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200206 How key Python projects are maintained.md b/sources/tech/20200206 How key Python projects are maintained.md index 2b3dc0e1e2..b96c9a71a2 100644 --- a/sources/tech/20200206 How key Python projects are maintained.md +++ b/sources/tech/20200206 How key Python projects are maintained.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -63,7 +63,7 @@ via: https://opensource.com/article/20/2/python-maintained 作者:[Moshe Zadka][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[stevenzdg988](https://github.com/stevenzdg988) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From faffcf3c2a94c2c9726613498a6a8fa7d2807124 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 24 Jun 2021 10:35:12 +0800 Subject: [PATCH 175/870] APL --- sources/tech/20210623 Replace find with fd on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210623 Replace find with fd on Linux.md b/sources/tech/20210623 Replace find with fd on Linux.md index 6e509c7e59..2a62cda9aa 100644 --- a/sources/tech/20210623 Replace find with fd on Linux.md +++ b/sources/tech/20210623 Replace find with fd on Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/fd-linux) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ff38fb0b61f820ab6115c91ded0f0599f120fbf2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 24 Jun 2021 11:01:59 +0800 Subject: [PATCH 176/870] TSL&PRF --- .../20210623 Replace find with fd on Linux.md | 75 ++++++++----------- 1 file changed, 33 insertions(+), 42 deletions(-) rename {sources => translated}/tech/20210623 Replace find with fd on Linux.md (50%) diff --git a/sources/tech/20210623 Replace find with fd on Linux.md b/translated/tech/20210623 Replace find with fd on Linux.md similarity index 50% rename from sources/tech/20210623 Replace find with fd on Linux.md rename to translated/tech/20210623 Replace find with fd on Linux.md index 2a62cda9aa..9daf85b38c 100644 --- a/sources/tech/20210623 Replace find with fd on Linux.md +++ b/translated/tech/20210623 Replace find with fd on Linux.md @@ -3,42 +3,40 @@ [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Replace find with fd on Linux +在 Linux 上用 fd 代替 find ====== -The fd command is a popular, user-friendly alternative to the find -command. -![Magnifying glass on code][1] -Many Linux programmers use the `find` command every single day of their career. But `find` gives a limited set of filesystem entries, and if you have to do a large set of `find` operations, it's not even very fast. So instead, I prefer to use the Rust `fd` command because it provides sensible defaults that work for most use cases. +> fd 命令是一个流行的、用户友好的 find 命令的替代品。 -As its [README][2] says, "`fd` is a program to find entries in your filesystem. It is a simple, fast, and user-friendly alternative to `find`." It features parallelized directory traversal, so it can search multiple directories at once. It supports regular expressions (regex) and glob-based patterns. +![代码上的放大镜][1] -### Install fd +许多 Linux 程序员在其工作中每天都在使用 `find` 命令。但是 `find` 给出的文件系统条目是有限的,如果你要进行大量的 `find` 操作,它甚至不是很快速。因此,我更喜欢使用 Rust 编写的 `fd` 命令,因为它提供了合理的默认值,适用于大多数使用情况。 -On Linux, you can install `fd` from your software repository (a list of available packages can be found on the [fd page on Repology][3].) For example, on Fedora: +正如它的 [README][2] 所说,“`fd` 是一个在文件系统中寻找条目的程序。它是一个简单、快速和用户友好的 `find` 的替代品。”它的特点是目录的并行遍历,可以一次搜索多个目录。它支持正则表达式(regex)和基于通配符的模式。 +### 安装 fd + +在 Linux 上,你可以从你的软件库中安装 `fd`(可用的软件包列表可以在 [Repology 上的 fd 页面][3] 找到)。 例如,在 Fedora 上: ``` -`$ sudo dnf install fd-find` +$ sudo dnf install fd-find ``` -On macOS, use [MacPorts][4] or [Homebrew][5]. - -Alternately, you can use Rust's Cargo package manager: +在 macOS 上,可以使用 [MacPorts][4] 或 [Homebrew][5]。 +另外,你也可以使用 Rust 的 Cargo 软件包管理器: ``` -`$ cargo install fd-find` +$ cargo install fd-find ``` -### Use fd - -To do a simple search, run `fd` after any argument, such as: +### 使用 fd +要做一个简单的搜索,运行 `fd` 并在后面跟上要搜索的名字,例如: ``` $ fd sh @@ -59,8 +57,7 @@ registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.12.19+1.1.0/libgit2/src/c [...] ``` -If you want to search for a specific directory, provide the directory path as a second argument to `fd`, such as: - +如果你想搜索一个特定的目录,可以将目录路径作为 `fd` 的第二个参数,例如: ``` $ fd passwd /etc @@ -70,8 +67,7 @@ $ fd passwd /etc /etc/security/opasswd ``` -To search for a particular file extension, use `-e` as an option. For example: - +要搜索一个特定的文件扩展名,使用 `-e` 作为选项。例如: ``` $ fd . '/home/ssur/exa' -e md @@ -83,22 +79,18 @@ $ fd . '/home/ssur/exa' -e md $ ``` -You can also execute a command by providing `-x` or `-X`. +你也可以通过提供 `-x` 或 `-X` 来执行一个命令。 - * The `-x/--exec` option runs an external command for each search result (in parallel). - * The `-X/--exec-batch` option launches the external command once with all search results as arguments. - - - -For example, to recursively find all ZIP archives and unpack them: + * `-x`/`--exec`:选项为每个搜索结果(并行)运行一个外部命令。 + * `-X`/`--exec-batch`:选项将所有搜索结果作为参数启动一次外部命令。 +例如,要递归地找到所有的 ZIP 档案并解压: ``` -`$ fd -e zip -x unzip` +$ fd -e zip -x unzip ``` -Or, to list all files under a particular directory that were changed within the last _n_ number of days, use the `--changed-within` option: - +或者,要列出某个特定目录下在过去 _n_ 天内改变的所有文件,使用`--changed-within` 选项: ``` $ fd . '/home/ssur/Work/' --changed-within 10d @@ -107,24 +99,23 @@ $ fd . '/home/ssur/Work/' --changed-within 10d [...] ``` -And to search all files that were changed before a specific number of days, use the `--changed-before` _n_ option: - +而要搜索所有在特定天数之前被修改的文件,请使用 `--changed-before` _n_ 选项: ``` -`$ fd . '/home/ssur/Work/' --changed-before 365d` +$ fd . '/home/ssur/Work/' --changed-before 365d ``` -Here, `.` acts as a wildcard entry to instruct `fd` to return all files. +这里,`.` 作为一个(正则)通配符,指示 `fd` 返回所有文件。 -To learn about more the functionalities of `fd`, consult its [documentation][2] on GitHub. +要了解更多关于 `fd` 的功能,请查阅 GitHub 上的 [文档][2]。 -### Conclusion +### 总结 -One thing I especially like about `fd` is that the search pattern is case-insensitive by default, which makes it easier to find things even when you have imprecise knowledge about what you're looking for. Better yet, it _automatically_ switches to case-sensitive if the pattern contains an uppercase character. +我特别喜欢 `fd` 的一点是,搜索模式默认是不区分大小写的,这使得它更容易找到东西,即使你对你要找的东西没有精确的认识。更好的是,如果模式包含一个大写的字符,它就会*自动*切换到大小写敏感。 -Another benefit is that it uses color-coding to highlight different file types. +另一个好处是,它使用颜色编码来突出不同的文件类型。 -If you are already using this amazing Rust tool, please let us know your thoughts in the comments. +如果你已经在使用这个神奇的 Rust 工具,请在评论中告诉我们你的想法。 -------------------------------------------------------------------------------- @@ -132,8 +123,8 @@ via: https://opensource.com/article/21/6/fd-linux 作者:[Sudeshna Sur][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9b4c4f906f6ae342c661e1d12c228b167c1ebffe Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 24 Jun 2021 11:10:25 +0800 Subject: [PATCH 177/870] PUB @wxy https://linux.cn/article-13516-1.html --- .../20210623 Replace find with fd on Linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210623 Replace find with fd on Linux.md (97%) diff --git a/translated/tech/20210623 Replace find with fd on Linux.md b/published/20210623 Replace find with fd on Linux.md similarity index 97% rename from translated/tech/20210623 Replace find with fd on Linux.md rename to published/20210623 Replace find with fd on Linux.md index 9daf85b38c..c20a9713ad 100644 --- a/translated/tech/20210623 Replace find with fd on Linux.md +++ b/published/20210623 Replace find with fd on Linux.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13516-1.html) 在 Linux 上用 fd 代替 find ====== > fd 命令是一个流行的、用户友好的 find 命令的替代品。 -![代码上的放大镜][1] +![](https://img.linux.net.cn/data/attachment/album/202106/24/110546npqmttwobtqpo4qk.jpg) 许多 Linux 程序员在其工作中每天都在使用 `find` 命令。但是 `find` 给出的文件系统条目是有限的,如果你要进行大量的 `find` 操作,它甚至不是很快速。因此,我更喜欢使用 Rust 编写的 `fd` 命令,因为它提供了合理的默认值,适用于大多数使用情况。 From 09855872f8c9f42a94a09ca8f1888783f6147e03 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 24 Jun 2021 11:49:38 +0800 Subject: [PATCH 178/870] PRF @geekpi --- ...new open source tool for data analytics.md | 41 ++++++++----------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/translated/tech/20210615 Try this new open source tool for data analytics.md b/translated/tech/20210615 Try this new open source tool for data analytics.md index f26fe0edb9..37fef06eae 100644 --- a/translated/tech/20210615 Try this new open source tool for data analytics.md +++ b/translated/tech/20210615 Try this new open source tool for data analytics.md @@ -3,55 +3,48 @@ [#]: author: (Ray Paik https://opensource.com/users/rpaik) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -试试这个新的数据分析开源工具吧 +Cube.js:试试这个新的数据分析开源工具 ====== -Cube.js 是一个开源的分析平台,作为数据源和应用之间的一层。 -![metrics and data shown on a computer screen][1] -数据分析是一个时髦的领域,有许多解决方案可供选择。其中之一是 [Cube.js][2],一个开源的分析平台。你可以把 Cube.js 看作是你的数据源和应用之间的一个层。 +> Cube.js 是一个开源的分析平台,可以作为数据源和应用之间的中间层。 + +![](https://img.linux.net.cn/data/attachment/album/202106/24/114907z53fpzv6szv936vj.jpg) + +数据分析是一个时髦的领域,有许多解决方案可供选择。其中之一是 [Cube.js][2],这是一个开源的分析平台。你可以把 Cube.js 看作是你的数据源和应用之间的一个中间层。 如下图所示,Cube.js 支持无服务器数据仓库和大多数现代关系型数据库管理系统 (RDBMS)。你可以使用任何用于数据可视化的 JavaScript 前端库,而 Cube.js 将负责其他工作,包括访问控制、性能、并发性等。 ![Cube.js architecture][3] -(©2021, [Cube Dev, Inc.][2]) - ### 主要优点 当我向我们的社区成员询问 Cube.js 的主要优点时,他们经常提到: + * **它的抽象层**:配置 Cube.js 后,人们说他们不再需要担心性能优化、资源管理、SQL 专业知识等问题。许多人把 Cube.js 称为 “黑盒”,因为它的抽象层帮助他们专注于理解数据,而不是实施细节。 + * **易于定制**:由于 Cube.js 是可视化的,它很容易与前端框架集成,建立看起来像用户自己平台的解决方案。大多数商业平台(如 Looker、Tableau 等)需要更多的定制工作来与他们的基础设施整合。许多用户说,定制的便利性与抽象层相结合,使他们能够减少数据分析平台的开发时间。 + * **社区支持**:在开始使用 Cube.js 时,人们通常会从社区成员那里得到帮助(特别是在我们的 [Slack][4]),许多人提到社区支持是一个关键的入门资源。 - **它的抽象层:**配置 Cube.js 后,人们说他们不再需要担心性能优化、资源管理、SQL 专业知识等问题。许多人把 Cube.js 称为 “黑盒”,因为它的抽象层帮助他们专注于理解数据,而不是实施细节。 - **易于定制:**由于 Cube.js 是可视化的,它很容易与前端框架集成,建立看起来像用户自己平台的解决方案。大多数商业平台(如 Looker、Tableau 等)需要更多的定制工作来与他们的基础设施整合。许多用户说,定制的便利性与抽象层相结合,使他们能够减少数据分析平台的开发时间。 - **社区支持:**在开始使用 Cube.js 时,人们通常会从社区成员那里得到帮助(特别是在我们的 [Slack][4]),许多人提到社区支持是一个关键的入门资源。 - - - -访问[用户故事页面][5],阅读更多关于人们使用 Cube.js 的经验以及他们如何使用它。 +访问 [用户故事页面][5],阅读更多关于人们使用 Cube.js 的经验以及他们如何使用它。 ### 开始使用 如果你想了解 Cube.js: - * 进入我们的[文档页面][6],点击**开始**,并按照指示在你的笔记本电脑或工作站上启动和运行 Cube.js。 + * 进入我们的 [文档页面][6],点击**开始**,并按照指示在你的笔记本电脑或工作站上启动和运行 Cube.js。 * 当你进入 [Developer Playground][7],你将能够生成数据模式,执行查询,并建立仪表盘,以看到 Cube.js 的运行。 - - 在你启动和运行 Cube.js 之后,这里有一些有用的资源: - * [文档][6]:我们把大量的精力放在我们的文档上,因为它是开源社区的重要资源。我们还在我们的文档页面和 YouTube 频道的[入门播放列表][8]中添加了视频剪辑。 + * [文档][6]:我们把大量的精力放在我们的文档上,因为它是开源社区的重要资源。我们还在我们的文档页面和 YouTube 频道的 [入门播放列表][8] 中添加了视频剪辑。 * [Discourse][9]:Cube.js 论坛是最近增加的,社区成员可以在这里分享他们的使用案例、技巧和窍门等,这样我们就可以建立一个社区知识库。 - * [GitHub][10]: 你可以在这里找到 Cube.js 的代码,社区成员可以通过[问题页面][11]提交错误或功能请求。我们还在 GitHub 上发布了我们的[季度路线图][12],以便每个人都能看到我们正在进行的工作。 - * [每月社区电话会议][13]:我们在每个月的第二个星期三举行电话会议,讨论社区更新,展示功能演示,并邀请社区成员分享他们的使用案例。你可以在[社区电话会议页面][13]上找到电话会议的日程,你也可以在我们 YouTube 频道的[社区电话会议播放列表][14]上找到过去的电话会议录音。 + * [GitHub][10]: 你可以在这里找到 Cube.js 的代码,社区成员可以通过 [问题页面][11] 提交错误或功能请求。我们还在 GitHub 上发布了我们的 [季度路线图][12],以便每个人都能看到我们正在进行的工作。 + * [每月社区电话会议][13]:我们在每个月的第二个星期三举行电话会议,讨论社区更新,展示功能演示,并邀请社区成员分享他们的使用案例。你可以在 [社区电话会议页面][13] 上找到电话会议的日程,你也可以在我们 YouTube 频道的 [社区电话会议播放列表][14] 上找到过去的电话会议录音。 - - -就像任何好的开源项目一样,Cube.js 有许多软件贡献者。如果你想查看社区的拉取请求 (PR),请搜索带有 `pr:community` 标签的 PR。如果你想寻找你可以回答的问题,请搜索带有 `good first issue` 或者 `help wanted` 标签的问题。 +就像任何好的开源项目一样,Cube.js 有许多软件贡献者。如果你想查看社区的拉取请求(PR),请搜索带有 `pr:community` 标签的 PR。如果你想寻找你可以回答的问题,请搜索带有 `good first issue` 或者 `help wanted` 标签的问题。 我希望你试试 Cube.js。如果你有任何问题,请随时在下面留言或在 [Cube.js Slack][4] 上找我! @@ -62,7 +55,7 @@ via: https://opensource.com/article/21/6/cubejs 作者:[Ray Paik][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 72f3b58ccf655a6913a17e51c2e1960c9f1da424 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 24 Jun 2021 11:50:33 +0800 Subject: [PATCH 179/870] PUB @geekpi https://linux.cn/article-13517-1.html --- ...210615 Try this new open source tool for data analytics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210615 Try this new open source tool for data analytics.md (98%) diff --git a/translated/tech/20210615 Try this new open source tool for data analytics.md b/published/20210615 Try this new open source tool for data analytics.md similarity index 98% rename from translated/tech/20210615 Try this new open source tool for data analytics.md rename to published/20210615 Try this new open source tool for data analytics.md index 37fef06eae..dbc5fc37b3 100644 --- a/translated/tech/20210615 Try this new open source tool for data analytics.md +++ b/published/20210615 Try this new open source tool for data analytics.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13517-1.html) Cube.js:试试这个新的数据分析开源工具 ====== From ee8c8cbd2aaf7c6e0a6eb03796346a73b6064468 Mon Sep 17 00:00:00 2001 From: frstlis <48125063@qq.com> Date: Thu, 24 Jun 2021 16:23:26 +0800 Subject: [PATCH 180/870] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How key Python projects are maintained.md | 91 ------------------- ... How key Python projects are maintained.md | 91 +++++++++++++++++++ 2 files changed, 91 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20200206 How key Python projects are maintained.md create mode 100644 translated/tech/20200206 How key Python projects are maintained.md diff --git a/sources/tech/20200206 How key Python projects are maintained.md b/sources/tech/20200206 How key Python projects are maintained.md deleted file mode 100644 index b96c9a71a2..0000000000 --- a/sources/tech/20200206 How key Python projects are maintained.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How key Python projects are maintained) -[#]: via: (https://opensource.com/article/20/2/python-maintained) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -How key Python projects are maintained -====== -A peek behind the scenes of the community that keeps open source Python -projects running smoothly. -![and old computer and a new computer, representing migration to new software or hardware][1] - -Jannis Leidel is part of the [Jazzband][2] community. Jazzband is a collaborative community that shares the responsibility of maintaining [Python][3]-based projects. - -Jazzband was born out of the stress of maintaining an open source project alone for a longer time. Jannis is a roadie, which means he does administrative tasks and makes sure the people in the band can play when they want. - -Jazzband is not his first open source volunteer work—he is a former [Django][4] core developer, [Django Software Foundation][5] board member, has written many Django apps and Python projects, has been a [pip][6] and [virtualenv][7] core developer and release manager, co-founded the [Python Packaging Authority][8], and been a [PyPI][9] admin. On the community front, he co-founded the German Django Association, served as [DjangoCon Europe][10] 2010 co-chairperson, has spoken at several conferences, and for the last year has served as a director and co-communication chair of the [Python Software Foundation][11]. - -### Moshe Zadka: How did you get started with programming? - -Jannis Leidel: I got started with programming as part of the regular German computer science lessons in high school, where I dabbled with Turbo Pascal and Prolog. I quickly got drawn into the world of web development and wrote small websites with PHP3, [Perl5][12], and [MySQL][13]. Later at university, I picked up programming again while working on media arts projects and found [Ruby][14], Perl, and Python to be particularly helpful. I eventually stuck with Python for its versatility and ease of use. I'm very happy to have been able to use Python and open web technologies (HTML/JS/CSS) in my career since then. - -### Zadka: How did you get started with open source? - -Leidel: As part of an art project at university, I needed a way to talk to various web services and interact with some electronics and found my prior PHP skills not up to the task. So I took a class about programming with Python and got interested in learning more about how frameworks work—compared to libraries—as they further enshrine best practices that I wanted to know about. In particular, the nascent Django Web Framework really appealed to me since it favored a pragmatic approach and provided lots of guidance for how to develop web applications. In 2007 I participated as a student in the Google Summer of Code for Django and later contributed more to Django and its ecosystem of reusable components—after a while as a Django core developer as well. While finishing my degree, I was able to use those skills to work as a freelancer and also spend time on many different parts of the Django community. Moving laterally to the broader Python community was only natural at that point. - -### Zadka: What do you for your day job? - -Leidel: I'm a Staff Software Engineer at Mozilla, working on data tools for the Firefox data pipeline. In practice, that means I'm working in the broader Firefox Engineering team on various internal and public-facing web-based projects that help Mozilla employees and community members to make sense of the telemetry data that the Firefox web browser sends. Part of my current focus is maintaining our data analysis and visualization platform, which is based on the open source project [Redash][15], and also contributing back to it. Other projects that I contribute to are our next-gen telemetry system [Glean][16] and a tool that allows you to do data science in the browser (including the Scientific Python stack) called [Iodide][17]. - -### Zadka: How did you get involved with Jazzband? - -Leidel: Back in 2015, I was frustrated with maintaining projects alone that a lot of people depended on and saw many of my community peers struggle with similar issues. I didn't know a good way to reach more people in the community who may also have an interest in long-term maintenance. On some occasions, I felt that the new "social coding" paradigm was rarely social and often rather isolating and sometimes even traumatic for old and new contributors. I believe the inequality in our community that I find intolerable nowadays was even more rampant at the time, which made providing a safe environment for contributors difficult—something which we now know is essential for stable project maintenance. I wondered if we were missing a more collaborative and inclusive approach to software development. - -The Jazzband project was launched in an attempt to lower the barriers to entry for maintenance and simplify some of the more boring aspects of it (e.g., best practices around [CI][18]). - -### Zadka: What is your favorite thing about Jazzband? - -Leidel: My favorite thing about Jazzband is the fact that we've secured the maintenance of many projects that a lot of people depend on while also making sure that new contributors of any level of experience can join. - -### Zadka: What is the job of a "roadie" in Jazzband? - -Leidel: A "roadie" is a go-to person when it comes to all things behind the scenes for Jazzband. That means, for example, dealing with onboarding new projects, maintaining the Jazzband website that handles user management and project releases, acting as a first responder to security or Code of Conduct incidents, and much more. The term "roadies" is borrowed from the music and event industry for support personnel that takes care of almost everything that needs to be done while traveling on tour, except for the actual artistic performance. In Jazzband, they are there to make sure the members can work on the projects. That also means that some tasks are partially or fully automated, where it makes sense, and that best practices are applied to the majority of the Jazzband projects like packaging setup, documentation hosting or continuous integration. - -### Zadka: What is the most challenging aspect of your job as a roadie for Jazzband? - -Leidel: At the moment, the most challenging aspect of my job as a roadie is to implement improvements for Jazzband that community members have proposed without risking the workflow that they have come to rely on. In other words, scaling the project on a conceptual level has become more difficult the bigger Jazzband gets. There is a certain irony in the fact that I'm the only roadie at the moment and handle some of the tasks alone while Jazzband tries to prevent that from happening for its projects. This is a big concern for the future of Jazzband. - -### Zadka: What would you say to someone who is wondering whether they should join Jazzband? - -Leidel: If you're interested in joining a group of people who believe that working collaboratively is better than working alone, or if you have struggled with maintenance burden on your own and don't know how to proceed, consider joining Jazzband. It simplifies onboarding new contributors, provides a framework for disputes, and automates releases to [PyPI][19]. There are many best practices that work well for reducing the risk of projects becoming unmaintained. - -### Zadka: Is there anything else you want to tell our readers? - -Leidel: I encourage everyone working on open source projects to consider the people on the other side of the screen. Be empathetic and remember that your own experience may not be the experience of your peers. Understand that you are members of a global and diverse community, which requires us always to take leaps of respect for the differences between us. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/python-maintained - -作者:[Moshe Zadka][a] -选题:[lujun9972][b] -译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/migration_innovation_computer_software.png?itok=VCFLtd0q (and old computer and a new computer, representing migration to new software or hardware) -[2]: https://jazzband.co/ -[3]: https://opensource.com/resources/python -[4]: https://opensource.com/article/18/8/django-framework -[5]: https://www.djangoproject.com/foundation/ -[6]: https://opensource.com/article/19/11/python-pip-cheat-sheet -[7]: https://virtualenv.pypa.io/en/latest/ -[8]: https://www.pypa.io/en/latest/ -[9]: https://pypi.org/ -[10]: https://djangocon.eu/ -[11]: https://www.python.org/psf/ -[12]: http://opensource.com/article/18/1/why-i-love-perl-5 -[13]: https://opensource.com/life/16/10/all-things-open-interview-dave-stokes -[14]: http://opensource.com/business/16/4/save-development-time-and-effort-ruby -[15]: https://redash.io/ -[16]: https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/start/report-gecko-telemetry-in-glean.html -[17]: https://alpha.iodide.io/ -[18]: https://opensource.com/article/19/12/cicd-resources -[19]: https://opensource.com/downloads/7-essential-pypi-libraries diff --git a/translated/tech/20200206 How key Python projects are maintained.md b/translated/tech/20200206 How key Python projects are maintained.md new file mode 100644 index 0000000000..7a4fac22ba --- /dev/null +++ b/translated/tech/20200206 How key Python projects are maintained.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How key Python projects are maintained) +[#]: via: (https://opensource.com/article/20/2/python-maintained) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +How key Python projects are maintained +如何维护关键的 Python 项目 +====== +开源 Python 项目保持平稳运行的社区幕后。 +![旧款电脑和新款电脑,代表迁移到新的软件或硬件][1] + +Jannis Leidel 是 [Jazzband][2] 社区的一部分。Jazzband 是一个基于 [Python][3] 项目维护责任的共享协作社区。 + +Jazzband 的诞生源于长期独自维护一个开源项目的压力。Jannis 是巡回乐队管理员,这意味着他负责管理任务并确保乐队中的人可以在他们想要的时候演奏。 + +Jazzband 并不是他的第一个开源志愿者工作——他是前 [Django][4] 核心开发人员,[Django 软件基金会][5] 董事会成员,编写了许多 Django 应用程序和 Python 项目,一直是 [pip][6] 和 [virtualenv][7] 核心开发人员和发布经理,共同创立了 [Python 软件包授权][8],并担任 [PyPI][9] 管理员。在社区方面,他共同创立了德国 Django 协会,担任 [DjangoCon Europe][10] 2010 联合主席,在多个会议上发言,并在去年担任了[Python 软件基金会][11]主管和联席主席 + +### Moshe Zadka: 你是如何开始编程的? + +Jannis Leidel:我在高中时作为常规德语计算机科学课程的一部分开始学习编程,在那里我涉猎了 Turbo Pascal 和 Prolog。我很快就进入了 Web 开发的世界,并使用 PHP3、[Perl5][12] 和 [MySQL][13] 编写了小型网站。后来在大学里,我在从事媒体艺术项目时再次学习编程,发现 [Ruby][14]、Perl 和 Python 特别有用。我最终坚持使用 Python,因为它的多功能性和易用性。从那时起,我很高兴能够在我的职业生涯中使用 Python 和开放网络技术(HTML/JS/CSS)。 + +### Zadka: 您是如何开始开源的? + +Leidel:作为大学艺术项目的一部分,我需要一种与各种 Web 服务对话并与一些电子设备交互的方法,但发现我之前的 PHP 技能无法胜任这项任务。因此,我参加了有关使用 Python 编程的课程,并对学习更多有关框架如何工作产生兴趣——与库相比——因为它们进一步体现了我想了解的最佳实践。特别是,新生的 Django Web 框架对我很有吸引力,因为它支持务实的方法,并为如何开发 Web 应用程序提供了大量指导。 2007 年,我作为学生参与了 Google Summer of Code for Django,后来为 Django 及其可重用组件生态系统做出了更多贡献——不久我也成为 Django 核心开发人员。在完成学位期间,我能够利用这些技能成为一名自由职业者,并花时间在 Django 社区的许多不同部分工作。在那时,横向移动到更广泛的 Python 社区不过是很自然的。 + +### Zadka: 你的日常工作是什么? + +Leidel:我是 Mozilla 的一名高级软件工程师,致力于为 Firefox 数据管道开发数据工具。实际上,这意味着我在更广泛的 Firefox 工程团队中从事各种内部和面向公众的基于 Web 的项目,这些项目帮助 Mozilla 员工和社区成员理解 Firefox Web 浏览器发送的遥测数据。我目前的部分重点是维护我们的数据分析和可视化平台,该平台基于开源项目 [Redash][15],并对其做出贡献。我参与的其他项目是我们的下一代遥测系统 [Glean][16] 和一个允许您在浏览器(包括 Scientific Python 堆栈)中进行数据科学的工具 [Iodide][17]。 + +### Zadka: 您是如何参与 Jazzband 的? + +Leidel:早在 2015 年,我就对单独维护很多人所依赖的项目感到沮丧,并看到我的许多社区同行都在为类似的问题苦苦挣扎。我不知道有什么好方法可以接触到社区中更多可能对长期维护感兴趣的人。在某些情况下,我觉得新的“社会编码”范例很少是社会性的,而且常常是孤立的,有时甚至对新老贡献者来说都是创伤。我相信我们社区中我现在无法容忍的不平等在当时更加猖獗,这使得为贡献者提供一个安全的环境变得困难——我们现在知道这对于稳定的项目维护至关重要。我想知道我们是否缺少一种更具协作性和包容性的软件开发方法。 + +Jazzband 项目的启动是为了降低进入维护的门槛,并简化其中一些较无聊的方面(例如,围绕 [CI][18] 的最佳实践)。 + +### Zadka: 您最喜欢 Jazzband 的什么? + +Leidel:我最喜欢 Jazzband 的一点是,我们确保了许多人所依赖的许多项目的维护,同时还确保任何经验水平的新贡献者都可以加入。 + +### Zadka: Jazzband 的“巡回乐队管理员”的工作是什么? + +Leidel:当谈到 Jazzband 幕后的所有事情时,“roadie”是一个寻求协助的人。这意味着,例如,处理新项目的入职、维护处理用户管理和项目发布的 Jazzband 网站、充当安全或行为准则事件的第一响应者等等。“roadies”这个词是从音乐和活动行业借来的,指的是支持人员,他们负责在巡回演出中几乎所有需要做的事情,除了实际的艺术表演。在 Jazzband,他们在那里确保成员可以在项目上工作。这也意味着某些任务是部分或完全自动化的,这是有意义的,并且最佳实践应用于大多数 Jazzband 项目,如打包设置、文档托管或持续集成。 + +### Zadka: 作为 Jazzband 的巡回乐队管理员,您工作中最具挑战性的方面是什么? + +Leidel:目前,我作为"巡回乐队管理员"的工作中最具挑战性的方面是实施社区成员提出的 Jazzband 改进,而不会冒他们所依赖的工作流程的风险。换句话说,Jazzband 越大,在概念级别上扩展项目变得越困难。具有讽刺意味的是,我是目前唯一的"巡回乐队管理员",独自处理一些任务,而 Jazzband 试图阻止其项目发生这种情况。这是 Jazzband 未来的一大担忧。 + +### Zadka: 对于有兴趣想知道能否加入 Jazzband 的人,您有什么想说的? + +Leidel:如果您有兴趣加入一群相信协作工作比单独工作更好的人,或者如果您一直在为自己的维护负担而苦苦挣扎并且不知道如何继续,请考虑加入 Jazzband。它简化了新贡献者的入职流程,提供了一个争议框架,并自动发布到 [PyPI][19]。有许多最佳实践可以很好地降低项目无法维护的风险。 + +### Zadka: 您还有什么想告诉我们的读者的吗? + +Leidel:我鼓励每个从事开源项目的人都考虑屏幕另一边的人。要有同理心,记住你自己的经历可能不是你同龄人的经历。了解您是全球多元化社区的成员,这要求我们始终尊重我们之间的差异。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/python-maintained + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[stevenzdg988](https://github.com/stevenzdg988) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/migration_innovation_computer_software.png?itok=VCFLtd0q (and old computer and a new computer, representing migration to new software or hardware) +[2]: https://jazzband.co/ +[3]: https://opensource.com/resources/python +[4]: https://opensource.com/article/18/8/django-framework +[5]: https://www.djangoproject.com/foundation/ +[6]: https://opensource.com/article/19/11/python-pip-cheat-sheet +[7]: https://virtualenv.pypa.io/en/latest/ +[8]: https://www.pypa.io/en/latest/ +[9]: https://pypi.org/ +[10]: https://djangocon.eu/ +[11]: https://www.python.org/psf/ +[12]: http://opensource.com/article/18/1/why-i-love-perl-5 +[13]: https://opensource.com/life/16/10/all-things-open-interview-dave-stokes +[14]: http://opensource.com/business/16/4/save-development-time-and-effort-ruby +[15]: https://redash.io/ +[16]: https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/start/report-gecko-telemetry-in-glean.html +[17]: https://alpha.iodide.io/ +[18]: https://opensource.com/article/19/12/cicd-resources +[19]: https://opensource.com/downloads/7-essential-pypi-libraries From 1827b4817953a8eed89f68cb120a07e1749caf60 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 24 Jun 2021 17:34:57 +0800 Subject: [PATCH 181/870] translated --- ...28 Learn Bash with this book of puzzles.md | 60 ------------------- ...28 Learn Bash with this book of puzzles.md | 59 ++++++++++++++++++ 2 files changed, 59 insertions(+), 60 deletions(-) delete mode 100644 sources/tech/20200428 Learn Bash with this book of puzzles.md create mode 100644 translated/tech/20200428 Learn Bash with this book of puzzles.md diff --git a/sources/tech/20200428 Learn Bash with this book of puzzles.md b/sources/tech/20200428 Learn Bash with this book of puzzles.md deleted file mode 100644 index 2a56979faf..0000000000 --- a/sources/tech/20200428 Learn Bash with this book of puzzles.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (baddate) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Learn Bash with this book of puzzles) -[#]: via: (https://opensource.com/article/20/4/bash-it-out-book) -[#]: author: (Carlos Aguayo https://opensource.com/users/hwmaster1) - -Learn Bash with this book of puzzles -====== -'Bash it out' covers basic, medium, and advanced Bash scripting using 16 -puzzles. -![Puzzle pieces coming together to form a computer screen][1] - -Computers are both my hobby and my profession. I have about 10 of them scattered around my apartment, all running Linux (including my Macs). Since I enjoy upgrading my computers and my computer skills, when I came across [_Bash it out_][2] by Sylvain Leroux, I jumped on the chance to buy it. I use the command line a lot on Debian Linux, and it seemed like a great opportunity to expand my Bash knowledge. I smiled when the author explained in the preface that he uses Debian Linux, which is one of my two favorite distributions. - -Bash lets you automate tasks, so it's a labor-saving, interesting, and useful tool. Before reading the book, I already had a fair amount of experience with Bash on Unix and Linux. I'm not an expert, in part because the scripting language is so extensive and powerful. I first became intrigued with Bash when I saw it on the welcome screen of [EndeavourOS][3], an Arch-based Linux distribution. - -The following screenshots show some options from EndeavourOS. Beleieve it or not, these panels just point to Bash scripts, each of which accomplish some relatively complex tasks. And because it's all open source, I can modify any of these scripts if I want. - -![EndeavourOS after install][4] - -![EndeavourOS install apps][5] - -### Always something to learn - -My impressions of this book are very favorable. It's not long, but it is well-thought-out. The author has very extensive knowledge of Bash and an uncanny ability to explain how to use it. The book covers basic, medium, and advanced Bash scripting using 16 puzzles, which he calls "challenges." This taught me to see Bash scripting as a programming puzzle to solve, which makes it more interesting to play with. - -An exciting aspect of Bash is that it's deeply integrated with the Linux system. While part of its power lies in its syntax, it's also powerful because it has access to so much. You can script repetitive tasks, or tasks that are easy but you're just tired of performing manually. Nothing is too great or too small, and _Bash it out_ helps you understand both what you can do, and how to achieve it. - -This review would not be complete if I didn't mention David Both's free resource [_A sysadmin's guide to Bash scripting_][6] on Opensource.com. This 17-page PDF guide is different from _Bash it out_, but together they make a winning combination for anyone who wants to learn about it. - -I am not a computer programmer, but _Bash it out_ has increased my desire to get into more advanced levels of Bash scripting—I might inadvertently end up as a computer programmer without planning to. - -One reason I love Linux is because of how powerful and versatile the operating system is. However much I know about Linux, there is always something new to learn that makes me appreciate Linux even more. - -In a competitive and ever-changing job market, it behooves all of us to continuously update our skills. This book helped me learn Bash in a very hands-on way. It almost felt as if the author was in the same room with me, patiently guiding me in my learning. - -The author, Leroux, has an uncanny ability to engage readers. This is a rare gift that I think is even more valuable than his technical expertise. In fact, I am writing this book review to thank the author for anticipating my own learning needs; although we have never met, I have benefited in real ways from his gifts. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/4/bash-it-out-book - -作者:[Carlos Aguayo][a] -选题:[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/hwmaster1 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) -[2]: https://www.amazon.com/Bash-Out-Strengthen-challenges-difficulties/dp/1521773262/ -[3]: https://endeavouros.com/ -[4]: https://opensource.com/sites/default/files/uploads/endeavouros-welcome.png (EndeavourOS after install) -[5]: https://opensource.com/sites/default/files/uploads/endeavouros-install-apps.png (EndeavourOS install apps) -[6]: https://opensource.com/downloads/bash-scripting-ebook diff --git a/translated/tech/20200428 Learn Bash with this book of puzzles.md b/translated/tech/20200428 Learn Bash with this book of puzzles.md new file mode 100644 index 0000000000..b35b78e7cf --- /dev/null +++ b/translated/tech/20200428 Learn Bash with this book of puzzles.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: (baddate) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn Bash with this book of puzzles) +[#]: via: (https://opensource.com/article/20/4/bash-it-out-book) +[#]: author: (Carlos Aguayo https://opensource.com/users/hwmaster1) + +用这本谜题书学习 Bash +====== +>“Bash it out”使用 16 个谜题,涵盖了基本、中级和高级 Bash 脚本。 + +![Puzzle pieces coming together to form a computer screen][1] + +计算机既是我的爱好,也是我的职业。我的公寓里散布着大约 10 个,它们都运行 Linux(包括我的 Mac)。由于我喜欢升级我的电脑和提升我的电脑技能,当我遇到 Sylvain Leroux 的[_Bash it out_][2]时,我抓住了购买它的机会。我在 Debian Linux 上经常使用命令行,这似乎是扩展我的 Bash 知识的好机会。当作者在前言中解释他使用 Debian Linux 时,我笑了,这是我最喜欢的两个发行版之一。 + +Bash 可让你自动执行任务,因此它是一种省力、有趣且有用的工具。在阅读本书之前,我已经有相当多的 Unix 和 Linux 上的 Bash 经验。我不是专家,部分原因是脚本语言非常广泛和强大。当我在基于 Arch 的 Linux 发行版[EndeavourOS][3]的欢迎屏幕上看到 Bash 时,我第一次对 Bash 产生了兴趣。 + +以下屏幕截图显示了 EndeavourOS 的一些选项。不管你信不信,这些面板只指向 Bash 脚本,每个脚本都完成一些相对复杂的任务。而且因为它都是开源的,所以我可以根据需要修改这些脚本中的任何一个。 +![EndeavourOS after install][4] + +![EndeavourOS install apps][5] + +### 总有东西要学 + +我对这本书的印象非常好。虽然不长,但经过了深思熟虑。作者对 Bash 有非常广泛的了解,并且具有解释如何使用它的不可思议的能力。这本书使用 16 个谜题涵盖了基本、中级和高级 Bash 脚本,他称之为“挑战”。这教会了我将 Bash 脚本视为需要解决的编程难题,这让我玩起来更有趣。 + +Bash 一个令人兴奋的方面是它与 Linux 系统深度集成。虽然它的部分能力在于它的语法,但它也很强大,因为它可以访问很多系统资源。你可以编写重复性任务或简单但厌倦了手动执行的任务的脚本。没有什么太大或太小的事,*Bash it out*可以帮助你了解可以做什么以及如何实现它。 + +如果我不提及 David Both 的免费资源[_A sysadmin's guide to Bash scripting_][6]on Opensource.com,这篇评论就不会完整。这个 17 页的 PDF 指南与Bash it out不同,但它们共同构成了任何想要了解它的人的成功组合。 + +我不是计算机程序员,但*Bash it out*增加了我进入更高级 Bash 脚本水平的欲望——虽然没有这个打算,但我可能最终无意中成为一名计算机程序员。 + +我喜欢 Linux 的原因之一是因为它的操作系统功能强大且用途广泛。无论我对 Linux 了解多少,总有一些新东西需要学习,这让我更加欣赏 Linux。 + +在竞争激烈且不断变化的就业市场中,我们所有人都应该不断更新我们的技能。这本书帮助我以非常实际的方式学习了 Bash。几乎感觉作者和我在同一个房间里,耐心地指导我学习。 + +作者 Leroux 具有不可思议的能力去吸引读者。这是一份难得的天赋,我认为比他的技术专长更有价值。事实上,我写这篇书评是为了感谢作者预见了我自己的学习需求;虽然我们从未见过面,但我从他的天赋中受益匪浅。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/4/bash-it-out-book + +作者:[Carlos Aguayo][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/baddates) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hwmaster1 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://www.amazon.com/Bash-Out-Strengthen-challenges-difficulties/dp/1521773262/ +[3]: https://endeavouros.com/ +[4]: https://opensource.com/sites/default/files/uploads/endeavouros-welcome.png (EndeavourOS after install) +[5]: https://opensource.com/sites/default/files/uploads/endeavouros-install-apps.png (EndeavourOS install apps) +[6]: https://opensource.com/downloads/bash-scripting-ebook From c950180b00e43c394d376d4a2bb1bd00c916f18d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 25 Jun 2021 05:03:14 +0800 Subject: [PATCH 182/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210625=20?= =?UTF-8?q?9=20Features=20in=20Brave=20Search=20That=20Make=20it=20a=20Gre?= =?UTF-8?q?at=20Google=20Search=20Alternative?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210625 9 Features in Brave Search That Make it a Great Google Search Alternative.md --- ...ke it a Great Google Search Alternative.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20210625 9 Features in Brave Search That Make it a Great Google Search Alternative.md diff --git a/sources/tech/20210625 9 Features in Brave Search That Make it a Great Google Search Alternative.md b/sources/tech/20210625 9 Features in Brave Search That Make it a Great Google Search Alternative.md new file mode 100644 index 0000000000..e1814e4871 --- /dev/null +++ b/sources/tech/20210625 9 Features in Brave Search That Make it a Great Google Search Alternative.md @@ -0,0 +1,161 @@ +[#]: subject: (9 Features in Brave Search That Make it a Great Google Search Alternative) +[#]: via: (https://itsfoss.com/brave-search-features/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +9 Features in Brave Search That Make it a Great Google Search Alternative +====== + +Brave Search is an ambitious initiative by Brave Software based on the open-source project [Tailcat][1], which tries to take on the big tech by introducing the ability to search anonymously. Brave Search itself is [not open source at the moment][2]. + +Of course, there are various other [private search engines][3] available out there trying to offer a privacy-focused experience. Even though not every service proves to be better than Google (regarding features), Brave Search seems to be a compelling choice when considering Brave Browser as a successful open-source replacement to Google Chrome. + +Here, let me highlight a few features in Brave Search that makes it an interesting alternative to Google Search. + +### Top 9 Brave Search Features + +Brave Search does a few things better than Google and those are worth highlighting as unique feature offerings that sets it apart. + +Brave Search is in beta at the time of writing this article. If you notice something different with your experience, there are chances that they may have made an improvement/change. Let me know in the comments below if that’s the case. + +#### 1\. Anonymous Search + +![][4] + +Google tracks your search queries, keeps a log of your history (unless you manually delete it or disable recording your activity). Not just the basics, but your IP address and the website you visit from the search result is also recorded in the process. + +In contrast, Brave Search does not track the IP, or the search queries made using their search portal. + +You stay completely anonymous, along with your search history being private only to yourself. + +This could eliminate the need of using a [secure VPN service][5] to keep your Internet search activity private. + +#### 2\. Ad-Free Version (Coming Soon) + +![][6] + +All the private search engines include advertisements to make money (which is fair). The advertisements used by Google Search include trackers when you click on it, which is not the case with privacy-focused search engines. + +But Brave Search tries to go a little further by offering a choice to the users. + +It is a feature that has been planned for addition, but it is worth mentioning. If you want to get rid of the ads, you can opt for the paid version of the search engine where you can explore the web ad-free. + +I think that’s a win-win for both Brave and you as a user. They do not lose on making revenue and you get to experience a truly ad-free search engine. + +#### 3\. Community Curated Search Rankings (Coming Soon) + +Users can help spot the quality of a web resource better than an algorithm often. + +So, Brave Search aims to work on a community-curated search ranking system, which will be open to all when it is available. + +This should improve the collaborative approach of exploring the web, which should be an impressive feature of Brave Search. + +#### 4\. Independent Index with No Search Algorithm + +![][7] + +With most of the other search engines, there’s an algorithm in place to make sure that only the high-quality web pages rank above the rest. Brave Search does not have any special algorithm controlling the search rankings. + +And yes, that is a feature in a world where everything depends on algorithms. + +Sometimes that algorithm ends up being biased by ranking plagiarism content first, low-quality web pages, along with a few other issues. + +Without any special search algorithm, Brave search uses its own Index to fetch results as per your queries. + +#### 5\. Private Local and Global Search Results + +![][8] + +No matter what region you choose for the search results, you get an additional option to filter your results based on your locality (IP address). + +Brave explains that the IP address is stored locally on your device and is used to serve you the local feed of results – which sounds useful. + +![][9] + +#### 6\. Transparency in Search Results + +![][10] + +The web is a vast network. Therefore, to keep the search result quality resourceful, Brave Search fetches some search results anonymously from Google and Bing (which is often less than 10% in my tests). + +For the rest of the results, Brave Search relies on its independent index. Brave Search also displays the percent of its independent search index used for your search. + +The more users start using Brave Search, the more independent the search results will become. So that’s a good thing. + +Considering not all search engines reveal a lot about their search results, Transparency, as a principle, can be a feature to compare with when choosing a search engine. + +![][11] + +#### [Brave: Open Source Web Browser That Blocks Ads and Tracking By Default][12] + +An open source web browser that blocks ads and tracking. A good choice if you are looking for a privacy focused web browser. Here’s how to install Brave on Linux. + +#### 7\. A Refreshing User Interface + +While every other Google search alternative tries to offer a familiar experience, Brave Search is actually refreshing to look at (in my opinion). + +![][13] + +The user interface looks well-thought and offers a modern, clean experience. Don’t you think? + +I like how DuckDuckGo simplifies things, but Brave certainly makes it up for a better user experience that looks unique and clean. + +#### 8\. No Anti-Competitive Nature + +Unlike some other search engines (especially, Google) do not suggest anything else explicitly, except their own products and services in their search results. + +That’s fair but potentially also anti-competitive, being the most popular search engine. They do have their reasons which we don’t have to talk about here, but giving a shout-out to your competitors is something new businesses/services are adopting. + +![][14] + +And Brave Search does an excellent jobat that. While you scroll through the search results, you will find a choice to use other search engines for your search query. + +#### 9\. Dark Mode & Tweaks + +Yes, the dark mode is an important feature (sigh). + +![][15] + +And from the settings available in Brave Search, you can **turn on the dark mode**, **set links to open in a new tab,** and **control the language** (soon). + +![][16] + +### Wrapping Up + +Brave Search is an interesting private search engine that aims to tackle the Big Tech by offering something new. It should be seamless user experience when [using Brave Browser][12] along with it, but you can use it on any browser without any limitations. + +I like what I see here, what do you think? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/brave-search-features/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.tailcat.com +[2]: https://www.reddit.com/r/brave_browser/comments/o5qknc/announcement_brave_search_beta_now_available_in/h2p3q22?utm_source=share&utm_medium=web2x&context=3 +[3]: https://itsfoss.com/privacy-search-engines/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-anonymous.png?resize=800%2C530&ssl=1 +[5]: https://itsfoss.com/best-vpn-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/paid-no-ads-brave.png?resize=800%2C450&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-sample.png?resize=800%2C586&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-local-global-search.png?resize=800%2C228&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-anonymous-local-results.png?resize=800%2C589&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-transparency.png?resize=800%2C654&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/09/brave-browser-1-e1573731875389.jpeg?resize=150%2C150&ssl=1 +[12]: https://itsfoss.com/brave-web-browser/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-ui.png?resize=800%2C590&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-competitors.png?resize=800%2C502&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-dark-mode.png?resize=800%2C573&ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/brave-search-settings.png?resize=483%2C389&ssl=1 From 5163879cae615f4dfede5c1736b16ed6ad549ba9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 25 Jun 2021 05:03:39 +0800 Subject: [PATCH 183/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210624=20?= =?UTF-8?q?Linux=20package=20management=20with=20apt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210624 Linux package management with apt.md --- ...10624 Linux package management with apt.md | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 sources/tech/20210624 Linux package management with apt.md diff --git a/sources/tech/20210624 Linux package management with apt.md b/sources/tech/20210624 Linux package management with apt.md new file mode 100644 index 0000000000..3e826c7dc1 --- /dev/null +++ b/sources/tech/20210624 Linux package management with apt.md @@ -0,0 +1,192 @@ +[#]: subject: (Linux package management with apt) +[#]: via: (https://opensource.com/article/21/6/apt-linux) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux package management with apt +====== +Learn how to install packages on Debian-based Linux distros with the apt +command, then download our cheat sheet to keep the right command at your +fingertips. +![bash logo on green background][1] + +On Linux, [package managers][2] help you handle updates, uninstalls, troubleshooting, and more for the software on your computer. Seth Kenlon [wrote about `dnf`][3], the command-line package management tool for installing software in RHEL, CentOS, Fedora, Mageia, OpenMandriva, and other Linux distros. + +Debian and Debian-based distros such as MX Linux, Deepin, Ubuntu—and distros based on Ubuntu, such as Linux Mint and Pop!_OS—have `apt`, a "similar but different" tool. In this article, I'll follow Seth's examples—but with `apt`—to show you how to use it. + +Before I start, I want to mention four `apt`-related tools for installing software: + + * [Synaptic][4] is a GTK+ based graphical user interface (GUI) front end for `apt`. + * [Aptitude][5] is an Ncurses-based full-screen command-line front end for `apt`. + * There are `apt-get`, `apt-cache`, and other predecessors of `apt`. + * [Dpkg][6] is the "behind the scenes" package manager `apt` uses to do the heavy lifting. + + + +There are other packaging systems, such as [Flatpak][7] and [Snap][8], that you might run into on Debian and Debian-based systems, but I'm not going to discuss them here. There are also application "stores," such as [GNOME Software][9], that overlap with `apt` and other packaging technologies; again, I'm not going to discuss them here. Finally, there are other Linux distros such as [Arch][10] and [Gentoo][11] that use neither `dnf` nor `apt`, and I'm not going to discuss those here either! + +With all the things I'm not going to discuss here, you may be wondering what tiny subset of software `apt` handles. Well, on my Ubuntu 20.04, `apt` gives me access to 69,371 packages, from the `0ad` real-time strategy game of ancient warfare to the `zzuf` transparent application fuzzer. Not bad at all. + +### Finding software with apt + +The first step in using a package manager such as `apt` is finding a software package of interest. Seth's `dnf` article used the [Cockpit][12] server management application as an example, so I will, too: + + +``` +$ apt search cockpit +Sorting... Done +Full Text Search... Done +389-ds/hirsute,hirsute 1.4.4.11-1 all +  389 Directory Server suite - metapackage + +cockpit/hirsute,hirsute 238-1 all +  Web Console for Linux servers + +... +$ +``` + +The second package above is the one you're after (it's the line beginning with `cockpit/hirsute`). If you decide you want to install it, enter: + + +``` +`$ sudo apt install cockpit` +``` + +`apt` will take care of installing Cockpit and all the bits and pieces, or _dependencies_, needed to make it work. Sometimes that's all that's needed; sometimes it's not. It's possible that having a bit more information could be useful in deciding whether you really want to install this application. + +### Package metadata + +To find out more about a package, use the `apt show` command: + + +``` +$ apt show cockpit +Package: cockpit +Version: 238-1 +Priority: optional +Section: universe/admin +Origin: Ubuntu +Maintainer: Ubuntu Developers <[ubuntu-devel-discuss@lists.ubuntu.com][13]> +Original-Maintainer: Utopia Maintenance Team <[pkg-utopia-maintainers@lists.alioth.debian.org][14]> +Bugs: +Installed-Size: 88.1 kB +Depends: cockpit-bridge (>= 238-1), cockpit-ws (>= 238-1), cockpit-system (>= 238-1) +Recommends: cockpit-storaged (>= 238-1), cockpit-networkmanager (>= 238-1), cockpit-packagekit (>= 238-1) +Suggests: cockpit-doc (>= 238-1), cockpit-pcp (>= 238-1), cockpit-machines (>= 238-1), xdg-utils +Homepage: +Download-Size: 21.3 kB +APT-Sources: hirsute/universe amd64 Packages +Description: Web Console for Linux servers + The Cockpit Web Console enables users to administer GNU/Linux servers using a + web browser. + . + It offers network configuration, log inspection, diagnostic reports, SELinux + troubleshooting, interactive command-line sessions, and more. + +$ +``` + +In particular, notice the `Description` field, which tells you more about the application. The `Depends` field says what else must be installed, and `Recommends` shows what other—if any—cooperating components are suggested alongside it. The `Homepage` field offers a URL in case you need more info. + +### What package provides a file? + +Sometimes you don't know the package name, but you know a file that must be in a package. Seth offers as an example the `qmake-qt5` utility. Using `apt search` doesn't find it: + + +``` +$ apt search qmake-qt5 +Sorting... Done +Full Text Search... Done +$ +``` + +However, a related command, `apt-file` will explore inside packages: + + +``` +$ apt-file search qmake-qt5 +qt5-qmake-bin: /usr/share/man/man1/qmake-qt5.1.gz +$ +``` + +This turns up a man page for `qmake-qt5` that is part of a package called `qt5-qmake-bin`. Note that this package name reverses the `qmake` and `qt5` parts. + +### What files are included in a package? + +That handy `apt-file` command also tells which files are included in a given package. For example: + + +``` +$ apt-file list cockpit +cockpit: /usr/share/doc/cockpit/TODO.Debian +cockpit: /usr/share/doc/cockpit/changelog.Debian.gz +cockpit: /usr/share/doc/cockpit/copyright +cockpit: /usr/share/man/man1/cockpit.1.gz +cockpit: /usr/share/metainfo/cockpit.appdata.xml +cockpit: /usr/share/pixmaps/cockpit.png +$ +``` + +Note that this is distinct from the info provided by the `apt show` command, which lists the package's dependencies (other packages that must be installed). + +### Removing an application + +You can also remove packages with `apt`. For example, to remove the `apt-file` application: + + +``` +`$ sudo apt purge apt-file` +``` + +Note that a superuser must run `apt` to install or remove applications. + +Removing a package doesn't automatically remove all the dependencies that `apt` installs along the way. However, it's easy to carry out that little bit of tidying: + + +``` +`$ sudo apt autoremove` +``` + +### Getting to know apt + +As Seth wrote, "the more you know about how your package manager works, the easier it is for you to install and query applications when necessary." + +Even if you're not a regular `apt` user, knowing it can be useful when you need to work at the command line while installing or removing packages (for example, on a remote server or when following a how-to published by some helpful soul). You may also need to know a bit about Dkpg (mentioned above); for example, some software creators provide a bare `.pkg` file. + +I find the Synaptic package manager to be a really useful tool on my desktop, but I also use `apt` on a handful of servers that I maintain for various purposes. + +**[Download our `apt` cheat sheet][15]** to get used to the command and try some new tricks with it. Once you do, you might find it hard to use anything else. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/apt-linux + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/article/21/2/linux-package-management +[3]: https://opensource.com/article/21/5/dnf +[4]: https://www.nongnu.org/synaptic/ +[5]: https://wiki.debian.org/Aptitude +[6]: https://wiki.debian.org/Teams/Dpkg +[7]: https://flatpak.org/ +[8]: https://snapcraft.io/ +[9]: https://wiki.gnome.org/Apps/Software +[10]: https://archlinux.org/ +[11]: https://www.gentoo.org/ +[12]: https://opensource.com/article/20/11/cockpit-server-management +[13]: mailto:ubuntu-devel-discuss@lists.ubuntu.com +[14]: mailto:pkg-utopia-maintainers@lists.alioth.debian.org +[15]: https://opensource.com/downloads/apt-cheat-sheet From becbe42d252a2437e58c9145734896b8a7f12e5e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 25 Jun 2021 05:04:04 +0800 Subject: [PATCH 184/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210624=20?= =?UTF-8?q?View=20statistics=20about=20your=20code=20with=20Tokei?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210624 View statistics about your code with Tokei.md --- ...w statistics about your code with Tokei.md | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 sources/tech/20210624 View statistics about your code with Tokei.md diff --git a/sources/tech/20210624 View statistics about your code with Tokei.md b/sources/tech/20210624 View statistics about your code with Tokei.md new file mode 100644 index 0000000000..539c97920d --- /dev/null +++ b/sources/tech/20210624 View statistics about your code with Tokei.md @@ -0,0 +1,201 @@ +[#]: subject: (View statistics about your code with Tokei) +[#]: via: (https://opensource.com/article/21/6/tokei) +[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +View statistics about your code with Tokei +====== +Learn details about projects' programming languages and more. +![A screen of code.][1] + +Recently, GitHub added a small indicator that shows details about projects, including what programming languages a project uses. Before this, it was hard for new contributors to know this type of information about the projects they were interested in. + +This addition is helpful, but what if you want to know the same information about projects in your local repository? That's where [Tokei][2] comes in handy. It's a tool that tells you code statistics about a project, which is especially useful when you want to build a project with people who are proficient in different languages. + +### Exploring Tokei + +According to its [README][3], "Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language." The introduction to its v.12.1.0 release [elaborates][4], "Tokei is a fast and accurate code analysis CLI tool and library, allowing you to easily and quickly see how many blank lines, comments, and lines of code are in your codebase." It can identify over 150 programming languages. + + +``` +$ ./tokei ~/exa/src ~/Work/wildfly/jaxrs +================== +Language   Files Lines Code Comments Blank +Java        46    6135  4324  945     632 +XML         23    5211  4839  473     224 +\--------------------------------- +Rust +Markdown +\----------------------------------- +Total +``` + +### Install Tokei + +To install Tokei in Fedora: + + +``` +`$ sudo dnf install tokei` +``` + +To install it with Rust's Cargo package manager: + + +``` +`$ cargo install tokei` +``` + +### Use Tokei + +To list code statistics for the current directory: + + +``` +$ tokei +=============================================================================== + Language            Files        Lines         Code     Comments       Blanks +=============================================================================== + Ada                    10         2840         1681          560          599 + Assembly                4         2508         1509          458          541 + GNU Style Assembly      4         2751         1528          748          475 + Autoconf               16         2294         1153          756          385 + Automake                1           45           34            0           11 + BASH                    4         1895         1602          133          160 + Batch                   2            4            4            0            0 + C                     330       206433       150241        23402        32790 + C Header              342        60941        24682        29143         7116 + CMake                  48         4572         3459          548          565 + C#                      9         1615          879          506          230 + C++                     5          907          599          136          172 + Dockerfile              2           16           10            0            6 + Fish                    1           87           77            5            5 + HTML                    1          545          544            1            0 + JSON                    5         8995         8995            0            0 + Makefile               10          504          293           72          139 + Module-Definition      12         1183         1046           65           72 + MSBuild                 1          141          140            0            1 + Pascal                  4         1443         1016          216          211 + Perl                    2          189          137           16           36 + Python                  4         1257          949          112          196 + Ruby                    1           23           18            1            4 + Shell                  15         1860         1411          222          227 + Plain Text             35        29425            0        26369         3056 + TOML                   64         3180         2302          453          425 + Visual Studio Pro|     30        14597        14597            0            0 + Visual Studio Sol|      6          655          650            0            5 + XML                     1          116           95           17            4 + YAML                    2           81           56           12           13 + Zsh                     1           59           48            8            3 +\------------------------------------------------------------------------------- + Markdown               55         4677            0         3214         1463 + |- C                    1            2            2            0            0 + |- Rust                19          336          268           20           48 + |- TOML                23           61           60            0            1 + (Total)                           5076          330         3234         1512 +\------------------------------------------------------------------------------- + Rust                  496       210966       188958         5348        16660 + |- Markdown           249        17676         1551        12502         3623 + (Total)                         228642       190509        17850        20283 +=============================================================================== + Total                1523       566804       408713        92521        65570 +=============================================================================== +$ +``` + +The following command prints out the supported languages and extensions: + + +``` +$ tokei -l +ABNF +ABAP +ActionScript +Ada +Agda +Alex +Alloy +Arduino C++ +AsciiDoc +ASN.1 +ASP +ASP.NET +Assembly +GNU Style Assembly +``` + +If you run `tokei` on two files and specify their location as an argument, it prints the stats for individual files in a last-in-first-out format: + +![Running Tokei on two files][5] + +(Sudeshna Sur, [CC BY-SA 4.0][6]) + +By default, `tokei` outputs only data about the languages used, but using the `--files` flag provides individual file statistics: + + +``` +$ tokei ~/exa/src --files +=========================================================================================== + Language                              Files      Lines      Code             Comments     Blanks +=========================================================================================== + Rust                                   54          9339        7070             400       1869 + |- Markdown                            33          1306           0            1165        141 + (Total)                                           10645        7070        1565       2010 +\------------------------------------------------------------------------------------------- + /home/ssur/exa/src/theme/default_theme.rs           130         107           0         23 + /home/ssur/exa/src/output/render/times.rs            30          24           0          6 + /home/ssur/exa/src/output/render/users.rs            98          76           0         22 + /home/ssur/exa/src/output/render/size.rs            182         141           3         38 + /home/ssur/exa/src/output/render/octal.rs           116          88           0         28 + /home/ssur/exa/src/output/render/mod.rs              33          20           3         10 + /home/ssur/exa/src/output/render/inode.rs            28          20           0          8 + /home/ssur/exa/src/output/render/links.rs            87          65           0         22 + /home/ssur/exa/src/output/render/groups.rs          123          93           0         30 + |ome/ssur/exa/src/output/render/filetype.rs          31          26           0          5 + /home/ssur/exa/src/output/render/blocks.rs           57          40           0         17 + /home/ssur/exa/src/output/render/git.rs             108          87           0         21 + |/ssur/exa/src/output/render/permissions.rs         204         160           3         41 + /home/ssur/exa/src/output/grid.rs                    67          51           3         13 + /home/ssur/exa/src/output/escape.rs                  26          18           4          4 + /home/ssur/exa/src/theme/lsc.rs                     235         158          39         38 + /home/ssur/exa/src/options/theme.rs                 159         124           6         29 + /home/ssur/exa/src/options/file_name.rs              46          39           0          7 + /home/ssur/exa/src/options/flags.rs                  84          63           6         15 + /home/ssur/exa/src/fs/mod.rs                         10           8           0          2 + /home/ssur/exa/src/fs/feature/mod.rs                 33          25           0          8 +\-- /home/ssur/exa/src/output/time.rs --------------------------------------------------------------- + |- Rust                                             215          170          5         40 + |- Markdown                                          28            0         25          3 +``` + +### Conclusion + +I found it very easy to use `tokei` to learn more about my code statistics. Another good thing about `tokei` is that it can be used as a library, which makes it easy to integrate into other projects. Visit Tokei's [Crate.io page][7] and [Docs.rs][8] to learn more about its usage. If you would like to get involved, you can also contribute to Tokei through its [GitHub repository][2]. + +Do you find Tokei useful? Let us know in the comments section below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/tokei + +作者:[Sudeshna Sur][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_development_programming_screen.png?itok=BgcSm5Pl (A screen of code.) +[2]: https://github.com/XAMPPRocky/tokei +[3]: https://github.com/XAMPPRocky/tokei/blob/master/README.md +[4]: https://github.com/XAMPPRocky/tokei/releases/tag/v12.1.0 +[5]: https://opensource.com/sites/default/files/uploads/tokei-two-files_0.png (Running Tokei on two files) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://crates.io/crates/tokei +[8]: https://docs.rs/tokei/12.1.2/tokei/ From 64dfe128a511507cf25101c4aab1f8ef65e7f659 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 25 Jun 2021 05:04:23 +0800 Subject: [PATCH 185/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210624=20?= =?UTF-8?q?Copy=20files=20between=20Linux=20and=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210624 Copy files between Linux and FreeDOS.md --- ...24 Copy files between Linux and FreeDOS.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20210624 Copy files between Linux and FreeDOS.md diff --git a/sources/tech/20210624 Copy files between Linux and FreeDOS.md b/sources/tech/20210624 Copy files between Linux and FreeDOS.md new file mode 100644 index 0000000000..20ad07c4ef --- /dev/null +++ b/sources/tech/20210624 Copy files between Linux and FreeDOS.md @@ -0,0 +1,129 @@ +[#]: subject: (Copy files between Linux and FreeDOS) +[#]: via: (https://opensource.com/article/21/6/copy-files-linux-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Copy files between Linux and FreeDOS +====== +Here's how I transfer files between my FreeDOS virtual machine and my +Linux desktop system. +![Files in a folder][1] + +I run Linux as my primary operating system, and I boot FreeDOS in a virtual machine. Most of the time, I use QEMU as my PC emulator, but sometimes I'll run other experiments with GNOME Boxes (which uses QEMU as a back-end virtual machine) or with VirtualBox. + +I like to play classic DOS games, and sometimes I'll bring up a favorite DOS application. I teach a Management Information Systems (MIS) class where I talk about the history of computing, and I'll sometimes record a demonstration using FreeDOS and a legacy DOS application, such as As-Easy-As (my favorite DOS spreadsheet—once released as "shareware" but now available [for free from TRIUS, Inc][2]). + +But using FreeDOS this way means I need to transfer files between my FreeDOS virtual machine and my Linux desktop system. Let me show you how I do that. + +### Accessing the image with guestmount + +I used to access my virtual disk image by calculating the offset to the first DOS partition, then calling the Linux `mount` command with the right mix of options to match that offset. This was always error-prone and not very flexible. Fortunately, there's an easier way to do it. The `guestmount` program from the [libguestfs-tools][3] package lets you access or _mount_ the virtual disk image from Linux. You can install `libguestfs-tools` using this command on Fedora: + + +``` +`$ yum install libguestfs-tools libguestfs` +``` + +Using `guestmount` is not as easy as double-clicking the file from the GNOME file manager, but the command line isn't too difficult to use. The basic usage of `guestmount` is: + + +``` +`$ guestmount -a image -m device mountpoint` +``` + +In this usage, _image_ is the virtual disk image to use. On my system, I created my QEMU virtual disk image with the `qemu-img` command. The g`uestmount` program can read this disk image format, as well as the QCOW2 image format used by GNOME Boxes, or the VDI image format used in VirtualBox. + +The _device_ option indicates the partition on the virtual disk. Imagine using this virtual disk as a real hard drive. You would access the first partition as `/dev/sda1`, the second partition as `/dev/sda2`, and so on. That's the syntax for `guestmount`. By default, FreeDOS 1.3 RC4 creates one partition on an empty drive, so access that partition as `/dev/sda1`. + +And _mountpoint_ is the location to "mount" the DOS filesystem on your local Linux system. I'll usually create a temporary directory to work with. You only need the mount point while you're accessing the virtual disk. + +Putting that all together, I use this set of commands to access my FreeDOS virtual disk image from Linux: + + +``` +$ mkdir /tmp/freedos +$ guestmount -a freedos.img -m /dev/sda1 /tmp/freedos +``` + +After that, I can access my FreeDOS files via the `/tmp/freedos` directory, using normal tools on Linux. I might use `ls /tmp/freedos` at the command line, or open the `/tmp/freedos` mount point using the desktop file manager. + + +``` +$ ls -l /tmp/freedos +total 216 +drwxr-xr-x.  5 root root  8192 May 10 15:53 APPS +-rwxr-xr-x.  1 root root 85048 Apr 30 07:54 COMMAND.COM +-rwxr-xr-x.  1 root root   103 May 13 15:48 CONFIG.SYS +drwxr-xr-x.  5 root root  8192 May 15 16:52 DEVEL +drwxr-xr-x.  2 root root  8192 May 15 13:36 EDLIN +-rwxr-xr-x.  1 root root  1821 May 10 15:57 FDAUTO.BAT +-rwxr-xr-x.  1 root root   740 May 13 15:47 FDCONFIG.SYS +drwxr-xr-x. 10 root root  8192 May 10 15:49 FDOS +-rwxr-xr-x.  1 root root 46685 Apr 30 07:54 KERNEL.SYS +drwxr-xr-x.  2 root root  8192 May 10 15:57 SRC +-rwxr-xr-x.  1 root root  3190 May 16 08:34 SRC.ZIP +drwxr-xr-x.  3 root root  8192 May 11 18:33 TEMP +``` + +![GNOME file manager][4] + +Using GNOME file manager to access the virtual disk +(Jim Hall, [CC-BY SA 4.0][5]) + +For example, to copy several C source files from my Linux `projects` directory into `C:\SRC` on the virtual disk image, so I can use the files under FreeDOS later, I can use the Linux `cp` command: + + +``` +`$ cp /home/jhall/projects/*.c /tmp/freedos/SRC` +``` + +The files and directories on the virtual drive are technically _case insensitive_, so you can refer to them using uppercase or lowercase letters. However, I find it more natural to type DOS files and directories using all uppercase. + + +``` +$ ls /tmp/freedos +APPS         CONFIG.SYS  EDLIN       FDCONFIG.SYS  KERNEL.SYS  SRC.ZIP +COMMAND.COM  DEVEL       FDAUTO.BAT  FDOS          SRC         TEMP + +$ ls /tmp/freedos/EDLIN +EDLIN.EXE  MAKEFILE.OW + +$ ls /tmp/freedos/edlin +EDLIN.EXE  MAKEFILE.OW +``` + +### Unmounting with guestmount + +You should always _unmount_ the virtual disk image before you use it again in your virtual machine. If you leave the image mounted while you run QEMU or VirtualBox, you risk messing up your files. + +The companion command to `guestmount` is `guestunmount`, to unmount the disk image. Just give the mount point that you wish to unmount: + + +``` +`$ guestunmount /tmp/freedos` +``` + +Note that this command is spelled slightly differently from the Linux `umount` system command. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/copy-files-linux-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) +[2]: http://www.triusinc.com/forums/viewtopic.php?t=10 +[3]: https://libguestfs.org/ +[4]: https://opensource.com/sites/default/files/uploads/gnome-file-manager.png (Using GNOME file manager to access the virtual disk) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ From 3b8d4c33ca905a2e3ef7a11864edab469316f123 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 25 Jun 2021 08:51:06 +0800 Subject: [PATCH 186/870] translated --- ...ly Useful BitTorrent Application by KDE.md | 110 ------------------ ...ly Useful BitTorrent Application by KDE.md | 110 ++++++++++++++++++ 2 files changed, 110 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md create mode 100644 translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md diff --git a/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md b/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md deleted file mode 100644 index 7f32c470e4..0000000000 --- a/sources/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: subject: (KTorrent: An Incredibly Useful BitTorrent Application by KDE) -[#]: via: (https://itsfoss.com/ktorrent/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -KTorrent: An Incredibly Useful BitTorrent Application by KDE -====== - -There are a variety of BitTorrent applications available for Linux. But finding a good application that offers many features should save you some time. - -KTorrent by KDE is one such BitTorrent app built for Linux. - -While there are [several torrent clients for Linux][1], I recently found KTorrent interesting for my use-case. - -### KTorrent: Open Source BitTorrent Client for Linux - -![][2] - -KTorrent is a full-fledged torrent client primarily tailored for KDE desktop. It should work simply fine no matter what desktop environment you use. - -Of course, with KDE desktop, you may get a seamless user experience. - -Let us look at the all the features offered. - -### Features of KTorrent - -![][3] - -For regular torrent users, having an extensive set of features makes things easy. And KTorrent is no exception. Here, I’ll highlight the key highlights of KTorrent: - - * Adding torrent downloads in a queue - * Ability to control the speed limits per download (or overall) - * Video and audio file preview option - * Supports importing of downloaded files (partial/full) - * Ability to prioritize torrent downloads when downloading multiple files - * Selection of specific files to download for multi-file torrents - * IP filter with the option of kicking/banning peers - * UDP tracker support - * µTorrent peer support - * Support for protocol encryption - * Ability to create trackerless torrent - * Scripting support - * System tray integration - * Connection through a proxy - * Added plugin support - * Supports IPv6 - - - -KTorrent sounds something useful as a torrent client that you can use daily with control to manage all your torrent downloads at one place. - -![][4] - -In addition to the features mentioned above, it offers great control over the behavior of the client as well. For instance, tweaking the color that indicates downloads/pause/trackers. - -You also get the ability to set the notification if you want to disable the sound of completing a torrent download or getting notified of the activity. - -![][5] - -While features like protocol encryption support may not be able to replace some of the [best VPN][6] services, it is an important addition for desktop clients. - -### Installing KTorrent in Linux - -KTorrent should be available through your package managers like [Synaptic][7] or the default repositories. You can also find it listed in your software center for easy installation. - -In addition to this, it also offers a [Flatpak][8] official package on [Flathub][9] for any Linux distribution. If you need help with that, we have a [Flatpak guide][10] for reference. - -You can also try the [snap package][11] available if you prefer that. - -To explore more about it and the source code, head to its [official KDE app page][12]. - -[KTorrent][12] - -### Closing Thoughts - -KTorrent is a phenomenal torrent client for Linux. I tried it on my Linux Mint system on top of Cinnamon desktop, and it worked great. - -I like how simple, yet configurable it is. Even though I don’t use a torrent client every day, I did not see anything weird with KTorrent in my brief testing. - -What do you think about KTorrent as a torrent client for Linux? What do you prefer to use it instead? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ktorrent/ - -作者:[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-torrent-ubuntu/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-download.png?resize=850%2C582&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-configure.png?resize=850%2C656&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-speed-limit.png?resize=850%2C585&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-plugins.png?resize=850%2C643&ssl=1 -[6]: https://itsfoss.com/best-vpn-linux/ -[7]: https://itsfoss.com/synaptic-package-manager/ -[8]: https://itsfoss.com/what-is-flatpak/ -[9]: https://flathub.org/apps/details/org.kde.ktorrent -[10]: https://itsfoss.com/flatpak-guide/ -[11]: https://snapcraft.io/ktorrent -[12]: https://apps.kde.org/ktorrent/ diff --git a/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md b/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md new file mode 100644 index 0000000000..f27f16d3db --- /dev/null +++ b/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md @@ -0,0 +1,110 @@ +[#]: subject: (KTorrent: An Incredibly Useful BitTorrent Application by KDE) +[#]: via: (https://itsfoss.com/ktorrent/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +KTorrent:KDE 的一个非常有用的 BitTorrent 应用 +====== + +Linux 中有各种各样的 BitTorrent 应用。但是,找到一个好的、提供许多功能的应用应该可以为你节省一些时间。 + +KDE 的 KTorrent 就是这样一个为 Linux 打造的 BitTorrent 应用。 + +虽然有 [Linux 有几个 torrent 客户端][1],但我最近发现 KTorrent 对我而言很有趣。 + +### KTorrent: 适用于 Linux 的开源 BitTorrent 客户端 + +![][2] + +KTorrent 是一个成熟的 torrent 客户端,主要为 KDE 桌面定制。无论你使用什么桌面环境,它都能很好地工作。 + +当然,使用KDE桌面,你可以得到一个无缝的用户体验。 + +让我们来看看它的所有功能。 + +### KTorrent 的功能 + +![][3] + +对于普通的 torrent 用户来说,拥有一套全面的功能使事情变得简单。而 KTorrent 也不例外。在这里,我将列出 KTorrent 的主要亮点: + + * 在一个队列中添加 torrent 下载 + * 能够控制每次下载(或整体)的速度限制 + * 视频和音频文件预览选项 + * 支持导入下载文件(部分/全部)。 + * 在下载多个文件时,能够对 torrent 下载进行优先排序 + * 为多文件 torrent 选择要下载的特定文件 + * IP 过滤器,可选择踢走/禁止 peer。 + * 支持 UDP 跟踪器 + * 支持 µTorrent peer + * 支持协议加密 + * 能够创建无 tracker 的 torrent + * 脚本支持 + * 系统托盘集成 + * 通过代理连接 + * 增加了插件支持 + * 支持 IPv6 + + + +KTorrent 听起来很有用,作为一个 torrent 客户端,你可以日常控制它在一个地方管理所有的 torrent 下载。 + +![][4] + +除了上面提到的功能外,它还对客户端的行为提供了很大的控制。例如,调整指示下载/暂停/tracker 服务器的颜色。 + +如果你想禁用完成 torrent 下载的声音或得到活动通知,你还可以设置通知。 + +![][5] + +虽然像协议加密支持这样的功能可能无法取代一些[最好的 VPN][6] 服务,但它对桌面客户端来说是一个重要的补充。 + +### 在 Linux 中安装 KTorrent + +KTorrent 应该可以通过包管理器(如 [Synaptic][7])或默认的仓库获得。你也可以在你的软件中心找到它并轻松安装。 + +除此之外,它还在 [Flathub][9] 上提供了一个适用于任何 Linux 发行版的 [Flatpak][8] 官方包。如果你需要帮助,我们有一个 [Flatpak 指南][10]供参考。 + +如果你喜欢的话,你也可以尝试可用的 [snap包][11]。 + +要探索更多关于它和源码的信息,请前往它的[官方 KDE 应用页面][12]。 + +[KTorrent][12] + +### 结束语 + +KTorrent 是 Linux 中一个出色的 torrent 客户端。我在我的 Linux Mint 系统的 Cinnamon 桌面上试用了它,它运行得很好。 + +我喜欢它的简单和可配置性。尽管我不是每天都在使用 torrent 客户端,但在我短暂的测试中,我没有发现 KTorrent 有什么奇怪的地方。 + +你认为 KTorrent 作为 Linux 的 torrent 客户端怎么样?你喜欢用什么呢? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ktorrent/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-torrent-ubuntu/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-download.png?resize=850%2C582&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-configure.png?resize=850%2C656&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-speed-limit.png?resize=850%2C585&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/ktorrent-plugins.png?resize=850%2C643&ssl=1 +[6]: https://itsfoss.com/best-vpn-linux/ +[7]: https://itsfoss.com/synaptic-package-manager/ +[8]: https://itsfoss.com/what-is-flatpak/ +[9]: https://flathub.org/apps/details/org.kde.ktorrent +[10]: https://itsfoss.com/flatpak-guide/ +[11]: https://snapcraft.io/ktorrent +[12]: https://apps.kde.org/ktorrent/ From 4b51ef1335cf730e95e58f4a70f207c3ea296adc Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 25 Jun 2021 08:56:33 +0800 Subject: [PATCH 187/870] translating --- sources/tech/20210623 Python 3.10 beta in Fedora Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md b/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md index 3cdae5cbc8..fc46e0e7f5 100644 --- a/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md +++ b/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/python-3-10-beta-in-fedora-linux/) [#]: author: (Miro Hrončok https://fedoramagazine.org/author/churchyard/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From be7911a0ad4ce0aaae3378a704edf9aeefb936b3 Mon Sep 17 00:00:00 2001 From: frstlis <48125063@qq.com> Date: Fri, 25 Jun 2021 08:59:43 +0800 Subject: [PATCH 188/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20200210 Music composition with Python and Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200210 Music composition with Python and Linux.md b/sources/tech/20200210 Music composition with Python and Linux.md index cb569520ec..c9c5cfbfec 100644 --- a/sources/tech/20200210 Music composition with Python and Linux.md +++ b/sources/tech/20200210 Music composition with Python and Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -86,7 +86,7 @@ via: https://opensource.com/article/20/2/linux-open-source-music 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[stevenzdg988](https://github.com/stevenzdg988) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a61969f3651ec0b42d4eaf640c82063088467a79 Mon Sep 17 00:00:00 2001 From: alex <37013819+baddate@users.noreply.github.com> Date: Fri, 25 Jun 2021 09:19:30 +0800 Subject: [PATCH 189/870] Update 20210614 What is a CI-CD pipeline.md --- sources/tech/20210614 What is a CI-CD pipeline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210614 What is a CI-CD pipeline.md b/sources/tech/20210614 What is a CI-CD pipeline.md index 282926567e..563fcb149b 100644 --- a/sources/tech/20210614 What is a CI-CD pipeline.md +++ b/sources/tech/20210614 What is a CI-CD pipeline.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/what-cicd-pipeline) [#]: author: (Will Kelly https://opensource.com/users/willkelly) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (baddate) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9e6849798e7f5612e1118eb856c5105904d8e8e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 25 Jun 2021 10:41:54 +0800 Subject: [PATCH 190/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zepoch 感谢您,完成了第一篇翻译贡献! --- ... Switching to Linux Makes Sense in 2021.md | 95 +++++++++---------- 1 file changed, 46 insertions(+), 49 deletions(-) diff --git a/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md index 589f75f280..f94311c93c 100644 --- a/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md +++ b/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md @@ -3,90 +3,92 @@ [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "zepoch" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -为什么在2021年我仍然推荐你使用Linux +为什么在 2021 年我仍然推荐你使用 Linux ====== -在某些领域,Linux确实要比Windows和macOS要更加优秀。人们也开始意识到这一点,而且Linux也在桌面操作系统应用市场中也在变得愈发流行。 +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/linux-2021.png?w=1200&ssl=1) -当然,目前大多数桌面操作系统用户仍然使用的是 Windows 或者 macOS, 但是也有着越来越多的用户开始尝试新的 Linux 发行版本,看看他们是否可以从原来的系统切换到 Linux 系统。 +在某些领域,Linux 确实要比 Windows 和 macOS 更加优秀。人们正在意识到这一点,而且 Linux 也在桌面操作系统市场上变得愈发流行。 -他们可能已经听过[用 Linux 作为桌面操作系统](https://news.itsfoss.com/linux-foundation-linux-desktop/)的一些优秀案例,又或者是仅仅想要去尝试一些与原先不同的事物,谁知道呢? +当然,目前大多数桌面操作系统用户仍然对 Windows 或者 macOS 推崇备至,但是也有着越来越多的用户开始尝试新的 Linux 发行版,看看他们是否可以从原来的系统切换到 Linux 系统。 -在这里,我将为你解释为什么在2021年我仍然推荐你使用Linux。 +他们可能已经听过 [用 Linux 作为桌面操作系统](https://news.itsfoss.com/linux-foundation-linux-desktop/) 的一些优秀案例,又或者是仅仅想要去尝试一些与原先不同的事物,谁知道呢? -### Linux 是伟大的,但是究竟是什么让其在 2021 年更被推荐呢? +在这里,我将为你解释为什么在 2021 年我仍然推荐你使用 Linux。 -如果已经知道了[使用 Linux 的优点](https://itsfoss.com/reasons-switch-linux-windows-xp/),你可能就知道接下来我会说些什么。 +### Linux 真棒,但是究竟是什么让其在 2021 年值得推荐呢? -#### 1\. 你不需要购买一个许可证 +如果已经知道了 [使用 Linux 的优点](https://itsfoss.com/reasons-switch-linux-windows-xp/),你可能就知道接下来我会说些什么。 + +#### 1、你不需要购买许可证 ![][3] -你必须支付购买才能获得 Windows 10 许可证。 +你必须付费才能获得 Windows 10 许可证。 -虽然有更便宜的选择,如获得OEM密钥。但是,如果您不愿意通过一些特别的网站,而是从官方网站获得许可证,那么仅授权使用 1 台 PC 的**家庭版**就至少需要花费 **140 美元**. +虽然有更便宜的选择,如获得 OEM 密钥。但是,如果你不愿意通过一些地下网站,而是从官方网站获得许可证,那么仅授权使用 1 台 PC 的**家庭版**就至少需要花费 **140 美元**。 -当然,macOS是一个完全不同的模式(你需要购买高级硬件才能使用macOS)——所以我们才会一直使用微软的 Windows。 +当然,macOS 是一个完全不同的模式(你需要购买先进的硬件才能使用 macOS)——所以我们才会一直使用微软的 Windows。 -关键是——在失业的浪潮中,组件一台新电脑是一个挑战。此外,您还需要花钱购买操作系统的许可证,但是你却可以在多台计算机上免费使用 Linux。 +关键是,在失业的浪潮中,配置一台新电脑是一个挑战。此外,你还需要花钱购买操作系统的许可证,但是你却可以在多台计算机上免费使用 Linux。 -是的,您不需要为 Linux 获取许可证密钥。您可以轻松下载 [Linux 发行版][4],并根据需要将其安装在尽可能多的设备上。 +是的,你不需要为 Linux 获取许可证密钥。你可以轻松下载 [Linux 发行版][4],并根据需要将其安装在尽可能多的设备上。 -不要担心, 如果你不知道 Linux 发行, 你可以看看我们的[最好的 Linux 发行版](https://itsfoss.com/best-linux-distributions/)的列表。 +不要担心,如果你不了解 Linux 发行版,你可以看看我们的 [最好的 Linux 发行版](https://itsfoss.com/best-linux-distributions/) 列表。 -#### 2\. 恢复现有的PC并节省资金 +#### 2、重新唤醒你的 PC 并节省资金 -[全球芯片短缺](https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html)已经严重影响了电脑组件的价格,特别是**显卡**。并不是简单的价格上升,而是你不得不支付 **2 到 5 倍**的零售价来购得显卡。 +[全球芯片短缺](https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html) 已经严重影响了电脑组件的价格,特别是**显卡**。并不是简单的价格上升,而是你不得不支付 **2 到 5 倍**的零售价来购得显卡。 -当然,如果你没有电脑,现在组建一个新的电脑可能是难以置信的挑战,但如果你有一个旧电脑的话,选择在上面运行 Windows 10 将会是十分卡顿的。 +当然,如果你没有电脑,现在配置一个新的电脑可能是难以置信的挑战,但如果你有一个旧电脑的话,选择在上面运行 Windows 10 将会是十分卡顿的。 -如果你不想要一个 Windows 的系统,那 macOS 呢?入门级 Mac 系统将会花费至少 **1100** 美金,这取决于你住在哪里。对许多人来说,这会是一笔昂贵的开销。 +如果你不想要 Windows 系统,那 macOS 呢?入门级 Mac 系统将会花费至少 **1100** 美金,甚至更多,这取决于你住在哪里。对许多人来说,这会是一笔昂贵的开销。 -你肯定需要升级你的系统——但是如果我说 Linux 可以让你的旧电脑重新派上用场,也能为你省钱呢? +你肯定需要升级你的系统 —— 但是如果我说 Linux 可以让你的旧电脑重新派上用场,能为你省钱呢? -您将能够在您认为无法运行最新版本的 Microsoft Windows 的电脑上运行 Linux。是的,这是正确的。 +你将能够在你认为无法运行最新版本的微软 Windows 的电脑上运行 Linux。是的,就是这样的。 Linux 是一个资源高效型的操作系统,可在各种较旧的系统配置上运行。 -所有你需要做的只是参考我们的列表 [轻量级 Linux 分布][7], 并选择一个你喜欢的。 +所有你需要做的只是参考我们的列表 [轻量级 Linux 发行版][7],并选择一个你喜欢的。 -#### 3\. 通过恢复系统减少电子浪费 +#### 3、通过再次利用系统来减少电子浪费 ![][8] -考虑到电子废物正在全球不断产生,尤其是矿工,我们可以尽量减少浪费。除非您真正需要新的硬件,否则最好将现有硬件设备重新用于新任务。 +考虑到电子废物正在全球不断产生,尤其是由加密矿工产生的,我们可以尽量减少浪费。除非你真正需要新的硬件,否则最好将现有硬件设备重新用于新任务。 -而且,多亏了 Linux,您可以将旧电脑或单片机转到媒体服务器或个人[Nextcloud][9] 服务器。 +而且,多亏了 Linux,你可以将旧电脑或单片机转变成媒体服务器或个人 [Nextcloud][9] 服务器。 -您可以在现有硬件上使用 Linux 做更多工作。 +你可以在现有硬件上使用 Linux 做更多工作。 -因此,这将显著降低对新硬件的需求,并让您高效地重复使用现有的设备。 +因此,这将显著降低对新硬件的需求,并让你高效地重复使用现有的设备。 -#### 4\. 远离病毒和恶意软件 +#### 4、远离病毒和恶意软件 ![][10] -在远程工作无处不在的时代,病毒和恶意软件显著增加。因此,即使您想和平地工作,您最终也可能受到恶意软件的影响。 +在远程工作无处不在的时代,病毒和恶意软件显著增加。因此,即使你想平静地工作,你最终也可能受到恶意软件的影响。 -Windows 和 macOS 都比以往任何时候都更容易受到恶意软件的影响。但是,对于Linux?这是极不可能的。 +Windows 和 macOS 比以往任何时候都更容易受到恶意软件的影响。但是,对于 Linux?这是不太可能的。 -Linux 发行版被定期修补,以确保最佳安全性。 +Linux 发行版会定期修补,以确保最佳安全性。 -此外,因为用户群很小,攻击者就不会花太多时间制作欺骗 Linux 用户的病毒或软件。因此,在使用 Linux 时遇到某种形式的恶意软件的机会较小。 +此外,正因为用户群体小,攻击者就不会花太多时间制作欺骗 Linux 用户的病毒或软件。因此,在使用 Linux 时遇到某种形式的恶意软件的机会较小。 -#### 5\. 没有强制更新 +#### 5、没有强制更新 -![][8] +![][11] -在一个人们压力倍增的时代,强制更新和发现计算机无法启动可能是一大烦恼。 +在一个人们压力倍增的时代,强制更新然后发现计算机无法启动可能是一大烦恼。 至少,Windows 用户的情况就是这样。 -但是,使用 Linux,您可以继续使用您的系统,而无需在后台强制下载任何更新。 +但是,使用 Linux,你可以继续使用你的系统,而无需在后台强制下载任何更新。 你的操作系统只有你能决定。 @@ -94,17 +96,11 @@ Linux 发行版被定期修补,以确保最佳安全性。 ### 总结 -这些只是我能想到的几个原因之一, Linux 作为操作系统的选择在 2021 年比以往任何时候都更值得被推荐。 +这些只是我能想到的几个原因之一,Linux 作为操作系统的选择在 2021 年比以往任何时候都更值得被推荐。 -当然,这也取决于您的要求,这些好处可能不会体现在在您的用例中。但是,如果你确实不了解 Linux,至少,现在你可以评估你的需求,重新作出选择。 +当然,这也取决于你的要求,这些好处可能不会体现在在你的用例中。但是,如果你确实不了解 Linux,至少,现在你可以评估你的需求,重新作出选择。 -除了上述要点之外,您还能想到什么?请在下面的评论中告诉我。 - -### 大型科技网站获得数百万收入,It's FOSS 为您服务! - -如果您喜欢我们在 It's FOSS 所做的工作,请考虑捐款以支持我们的独立出版物。 您的支持将帮助我们继续发布专注于桌面 Linux 和开源软件的内容。 - -感谢各位。 +除了上述几点之外,你还能想到什么?请在下面的评论中告诉我。 -------------------------------------------------------------------------------- @@ -113,7 +109,7 @@ via: https://news.itsfoss.com/switch-to-linux-in-2021/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -121,11 +117,12 @@ via: https://news.itsfoss.com/switch-to-linux-in-2021/ [b]: https://github.com/lujun9972 [1]: https://news.itsfoss.com/linux-foundation-linux-desktop/ [2]: https://itsfoss.com/reasons-switch-linux-windows-xp/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/license-agreement.jpg?w=1000&ssl=1 [4]: https://itsfoss.com/what-is-linux-distribution/ [5]: https://itsfoss.com/best-linux-distributions/ [6]: https://www.cnbc.com/2021/05/12/the-global-chip-shortage-could-last-until-2023-.html [7]: https://itsfoss.com/lightweight-linux-beginners/ -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/e-waste-illustration.jpg?w=800&ssl=1 [9]: https://itsfoss.com/nextcloud/ -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/system-malware.jpg?w=800&ssl=1 +[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/linux-system-update.jpg?w=800&ssl=1 \ No newline at end of file From 800bd46e1c68aafd4fa07bf16add373e05b692ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 25 Jun 2021 10:42:59 +0800 Subject: [PATCH 191/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zepoch 本文首发地址:https://linux.cn/article-13519-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/zEpoch --- ...10619 Here-s Why Switching to Linux Makes Sense in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md (98%) diff --git a/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/published/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md similarity index 98% rename from translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md rename to published/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md index f94311c93c..f018eca6e7 100644 --- a/translated/talk/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md +++ b/published/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13519-1.html" 为什么在 2021 年我仍然推荐你使用 Linux ====== From 5fcde94fd4299f1e51aa2545a1dcdd118dec2770 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 25 Jun 2021 11:30:44 +0800 Subject: [PATCH 192/870] PRF @geekpi --- ...chines to Kubernetes with this new tool.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md b/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md index f0cc8023f3..562619fcc4 100644 --- a/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md +++ b/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md @@ -3,60 +3,60 @@ [#]: author: (Miguel Perez Colino https://opensource.com/users/mperezco) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -用这个新工具将虚拟机迁移到 Kubernetes 上 +用 Forklift 将虚拟机迁移到 Kubernetes 上 ====== -用 Forklift 将你的虚拟化工作负载过渡到 Kubernetes。 -![Containers on a ship on the ocean][1] -2017 年,[KubeVirt][2] 团队[发起][3]了一个在 [Kubernetes][4] 中与容器一起管理虚拟机 (VM) 的项目。这个开源项目的意图是让虚拟机成为这个环境中的一等公民。 +> 用 Forklift 将你的虚拟化工作负载过渡到 Kubernetes。 -自从在 [2018 年开源峰会][5]上推出以来,KubeVirt 一直在不断成熟和发展。它在 GitHub 上已经达到了 200 多颗星,甚至在 2021 年 2 月推出了自己的活动:[KubeVirt 峰会][6]。 +![](https://img.linux.net.cn/data/attachment/album/202106/25/113010mxhtznxjhxf1glz7.jpg) + +2017 年,[KubeVirt][2] 团队 [发起][3] 了一个在 [Kubernetes][4] 中管理容器及相关的虚拟机(VM)的项目。这个开源项目的意图是让虚拟机成为这个环境中的一等公民。 + +自从在 [2018 年开源峰会][5] 上推出以来,KubeVirt 一直在不断成熟和发展。它在 GitHub 上已经达到了 200 多颗星,甚至在 2021 年 2 月推出了自己的活动:[KubeVirt 峰会][6]。 ![KubeVirt architecture][7] -KubeVirt架构(© 2020,[Red Hat OpenShift][8]) +*KubeVirt 架构(© 2020,[Red Hat OpenShift][8])* -KubeVirt 是 [OpenShift 虚拟化][9]的基础,它帮助开发者将虚拟机带入容器化工作流程。 +KubeVirt 是 [OpenShift 虚拟化][9] 的基础,它帮助开发者将虚拟机带入容器化工作流程。 ### 在 Kubernetes 中使用虚拟机 -KubeVirt 使你能够在虚拟机上原生使用 Kubernetes。这意味着它们可以连接到使用标准 Kubernetes 方法访问的 pod 网络,包括服务、路由、管道等。应用于虚拟机 pod 的网络策略与应用于应用的 pod 方式相同,它提供一个一致的模型来管理虚拟机到 pod (反之亦然)的通信。 +KubeVirt 使你能够在虚拟机上原生使用 Kubernetes。这意味着它们可以连接到使用标准 Kubernetes 方法(如服务、路由、管道等)访问的吊舱Pod网络。应用于虚拟机吊舱的网络策略与应用于应用吊舱的方式相同,它提供一个一致的模型来管理虚拟机到吊舱(或反之)的通信。 这方面的一个真实例子是一家航空公司利用旧的模拟器软件的方式。它注入了人工智能和机器学习 (AI/ML) 的模型,然后在基于虚拟机的模拟器上自动部署和测试它们。这使得它能够使用 Kubernetes 和 [Kubeflow][10] 完全自动化地获得测试结果和新的遥测训练数据。 ![VM-creation workflow][11] -(Konveyor, [CC BY-SA 4.0][12]) +*(Konveyor, [CC BY-SA 4.0][12])* -[Konveyor.io][13] 是一个开源项目,帮助现有工作负载(开发、测试和生产)过渡到 Kubernetes。其工具包括 [Crane][14],将容器从一个 Kubernetes 平台转移到另一个平台、[Move2Kube][15],将工作负载从 Cloud Foundry 带到 Kubernetes,以及 [Tackle][16],分析 Java 应用,使其对 Kubernetes 等容器化平台中的运行时更加标准和便携,从而使其现代化。 +[Konveyor.io][13] 是一个开源项目,帮助现有工作负载(开发、测试和生产)过渡到 Kubernetes。其工具包括将容器从一个 Kubernetes 平台转移到另一个平台的 [Crane][14];将工作负载从 Cloud Foundry 带到 Kubernetes的 [Move2Kube][15];以及分析 Java 应用,使其对 Kubernetes 等容器化平台中的运行时更加标准和可移植,从而使其现代化的 [Tackle][16]。 这些工具在转化模式中很有用,但许多项目希望在早期阶段利用 Kubernetes,以变得更加敏捷和富有成效。在基础设施方面,这些好处可能包括蓝/绿负载均衡、路由管理、声明式部署,或(取决于你的部署方式)由于不可变的基础设施而更容易升级。在开发方面,它们可能包括将持续集成/持续开发 (CI/CD) 管道与平台整合,使应用更快地投入生产,自我提供资源,或整合健康检查和监控。 -KubeVirt 可以通过在 Kubernetes 环境中作为虚拟机运行工作负载来帮助你。它能让你的工作负载迅速使用 Kubernetes,享受它的好处,并随着时间的推移稳步实现工作负载的现代化。但是,你仍然有一个问题,就是把你的虚拟机从传统的虚拟化平台带到现代的 Kubernetes 平台。这就是 Konveyor 的 [Forklift][17] 项目的意义所在。 +KubeVirt 可以通过在 Kubernetes 环境中以虚拟机来运行工作负载帮助你。它能让你的工作负载迅速使用 Kubernetes,享受它的好处,并随着时间的推移稳步实现工作负载的现代化。但是,仍然有一个问题,就是把你的虚拟机从传统的虚拟化平台带到现代的 Kubernetes 平台。这就是 Konveyor 的 [Forklift][17] 项目的意义所在。 ### 关于 Forklift -Forklift 使用 KubeVirt 将不同来源的虚拟化工作负载迁移到 Kubernetes。它被设计成使任务变得简单,以便你可以从一两台机器到数百台机器迁移任何东西。 +Forklift 使用 KubeVirt 将不同来源的虚拟化工作负载迁移到 Kubernetes。它的设计目标是使任务变得简单,以便你可以从一两台机器到数百台机器迁移任何东西。 迁移是一个简单的、三阶段的过程: 1. 连接到一个现有的虚拟化平台(称为“源提供者”)和一个 Kubernetes 环境(“目标提供者”)。 - 2. 将网络和存储资源从源提供者映射到目标提供者,在两者中寻找相同的资源。 + 2. 将网络和存储资源从源提供者映射到目标提供者,在两者中寻找等价的资源。 3. 选择要迁移的虚拟机,分配网络和存储映射,制定迁移计划。然后运行它。 - - ### 如何开始 要开始使用 Forklift,首先,你需要一个兼容的源提供商。你还需要一个带有 KubeVirt 0.40 或更新版本的 Kubernetes 环境和裸机节点(尽管为了测试,你可以使用嵌套虚拟化)。用读-写-执行 (RWX) 功能配置你的存储类,并使用 [Multus][18] 配置你的网络,以匹配你的虚拟机在源提供者中使用的网络。(如果你不能这样做,也不用担心。你也可以选择重新分配 IP 地址。) -最后,使用提供的操作者在你的 Kubernetes 上[安装 Forklift][19],并进入用户界面,开始运行你的第一次测试迁移。 +最后,使用提供的操作器在你的 Kubernetes 上[安装 Forklift][19],并进入用户界面,开始运行你的第一次测试迁移。 -Forklift 是 Red Hat 的[虚拟化迁移工具套件][20]的上游版本。因此,如果你想在生产环境中使用它,你可以考虑使用该工具的支持版本。 +Forklift 是 Red Hat 的 [虚拟化迁移工具套件][20] 的上游版本。因此,如果你想在生产环境中使用它,你可以考虑使用该工具的支持版本。 迁移愉快! @@ -67,7 +67,7 @@ via: https://opensource.com/article/21/6/migrate-vms-kubernetes-forklift 作者:[Miguel Perez Colino][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 32193b1fff3d70e2656ce4517212d64a7ea0d2ab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 25 Jun 2021 11:31:21 +0800 Subject: [PATCH 193/870] PUB @geekpi https://linux.cn/article-13520-1.html --- ...grate virtual machines to Kubernetes with this new tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210616 Migrate virtual machines to Kubernetes with this new tool.md (98%) diff --git a/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md b/published/20210616 Migrate virtual machines to Kubernetes with this new tool.md similarity index 98% rename from translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md rename to published/20210616 Migrate virtual machines to Kubernetes with this new tool.md index 562619fcc4..97814b89e0 100644 --- a/translated/tech/20210616 Migrate virtual machines to Kubernetes with this new tool.md +++ b/published/20210616 Migrate virtual machines to Kubernetes with this new tool.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13520-1.html) 用 Forklift 将虚拟机迁移到 Kubernetes 上 ====== From 2678042d4c0c7e0587b531c4e9e9ecd66b9e0b8d Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 25 Jun 2021 13:26:07 +0800 Subject: [PATCH 194/870] translated --- .../tech/20210614 What is a CI-CD pipeline.md | 83 ------------------- .../tech/20210614 What is a CI-CD pipeline.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20210614 What is a CI-CD pipeline.md create mode 100644 translated/tech/20210614 What is a CI-CD pipeline.md diff --git a/sources/tech/20210614 What is a CI-CD pipeline.md b/sources/tech/20210614 What is a CI-CD pipeline.md deleted file mode 100644 index 563fcb149b..0000000000 --- a/sources/tech/20210614 What is a CI-CD pipeline.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: subject: (What is a CI/CD pipeline?) -[#]: via: (https://opensource.com/article/21/6/what-cicd-pipeline) -[#]: author: (Will Kelly https://opensource.com/users/willkelly) -[#]: collector: (lujun9972) -[#]: translator: (baddate) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What is a CI/CD pipeline? -====== -How you define a continuous integration/continuous deployment pipeline -depends on your organization's requirements. -![Plumbing tubes in many directions][1] - -A continuous integration/continuous deployment (CI/CD) pipeline is an anchor for every DevOps initiative. The CI/CD pipeline breaks down traditional silos and enables development and operations teams to collaborate throughout the entire software development lifecycle. - -Better yet, moving to DevOps and a CI/CD pipeline can help your organization [deliver software][2] more securely at a higher velocity. - -### Breaking down the CI/CD pipeline - -There are many definitions of CI/CD pipelines out there, so I always advise organizations to define their own version of a CI/CD pipeline and other DevOps concepts rather than using someone else's. Open source CI/CD tools give you the freedom and options to construct a CI/CD pipeline that meets your organization's requirements. - -The stages that form a CI/CD pipeline are distinct subsets of tasks grouped into _pipeline stages_. Typical pipeline stages include: - - * **Build:** Developers compile the application code.  - * **Test**: The quality assurance (QA) team tests the application code using automated testing tools and strategies.  - * **Release:** The development team delivers the application code to the code repository. - * **Deploy**: The DevOps team stages application code to production.  - * **Security and compliance**: The QA team validates a build based on the project's requirements. This is the stage where organizations deploy container-scanning tools that check the quality of images against Common Vulnerabilities and Exposures (CVEs).  - - - -These are standard stages for a CI/CD pipeline, yet some organizations adapt the CI/CD pipeline model to fit their requirements. For example, an organization building applications for the healthcare market, with its stringent compliance standards, may distribute the test, validation, and compliance gates throughout their toolchain. - -Other examples might be an organization that depends on a complex software supply chain with open source software (OSS). Commercial components may institute a gate where development team members generate a [software bill of materials][3] (SBOM) for OSS packages or the outside commercial software vendor must deliver an SBOM as part of their contract deliverable. - -### Barriers to CI/CD pipelines - -Implementing a CI/CD pipeline changes a team's processes and culture. While many developers are receptive to automation of some tasks and testing, people can be a barrier to CI/CD adoption. - -Moving from a waterfall process to CI/CD can shake up the fundamental and implied power structure in some organizations. Since a CI/CD pipeline increases software delivery velocity, the "gatekeepers" of your old manual process may feel threatened by this change. - -### Integration opportunities - -The open source roots of the tools comprising a CI/CD toolchain create opportunities for some exciting integrations as you achieve greater DevOps maturity levels in your culture, processes, and tooling. - -Analyst firm Forrester predicted in 2020 that just-in-time learning will join the CI/CD pipeline. It makes sense if you think about it. It makes even more sense in the current era of remote work and even for remote onboarding of new employees. For instance, an organization could integrate a documentation wiki into its pipeline with documentation of internal processes. - -A more ambitious organization can integrate a learning management system (LMS) such as [Moodle][4] into its CI/CD pipeline. It could use the LMS to publish short videos about new DevOps toolchain features that developers need to learn as they onboard or when tools are updated across the pipeline. - -Some organizations are integrating group chat and other collaboration tools directly into their CI/CD pipelines. The chat platform serves alerts and enables collaboration and communication among teams. Integrating Mattermost, Rocket.Chat, or another [enterprise chat][5] platform into your CI/CD pipeline requires upfront planning and analysis to ensure that pipeline users won't drown in alerts. - -Another integration opportunity to explore is building analytics and advanced reporting into your CI/CD pipeline. This helps you harness the data that courses through your pipeline. - -### Final thoughts - -The CI/CD pipeline is foundational to DevOps. And open source makes it adaptable and flexible to new requirements resulting from operational changes you implement during your DevOps journey. - -I hope to see an open source response to the unified DevOps platform trend, in which organizations seek an end-to-end CI/CD solution. The makings of such a solution are out there. After all, GitLab and GitHub trace their platforms back to open source roots. - -Lastly, don't forget the education and outreach underlying every successful CI/CD toolchain. Documenting your toolchains and accompanying processes will improve developer onboarding and ongoing DevOps team training. - -How do you and your organization define your CI/CD toolchain? Please share your feedback in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/what-cicd-pipeline - -作者:[Will Kelly][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/willkelly -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) -[2]: https://techbeacon.com/devops/5-reasons-why-cicd-vital-your-organizations-value-stream -[3]: https://www.ntia.gov/SBOM -[4]: https://moodle.org/ -[5]: https://opensource.com/alternatives/slack diff --git a/translated/tech/20210614 What is a CI-CD pipeline.md b/translated/tech/20210614 What is a CI-CD pipeline.md new file mode 100644 index 0000000000..94148e3d1c --- /dev/null +++ b/translated/tech/20210614 What is a CI-CD pipeline.md @@ -0,0 +1,82 @@ +[#]: subject: (What is a CI/CD pipeline?) +[#]: via: (https://opensource.com/article/21/6/what-cicd-pipeline) +[#]: author: (Will Kelly https://opensource.com/users/willkelly) +[#]: collector: (lujun9972) +[#]: translator: (baddate) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +CI/CD 管道是什么? +====== + +你如何定义持续集成/持续部署管道取决于你组织的要求。 +![Plumbing tubes in many directions][1] + +持续集成/持续部署 (CI/CD) 管道是每个 DevOps 计划的基础。 CI/CD 管道打破了传统的开发孤岛,使开发和运营团队能够在整个软件开发生命周期中进行协作。 + +更好的是,转向 DevOps 和 CI/CD 管道可以帮助你的组织以更高的速度更安全地[交付软件][2]。 +### Breaking down the CI/CD pipeline + +CI/CD 管道有很多定义,所以我总是建议组织定义自己的 CI/CD 管道版本和其他 DevOps 概念,而不是使用其他人的。开源 CI/CD 工具为你提供构建满足组织要求的 CI/CD 管道的自由和选择。 + +形成 CI/CD 管道的阶段是将不同的任务子集分组为 _管道阶段_。典型的管道阶段包括: + + * **构建**:开发人员编译应用程序代码。 + * **测试**:质量保证 (QA) 团队使用自动化测试工具和策略测试应用程序代码。 + * **发布**:开发团队将应用程序代码交付到代码库。 + * **部署**:DevOps 团队将应用程序代码分阶段投入生产。 + * **安全性和合规性**:QA 团队根据项目要求验证构建。这是组织部署容器扫描工具的阶段,这些工具根据常见漏洞和暴露 (CVE) 检查图像的质量。 + + + + +这些是 CI/CD 管道的标准阶段,但一些组织调整 CI/CD 管道模型以满足他们的要求。例如,为医疗保健市场构建应用程序的组织,具有严格的合规性标准,可以在整个工具链中分发测试、验证和合规性门。 + +其他示例可能是依赖于具有开源软件 (OSS) 的复杂软件供应链的组织。商业组件可能会设立一个门槛,开发团队成员可以在其中为 OSS 包生成[软件物料清单][3] (SBOM),或者外部商业软件供应商必须将 SBOM 作为其合同可交付成果的一部分进行交付。 +### CI/CD 管道的障碍 + +实施 CI/CD 管道会改变团队的流程和文化。尽管许多开发人员愿意接受某些任务和测试的自动化,但人员可能成为采用 CI/CD 的障碍。 + +从瀑布式流程转向 CI/CD 可能会动摇某些组织中基本的和隐含的权力结构。由于 CI/CD 管道提高了软件交付速度,旧手动流程的“守门人”可能会受到这种变化的威胁。 + +### 整合机会 + +随着你在文化、流程和工具中达到更高的 DevOps 成熟度水平,包含 CI/CD 工具链的工具的开源根源为一些激动人心的集成创造了机会。 + +分析公司 Forrester 在 2020 年预测,即时学习将加入 CI/CD 管道。如果你考虑一下,会发现这是有道理的。在当前远程工作的时代,甚至对于新员工的远程入职,这更有意义。例如,组织可以将文档 wiki 与内部流程文档集成到其管道中。 + +更雄心勃勃的组织可以将学习管理系统 (LMS)(例如 [Moodle][4])集成到其 CI/CD 管道中。它可以使用 LMS 发布有关新 DevOps 工具链功能的简短视频,开发人员在加入时或在整个管道中更新工具时需要学习这些功能。 + +一些组织正在将群聊和其他协作工具直接集成到他们的 CI/CD 管道中。聊天平台提供警报并支持团队之间的协作和沟通。将 Mattermost、Rocket.Chat 或其他[企业聊天][5]平台集成到你的 CI/CD 管道中需要预先规划和分析,以确保管道用户不会被警报淹没。 + +另一个需要探索的集成机会是将分析和高级报告构建到你的 CI/CD 管道中。这有助于你利用通过管道传输的数据。 + +### 最后的想法 + +CI/CD 管道是 DevOps 的基础。开源使其能够适应并灵活地满足你在 DevOps 之旅中实施的运营变更所产生的新需求。 + +我希望看到对统一 DevOps 平台趋势的开源响应,在这种趋势中,组织寻求端到端的 CI/CD 解决方案。这种解决方案的要素就在那里。毕竟,GitLab 和 GitHub 将他们的平台追溯到开源根源。 + +最后,不要忘记每一个成功的 CI/CD 工具链背后的教育和外展。记录你的工具链和相关流程将改善开发人员入职和持续的 DevOps 团队培训。 + +你和你的组织如何定义你的 CI/CD 工具链?请在评论中分享你的反馈。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/what-cicd-pipeline + +作者:[Will Kelly][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/baddate) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) +[2]: https://techbeacon.com/devops/5-reasons-why-cicd-vital-your-organizations-value-stream +[3]: https://www.ntia.gov/SBOM +[4]: https://moodle.org/ +[5]: https://opensource.com/alternatives/slack From 61498da5c2e11753b64c90faf6253a1c282bfa2d Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Fri, 25 Jun 2021 14:05:27 +0800 Subject: [PATCH 195/870] Update 20200914 Use Python to solve a charity-s business problem.md --- ...n to solve a charity-s business problem.md | 262 +++++++++--------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/sources/tech/20200914 Use Python to solve a charity-s business problem.md b/sources/tech/20200914 Use Python to solve a charity-s business problem.md index f0803cbb17..f30612f329 100644 --- a/sources/tech/20200914 Use Python to solve a charity-s business problem.md +++ b/sources/tech/20200914 Use Python to solve a charity-s business problem.md @@ -1,200 +1,200 @@ -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use Python to solve a charity's business problem) -[#]: via: (https://opensource.com/article/20/9/solve-problem-python) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Use Python to solve a charity's business problem" +[#]: via: "https://opensource.com/article/20/9/solve-problem-python" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" -Use Python to solve a charity's business problem +使用 Python 来解决慈善机构的业务问题 ====== -Comparing how different programming languages solve the same problem is -fun and instructive. Next up, Python. + +比较不同的编程语言如何解决同一个问题是一个很有趣的事情,也很有指导意义。接下来,我们就来讲一讲 Python。 ![Python programming language logo with question marks][1] -In my [first article][2] in this series, I described a problem of dividing bulk supplies into hampers of similar value to distribute to struggling neighbors in your community. I also wrote about how I enjoy solving small problems like this with small programs in various languages and comparing how they do it. +在我这一系列的[第一篇文章][2]里,我描述了这样子的一个问题,如何将一大批的救助物资分为具有相同价值的物品,并将其分发给社区中的困难住户。我也曾写过用不同的编程语言写一些小程序来解决这样子的小问题以及比较这些程序时如何工作的。 -In the first article, I solved this problem with the [Groovy][3] programming language. Groovy is like [Python][4] in many ways, but syntactically it's more like C and Java. Therefore, it should be interesting and instructive to create the same solution in Python. +在第一篇文章中,我是使用了 [Groovy][3] 语言来解决问题的。Groovy 在很多方面都与 [Python][4] 很相似,但是在语法上她更像 C 语言和 Java。因此,使用 Python 来创造一个相同的解决方案应该会很有趣且更有意义。 -### The Python solution +### 使用 Python 的解决方案 -In Java, I declare utility classes to hold tuples of data (the new record feature is going to be great for that). In Groovy, I use the language support for maps, and I follow the same approach in Python. +使用 Java 时,我会声明一个 utility 类来保存元组数据(新的特征记录器将会很好地解决这个问题)。使用 Groovy 时,我就是用了 maps 中的映射,我也将在 Python 使用相同的映射 -Use a list of dictionaries to hold the bulk items picked up from the wholesaler: +使用一个字典来保存从批发商处批发来的货物: ``` packs = [ -        {'item':'Rice','brand':'Best Family','units':10,'price':5650,'quantity':1}, -        {'item':'Spaghetti','brand':'Best Family','units':1,'price':327,'quantity':10}, -        {'item':'Sardines','brand':'Fresh Caught','units':3,'price':2727,'quantity':3}, -        {'item':'Chickpeas','brand':'Southern Style','units':2,'price':2600,'quantity':5}, -        {'item':'Lentils','brand':'Southern Style','units':2,'price':2378,'quantity':5}, -        {'item':'Vegetable oil','brand':'Crafco','units':12,'price':10020,'quantity':1}, -        {'item':'UHT milk','brand':'Atlantic','units':6,'price':4560,'quantity':2}, -        {'item':'Flour','brand':'Neighbor Mills','units':10,'price':5200,'quantity':1}, -        {'item':'Tomato sauce','brand':'Best Family','units':1,'price':190,'quantity':10}, -        {'item':'Sugar','brand':'Good Price','units':1,'price':565,'quantity':10}, -        {'item':'Tea','brand':'Superior','units':5,'price':2720,'quantity':2}, -        {'item':'Coffee','brand':'Colombia Select','units':2,'price':4180,'quantity':5}, -        {'item':'Tofu','brand':'Gourmet Choice','units':1,'price':1580,'quantity':10}, -        {'item':'Bleach','brand':'Blanchite','units':5,'price':3550,'quantity':2}, -        {'item':'Soap','brand':'Sunny Day','units':6,'price':1794,'quantity':2}] + {'item':'Rice','brand':'Best Family','units':10,'price':5650,'quantity':1}, + {'item':'Spaghetti','brand':'Best Family','units':1,'price':327,'quantity':10}, + {'item':'Sardines','brand':'Fresh Caught','units':3,'price':2727,'quantity':3}, + {'item':'Chickpeas','brand':'Southern Style','units':2,'price':2600,'quantity':5}, + {'item':'Lentils','brand':'Southern Style','units':2,'price':2378,'quantity':5}, + {'item':'Vegetable oil','brand':'Crafco','units':12,'price':10020,'quantity':1}, + {'item':'UHT milk','brand':'Atlantic','units':6,'price':4560,'quantity':2}, + {'item':'Flour','brand':'Neighbor Mills','units':10,'price':5200,'quantity':1}, + {'item':'Tomato sauce','brand':'Best Family','units':1,'price':190,'quantity':10}, + {'item':'Sugar','brand':'Good Price','units':1,'price':565,'quantity':10}, + {'item':'Tea','brand':'Superior','units':5,'price':2720,'quantity':2}, + {'item':'Coffee','brand':'Colombia Select','units':2,'price':4180,'quantity':5}, + {'item':'Tofu','brand':'Gourmet Choice','units':1,'price':1580,'quantity':10}, + {'item':'Bleach','brand':'Blanchite','units':5,'price':3550,'quantity':2}, + {'item':'Soap','brand':'Sunny Day','units':6,'price':1794,'quantity':2}] ``` -There is one bulk pack of 10 bags of rice and 10 bulk packs with one bag each of spaghetti. In the above, the variable `packs` is set to a Python list of dictionaries. This turns out to be very similar to the Groovy approach. A few points worth noting about the difference between Groovy and Python: +大米有一包,每包中有 10 袋大米,意大利面条有十包,每包中有一袋意大利面条。上述代码中,变量 `packs` 被设置为 Python 字典列表。这与Groovy的方法非常相似。关于 Groovy 和 Python 之间的区别,有几点需要注意: - 1. In Python, there is no keyword used to define the variable `packs`; Python expects the first use to set a value. - 2. Python dictionary keys (e.g., `item`, `brand`, `units`, `price`, `quantity`) require quotes to indicate they are strings; Groovy assumes these are strings, but accepts quotes as well. - 3. In Python, the notation `{ … }` indicates a dictionary declaration; Groovy uses the same square brackets as a list, but the structure in both cases must have key-value pairs. + 1. 在 Python 中,无需关键字来定义变量 `packs`,Python 变量初始化时需要设置一个值。 + 2. Python 字典中的词键(例如,`item`, `brand`, `units`, `price`, `quantity`)需要引号来表明它们是字符串;Groovy 假定这些是字符串,但也接受引号。 + 3. 在 Python 中,符号 `{ ... }` 表明一个字典声明; Groovy 使用与列表相同的方括号,但两种情况下的结构都必须具有键值对。 -And, yes, those prices aren't in US dollars. +当然,表中的价格不是以美元计算的。 -Next, unpack the bulk packages. Unpacking the single bulk package of rice, for example, will yield 10 units of rice; that is, the total number of units yielded is `units * quantity`. The Groovy script uses a handy function called `collectMany` that can be used to flatten out lists of lists. As far as I know, Python doesn't have anything similar, so use two list comprehensions to produce the same result: +接下来,打开散装包。 例如,打开大米的单个散装包装,将产出 10 单位大米; 也就是说,产出的单位总数是`单位 * 数量`。 Groovy 脚本使用一个名为 `collectMany` 的方便的函数,该函数可用于展平列表列表。 据我所知,Python 没有类似的东西,所以使用两个列表推导式来产生相同的结果: ``` units = [[{'item':pack['item'],'brand':pack['brand'], -        'price':(pack['price'] / pack['units'])}] * -        (pack['units'] * pack['quantity']) for pack in packs] + 'price':(pack['price'] / pack['units'])}] * + (pack['units'] * pack['quantity']) for pack in packs] units = [x for sublist in units for x in sublist] ``` -The first list comprehension (assignment to units) builds the list of lists of dictionaries. The second "flattens" that into just a list of dictionaries. Note that both Python and Groovy provide an `*` operator that takes a list on the left and a number `N` on the right and replicates the list `N` times. +第一个列表可理解为(分配给单元)构建字典列表列表。 第二个将其“扁平化”为字典列表。 请注意,Python 和 Groovy 都提供了一个 `*` 运算符,它接受左侧的列表和右侧的数字 `N`,并复制列表 `N` 次。 -The final step is to repack the units into the hampers for distribution. As in the Groovy version, you need to get a bit more specific about the ideal hamper value, and you might as well not be overly restrictive when you get down to just a few units left: +后一步是将这些单位的大米之类的重新包装到 hamper 中以进行分发。 就像在 Groovy 版本中一样,您需要更具体地了解理想的 hamper 值,当您只剩下几个单位时,您最好不要过度限制,即可以做一些随机分配: -``` +```python valueIdeal = 5000 valueMax = valueIdeal * 1.1 ``` -OK! Repack the hampers: +很好! 重新包装包裹。 -``` +```python import random -hamperNumber = 0           # [1] -while len(units) > 0:      # [2] -    hamperNumber += 1 -    hamper = [] -    value = 0 -    canAdd = True              # [2.1] -    while canAdd:              # [2.2] -        u = random.randint(0,len(units)-1)  # [2.2.1] -        canAdd = False                      # [2.2.2] -        o = 0                               # [2.2.3] -        while o < len(units):               # [2.2.4] -            uo = (u + o) % len(units) -            unit = units[uo] -            unitPrice = unit['price']          # [2.2.4.1] -            if len(units) < 3 or not (unit in hamper) and (value + unitPrice) < valueMax: -                                               # [2.2.4.2] -                hamper.append(unit) -                value += unitPrice -                units.pop(u)                   # [2.2.4.3] -                canAdd = len(units) > 0 -                break                          # [2.2.4.4] -            o += 1                             # [2.2.4.5] -                                            # [2.2.5] -    print('') -    print('Hamper',hamperNumber,'value',value) -    for item in hamper: -        print('%-25s%-25s%7.2f' % (item['item'],item['brand'],item['price'])) # [2.3] -    print('Remaining units',len(units))                                       # [2.4] +hamperNumber = 0 # [1] +while len(units) > 0: # [2] + hamperNumber += 1 + hamper = [] + value = 0 + canAdd = True # [2.1] + while canAdd: # [2.2] + u = random.randint(0,len(units)-1) # [2.2.1] + canAdd = False # [2.2.2] + o = 0 # [2.2.3] + while o < len(units): # [2.2.4] + uo = (u + o) % len(units) + unit = units[uo] + unitPrice = unit['price'] # [2.2.4.1] + if len(units) < 3 or not (unit in hamper) and (value + unitPrice) < valueMax: + # [2.2.4.2] + hamper.append(unit) + value += unitPrice + units.pop(u) # [2.2.4.3] + canAdd = len(units) > 0 + break # [2.2.4.4] + o += 1 # [2.2.4.5] + # [2.2.5] + print('') + print('Hamper',hamperNumber,'value',value) + for item in hamper: + print('%-25s%-25s%7.2f' % (item['item'],item['brand'],item['price'])) # [2.3] + print('Remaining units',len(units)) # [2.4] ``` -Some clarification, with numbers in brackets in the comments above (e.g., _[1]_) corresponding to the clarifications below: +一些澄清,上面注释中括号中的数字(例如,_[1]_)对应于以下澄清: - * 1\. Import Python's random number generator facilities and initialize the hamper number. - * 2\. This `while` loop will redistribute units into hampers as long as there are more available: - * 2.1 Increment the hamper number, get a new empty hamper (a list of units), and set its value to 0; start off assuming you can add more items to the hamper. - * 2.2 This `while` loop will add as many units to the hamper as possible (the Groovy code used a `for` loop, but Python's `for` loops expect to iterate over something, while Groovy has the more traditional C form of `for` loop): - * 2.2.1 Get a random number between zero and the number of remaining units minus 1. - * 2.2.2 Assume you can't find more units to add. - * 2.2.3 Create a variable to be used for the offset from the starting point where you're looking for items to put in the hamper. - * 2.2.4 Starting at the randomly chosen index, this `while` loop will try to find a unit that can be added to the hamper (once again, note that the Python `for` loop probably isn't suitable here since the length of the list will change during processing). - * 2.2.4.1. Figure out which unit to look at (random starting point + offset) and get its price. - * 2.2.4.2 You can add this unit to the hamper if there are only a few left or if the value of the hamper isn't too high once the unit is added. - * 2.2.4.3 Add the unit to the hamper, increment the hamper value by the unit price, remove the unit from the available units list. - * 2.2.4.4 As long as there are units left, you can add more, so break out of this loop to keep looking. - * 2.2.4.5 Increment the offset. - * 2.2.5 On exit from this `while` loop, if you inspected every remaining unit and could not find one to add to the hamper, the hamper is complete; otherwise, you found one and can continue looking for more. - * 2.3 Print out the contents of the hamper. - * 2.4 Print out the remaining units info. + * 1\. 导入 Python 的随机数生成器工具并初始化 hampers 数。 + * 2\. 只要有更多可用的单元,这个`while` 循环就会将单元重新分配到 hampers 中: + * 2.1 增加 hamper 编号,得到一个新的空hamper(单位列表),并将其值设为0; 开始假设您可以向 hamper 中添加更多物品。 + * 2.2 这个 `while` 循环将尽可能多地向 Hamper 添加单元(Groovy 代码使用了 `for` 循环,但 Python 的 `for` 循环期望迭代某些东西,而 Groovy 则是为更传统的 C 形式的 `for` 循环形式): + * 2.2.1 获取一个介于 0 和剩余单位数减 1 之间的随机数。 + * 2.2.2 假设您找不到更多要添加的单位。 + * 2.2.3 创建一个变量,用于从您正在寻找要放入 hamper 中的物品的起点的偏移量。 + * 2.2.4 从随机选择的索引开始,这个 `while` 循环将尝试找到一个可以添加到 hamper 的单元(再次注意,Python `for` 循环可能不适合这里,因为列表的长度将在迭代中中发生变化)。 + * 2.2.4.1 找出要查看的单位(随机起点+偏移量)并获得其价格。 + * 2.2.4.2 如果只剩下几个,或者添加单位后篮子的价值不太高,您可以将此单位添加到 Hamper 中。 + * 2.2.4.3 将单位添加到 Hamper 中,按单价增加 Hamper 价值,从可用单位列表中删除该单位。 + * 2.2.4.4 只要还有剩余单位,您就可以添加更多单位,因此可以跳出此循环继续寻找。 + * 2.2.4.5 增加偏移量,。 + * 2.2.5 在退出这个 `while` 循环时,如果你检查了所有剩余的单元并且找不到单元可以添加到 hamper 中,那么 hamper 就完成了搜索; 否则,您找到了一个,可以继续寻找更多。 + * 2.3 打印出 hamper 的内容。 + * 2.4 打印出剩余的单位信息。 -When you run this code, the output looks quite similar to the output from the Groovy program: +运行此代码时,输出看起来与 Groovy 程序的输出非常相似: -``` +```python Hamper 1 value 5304.0 -UHT milk                 Atlantic                  760.00 -Tomato sauce             Best Family               190.00 -Rice                     Best Family               565.00 -Coffee                   Colombia Select          2090.00 -Sugar                    Good Price                565.00 -Vegetable oil            Crafco                    835.00 -Soap                     Sunny Day                 299.00 +UHT milk Atlantic 760.00 +Tomato sauce Best Family 190.00 +Rice Best Family 565.00 +Coffee Colombia Select 2090.00 +Sugar Good Price 565.00 +Vegetable oil Crafco 835.00 +Soap Sunny Day 299.00 Remaining units 148 Hamper 2 value 5428.0 -Tea                      Superior                  544.00 -Lentils                  Southern Style           1189.00 -Flour                    Neighbor Mills            520.00 -Tofu                     Gourmet Choice           1580.00 -Vegetable oil            Crafco                    835.00 -UHT milk                 Atlantic                  760.00 +Tea Superior 544.00 +Lentils Southern Style 1189.00 +Flour Neighbor Mills 520.00 +Tofu Gourmet Choice 1580.00 +Vegetable oil Crafco 835.00 +UHT milk Atlantic 760.00 Remaining units 142 Hamper 3 value 5424.0 -Soap                     Sunny Day                 299.00 -Chickpeas                Southern Style           1300.00 -Sardines                 Fresh Caught              909.00 -Rice                     Best Family               565.00 -Vegetable oil            Crafco                    835.00 -Spaghetti                Best Family               327.00 -Lentils                  Southern Style           1189.00 +Soap Sunny Day 299.00 +Chickpeas Southern Style 1300.00 +Sardines Fresh Caught 909.00 +Rice Best Family 565.00 +Vegetable oil Crafco 835.00 +Spaghetti Best Family 327.00 +Lentils Southern Style 1189.00 Remaining units 135 … Hamper 21 value 5145.0 -Tomato sauce             Best Family               190.00 -Tea                      Superior                  544.00 -Chickpeas                Southern Style           1300.00 -Spaghetti                Best Family               327.00 -UHT milk                 Atlantic                  760.00 -Vegetable oil            Crafco                    835.00 -Lentils                  Southern Style           1189.00 +Tomato sauce Best Family 190.00 +Tea Superior 544.00 +Chickpeas Southern Style 1300.00 +Spaghetti Best Family 327.00 +UHT milk Atlantic 760.00 +Vegetable oil Crafco 835.00 +Lentils Southern Style 1189.00 Remaining units 4 Hamper 22 value 2874.0 -Sardines                 Fresh Caught              909.00 -Vegetable oil            Crafco                    835.00 -Rice                     Best Family               565.00 -Rice                     Best Family               565.00 +Sardines Fresh Caught 909.00 +Vegetable oil Crafco 835.00 +Rice Best Family 565.00 +Rice Best Family 565.00 Remaining units 0 ``` -The last hamper is abbreviated in contents and value. +最后一个 hamper 在内容和价值上有所简化。 -### Closing thoughts +### 结论 -At a glance, there isn't a whole lot of difference between the Python and Groovy versions of this program. Both have a similar set of constructs that make handling lists and dictionaries very straightforward. Neither requires a lot of "boilerplate code" or other "ceremonial" actions. +乍一看,这个程序的 Python 和 Groovy 版本之间没有太大区别。 两者都有一组相似的结构,这使得处理列表和字典非常简单。 两者都不需要很多“样板代码”或其他“繁杂”操作。 -Also, as in the Groovy example, there is some fiddly business about being able to add units to the hamper. Basically, you pick a random position in the list of units and, starting at that position, iterate through the list until you either find a unit whose price allows it to be included or until you exhaust the list. Also, when there are only a few items left, you just toss them into the last hamper. +此外,使用 Groovy 时,向 Hamper 中添加单元还是一件比较繁琐的事情。 您需要在单位列表中随机选择一个位置,然后从该位置开始,遍历列表,直到找到一个价格允许的且包含它的单位,或者直到您用完列表为止。 当只剩下几件物品时,您需要将它们扔到最后一个 Hamper 里。 -Another issue worth mentioning: This isn't a particularly efficient approach. Removing elements from lists, being careless about repeated expressions, and a few other things make this less suitable for a huge redistribution problem. Still, it runs in a blink on my old machine. +另一个值得一提的问题是:这不是一种特别有效的方法。 从列表中删除元素、极其多的重复表达式还有一些其它的问题使得这不太适合解决这种大数据重新分配问题。 尽管如此,它仍然在我的老机器上运行。 -If you are shuddering at my use of `while` loops and mutating the data in this code, you probably wish I made it more functional. I couldn't think of a way to use map and reduce features in Python in conjunction with a random selection of units for repackaging. Can you? +如果你觉得我在这段代码中使用 `while` 循环并改变其中的数据感到不舒服,您可能希望我让它更有用一些。 我想不出一种方法不使用 Python 中的 map 和 reduce 函数,并结合随机选择的单元进行重新打包。 你可以吗? -In the next article, I'll re-do this in Java just to see how much less effort Groovy and Python are, and future articles will cover Julia and Go. +在下一篇文章中,我将使用 Java 重新执行此操作,以了解 Groovy 和 Python 的工作量减少了多少,未来的文章将介绍 Julia 和 Go。 -------------------------------------------------------------------------------- @@ -202,14 +202,14 @@ via: https://opensource.com/article/20/9/solve-problem-python 作者:[Chris Hermansen][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zepoch](https://github.com/zepoch) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/clhermansen [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r (Python programming language logo with question marks) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r "Python programming language logo with question marks" [2]: https://opensource.com/article/20/8/solving-problem-groovy [3]: https://groovy-lang.org/ [4]: https://www.python.org/ From ba6a7927bb53e550258c15cbed9f70d32d1dc9bd Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Fri, 25 Jun 2021 14:06:32 +0800 Subject: [PATCH 196/870] Rename sources/tech/20200914 Use Python to solve a charity-s business problem.md to translated/tech/20200914 Use Python to solve a charity-s business problem.md --- .../20200914 Use Python to solve a charity-s business problem.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20200914 Use Python to solve a charity-s business problem.md (100%) diff --git a/sources/tech/20200914 Use Python to solve a charity-s business problem.md b/translated/tech/20200914 Use Python to solve a charity-s business problem.md similarity index 100% rename from sources/tech/20200914 Use Python to solve a charity-s business problem.md rename to translated/tech/20200914 Use Python to solve a charity-s business problem.md From 757d2b6cbd004fdca0f476fd3b448819cd659324 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 25 Jun 2021 17:57:25 +0800 Subject: [PATCH 197/870] PRF @dcoliversun --- ...618 Systemd Timers for Scheduling Tasks.md | 89 +++++++++---------- 1 file changed, 41 insertions(+), 48 deletions(-) diff --git a/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md b/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md index f6d756b5aa..71f8494b6c 100644 --- a/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md +++ b/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md @@ -3,51 +3,48 @@ [#]: author: (Richard England https://fedoramagazine.org/author/rlengland/) [#]: collector: (lujun9972) [#]: translator: (dcoliversun) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -用于调度任务的 Systemd 定时器 +用于调度任务的 systemd 定时器 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202106/25/175650j4wrdw0z884iod80.jpg ) -Systemd 提供定时器有一段时间了,定时器替代了 _cron_ 功能,这一特性值得看看。本文将向你介绍在系统启动后如何使用 _systemd_ 中的定时器来运行任务,此后重复运行。这不是对 _systemd_ 的全面讨论,只是介绍这一特性。 +systemd 提供定时器有一段时间了,定时器替代了 cron 功能,这一特性值得看看。本文将向你介绍在系统启动后如何使用 systemd 中的定时器来运行任务,并在此后重复运行。这不是对 systemd 的全面讨论,只是对此特性的一个介绍。 -### Cron、anacron 与 systemd:快速回顾 +### 快速回顾:cron、anacron 与 systemd -_Cron_ 可以将任务调度以几分钟到几个月或更长时间的粒度运行。设置起来相对简单,只需要一个配置文件。虽然配置过程有些深奥,但一般用户也可以使用。 +cron 可以以几分钟到几个月或更长时间的粒度调度运行一个任务。设置起来相对简单,它只需要一个配置文件。虽然配置过程有些深奥,但一般用户也可以使用。 +然而,如果你的系统在需要执行的时间没有运行,那么 cron 会失败。 -然而,如果您的系统在需要执行的时间没有运行,那么 _Cron_ 会失败。 +anacron 克服了“系统没有运行”的问题。它确保任务将在你的系统再次启动时执行。虽然它旨在给管理员使用,但有些系统允许普通用户访问 anacron。 -_Anacron_ 克服了“系统不运行”问题。它确保你的系统再次启动时,任务将执行。虽然它旨在管理员使用,但有些系统允许普通用户访问 _Anacron_。 +但是,anacron 的执行频率不能低于每天一次。 -但是,_anacron_ 的执行频率不能低于每天一次。 +cron 和 anacron 都存在执行上下文一致性的问题。必须注意任务运行时有效的环境与测试时使用的环境完全相同。必须提供相同的 shell、环境变量和路径。这意味着测试和调试有时会很困难。 -_cron_ 和 _anacron_ 都存在执行上下文一致性的问题。必须注意任务运行时有效的环境与测试时使用的环境完全相同。必须提供相同的 shell、环境变量和路径。这意味着测试和调试有时会很困难。 +systemd 定时器提供了 cron 和 anacron 二者的优点,允许调度到分钟粒度。确保在系统再次运行时执行任务,即使在预期的执行时间内系统处于关闭状态。它对所有用户都可用。你可以在它将要运行的环境中测试和调试执行。 -_Systemd_ 定时器提供了 _cron_ 和 _anacron_ 的优点,允许调度到分钟粒度。确保在系统再次运行时执行任务,即使在预期的执行时间内任务处于关闭状态。对所有用户都可用。你可以在它将要运行的环境中测试和调试执行。 +但是,它的配置更加复杂,至少需要两个配置文件。 -但是,配置更加复杂,至少需要两个配置文件。 - -如果你的 _cron_ and _anacron_ 配置很好地为你服务,那么可能没有理由改变。但是 _systemd_ 至少值得研究,因为它可以简化任何当前的 _cron_/_anacron_ 工作方式。 +如果你的 cron 和 anacron 配置可以很好地为你服务,那么可能没有理由改变。但是 systemd 至少值得研究,因为它可以简化任何当前的 cron/anacron 工作方式。 ### 配置 -_Systemd_ 定时器执行的函数至少需要两个文件。这两个是“定时器timer unit”和“系统服务service unit”。动作不仅仅是简单的命令,你还需要一个“作业”文件或脚本来执行必要的功能。 +systemd 定时器执行功能至少需要两个文件。这两个是“定时器单元timer unit”和“服务单元service unit”。(其执行的)“动作”不仅仅是简单的命令,你还需要一个“作业”文件或脚本来执行必要的功能。 -定时器文件定义调度表,而系统服务文件定义执行的任务。有关的更多详细信息参考 “man systemd.timer” 中提供的 .timer unit。服务单元的详细信息可在 “man systemd.service” 中找到。 +定时器单元文件定义调度表,而服务单元文件定义执行的任务。有关的更多详细信息请参考 `man systemd.timer` 中提供的 .timer 单元。服务单元的详细信息可在 `man systemd.service` 中找到。 -There are several locations where unit files exist (listed in the man page). Perhaps the easiest location for the general user, however, is “~/.config/systemd/user”. Note that “user” here, is the literal string “user”. -单元文件存在于几个位置(在 man page 中列出)。然而,对于普通用户来说,最容易找到的位置可能是 “~/.config/systemd/user”。请注意,这里的“用户”是字符串“用户”。 +单元文件存放在几个位置(在手册页中有列出)。然而,对于普通用户来说,最容易找到的位置可能是 `~/.config/systemd/user`。请注意,这里的 `user` 是字符串 `user`。 ### 示例 -此示例是一个创建用户调度作业而不是系统调度作业(以root用户身份运行)的简单示例。它将消息、日期和时间打印到文件中。 +此示例是一个创建用户调度作业而不是(以 root 用户身份运行的)系统调度作业的简单示例。它将消息、日期和时间打印到文件中。 - - 1. 首先创建一个执行任务的 shell 脚本。在你的本地 “bin” 目录中创建它,例如在 “~/bin/schedule-test.sh” 中。 +1、首先创建一个执行任务的 shell 脚本。在你的本地 `bin` 目录中创建它,例如在 `~/bin/schedule-test.sh` 中。 创建文件: @@ -55,7 +52,7 @@ There are several locations where unit files exist (listed in the man page). Per touch ~/bin/schedule-test.sh ``` -然后将以下内容添加到你刚刚创建的文件中。 +然后将以下内容添加到你刚刚创建的文件中: ``` #!/bin/sh @@ -64,9 +61,7 @@ echo "This is only a test: $(date)" >> "$HOME/schedule-test-output.txt" 记住赋予你的 shell 脚本执行权限。 - 2. 创建 .service 调用上面的脚本。在以下位置创建目录与文件:“~/.config/systemd/user/schedule-test.service - - +2、创建 .service 单元调用上面的脚本。在以下位置创建目录与文件:`~/.config/systemd/user/schedule-test.service`: ``` [Unit] @@ -80,17 +75,17 @@ ExecStart=/home//bin/schedule-test.sh WantedBy=default.target ``` -请注意<用户>应该是你的 @HOME 地址,但是资源文件路径名中的“用户”实际上是字符串“用户”。 +请注意 `` 应该是你的家目录地址,但是单元文件路径名中的 `user` 实际上是字符串 `user`。 -_ExecStart_ 应该提供一个没有变量的绝对地址。例外情况是,对于 _用户_,您可以用 “%h” 替换 $HOME。换句话说,你可以使用: +`ExecStart` 应该提供一个没有变量的绝对地址。例外情况是,对于用户单元文件,你可以用 `%h` 替换 `$HOME`。换句话说,你可以使用: ``` ExecStart=%h/bin/schedule-test.sh ``` -这仅用于用户文件。这不适用于系统服务,因为在系统环境中运行时 “%h” 总是返回 “/root”。其他替换可在“说明符”下的 “man systemd.unit” 中找到。因为它超出了本文的范围,所以这就是我们目前需要了解的关于说明符的全部内容。 +这仅用于用户单元文件,而不适用于系统服务,因为在系统环境中运行时 `%h` 总是返回 `/root`。其他特殊符号可在 `man systemd.unit` 的 `SPECIFIERS` 中找到。因为它超出了本文的范围,所以这就是我们目前需要了解的关于特殊符号的全部内容。 -3\. 创建一个 .timer 文件,该文件实际上调度你创建的 .service。在 .service 文件相同位置 “~/.config/systemd/user/schedule-test.timer” 创建它。请注意,文件名仅在拓展名上有所不同,例如一个是 “.service”,一个是 ".timer"。 +3、创建一个 .timer 单元文件,该文件实际上调度你创建的 .service 单元文件。在 .service 单元文件相同位置创建它:`~/.config/systemd/user/schedule-test.timer`。请注意,文件名仅在扩展名上有所不同,例如一个是 `.service`,一个是 `.timer`。 ``` [Unit] @@ -112,8 +107,7 @@ Unit=schedule-test.service WantedBy=timers.target ``` -请注意,.timer 文件使用了 “OnUnitActiveSec” 来指定调度表。“OnCalendar” 选项更加灵活。例如: - +请注意,这个 .timer 单元文件使用了 `OnUnitActiveSec` 来指定调度表。`OnCalendar` 选项更加灵活。例如: ``` # run on the minute of every minute every hour of every day @@ -127,9 +121,9 @@ WantedBy=timers.target OnCalendar=Thu,Fri 2012-*-1,5 11:12:13 ``` -有关 “OnCalendar” 的更多信息参见[这里][2]。 +有关 `OnCalendar` 的更多信息参见 [这里][2]。 -4\. 所有的部件都已就位,但你应该进行测试,以确保一切正常。首先,启用用户服务: +4、所有的部件都已就位,但你应该进行测试,以确保一切正常。首先,启用该用户服务: ``` $ systemctl --user enable schedule-test.service @@ -147,25 +141,24 @@ Created symlink /home//.config/systemd/user/default.target.wants/schedule- $ systemctl --user start schedule-test.service ``` -检查你的输出文件($HOME/schedule-test-output.txt),确保你的脚本运行正常。应该只有一个条目,因为我们还没有启动定时器。必要时进行调试。如果你需要更改 .service 文件,而不是更改它调用的 shell 脚本,请不要忘记再次启用该服务。 +检查你的输出文件(`$HOME/schedule-test-output.txt`),确保你的脚本运行正常。应该只有一个条目,因为我们还没有启动定时器。必要时进行调试。如果你需要更改 .service 单元文件,而不是更改它调用的 shell 脚本,请不要忘记再次启用该服务。 -5\. 一旦作业正常运行,通过为服务启用、启动用户定时器来实时调度作业: +5、一旦作业正常运行,通过为服务启用、启动用户定时器来实时调度作业: ``` $ systemctl --user enable schedule-test.timer $ systemctl --user start schedule-test.timer ``` -请注意,你已经在上面的步骤4中启动、启用了服务,因此只需要为它启用、启动定时器。 +请注意,你已经在上面的步骤 4 中启动、启用了服务,因此只需要为它启用、启动定时器。 -启用命令会产生如下输出: +`enable` 命令会产生如下输出: ``` Created symlink /home//.config/systemd/user/timers.target.wants/schedule-test.timer → /home//.config/systemd/user/schedule-test.timer. ``` -启动命令将返回命令行界面提示。 - +`start` 命令将只是返回命令行界面提示符。 ### 其他操作 @@ -195,17 +188,17 @@ $ systemctl --user reset-failed ### 总结 -本文以 _systemd_ 定时器为出发点,但是 _systemd_ 的内容远不止于此。这篇文章应该为你提供一个基础。你可以从[Fedora Magazine systemd系列][3]开始探索更多。 +本文以 systemd 定时器为出发点,但是 systemd 的内容远不止于此。这篇文章应该为你提供一个基础。你可以从 [Fedora Magazine systemd 系列][3] 开始探索更多。 -参考 —— 更多阅读: +### 参考 - * man systemd.timer - * man systemd.service +更多阅读: + + * `man systemd.timer` + * `man systemd.service` * [Use systemd timers instead of cronjobs][4] * [Understanding and administering systemd][5] - * 内有 systemd 快捷查询列表 - - + * 内有 systemd 速查表 -------------------------------------------------------------------------------- @@ -214,13 +207,13 @@ via: https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/ 作者:[Richard England][a] 选题:[lujun9972][b] 译者:[dcoliversun](https://github.com/dcoliversun) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://fedoramagazine.org/author/rlengland/ [b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/schedule_with_systemd_timer-816x345.jpg +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/schedule_withsystemdtimer-816x345.jpg [2]: https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Events [3]: https://fedoramagazine.org/what-is-an-init-system/ [4]: https://opensource.com/article/20/7/systemd-timers From 49a3de4167d170861798007897da98d27052abd0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 25 Jun 2021 17:58:29 +0800 Subject: [PATCH 198/870] PUB @dcoliversun https://linux.cn/article-13522-1.html --- .../20210618 Systemd Timers for Scheduling Tasks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210618 Systemd Timers for Scheduling Tasks.md (99%) diff --git a/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md b/published/20210618 Systemd Timers for Scheduling Tasks.md similarity index 99% rename from translated/tech/20210618 Systemd Timers for Scheduling Tasks.md rename to published/20210618 Systemd Timers for Scheduling Tasks.md index 71f8494b6c..6ce42556f9 100644 --- a/translated/tech/20210618 Systemd Timers for Scheduling Tasks.md +++ b/published/20210618 Systemd Timers for Scheduling Tasks.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (dcoliversun) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13522-1.html) 用于调度任务的 systemd 定时器 ====== From fea73e2ecf7514b84e37edd3a157c97eea31002a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 26 Jun 2021 05:03:12 +0800 Subject: [PATCH 199/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210625=20?= =?UTF-8?q?Mount=20cue/bin=20image=20files=20with=20CDemu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210625 Mount cue-bin image files with CDemu.md --- ...25 Mount cue-bin image files with CDemu.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20210625 Mount cue-bin image files with CDemu.md diff --git a/sources/tech/20210625 Mount cue-bin image files with CDemu.md b/sources/tech/20210625 Mount cue-bin image files with CDemu.md new file mode 100644 index 0000000000..21ed6d68d7 --- /dev/null +++ b/sources/tech/20210625 Mount cue-bin image files with CDemu.md @@ -0,0 +1,87 @@ +[#]: subject: (Mount cue/bin image files with CDemu) +[#]: via: (https://fedoramagazine.org/mount-cue-bin-image-files-with-cdemu/) +[#]: author: (Luca Rastelli https://fedoramagazine.org/author/luca247/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Mount cue/bin image files with CDemu +====== + +![][1] + +Photo by [Cameron Bunney][2] on [Unsplash][3] + +The other day I needed to burn a disc. Yeah, I know, some of you might be wondering, “A disc? What’s that?” Others might ask, “Are you really using that archaic media?” + +Well, yes I am. I feel there is still something charming about physical things that digital media cannot replace. + +I needed to burn a very old game that was comprised of a [cue file][4], some audio tracks in [cda format][5], and a [bin file][6] which stored all the binary content that was indexed by the cue file. + +First I tried to use [Brasero][7]. Yeah I know, it’s old but it does the job generally and it fits with the rest of the system, so it’s my choice generally. Unfortunately, this time it was not up to the task. It stated that it had some problems reading the cue file. Then I tried [Xfburn][8] and [K3b][9]. But neither of those worked either. They both detected the bin file but not the cda files. + +Next, I searched on the web and I found lots of posts explaining how to burn image files using command line applications. Or how to create [iso images][10] and then write those out to discs. These methods seemed excessively complex for what I wanted to do. Why all that difficulty for a task that should be easy as clicking on a button? Fedora Linux should be about freedom, not about difficulties! Although it can be used by experts, an easy way of doing things is always appreciated. + +I had almost surrendered. Then, in a forum post buried under all the suggestions mentioned previously, I found the answer I was looking for – [CDemu][11]. + +Those familiar with [Daemon Tools][12] may find CDemu to be similar. I find CDemu to be even easier and far less bloated. With CDemu, you can mount cue images with the classic double-click. Sounds easy? Well that’s because it actually is. + +CDemu is not present in Fedora Linux’s default repositories. So if you want to try it out, you will have to use the [rok/cdemu][13] Copr repository that is compatible with your version of Fedora Linux. + +**Note**: _Copr is not officially supported by Fedora infrastructure. Use packages at your own risk._ + +Open a terminal and enable the Copr repo by entering the following command. + +``` +$ sudo dnf copr enable rok/cdemu +``` + +Then install the daemon and the clients by entering the following commands. + +``` +$ sudo dnf install cdemu-daemon +$ sudo dnf install cdemu-client +$ sudo dnf install gcdemu +``` + +Next, enter the following commands to ensure the right kernel module is available and loaded. + +``` +$ sudo akmods +$ sudo systemctl restart systemd-modules-load.service +``` + +Now CDemu is installed. To associate it with your CD images, you just need to right-click on a file type that you want to mount with CDemu, select _properties_, and the select _Open with CDemu_. Now, double-clicking on those image types should mount them in Nautilus like a physical drive. + +If you need to burn the image (like I did), open Brasero and select _copy disc_. + +CDemu can also be run from the command line. But this guide was all about getting easy, right? + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/mount-cue-bin-image-files-with-cdemu/ + +作者:[Luca Rastelli][a] +选题:[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/luca247/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/cdemu-816x345.jpg +[2]: https://unsplash.com/@bdbillustrations?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/dvd?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://en.wikipedia.org/wiki/Cue_sheet_(computing) +[5]: https://en.wikipedia.org/wiki/.cda_file +[6]: https://en.wikipedia.org/wiki/Binary_file +[7]: https://en.wikipedia.org/wiki/Brasero_(software) +[8]: https://en.wikipedia.org/wiki/Xfce#Xfburn +[9]: https://en.wikipedia.org/wiki/K3b +[10]: https://en.wikipedia.org/wiki/Optical_disc_image +[11]: https://en.wikipedia.org/wiki/CDemu +[12]: https://en.wikipedia.org/wiki/Daemon_Tools +[13]: https://copr.fedorainfracloud.org/coprs/rok/cdemu/ From ec5ea506e3e4a3893164b3885174164d047e6198 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 26 Jun 2021 05:03:39 +0800 Subject: [PATCH 200/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210625=20?= =?UTF-8?q?Use=20Python=20to=20parse=20configuration=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210625 Use Python to parse configuration files.md --- ...Use Python to parse configuration files.md | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 sources/tech/20210625 Use Python to parse configuration files.md diff --git a/sources/tech/20210625 Use Python to parse configuration files.md b/sources/tech/20210625 Use Python to parse configuration files.md new file mode 100644 index 0000000000..c062d105b7 --- /dev/null +++ b/sources/tech/20210625 Use Python to parse configuration files.md @@ -0,0 +1,205 @@ +[#]: subject: (Use Python to parse configuration files) +[#]: via: (https://opensource.com/article/21/6/parse-configuration-files-python) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use Python to parse configuration files +====== +The first step is choosing a configuration format: INI, JSON, YAML, or +TOML. +![Python programming language logo with question marks][1] + +Sometimes, a program needs enough parameters that putting them all as command-line arguments or environment variables is not pleasant nor feasible. In those cases, you will want to use a configuration file. + +There are several popular formats for configuration files. Among them are the venerable (although occasionally under-defined) `INI` format, the popular but sometimes hard to write by hand `JSON` format, the extensive yet occasionally surprising in details `YAML` format, and the newest addition, `TOML`, which many people have not heard of yet. + +Your first task is to choose a format and then to document that choice. With this easy part out of the way, it is time to parse the configuration. + +It is sometimes a good idea to have a class that corresponds to the "abstract" data in the configuration. Because this code will do nothing with the configuration, this is the simplest way to show parsing logic. + +Imagine the configuration for a file processor: it includes an input directory, an output directory, and which files to pick up. + +The abstract definition for the configuration class might look something like: + + +``` +`from __future__ import annotations`[/code] [code] + +import attr + +@attr.frozen +class Configuration: +    @attr.frozen +    class Files: +        input_dir: str +        output_dir: str +    files: Files +    @attr.frozen +    class Parameters: +        patterns: List[str] +    parameters: Parameters +``` + +To make the format-specific code simpler, you will also write a function to parse this class out of dictionaries. Note that this assumes the configuration will use dashes, not underscores. This kind of discrepancy is not uncommon. + + +``` +def configuration_from_dict(details): +    files = Configuration.Files( +        input_dir=details["files"]["input-dir"], +        output_dir=details["files"]["output-dir"], +    ) +    parameters = Configuration.Paraneters( +        patterns=details["parameters"]["patterns"] +    ) +    return Configuration( +        files=files, +        parameters=parameters, +    ) +``` + +### JSON + +JSON (JavaScript Object Notation) is a JavaScript-like format. + +Here is an example configuration in JSON format: + + +``` +json_config = """ +{ +    "files": { +        "input-dir": "inputs", +        "output-dir": "outputs" +    }, +    "parameters": { +        "patterns": [ +            "*.txt", +            "*.md" +        ] +    } +} +""" +``` + +The parsing logic parses the JSON into Python's built-in data structures (dictionaries, lists, strings) using the `json` module and then creates the class from the dictionary: + + +``` +import json +def configuration_from_json(data): +    parsed = json.loads(data) +    return configuration_from_dict(parsed) +``` + +### INI + +The INI format, originally popular on Windows, became a de facto configuration standard. + +Here is the same configuration as an INI: + + +``` +ini_config=""" +[files] +input-dir = inputs +output-dir = outputs + +[parameters] +patterns = ['*.txt', '*.md'] +""" +``` + +Python can parse it using the built-in `configparser` module. The parser behaves as a `dict`-like object, so it can be passed directly to `configuration_from_dict`: + + +``` +import configparser + +def configuration_from_ini(data): +    parser = configparser.ConfigParser() +    parser.read_string(data) +    return configuration_from_dict(parser) +``` + +### YAML + +YAML (Yet Another Markup Language) is an extension of JSON that is designed to be easier to write by hand. It accomplishes this, in part, by having a long specification. + +Here is the same configuration in YAML: + + +``` +yaml_config = """ +files: +  input-dir: inputs +  output-dir: outputs +parameters: +  patterns: +  - '*.txt' +  - '*.md' +""" +``` + +For Python to parse this, you will need to install a third-party module. The most popular is `PyYAML` (`pip install pyyaml`). The YAML parser also returns built-in Python data types that can be passed to `configuration_from_dict`. However, the YAML parser expects a stream, so you need to convert the string into a stream. + + +``` +import io +import yaml +def configuration_from_yaml(data): +    fp = io.StringIO(data) +    parsed = yaml.safe_load(fp) +    return configuration_from_dict(parsed) +``` + +### TOML + +TOML (Tom's Own Markup Language) is designed to be a lightweight alternative to YAML. The specification is shorter, and it is already popular in some places (for example, Rust's package manager, Cargo, uses it for package configuration). + +Here is the same configuration as a TOML: + + +``` +toml_config = """ +[files] +input-dir = "inputs" +output-dir = "outputs" + +[parameters] +patterns = [ "*.txt", "*.md",] +""" +``` + +In order to parse TOML, you need to install a third-party package. The most popular one is called, simply, `toml`. Like YAML and JSON, it returns basic Python data types. + + +``` +import toml +def configuration_from_toml(data): +    parsed = toml.loads(data) +    return configuration_from_dict(parsed) +``` + +### Summary + +Choosing a configuration format is a subtle tradeoff. However, once you make the decision, Python can parse most of the popular formats using a handful of lines of code. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/parse-configuration-files-python + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r (Python programming language logo with question marks) From 2b79b2fbbcafcb6232aef5ff5a5fc21e1b855cdb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 26 Jun 2021 05:04:00 +0800 Subject: [PATCH 201/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210625=20?= =?UTF-8?q?How=20to=20program=20in=20C=20on=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210625 How to program in C on FreeDOS.md --- ...20210625 How to program in C on FreeDOS.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20210625 How to program in C on FreeDOS.md diff --git a/sources/tech/20210625 How to program in C on FreeDOS.md b/sources/tech/20210625 How to program in C on FreeDOS.md new file mode 100644 index 0000000000..0a3f6ddeb1 --- /dev/null +++ b/sources/tech/20210625 How to program in C on FreeDOS.md @@ -0,0 +1,137 @@ +[#]: subject: (How to program in C on FreeDOS) +[#]: via: (https://opensource.com/article/21/6/program-c-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to program in C on FreeDOS +====== +Programming in C on FreeDOS is very similar to C programming on Linux. +![Woman sitting in front of her computer][1] + +When I first started using DOS, I enjoyed writing games and other interesting programs using BASIC, which DOS included. Much later, I learned the C programming language. + +I immediately loved working in C! It was a straightforward programming language that gave me a ton of flexibility for writing useful programs. In fact, much of the FreeDOS core utilities are written in C and Assembly. + +So it's probably not surprising that FreeDOS 1.3 RC4 includes a C compiler—along with other programming languages. The FreeDOS 1.3 RC4 LiveCD includes two C compilers—Bruce's C compiler (a simple C compiler) and the OpenWatcom C compiler. On the Bonus CD, you can also find DJGPP (a 32-bit C compiler based on GNU GCC) and the IA-16 port of GCC (requires a '386 or better CPU to compile, but the generated programs can run on low-end systems). + +Programming in C on FreeDOS is basically the same as C programming on Linux, with two exceptions: + + 1. **You need to remain aware of how much memory you use.** Linux allows programs to use lots of memory, but FreeDOS is more limited. Thus, DOS programs used one of four [memory models][2] (large, medium, compact, and small) depending on how much memory they needed. + 2. **You can directly access the console.** On Linux, you can create _text-mode_ mode programs that draw to the terminal screen using a library like _ncurses_. But DOS allows programs to access the console and video hardware. This provides a great deal of flexibility in writing more interesting programs. + + + +I like to write my C programs in the IA-16 port of GCC, or OpenWatcom, depending on what program I am working on. The OpenWatcom C compiler is easier to install since it's only a single package. That's why we provide OpenWatcom on the FreeDOS LiveCD, so you can install it automatically if you choose to do a "Full installation including applications and games" when you install FreeDOS 1.3 RC4. If you opted to install a "Plain DOS system," then you'll need to install the OpenWatcom C compiler afterward, using the FDIMPLES package manager. + +![installing OpenWatcom][3] + +Installing OpenWatcom on FreeDOS 1.3 RC4 +(Jim Hall, [CC-BY SA 4.0][4]) + +### DOS C programming + +You can find documentation and library guides on the [OpenWatcom project website][5] to learn all about the unique DOS C programming libraries provided by the OpenWatcom C compiler. To briefly describe a few of the most useful functions: + +From `conio.h`: + + * `int getch(void)—`Get a single keystroke from the keyboard + * `int getche(void)—`Get a single keystroke from the keyboard, and echo it + + + +From `graph.h`: + + * `_settextcolor(short color)—`Sets the color when printing text + * `_setbkcolor(short color)—`Sets the background color when printing text + * `_settextposition(short y, short x)—`Move the cursor to row `y` and column `x` + * `_outtext(char _FAR *string)—`Print a string directly to the screen, starting at the current cursor location + + + +DOS only supports [sixteen text colors][6] and eight background colors. You can use the values 0 (Black) to 15 (Bright White) to specify the text colors, and 0 (Black) to 7 (White) for the background colors: + + * **0**—Black + * **1**—Blue + * **2**—Green + * **3**—Cyan + * **4**—Red + * **5**—Magenta + * **6**—Brown + * **7**—White + * **8**—Bright Black + * **9**—Bright Blue + * **10**—Bright Green + * **11**—Bright Cyan + * **12**—Bright Red + * **13**—Bright Magenta + * **14**—Yellow + * **15**—Bright White + + + +### A fancy "Hello world" program + +The first program many new developers learn to write is a program that just prints "Hello world" to the user. We can use the DOS "conio" and "graphics" libraries to make this a more interesting program and print "Hello world" in a rainbow of colors. + +In this case, we'll iterate through each of the text colors, from 0 (Black) to 15 (Bright White). As we print each line, we'll indent the next line by one space. When we're done, we'll wait for the user to press any key, then we'll reset the screen and exit. + +You can use any text editor to write your C source code. I like using a few different editors, including [FreeDOS Edit][7]** **and [Freemacs][8], but more recently I've been using the [FED editor][9] because it provides _syntax highlighting_, making it easier to see keywords, strings, and variables in my program source code. + +![writing a simple C program][10] + +Writing a simple test program in C +(Jim Hall, [CC-BY SA 4.0][4]) + +Before you can compile using OpenWatcom, you'll need to set up the DOS [environment variables][11]** **so OpenWatcom can find its support files. The OpenWatcom C compiler package includes a setup [batch file][12] that does this for you, as `\DEVEL\OW\OWSETENV.BAT`. Run this batch file to automatically set up your environment for OpenWatcom. + +Once your environment is ready, you can use the OpenWatcom compiler to compile this "Hello world" program. I've saved my C source file as `TEST.C`, so I can type `WCL TEST.C` to compile and link the program into a DOS executable, called `TEST.EXE`. In the output messages from OpenWatcom, you can see that `WCL` actually calls the OpenWatcom C Compiler (`WCC`) to compile, and the OpenWatcom Linker (`WLINK`) to perform the object linking stage: + +![compiling with OpenWatcom][13] + +Compiling the test program with OpenWatcom +(Jim Hall, [CC-BY SA 4.0][4]) + +OpenWatcom prints some extraneous output that may make it difficult to spot errors or warnings. To tell the compiler to suppress most of these extra messages, use the `/Q` ("Quiet") option when compiling: + +![compiling with OpenWatcom][14] + +If you don't see any error messages when compiling the C source file, you can now run your DOS program. This "Hello world" example is `TEST.EXE`. Enter `TEST` on the DOS command line to run the new program, and you should see this very pretty output: + +![running the test program][15] + +C is a very efficient programming language that works well for writing programs on limited-resource systems like DOS. There's lots more that you can do by programming in C on DOS. If you're new to the C language, you can learn C yourself by following along in our [Writing FreeDOS Programs in C][16] self-paced ebook on the FreeDOS website, and the accompanying "how-to" video series on the [FreeDOS YouTube channel][17]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/program-c-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_2.png?itok=JPlR5aCA (Woman sitting in front of her computer) +[2]: https://devblogs.microsoft.com/oldnewthing/20200728-00/?p=104012 +[3]: https://opensource.com/sites/default/files/uploads/install-ow.png (Installing OpenWatcom on FreeDOS 1.3 RC4) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: http://openwatcom.org/ +[6]: https://opensource.com/article/21/6/freedos-sixteen-colors +[7]: https://opensource.com/article/21/6/freedos-text-editor +[8]: https://opensource.com/article/21/6/freemacs +[9]: https://opensource.com/article/21/1/fed-editor +[10]: https://opensource.com/sites/default/files/uploads/fed-test.png (Writing a simple test program in C) +[11]: https://opensource.com/article/21/6/freedos-environment-variables +[12]: https://opensource.com/article/21/6/automate-tasks-bat-files-freedos +[13]: https://opensource.com/sites/default/files/uploads/wcl-test.png (Compiling the test program with OpenWatcom) +[14]: https://opensource.com/sites/default/files/uploads/wcl-q-test.png (Use the /Q ("Quiet") option to make OpenWatcom print less output) +[15]: https://opensource.com/sites/default/files/uploads/test.png (You can create beautiful programs in C) +[16]: https://www.freedos.org/books/cprogramming/ +[17]: https://www.youtube.com/freedosproject From 9c406514893f16ffea60bb73173b72b1a21e2bde Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 26 Jun 2021 05:04:15 +0800 Subject: [PATCH 202/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210625=20?= =?UTF-8?q?How=20the=20Apache=20Software=20Foundation=20selects=20open=20s?= =?UTF-8?q?ource=20projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210625 How the Apache Software Foundation selects open source projects.md --- ...Foundation selects open source projects.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20210625 How the Apache Software Foundation selects open source projects.md diff --git a/sources/tech/20210625 How the Apache Software Foundation selects open source projects.md b/sources/tech/20210625 How the Apache Software Foundation selects open source projects.md new file mode 100644 index 0000000000..e8471bf7a3 --- /dev/null +++ b/sources/tech/20210625 How the Apache Software Foundation selects open source projects.md @@ -0,0 +1,65 @@ +[#]: subject: (How the Apache Software Foundation selects open source projects) +[#]: via: (https://opensource.com/article/21/6/apache-software-foundation) +[#]: author: (Justin Mclean https://opensource.com/users/justin-mclean) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How the Apache Software Foundation selects open source projects +====== +The Apache Software Foundation (ASF) is built around a unique set of +processes and values to ensure openness. +![Wide open sky and trees][1] + +As a longtime volunteer and mentor (and current board member) at the [Apache Software Foundation][2] (ASF) and vice president of the Apache Incubator, I'm proud to offer my insights into the unique processes and values with which the ASF operates. + +Centered upon the permissive and pragmatic open source [Apache License][3], the ASF conducts itself differently from many other foundations simply because it is a charitable organization constructed for the public good. For example, the ASF board is elected by members. No one can buy a seat on the board, and the ASF's affiliations are with individuals, not companies. Generally, the corporate affiliation of any individual involved with ASF goes unstated, and it doesn't matter. As an outcome, the ASF has fostered a vendor-neutral environment where companies can comfortably collaborate on building valuable projects. + +Let's take a look at how the ASF selects its projects, the state of open source licensing today, and what you can expect from the ASF heading into the future. + +### The Apache Incubator process and 'The Apache Way' + +Potential Apache projects begin in the [Apache Incubator][4], where they receive assistance and mentoring toward their hopeful graduation as top-level Apache projects. Anyone is welcome to put together a project proposal for the Incubator (they simply need to find someone inside the ASF who's willing to help champion it). When vetting a potential project, the ASF prefers to see a diversity of people and entities involved—and certainly not just a singular corporate body. We've found this greater diversity results in projects that are more widely used and longer lasting. + +The central purpose of the Incubator is to help projects learn and operate in alignment with what we call [The Apache Way][5]. It is a set of values that inform best practices for community-led development. The most important aspects of The Apache Way include strict vendor-neutral independence and prioritization of a strong community, even over the strength of a project's code. Open and transparent communication is crucial as well: The ASF requires that all project communication is publicly accessible and permanently archived to enable asynchronous collaboration. In addition, the open source Apache License is attached to all accepted projects, ensuring that all source code is publicly available as well. + +At the Incubator, we initially look at whether a project is a good fit in terms of how it aligns with these Apache values. It isn't necessary to have 100% alignment, but the project needs to be willing to adapt. There will also be a discussion around ensuring that the project is fully compatible with Apache from a licensing perspective—in some scenarios, dependencies will be removed or replaced as needed. The Apache Way prepares projects to build communities that are self-sustaining. That said, it can be difficult for some projects to build a community, and some don't make it through the incubator. + +Another key element of The Apache Way—one essential to thriving communities—is making decisions based on consensus. In our experience, open discussions and avoiding a single individual project leader are mission-critical to that process. We have had a couple of incubating projects that included a strong personality trying to retain control, and well, those projects didn't succeed for that reason. + +### Open source and the Apache License + +Open source projects come in many varieties. At the same time, using an open source license doesn't automatically make a project open source. It's a project's community that unlocks open source benefits and whose contributions precipitate greater openness and transparency. + +Recently, some companies have made high-profile moves away from the Apache License to less-permissive licensing. If your company changes from an open source to a non-open source license, I have to question why you had that open source license in the first place. It probably meant that the business model didn't fit open source. I believe that by changing away from open source licenses, companies are doing a huge disservice to their communities and their users. + +As I said, the ASF is a non-profit, charitable organization that creates software for the public good. That's the purpose of the permissive Apache License. Making money off that software is fine, but that's not what the Apache License is about. As a rule, ASF disallows any field-of-use restrictions. _Anyone_ can use Apache projects for any reason. The idea behind true open source is that some people who use a project will give back to it, but contributions absolutely cannot be required. The companies that seem so hung up on that point need to understand that isn't how open source works, and that isn't how it should work. + +### The future of open source and the ASF + +Open source has certainly seen outsized adoption in the last five to 10 years and particular acceleration among enterprises. I think it's safe to say that there's hardly any software on the planet that doesn't include or rely upon open source projects in some way. That adoption is only going to grow. + +Unlike some foundations, the ASF is fairly hands-off in terms of project recruitment. Expect the ASF to continue as it has, stating the values of The Apache Way and working with those projects that see value in the ASF's approach. With ASF projects leading at the forefront of major industry shifts—initially with web servers and more recently with big data through projects like Apache Hadoop and Spark, Cassandra, and Kafka—the hands-off stance has shown to be successful and sustainable. + +When it comes to what's next, the ASF has several large and buzzed-about artificial intelligence and machine learning projects. In addition, several Internet of Things (IoT) projects have also been passing through the Apache Incubator, some of which will likely become quite influential. Looking forward, expect the ASF to continue as it has, introducing some hugely successful open source projects used by major industry players, with other smaller projects providing vital—if more niche—appeal. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/apache-software-foundation + +作者:[Justin Mclean][a] +选题:[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/justin-mclean +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/nature_open_sky_tree.png?itok=2J79Futp (Wide open sky and trees) +[2]: https://www.apache.org/ +[3]: https://www.apache.org/licenses/LICENSE-2.0 +[4]: https://incubator.apache.org/ +[5]: https://apache.org/theapacheway/ From 456cc34268a990a90e1ce15382fbe71208435a32 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 26 Jun 2021 05:04:37 +0800 Subject: [PATCH 203/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210625=20?= =?UTF-8?q?Windows=2011=20Makes=20Your=20Hardware=20Obsolete,=20Use=20Linu?= =?UTF-8?q?x=20Instead!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md --- ...ur Hardware Obsolete, Use Linux Instead.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md diff --git a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md new file mode 100644 index 0000000000..4fc636c134 --- /dev/null +++ b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md @@ -0,0 +1,114 @@ +[#]: subject: (Windows 11 Makes Your Hardware Obsolete, Use Linux Instead!) +[#]: via: (https://news.itsfoss.com/windows-11-linux/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Windows 11 Makes Your Hardware Obsolete, Use Linux Instead! +====== + +Windows 11 is finally here. We’re not entirely thrilled by it – but it introduces problems for many computer users. + +And I’m not even talking the privacy aspect or its design choice. But it seems that Windows 11 is demanding newer hardware to work, which makes your old computer obsolete in a way and forces you to upgrade your hardware for no good reason. + +What else is a problem with the arrival of Windows 11? What’s so bad about it? + +### Only Eligible Devices Can Get the Windows 11 Upgrade + +To start with, Windows 11 has interestingly added a minimum system requirement which looks good on paper: + + * 1 GHz dual-core 64-bit processor + * 4 GB RAM + * 64 GB storage + * UEFI, Secure Boot support + * Trusted Platform Module version 2.0 + * DirectX 12 compatible graphics + * 720p resolution display + + + +![][1] + +You can check if your system is eligible by downloading the **PC Health Check** app from [Microsoft’s official site][2]. + +Most of the computers from the last decade should meet these criteria – but there’s a catch. + +The hardware should have a TPM chip, which may not be the case for some PC builds or laptops. Fortunately, it is not all bad, you may just need to enable it from your BIOS settings including the Secure Boot support, to make your PC eligible. There’s a guide on [PCGamer][3] to help you with that. + +Technically, processors older than **Intel 8th gen and Ryzen 3000 series** are not officially supported as per Microsoft’s official documentations ([AMD][4] | [Intel][5]). + +However, there are a sound number of systems that may not have the support for it. So, what do you do? + +Easy, [**switch to Linux in 2021**][6] before Windows 10 no longer receives updates. This year, it makes more sense than ever for you to try Linux for your personal computer! + +### Windows 11 Installation Requires Internet Connectivity + +![][7] + +While we do not have enough clarity about this but as per its system requirement specifications, it will require users to have an active Internet connection for Windows 11 installation. + +But, with Linux, you do not need that. + +That’s just one of the [benefits of using Linux over Windows][8] – you get complete control of your operating system. + +### No 32-Bit Support + +![][7] + +Windows 10 did support 32-bit systems, but Windows 11 ends that. + +This is where Linux shines. + +Even though the 32-bit support is dwindling everywhere, we still have a bunch of [**Linux distributions that support 32-bit systems**][9]. Your 32-bit system may still live for a decade with Linux. + +### Windows 10 Support Ends in 2025 + +Well, this was unexpected considering Microsoft initially planned to never have an upgrade after Windows 10 but support it for the foreseeable future. + +Now, Windows 10 will be killed in 2025… + +So, what do you do then? Upgrade your hardware just because it does not support Windows 11? + +Unless there’s a necessity, Linux is your friend forever. + +You can try several [**lightweight Linux distributions**][10] that will revive any of your computers that Microsoft considers obsolete! + +### Wrapping Up + +While Windows 11 plans to force users to upgrade their hardware in the next few years, Linux lets you keep your hardware for a long time along with several added benefits. + +So, if you are not happy with Windows 11 release, you may want to start using Linux instead. Fret not, you can refer to our guides on our main web portal [It’s FOSS][11] to learn everything you need to get started using Linux! + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/windows-11-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIyNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://www.microsoft.com/en-us/windows/windows-11 +[3]: https://www.pcgamer.com/Windows-11-PC-Health-Check/ +[4]: https://docs.microsoft.com/en-us/windows-hardware/design/minimum/supported/windows-11-supported-amd-processors +[5]: https://docs.microsoft.com/en-us/windows-hardware/design/minimum/supported/windows-11-supported-intel-processors +[6]: https://news.itsfoss.com/switch-to-linux-in-2021/ +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: https://itsfoss.com/linux-better-than-windows/ +[9]: https://itsfoss.com/32-bit-linux-distributions/ +[10]: https://itsfoss.com/lightweight-linux-beginners/ +[11]: https://itsfoss.com From 6783d3935cdc09b4e7ec10f858c69e72d17d894b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 26 Jun 2021 11:08:44 +0800 Subject: [PATCH 204/870] Rename sources/tech/20210625 How the Apache Software Foundation selects open source projects.md to sources/talk/20210625 How the Apache Software Foundation selects open source projects.md --- ...the Apache Software Foundation selects open source projects.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210625 How the Apache Software Foundation selects open source projects.md (100%) diff --git a/sources/tech/20210625 How the Apache Software Foundation selects open source projects.md b/sources/talk/20210625 How the Apache Software Foundation selects open source projects.md similarity index 100% rename from sources/tech/20210625 How the Apache Software Foundation selects open source projects.md rename to sources/talk/20210625 How the Apache Software Foundation selects open source projects.md From f7af5c90965300f972767888946601b95aa520d6 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Sat, 26 Jun 2021 13:09:03 +0800 Subject: [PATCH 205/870] Update 20210610 Why choose open source for your home automation project.md --- ...0 Why choose open source for your home automation project.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210610 Why choose open source for your home automation project.md b/sources/talk/20210610 Why choose open source for your home automation project.md index ff339f798d..bdedd0ee45 100644 --- a/sources/talk/20210610 Why choose open source for your home automation project.md +++ b/sources/talk/20210610 Why choose open source for your home automation project.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/home-automation-ebook) [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a15fa850714e7d8b67764130809d00a771ad2e13 Mon Sep 17 00:00:00 2001 From: littlebirdnest <63171986+littlebirdnest@users.noreply.github.com> Date: Sat, 26 Jun 2021 19:17:26 +0800 Subject: [PATCH 206/870] Update 20200930 FCC auctions should be a long-term boost for 5G availability.md --- ...e a long-term boost for 5G availability.md | 84 ++++++------------- 1 file changed, 24 insertions(+), 60 deletions(-) diff --git a/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md b/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md index 5f9fb4fd11..edb4abd9ae 100644 --- a/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md +++ b/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md @@ -9,76 +9,40 @@ -美国联邦通讯委员的拍卖是长期的有助于5G普及 +FCC 的拍卖应该是长期有助于 5G 普及 + ====== -美国联邦通讯委员新的决策——让更多的频段能够被用于通信 +FCC 制定新政策目标是让更多的频段能够被用于通信以此来创造新的服务。 -在5G的竞争当中,为了让5G的能力完全发挥出来,增加频谱是非常有必要的, 美国联邦通讯委员也知晓这一点 +[FCC][1] +[美国联邦通信委员会][1] -什么是5G 给企业和手机更快的传输速度 +随着 5G 的发展,为了让 5G 的服务能成气候,增加更多频谱就是重中之重的事情,FCC 熟知于心。 - +### 5G 资源 + * [什么是 5G 给企业和手机更快的无限传播][2] + * [ 5G 频率是如何影响 5G 范围和 5G 的速度的][3] + * [ 5G 能够解决哪些,WiFi 无法解决的问题][4] + * [ 5G 能够让 Whirlpool 无人驾驶汽车继续运转][5] + * [ 5G 能够让网络回传更有效率][6] + * [ CBRS 能将 5G 带给企业][7] -5G频率是如何影响5G范围和5G的速度的 +FCC 近日完成了有关 CBRS 其 5G 频谱的拍卖,代表就有3.5GHz 中的 70MHz 其花费了 45.8 个亿并且是近几年一系列拍卖会之中以腾出更多频段用于无线传输为目的的拍卖会。 +FCC 在 2011、2014 和 2015 年拍卖了 65MHz 的低到中频,大致在 1.7GHz 至 2.2GHz ,例如 700MHz 就在其中。当前频段可操作的范围是低于 6GHz 频段或是中间频段,恰恰是 CMRS 拍卖的部分,即将到来的C频段拍卖将会是重要一环,根据专家猜测,将会有高达280频段进行拍卖“C 频段的拍卖,将会很有价值” IDC 的研究主管Jasom leigh 说到“中频段在美国是极稀有的,这也就是为什么人们会如此积极。” +然而几大主要移动运营商都希望抢到这次拍卖中的最大份额,企业也会对新的频段进行一系列的创新,所以同样将会与运营商竞争一系列可用的频段特别是物联网,资产追踪以及其他的个人应用早已通过 [LTE]网络实现,而 5G 网络将会扩大他们的前景,这多亏了 5G 的先进的频谱共享,低延迟,多连接的特性。广义上讲,能替代更多当前需要线的设备,如工业上的自动化,设备的管理等等。 - +## 重新分配频段就意味着谈判 -5G能够解决哪些,WiFi无法解决的问题 - - - -5G能够让Whirlpool无人驾驶汽车继续运转 - - - -5G能够让网络回传更有效率 - - - -公民的宽带无线服务将5G带给企业 - -美国联邦通讯委员近日完成了对公民的宽带无线服务5G频谱的拍卖---3.5GHz中的70MHz - -砸进去了45.8个亿的目的,和以往的拍卖不同的地方在于,能腾出更多的频段用于无线传输 - - - -FCC 在 2011 2014和2015年拍卖了 65MHz 的低中频,大致在1.7GHz至2.2GHz,例如现在的700MHz。但是现在可操作的范围的频段是低于6GHz频段或中间频段,刚好是CMRS拍卖的部分,即将到来的C频段拍卖将会是重要一环,根据专家猜测,将会有巨大的280MHz频段进行拍卖 - -C频段的拍卖,将会很有价值” IDC的研究主管Jasom leigh说到 - -中频段在美国是极稀有的,这也就是为什么人们会如此积极 - -然而主要的移动数据提供商仍然希望抢到这次拍卖中的最大份额, - -企业会对新的频段实施一系列的创新,同样将会与运营商竞争一系列可用的频率 - -特别是物联网,资产追踪以及其他的个人应用早已通过LTE网络实现,而5G网络将会有扩大他们的范围,这多亏了 5G的频谱共享,低延迟,多连接的特性。广义讲,能替代更多当前需要线的设备,如工业上的自动化,设备的管理等等 - -重新分配频段就意味着谈判 - -对于想要改变美国的频段优先事项上的问题绝非小事,FCC此前的主席Tom Wheeler对此绝对深有体会,过去10年里,政府一直在推动重新分配频段,而享有频段者的大多是政府机构或者是卫星网络运营商商 - -这些频段享有者被分配到不同频段,常以纳税人的税进行补偿,然后让更多的人进行享用,然而这一过程通常是困难的 - -并指出“ FCC现在要面临的其中一个挑战就是分配频段从原本的模拟信号变成数字信号” 类似于模拟电视变成数字电视 - -当模拟电视要求上到6MHz频段以及要求更宽的宽带去避免冲突,数字信号却能够在一个频率里有5个信号 - -这一系列变革是具有挑战性的,反对者义不容辞公开反对FCC进入中频宽带,并说明这样做会干涉他们原有的设备和服务,也意味着更换频率就等于买新的设备 - -公司讨论过,事实上其中一个较大的原因是监管层的问题,没人想放弃现有体系下基于模拟信号的工作岗位” Wheeler说到,“我觉得你应该考虑周全,但我发现那些所谓宣称信号冲突的人,其实并不关心来自竞争的威胁或者其他事物的威胁。 - -未来:更多的服务 - -将中频段开放给企业和运营商对美国商业将会有更多潜在的优势,无论是具体是哪一个频段开放,根据Leigh的说法,美国应该根据拍卖的形式来分配无线频段,像德国就早已设立专门的中频段来给企业使用 - -对于一家试图推出自己的私有 5G 网络的公司,就可能推高拍卖的价格,但最终,一定要让这项服务存在,无论是内部供应服务还是移动运营商贩卖服务,只要他们有足够的频段使用 - -“企业能够围绕5G做更加有科技含量的事物”他说到 +对于想要改变美国的频段优先事项上的问题早已不是小事,FCC 此前的主席 Tom Wheeler 对此绝对深有体会,过去 10 年里,政府一直在推动重新分配频段,而享有频段者的大多是政府机构或者是卫星网络运营商商。这些频段享有者会被分配到不同频段,并常以纳税人的税进行补偿,然后让更多的人进行享用,而这一过程通常是繁琐的, Wheeler 说到。 +并指出“ FCC 现在要面临的一个挑战要从原本分配频段从模拟假设变成数字科技” 就像电视从模拟电视转变成数字电视。当模拟电视要求上到 6MHz 频段以及要求更宽的频宽去避免冲突时,数字信号却能够在一个频段里塞进5个信号。这些假设的证明要面对挑战,反对者义不容辞公开反对 FCC 进入中频宽带,并反对这样做会干涉他们原有的设备和服务,也意味着更换频率就等于买新的设备。 + 我们和[安全部门]还有卫星部门讨论过,事实上其中一个较大的原因是监管的挑战,没人想放弃现有体系下基于模拟信号的安全工作岗位” Wheeler 说到,“我觉得你同样应该考虑周全,但我发现那些所谓宣声信号冲突的人,其实是将眼下当作避难所,根本没有竞争和威胁方面的意识。 +## 未来:更多的服务 +Leigh 表示,无论开放频谱的确切方式如何,但广泛的观点认为将中频频段开放给运营商和企业,对美国商业会有潜在的优势。而当美国在分配无线频谱方面坚持以拍卖形式时,其他国家,像德国,就已经专门预留了供企业使用的中频频谱。 +对于试图推出自己的私有 5G 网络的公司而言,可能会推高频谱拍卖价格。但是,只要最终有足够可用的频谱,就有服务足够可用,无论它们是内部提供的,还是由移动运营商或供应商销售的。 +“企业能将 5G 变成未来" 他说 via: https://www.networkworld.com/article/3584072/fcc-auctions-should-be-a-long-term-boost-for-5g-availability.html From d44d8e662374f02b9b9b80d504dba8046d13d406 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 27 Jun 2021 05:03:10 +0800 Subject: [PATCH 207/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210627=20?= =?UTF-8?q?How=20to=20Convert=20File=20Formats=20With=20Pandoc=20in=20Linu?= =?UTF-8?q?x=20[Quick=20Guide]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md --- ...rmats With Pandoc in Linux -Quick Guide.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md diff --git a/sources/tech/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md b/sources/tech/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md new file mode 100644 index 0000000000..e6abce3857 --- /dev/null +++ b/sources/tech/20210627 How to Convert File Formats With Pandoc in Linux -Quick Guide.md @@ -0,0 +1,137 @@ +[#]: subject: (How to Convert File Formats With Pandoc in Linux [Quick Guide]) +[#]: via: (https://itsfoss.com/pandoc-convert-file/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Convert File Formats With Pandoc in Linux [Quick Guide] +====== + +In an earlier article, I covered the [procedure to batch convert a handful of Markdown files to HTML][1] using pandoc. In that article, multiple HTML files were created, but pandoc can do much more. It has been called “the Swiss army knife” of document conversion – and with good reason. There isn’t a lot that it can’t do. + +[Pandoc][2] can covert .docx, .odt, .html, .epub, LaTeX, DocBook, etc. to these and other formats, such as JATS, TEI Simple, AsciiDoc, and more. + +Yes, this means that pandoc can convert .docx files to .pdf and .html, but you may be thinking: “Word can export files to .pdf and .html too. Why would I need pandoc?” + +You would have a good point there, but since pandoc can convert so many formats, it could well become your go-to tool for all of your conversion tasks. For example, many of us know that [Markdown editors][3] can export its Markdown files to .html. With pandoc, Markdown files can be converted to numerous other formats as well. + +I rarely have Markdown export to HTML; I normally let pandoc do it. + +### Converting File Formats with Pandoc + +![][4] + +Here, I will convert Markdown files into a few different formats. I do almost all of my writing using Markdown syntax, but I often have to convert to another format: .docx files are usually required for school work, .html for web pages that I create – and for .epub work, .pdf for flyers and handouts, and even an occasional TEI Simple file for a university digital humanities project. Pandoc can handle all of these, and more, easily. + +First, you need to [install pandoc][5]. Also, to create .pdf files, LaTeX will be needed as well. The package I prefer is [TeX Live][6]. + +**Note**: If you would like to try out pandoc before installing it, there is an online try-out page at: + +#### Installing pandoc and texlive + +Users of Ubuntu and other Debian distros can type the following commands in the terminal: + +``` +sudo apt-get update +sudo apt-get install pandoc texlive +``` + +Notice on the second line, you are installing pandoc and texlive in one shot. [apt-get command][7] will have no problem with this, but go get some coffee; this may take a few minutes. + +#### Getting to Conversion + +Once pandoc and texlive are installed, you can burn through some work! + +The sample document for this project will be an article that was first published in the _North American Review_ in December of 1894, and is titled: “How To Repel Train Robbers”. The Markdown file that I will be using was created some time ago as part of a restoration project. + +The file: `how_to_repel_train_robbers.md` is located in my Documents directory, in a sub-directory named samples. Here is what it looks like in Ghostwriter. + +![Markdown file in Ghostwriter][8] + +I want to create .docx, .pdf, and .html versions of this file. + +#### The First Conversion + +I’ll start with making a .pdf copy first, since I went through the trouble of installing a LaTeX package. + +While in the ~/Documents/samples/ directory, I type the following to create a .pdf file: + +``` +pandoc -o htrtr.pdf how_to_repel_train_robbers.md +``` + +The above command will create a file called htrtr.pdf from the how_to_repel_train_robbers.md file. The reason I used htrtr as a name was that it is shorter than how_to_repel_train_robbers – htrtr is the first letter of each word in the long title. + +Here is a snapshot of the .pdf file once it is made: + +![Converted PDF file viewed in Ocular][9] + +#### The Second Conversion + +Next, I want to create a .docx file. The command is almost identical to the one I used to create the .pdf and it is: + +``` +pandoc -o htrtr.docx how_to_repel_train_robbers.md +``` + +In no time, a .docx file is created. Here is what it looks like in Libre Writer: + +![Converted DOCX file viewed in Libre Writer][10] + +#### The Third Conversion + +I may want to post this on the web, so a web page would be nice. I will create a .html file with this command: + +``` +pandoc -o htrtr.html how_to_repel_train_robbers.md +``` + +Again, the command to create it is very much like the last two conversions. Here is what the .html file looks like in a browser: + +![Converted HTML file viewed in Firefox][11] + +#### Noticed Anything Yet? + +Let’s look at the past commands again. They were: + +``` +pandoc -o htrtr.pdf how_to_repel_train_robbers.md +pandoc -o htrtr.docx how_to_repel_train_robbers.md +pandoc -o htrtr.html how_to_repel_train_robbers.md +``` + +The only thing different about these three commands is the extension next to htrtr. This gives you a hint that pandoc relies on the extension of the output filename you provide. + +### Conclusion + +Pandoc can do far more than the three little conversions done here. If you write with a preferred format, but need to convert the file to another format, chances are great that pandoc will be able to do it for you. + +What would you do with this? Would you automate this? What if you had a web site that had articles for your readers to download? You could modify these little commands to work as a script and your readers could decide which format they would like. You could offer .docx, .pdf, .odt, .epub, or more. Your readers choose, the proper conversion script runs, and your readers download their file. It can be done. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pandoc-convert-file/ + +作者:[Bill Dyer][a] +选题:[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/bill/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/convert-markdown-files/ +[2]: https://pandoc.org/ +[3]: https://itsfoss.com/best-markdown-editors-linux/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/pandoc-quick-guide.png?resize=800%2C450&ssl=1 +[5]: https://pandoc.org/installing.html +[6]: https://www.tug.org/texlive/ +[7]: https://itsfoss.com/apt-get-linux-guide/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_ghostwriter.png?resize=800%2C516&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_ocular.png?resize=800%2C509&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_libre_writer.png?resize=800%2C545&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/convert_with_pandoc_firefox.png?resize=800%2C511&ssl=1 From 1534a8e71cf48a8f9df13edc51c4f65341c6ae82 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 27 Jun 2021 05:03:34 +0800 Subject: [PATCH 208/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210626=20?= =?UTF-8?q?How=20I=20helped=20my=20mom=20switch=20from=20Windows=20to=20Li?= =?UTF-8?q?nux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210626 How I helped my mom switch from Windows to Linux.md --- ...ped my mom switch from Windows to Linux.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20210626 How I helped my mom switch from Windows to Linux.md diff --git a/sources/tech/20210626 How I helped my mom switch from Windows to Linux.md b/sources/tech/20210626 How I helped my mom switch from Windows to Linux.md new file mode 100644 index 0000000000..7e0a4ae5fa --- /dev/null +++ b/sources/tech/20210626 How I helped my mom switch from Windows to Linux.md @@ -0,0 +1,161 @@ +[#]: subject: (How I helped my mom switch from Windows to Linux) +[#]: via: (https://opensource.com/article/21/6/mom-switch-linux) +[#]: author: (Tomasz https://opensource.com/users/tomaszwaraksa) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How I helped my mom switch from Windows to Linux +====== +With Linux, novice users will gain a smooth, polished desktop experience +with a multitude of familiar applications. +![Red Lego Heart][1] + +The Large Hadron Collider is [powered by Linux][2]. Laptops on the International Space Station [run on Linux][3]. So do [Instagram][4] and [Nest thermostats][5]. Recently, we watched Ingenuity fly over Mars, an amazing robo-copter driven by… [Linux][6]! It's yet more proof of how flexible and versatile this operating system can be. + +But now, the really big news. It's official. Linux can handle Mom and Dad just as well! + +### The story + +About a year ago, I decided to migrate my mom to Linux. A year has passed, so it's time for retrospection and conclusions. + +Like most of us, I'm officially _Mom's Computer Admin_. Mom is a lovely lady in her late 60s—a real sweetheart. Mom's computer skills are basic. Mom's computer needs are basic, too. Read the internets, send email, type text, browse and edit photos, play videos and music, call family and friends on Skype or Signal. + +Until last year, she was using a Windows laptop, old but not too bad. Then one day, through deceit, threats, and obnoxious popups, Microsoft finally made her click that dreaded "UPGRADE TO WINDOWS 10" button. + +My life as Mom's Computer Admin quickly turned into hell with her desperate calls for help. Why does everything look so different? Where is my app menu? What, this pile of tiles is now my app menu? Why is the computer so slow? Why does it restart daily for updates, just when I need to use it?! Why is something (she meant the hard drive) making noise all the time? What is it actually doing all the time? + +And how would I know that without any ability to look into the source code? + +I considered rolling back the upgrade. But with Windows 7 reaching end-of-life soon, I feared the worst: Without security updates, Mom's computer would soon become a member of countless bot networks, mining cryptocurrencies, mailing spam, and launching vicious DDOS attacks on the vital infrastructure of entire countries. And I'd be the one to clean this mess—every weekend. + +### Linux to the rescue + +With nothing to lose, I decided to migrate her to Linux. I made "the move" five years ago and have never been happier. It surely wouldn't do harm to try it with her. + +Mom was happy when I declared to fix her problems once and for all. What she didn't know is that she would become the crucial part of a year-long scientific experiment named: "Can Mom survive Linux?" + +![Cowsay "Can Mom Survive Linux?"][7] + +(Tomasz Waraksa, [CC BY-SA 4.0][8]) + +And so, one day in February 2020, I arrived from faraway Dublin with a seven-year-old Lenovo Yoga 13, which had similar specs but a much nicer screen and half the weight. After some deliberations and testing various Linux distributions on VirtualBox, I decided on the [Zorin OS][9] distribution, proudly made in Ireland. My choice was driven by the following factors: + + * It's based on Ubuntu Linux, with which I'm most familiar. + * It closely resembles Windows 7, being carefully designed with Windows refugees in mind. + * It feels lightweight, simple, and sufficiently conservative for Mom. No shiny macOS Big Sur glitz anywhere around! + + + +![Zorin OS desktop][10] + +(Tomasz Waraksa, [CC BY-SA 4.0][8]) + +### System installation + +I installed the operating system my usual way, with the `/home` folder on a dedicated partition to keep Mom's Stuff safe in the unlikely case of system reinstallation. It's my old trick that makes late-night distro-hopping much easier. + +During installation, I chose Polish as the user interface (UI) language. Just like me, Mom is Polish to the bone. No worries, Linux seems to support every possible language, including [Klingon][11]. + +Then, I installed the following applications to cover Mom's needs: + + * Skype + * [Signal for Desktop][12] + * Google Chrome browser + * [Geary][13] email client + * [gThumb][14] for photo viewing and editing + * [VLC][15] for playing video and music + * Softmaker Office for text editing and spreadsheets + + + +Notice how there's no antivirus on the list. Yay! + +An hour later, her Zorin OS box was ready and loaded with applications. + +![Zorin OS home folder][16] + +(Tomasz Waraksa, [CC BY-SA 4.0][8]) + +### System configuration + +I made myself Mom's Computer Admin by doing the following: + + * Created an admin account for myself + * Turned Mom's account into non-admin + * Installed the `ssh` daemon for remote unattended access + * Added the machine to my Hamachi VPN: This way, I can securely connect via `ssh` without opening port 22 on the router. Hamachi is a VPN service by LogMeIn. An old-school VPN, I mean. Intended not for running Netflix from another country but for connecting computers into a secure network over the internet. + * Enabled Uncomplicated Firewall ( `ufw`) and allowed ssh traffic + * Installed AnyDesk for logging in to the desktop + + + +With this, I have secure ssh access to Mom's laptop. I can perform periodic maintenance via shell without Mom even noticing anything. That's because Linux normally _does not_ require a reboot after completed updates; what a miracle, how's that even possible? + +![Updating software remotely][17] + +(Tomasz Waraksa, [CC BY-SA 4.0][8]) + +### Can Mom survive Linux? + +Without the slightest doubt! + +When I showed Mom her new PC, she did ask why this new Windows looked different _again_. I had to reveal that this is not Windows at all, but Linux, and explain why we all love Linux. But she picked it up quickly. The classic Zorin OS desktop is very much like her old Windows 7. I watched her find her way through the system and launch her familiar applications with ease. + +She immediately noticed how much faster the computer starts and how much better it performs. + +She's been asking me when I will do the usual computer cleanup so that it doesn't become slow again. I've explained that, with her average use, it won't be needed. Linux simply doesn't rot on its own as Windows does. So far, this has been true. Her PC runs as smooth and fast as on day one. + +Every now and then, I ask how she feels about her new computer. She invariably answers that she's happy with it. Everything works smoothly. The computer doesn't get busy for no reason. No more interrupting her with Very Important Updates. And the menu is where it should always be. She's comfortable with her usual applications in this entirely new environment. + +Over the year, I've logged in remotely a few times to run routine package upgrades. I've logged in with AnyDesk twice. Once, when Mom asked whether photos from an inserted SD card could be imported automatically into the `~/Pictures` folder, and preferably into folders named by dates. Yes, `gThumb` can easily be made to do that with a bit of Bash. Another time, I logged in to add frequently used websites as desktop icons. + +And this has been all of my effort as Mom's Linux Admin so far! At this pace, I could be Mom's Computer Admin to 50 other moms! + +### Summary + +I hope that my story will inspire you to think about migrating to Linux. In the past, we considered Linux to be too difficult for casual users. But today I believe that the opposite is true. The less proficient computer users are, the more reasons they have to migrate to Linux! + +With Linux, novice users will gain a smooth, polished desktop experience with a multitude of familiar applications. They will be much safer than on any other popular computing platform. And helping them with remote access has never been easier and more secure! + +_Disclaimer: This article is not promoting any of the described products, services, or vendors. I don't have any commercial interest nor associations with them. I'm not trying to suggest that these products or services are best for you, nor promising that your experience will be the same._ + +* * * + +_This article originally appeared on [Let's Debug It][18] and is reused with permission._ + +Sandstorm's Jade Wang shares some of her favorite open source web apps that are self-hosted... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/mom-switch-linux + +作者:[Tomasz][a] +选题:[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/tomaszwaraksa +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/heart_lego_ccby20.jpg?itok=VRpHf4iU (Red Lego Heart) +[2]: https://www.redhat.com/en/about/press-releases/red-hat-provides-cern-platform-mission-critical-applications +[3]: https://www.extremetech.com/extreme/155392-international-space-station-switches-from-windows-to-linux-for-improved-reliability +[4]: https://instagram-engineering.com/what-powers-instagram-hundreds-of-instances-dozens-of-technologies-adf2e22da2ad +[5]: https://www.theverge.com/2011/11/14/2559567/tony-fadell-nest-learning-thermostat +[6]: https://www.zdnet.com/article/to-infinity-and-beyond-linux-and-open-source-goes-to-mars/ +[7]: https://opensource.com/sites/default/files/uploads/intro.png (Cowsay "Can Mom Survive Linux?") +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://zorinos.com/ +[10]: https://opensource.com/sites/default/files/uploads/zorin-os-desktop.png (Zorin OS desktop) +[11]: https://blogs.gnome.org/muelli/2010/04/klingon-language-support/ +[12]: https://github.com/signalapp +[13]: https://wiki.gnome.org/Apps/Geary +[14]: https://wiki.gnome.org/Apps/Gthumb +[15]: https://www.videolan.org/vlc/ +[16]: https://opensource.com/sites/default/files/uploads/zorin-os-home-folder.png (Zorin OS home folder) +[17]: https://opensource.com/sites/default/files/uploads/upgrading-software.png (Updating software remotely) +[18]: https://letsdebug.it/post/16-linux-for-mars-copters-moms-and-pops/ From 9788910cdd19fd2e1f2ff34bc1de7d07298fc8db Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 27 Jun 2021 10:32:20 +0800 Subject: [PATCH 209/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @littlebirdnest 感谢您,完成了第一篇翻译贡献! (下回请选择自己熟悉的内容方向,并仔细研读项目的维基,可参照我的校对) --- ...e a long-term boost for 5G availability.md | 65 ++++++++++--------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md b/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md index edb4abd9ae..5dc568f00f 100644 --- a/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md +++ b/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md @@ -1,61 +1,66 @@ [#]: collector: (lujun9972) [#]: translator: (littlebirdnest) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (FCC auctions should be a long-term boost for 5G availability) [#]: via: (https://www.networkworld.com/article/3584072/fcc-auctions-should-be-a-long-term-boost-for-5g-availability.html) [#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) - - -FCC 的拍卖应该是长期有助于 5G 普及 - - +FCC 的频谱拍卖是对 5G 普及的长期助推 ====== -FCC 制定新政策目标是让更多的频段能够被用于通信以此来创造新的服务。 +> FCC 制定新政策是为了让更多的频谱能够被用于通信以此来创造新的服务。 -[FCC][1] -[美国联邦通信委员会][1] +![FCC][1] -随着 5G 的发展,为了让 5G 的服务能成气候,增加更多频谱就是重中之重的事情,FCC 熟知于心。 +随着 5G 的发展,为了完全实现它的服务,显然需要更多的频谱来,FCC 显然对此当成重中之重。 -### 5G 资源 - * [什么是 5G 给企业和手机更快的无限传播][2] - * [ 5G 频率是如何影响 5G 范围和 5G 的速度的][3] - * [ 5G 能够解决哪些,WiFi 无法解决的问题][4] - * [ 5G 能够让 Whirlpool 无人驾驶汽车继续运转][5] - * [ 5G 能够让网络回传更有效率][6] - * [ CBRS 能将 5G 带给企业][7] +FCC 近日完成了有关公民宽带无线电服务Citizen’s Broadband Radio Service(CBRS)的 5G 频谱的[拍卖][8],这些频谱是位于 3.5GHz 频段中的 70MHz 新带宽。它拍卖了 45.8 个亿,是近几年为无线传输释放更多频道的拍卖会之一。FCC 在 2011、2014 和 2015 年在中低频段(大致在 1.7GHz 至 2.2GHz)和 700MHz 上拍卖了 65MHz。 -FCC 近日完成了有关 CBRS 其 5G 频谱的拍卖,代表就有3.5GHz 中的 70MHz 其花费了 45.8 个亿并且是近几年一系列拍卖会之中以腾出更多频段用于无线传输为目的的拍卖会。 -FCC 在 2011、2014 和 2015 年拍卖了 65MHz 的低到中频,大致在 1.7GHz 至 2.2GHz ,例如 700MHz 就在其中。当前频段可操作的范围是低于 6GHz 频段或是中间频段,恰恰是 CMRS 拍卖的部分,即将到来的C频段拍卖将会是重要一环,根据专家猜测,将会有高达280频段进行拍卖“C 频段的拍卖,将会很有价值” IDC 的研究主管Jasom leigh 说到“中频段在美国是极稀有的,这也就是为什么人们会如此积极。” -然而几大主要移动运营商都希望抢到这次拍卖中的最大份额,企业也会对新的频段进行一系列的创新,所以同样将会与运营商竞争一系列可用的频段特别是物联网,资产追踪以及其他的个人应用早已通过 [LTE]网络实现,而 5G 网络将会扩大他们的前景,这多亏了 5G 的先进的频谱共享,低延迟,多连接的特性。广义上讲,能替代更多当前需要线的设备,如工业上的自动化,设备的管理等等。 +当前频谱可操作的范围是低于 6GHz 频段或是中频段的频谱,与 [CBRS][9] 拍卖中出售的频谱处于同一区域。据专家称,即将举行的 C 频段拍卖将会是重要一环,将会有高达 280 MHz 频谱被拍卖。 -## 重新分配频段就意味着谈判 +IDC 的研究主管 Jasom leigh 说,“C 频段的拍卖将带来大笔资金。……美国的中频段频谱是稀缺的,这就是为什么你会看到这种巨大的紧迫性。” -对于想要改变美国的频段优先事项上的问题早已不是小事,FCC 此前的主席 Tom Wheeler 对此绝对深有体会,过去 10 年里,政府一直在推动重新分配频段,而享有频段者的大多是政府机构或者是卫星网络运营商商。这些频段享有者会被分配到不同频段,并常以纳税人的税进行补偿,然后让更多的人进行享用,而这一过程通常是繁琐的, Wheeler 说到。 -并指出“ FCC 现在要面临的一个挑战要从原本分配频段从模拟假设变成数字科技” 就像电视从模拟电视转变成数字电视。当模拟电视要求上到 6MHz 频段以及要求更宽的频宽去避免冲突时,数字信号却能够在一个频段里塞进5个信号。这些假设的证明要面对挑战,反对者义不容辞公开反对 FCC 进入中频宽带,并反对这样做会干涉他们原有的设备和服务,也意味着更换频率就等于买新的设备。 - 我们和[安全部门]还有卫星部门讨论过,事实上其中一个较大的原因是监管的挑战,没人想放弃现有体系下基于模拟信号的安全工作岗位” Wheeler 说到,“我觉得你同样应该考虑周全,但我发现那些所谓宣声信号冲突的人,其实是将眼下当作避难所,根本没有竞争和威胁方面的意识。 +虽然几大主要移动运营商仍有望抢到这次拍卖中的大部分可用的许可证,但频谱的一些最具创新性的用途将由企业实施,所以将会与运营商竞争一系列可用的频段。 + +[物联网][11]、资产追踪以及其他私人网络应用的专用网络早已可以通过私人 LTE 实现,但由于 5G 技术先进的频谱共享、低延迟和多连接的特性,它的成熟大大拓宽了它们的范围。广义上讲,能替代更多当前需要连线的应用,如工业自动化、设备管理等等。 + +### 重新分配频谱就意味着谈判 + +对于想要改变美国的频谱优先事项上的问题并不是小事,FCC 前主席 Tom Wheeler 对此绝对深有体会,过去 10 年里,美国政府一直在推动重新分配频段,而持有频段者的大多是政府机构或者是卫星网络运营商。 + +Wheeler 说,这些利益相关者必须被分配到不同频段,通常以纳税人出资补偿,而让各个相关方参与分享和进行分享经常是一个复杂的过程。 + + +他指出,“FCC 现在面临的挑战之一是,频谱的分配是根据假定使用模拟信号做出的,而这些假定由于数字技术而被改写”。就像电视从模拟电视转变成数字电视。当模拟电视占用了 6MHz 频段,并需要两侧的保护带以避免干扰时,数字信号却能够在一个频段里容纳四到五个信号。 + +事实证明,这些假定是很难面对的。反对者公开反对 FCC 在中频段的动作,认为这样做没有足够的预防措施来避免对他们原有的设备和服务的干扰,而改变频率也意味着必须购买新的设备。 + +“我们和[美国国防部]还有卫星公司讨论过,事实上其中一个较大的原因是监管的挑战,没人想放弃现有体系下基于模拟信号假定下的安全地位。”Wheeler 说到,“我认为你也必须考虑周全,但我发现那些所谓宣声信号冲突的人,其实是将眼下当作避难所,根本没有竞争和威胁方面的意识。” + +### 未来:更多的服务 + +Leigh 表示,无论开放频谱的确切方式如何,但广泛的观点认为将中频频段开放给运营商和企业,对美国商业会有潜在的优势。而当美国坚持以拍卖形式分配无线频谱时,其他国家,像德国,就已经专门预留了供企业使用的中频段频谱。 -## 未来:更多的服务 -Leigh 表示,无论开放频谱的确切方式如何,但广泛的观点认为将中频频段开放给运营商和企业,对美国商业会有潜在的优势。而当美国在分配无线频谱方面坚持以拍卖形式时,其他国家,像德国,就已经专门预留了供企业使用的中频频谱。 对于试图推出自己的私有 5G 网络的公司而言,可能会推高频谱拍卖价格。但是,只要最终有足够可用的频谱,就有服务足够可用,无论它们是内部提供的,还是由移动运营商或供应商销售的。 -“企业能将 5G 变成未来" 他说 + +他说:“企业在 5G 方面做的事情,将推动真正的未来。” + +------ via: https://www.networkworld.com/article/3584072/fcc-auctions-should-be-a-long-term-boost-for-5g-availability.html 作者:[Jon Gold][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/littlebirdnest) -校对:[校对者ID](https://github.com/校对者ID) +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.networkworld.com/author/Jon-Gold/ [b]: https://github.com/lujun9972 -[1]: https://www.flickr.com/photos/fccdotgov/4808818548/ +[1]: https://images.techhive.com/images/article/2017/01/fcc-100704762-large.jpg [2]: https://www.networkworld.com/article/3203489/what-is-5g-fast-wireless-technology-for-enterprises-and-phones.html [3]: https://www.networkworld.com/article/3568253/how-5g-frequency-affects-range-and-speed.html [4]: https://www.networkworld.com/article/3568614/private-5g-can-solve-some-enterprise-problems-that-wi-fi-can-t.html From 2c451ea2aaaf0b3714689e1e594e18bfb0a32c9e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 27 Jun 2021 10:33:27 +0800 Subject: [PATCH 210/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @littlebirdnest 本文首发地址:https://linux.cn/article-13525-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/littlebirdnest --- ...uctions should be a long-term boost for 5G availability.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20200930 FCC auctions should be a long-term boost for 5G availability.md (98%) diff --git a/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md b/published/20200930 FCC auctions should be a long-term boost for 5G availability.md similarity index 98% rename from translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md rename to published/20200930 FCC auctions should be a long-term boost for 5G availability.md index 5dc568f00f..c51a38e7d9 100644 --- a/translated/talk/20200930 FCC auctions should be a long-term boost for 5G availability.md +++ b/published/20200930 FCC auctions should be a long-term boost for 5G availability.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (littlebirdnest) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13525-1.html) [#]: subject: (FCC auctions should be a long-term boost for 5G availability) [#]: via: (https://www.networkworld.com/article/3584072/fcc-auctions-should-be-a-long-term-boost-for-5g-availability.html) [#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) From 89c7eb03b418462385db5eff561fca9f72cd6308 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 27 Jun 2021 13:04:41 +0800 Subject: [PATCH 211/870] PRF @stevenzdg988 --- ... How key Python projects are maintained.md | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/translated/tech/20200206 How key Python projects are maintained.md b/translated/tech/20200206 How key Python projects are maintained.md index 7a4fac22ba..717e1272e4 100644 --- a/translated/tech/20200206 How key Python projects are maintained.md +++ b/translated/tech/20200206 How key Python projects are maintained.md @@ -1,61 +1,62 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How key Python projects are maintained) [#]: via: (https://opensource.com/article/20/2/python-maintained) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) -How key Python projects are maintained 如何维护关键的 Python 项目 ====== -开源 Python 项目保持平稳运行的社区幕后。 -![旧款电脑和新款电脑,代表迁移到新的软件或硬件][1] -Jannis Leidel 是 [Jazzband][2] 社区的一部分。Jazzband 是一个基于 [Python][3] 项目维护责任的共享协作社区。 +> 一窥开源 Python 项目保持平稳运行的社区幕后。 -Jazzband 的诞生源于长期独自维护一个开源项目的压力。Jannis 是巡回乐队管理员,这意味着他负责管理任务并确保乐队中的人可以在他们想要的时候演奏。 +![](https://img.linux.net.cn/data/attachment/album/202106/27/130401uu3l1nkq1padn1gn.jpg) -Jazzband 并不是他的第一个开源志愿者工作——他是前 [Django][4] 核心开发人员,[Django 软件基金会][5] 董事会成员,编写了许多 Django 应用程序和 Python 项目,一直是 [pip][6] 和 [virtualenv][7] 核心开发人员和发布经理,共同创立了 [Python 软件包授权][8],并担任 [PyPI][9] 管理员。在社区方面,他共同创立了德国 Django 协会,担任 [DjangoCon Europe][10] 2010 联合主席,在多个会议上发言,并在去年担任了[Python 软件基金会][11]主管和联席主席 +Jannis Leidel 是 [Jazzband][2] 社区的一部分。Jazzband 是一个协作社区,共同承担维护基于 [Python][3] 的项目。 + +Jazzband 的诞生源于长期独自维护一个开源项目的压力。Jannis 是“roadie”,这意味着他负责管理任务并确保团队中的人可以在他们想要的时候参与。 + +Jazzband 并不是他的第一个开源志愿者工作——他是前 [Django][4] 核心开发人员,[Django 软件基金会][5] 董事会成员,编写了许多 Django 应用程序和 Python 项目,曾是 [pip][6] 和 [virtualenv][7] 核心开发人员和发布经理,共同创立了 [Python 打包机构][8]Python Packaging Authority,还担任过 [PyPI][9] 管理员。在社区方面,他共同创立了德国 Django 协会,担任 [DjangoCon Europe][10] 2010 联合主席,在多个会议上发言,并在去年担任了 [Python 软件基金会][11] 董事和联席主席。 ### Moshe Zadka: 你是如何开始编程的? -Jannis Leidel:我在高中时作为常规德语计算机科学课程的一部分开始学习编程,在那里我涉猎了 Turbo Pascal 和 Prolog。我很快就进入了 Web 开发的世界,并使用 PHP3、[Perl5][12] 和 [MySQL][13] 编写了小型网站。后来在大学里,我在从事媒体艺术项目时再次学习编程,发现 [Ruby][14]、Perl 和 Python 特别有用。我最终坚持使用 Python,因为它的多功能性和易用性。从那时起,我很高兴能够在我的职业生涯中使用 Python 和开放网络技术(HTML/JS/CSS)。 +Jannis Leidel:我开始接触编程是在高中的常规德国计算机科学课程中,在那里我涉猎了 Turbo Pascal 和 Prolog。我很快就进入了 Web 开发的世界,并使用 PHP3、[Perl5][12] 和 [MySQL][13] 编写了一些小型网站。后来在大学里,我在从事媒体艺术项目时再次学习了编程,发现 [Ruby][14]、Perl 和 Python 特别有用。我最终坚持使用 Python,因为它的多功能性和易用性。从那时起,我很高兴能够在我的职业生涯中使用 Python 和开放 Web 技术(HTML/JS/CSS)。 -### Zadka: 您是如何开始开源的? +### Zadka: 你是如何开始接触开源的? -Leidel:作为大学艺术项目的一部分,我需要一种与各种 Web 服务对话并与一些电子设备交互的方法,但发现我之前的 PHP 技能无法胜任这项任务。因此,我参加了有关使用 Python 编程的课程,并对学习更多有关框架如何工作产生兴趣——与库相比——因为它们进一步体现了我想了解的最佳实践。特别是,新生的 Django Web 框架对我很有吸引力,因为它支持务实的方法,并为如何开发 Web 应用程序提供了大量指导。 2007 年,我作为学生参与了 Google Summer of Code for Django,后来为 Django 及其可重用组件生态系统做出了更多贡献——不久我也成为 Django 核心开发人员。在完成学位期间,我能够利用这些技能成为一名自由职业者,并花时间在 Django 社区的许多不同部分工作。在那时,横向移动到更广泛的 Python 社区不过是很自然的。 +Leidel:作为大学艺术项目的一部分,我需要一种与各种 Web 服务对话并与一些电子设备交互的方法,但发现我之前的 PHP 技能无法胜任这项任务。因此,我参加了有关使用 Python 编程的课程,相比库,我对学习更多有关框架如何工作更感兴趣,因为它们进一步体现了我想了解的最佳实践。特别是,新生的 Django Web 框架对我很有吸引力,因为它倾向于一种务实的方法,并为如何开发 Web 应用程序提供了大量指导。 2007 年,我作为学生参与了 Google Summer of Code for Django,后来为 Django 及其可重用组件生态系统做出了更多贡献,不久我也成为了 Django 核心开发人员。在完成学位期间,我能够利用这些技能成为一名自由职业者,并花时间在 Django 社区的许多不同部分工作。在那时,横向移动到更广泛的 Python 社区不过是很自然的。 ### Zadka: 你的日常工作是什么? -Leidel:我是 Mozilla 的一名高级软件工程师,致力于为 Firefox 数据管道开发数据工具。实际上,这意味着我在更广泛的 Firefox 工程团队中从事各种内部和面向公众的基于 Web 的项目,这些项目帮助 Mozilla 员工和社区成员理解 Firefox Web 浏览器发送的遥测数据。我目前的部分重点是维护我们的数据分析和可视化平台,该平台基于开源项目 [Redash][15],并对其做出贡献。我参与的其他项目是我们的下一代遥测系统 [Glean][16] 和一个允许您在浏览器(包括 Scientific Python 堆栈)中进行数据科学的工具 [Iodide][17]。 +Leidel:我是 Mozilla 的一名软件工程师,致力于为 Firefox 数据管道开发数据工具。实际上,这意味着我在更广泛的 Firefox 工程团队中工作,从事各种内部和面向公众的基于 Web 的项目,这些项目帮助 Mozilla 员工和社区成员理解 Firefox Web 浏览器发送的遥测数据。我目前的部分重点是维护我们的数据分析和可视化平台,该平台基于开源项目 [Redash][15],并对其做出贡献。我参与的其他项目是我们的下一代遥测系统 [Glean][16] 和一个允许你在浏览器(包括 Scientific Python 堆栈)中进行数据科学的工具 [Iodide][17]。 -### Zadka: 您是如何参与 Jazzband 的? +### Zadka: 你是如何参与 Jazzband 的? -Leidel:早在 2015 年,我就对单独维护很多人所依赖的项目感到沮丧,并看到我的许多社区同行都在为类似的问题苦苦挣扎。我不知道有什么好方法可以接触到社区中更多可能对长期维护感兴趣的人。在某些情况下,我觉得新的“社会编码”范例很少是社会性的,而且常常是孤立的,有时甚至对新老贡献者来说都是创伤。我相信我们社区中我现在无法容忍的不平等在当时更加猖獗,这使得为贡献者提供一个安全的环境变得困难——我们现在知道这对于稳定的项目维护至关重要。我想知道我们是否缺少一种更具协作性和包容性的软件开发方法。 +Leidel:早在 2015 年,我就对单独维护很多人所依赖的项目感到沮丧,并看到我的许多社区同行都在为类似的问题苦苦挣扎。我不知道有什么好方法可以让社区中更多的人对长期维护感兴趣。在某些情况下,我觉得新的“社会编码”范式的社会性的不足,而且常常是孤立的,有时甚至对新老贡献者来说都是创伤。我相信在我们的社区中,我现在觉得无法容忍的不平等现象在当时更加猖獗,这使得为贡献者提供一个安全的环境变得困难——我们现在知道这对于稳定的项目维护至关重要。我想知道我们是否缺少一种更具协作性和包容性的软件开发方法。 Jazzband 项目的启动是为了降低进入维护的门槛,并简化其中一些较无聊的方面(例如,围绕 [CI][18] 的最佳实践)。 -### Zadka: 您最喜欢 Jazzband 的什么? +### Zadka: 你最喜欢 Jazzband 的哪一点? Leidel:我最喜欢 Jazzband 的一点是,我们确保了许多人所依赖的许多项目的维护,同时还确保任何经验水平的新贡献者都可以加入。 -### Zadka: Jazzband 的“巡回乐队管理员”的工作是什么? +### Zadka: Jazzband 的“roadie”的工作是什么? -Leidel:当谈到 Jazzband 幕后的所有事情时,“roadie”是一个寻求协助的人。这意味着,例如,处理新项目的入职、维护处理用户管理和项目发布的 Jazzband 网站、充当安全或行为准则事件的第一响应者等等。“roadies”这个词是从音乐和活动行业借来的,指的是支持人员,他们负责在巡回演出中几乎所有需要做的事情,除了实际的艺术表演。在 Jazzband,他们在那里确保成员可以在项目上工作。这也意味着某些任务是部分或完全自动化的,这是有意义的,并且最佳实践应用于大多数 Jazzband 项目,如打包设置、文档托管或持续集成。 +Leidel:“roadie”是指处理 Jazzband 幕后所有事务的人。这意味着,例如,处理新项目的进入、维护 Jazzband 网站以处理用户管理和项目发布、充当安全或行为准则事件的第一响应者等等。“roadie”这个词是从音乐和演出行业借来的,指的是支持人员,他们负责在巡回演出中几乎所有需要做的事情,除了实际的艺术表演。在 Jazzband,他们的存在是为了确保成员可以在项目中工作。这也意味着,在有意义的情况下,某些任务是部分或完全自动化的,并且最佳实践被应用于大多数 Jazzband 项目,如打包设置、文档托管或持续集成。 -### Zadka: 作为 Jazzband 的巡回乐队管理员,您工作中最具挑战性的方面是什么? +### Zadka: 作为 Jazzband 的“roadie”,你工作中最具挑战性的方面是什么? -Leidel:目前,我作为"巡回乐队管理员"的工作中最具挑战性的方面是实施社区成员提出的 Jazzband 改进,而不会冒他们所依赖的工作流程的风险。换句话说,Jazzband 越大,在概念级别上扩展项目变得越困难。具有讽刺意味的是,我是目前唯一的"巡回乐队管理员",独自处理一些任务,而 Jazzband 试图阻止其项目发生这种情况。这是 Jazzband 未来的一大担忧。 +Leidel:目前,我作为“roadie”的工作中最具挑战性的方面是实施社区成员提出的 Jazzband 改进,而不影响他们所依赖的工作流程。换句话说,Jazzband 越大,在概念级别上扩展项目变得越困难。具有讽刺意味的是,我是目前唯一的“roadie”,独自处理一些任务,而 Jazzband 却试图阻止其项目发生这种情况。这是 Jazzband 未来的一大担忧。 -### Zadka: 对于有兴趣想知道能否加入 Jazzband 的人,您有什么想说的? +### Zadka: 对于有兴趣想知道能否加入 Jazzband 的人,你有什么想说的? -Leidel:如果您有兴趣加入一群相信协作工作比单独工作更好的人,或者如果您一直在为自己的维护负担而苦苦挣扎并且不知道如何继续,请考虑加入 Jazzband。它简化了新贡献者的入职流程,提供了一个争议框架,并自动发布到 [PyPI][19]。有许多最佳实践可以很好地降低项目无法维护的风险。 +Leidel:如果你有兴趣加入一群相信协作工作比单独工作更好的人,或者如果你一直在为自己的维护负担而苦苦挣扎,并且不知道如何继续,请考虑加入 Jazzband。它简化了新贡献者的进入流程,提供了一个争议解决框架,并自动发布到 [PyPI][19]。有许多最佳实践可以很好地降低项目无人维护的风险。 -### Zadka: 您还有什么想告诉我们的读者的吗? +### Zadka: 你还有什么想告诉我们的读者的吗? -Leidel:我鼓励每个从事开源项目的人都考虑屏幕另一边的人。要有同理心,记住你自己的经历可能不是你同龄人的经历。了解您是全球多元化社区的成员,这要求我们始终尊重我们之间的差异。 +Leidel:我鼓励每个从事开源项目的人都考虑屏幕另一边的人。要有同理心,记住你自己的经历可能不是你同龄人的经历。要明白你是全球多元化社区的成员,这要求我们始终尊重我们之间的差异。 -------------------------------------------------------------------------------- @@ -64,7 +65,7 @@ via: https://opensource.com/article/20/2/python-maintained 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 25718aa7a8f7d82d9d9d73dcecefe93825b5c438 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 27 Jun 2021 13:05:16 +0800 Subject: [PATCH 212/870] PUB @stevenzdg988 https://linux.cn/article-13526-1.html --- .../20200206 How key Python projects are maintained.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200206 How key Python projects are maintained.md (99%) diff --git a/translated/tech/20200206 How key Python projects are maintained.md b/published/20200206 How key Python projects are maintained.md similarity index 99% rename from translated/tech/20200206 How key Python projects are maintained.md rename to published/20200206 How key Python projects are maintained.md index 717e1272e4..6fd2a1952c 100644 --- a/translated/tech/20200206 How key Python projects are maintained.md +++ b/published/20200206 How key Python projects are maintained.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13526-1.html) [#]: subject: (How key Python projects are maintained) [#]: via: (https://opensource.com/article/20/2/python-maintained) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From e8740c1e5989df6774241ac58da2d25c07918b09 Mon Sep 17 00:00:00 2001 From: BoosterY <85090719+BoosterY@users.noreply.github.com> Date: Sun, 27 Jun 2021 13:25:45 +0800 Subject: [PATCH 213/870] Begin to translate 7_Git_Tricks --- sources/tech/20201026 7 Git tricks that changed my life.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201026 7 Git tricks that changed my life.md b/sources/tech/20201026 7 Git tricks that changed my life.md index e2b14241d4..7d106f7804 100644 --- a/sources/tech/20201026 7 Git tricks that changed my life.md +++ b/sources/tech/20201026 7 Git tricks that changed my life.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (BoosterY) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f953c0103a7469e718836390dff7971acf6d759c Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Sun, 27 Jun 2021 15:03:29 +0800 Subject: [PATCH 214/870] Update and rename sources/talk/20210610 Why choose open source for your home automation project.md to translated/talk/20210610 Why choose open source for your home automation project.md --- ...source for your home automation project.md | 44 ------------------ ...source for your home automation project.md | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+), 44 deletions(-) delete mode 100644 sources/talk/20210610 Why choose open source for your home automation project.md create mode 100644 translated/talk/20210610 Why choose open source for your home automation project.md diff --git a/sources/talk/20210610 Why choose open source for your home automation project.md b/sources/talk/20210610 Why choose open source for your home automation project.md deleted file mode 100644 index bdedd0ee45..0000000000 --- a/sources/talk/20210610 Why choose open source for your home automation project.md +++ /dev/null @@ -1,44 +0,0 @@ -[#]: subject: (Why choose open source for your home automation project) -[#]: via: (https://opensource.com/article/21/6/home-automation-ebook) -[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Why choose open source for your home automation project -====== -Home automation is an exciting and fun branch of tech. Start designing -your home automation solutions today with open source tools. -![Working from home at a laptop][1] - -Let's face it. The point of technology is to make life better. - -Of course, what qualifies as "better" varies for people, depending on what they need at any given moment. Still, technology has the unique ability to affect lives at many different stages. For some people, technology offers a relaxing afternoon of entertainment, while for others, it provides navigational assistance, improved health care, or more precise scientific research. - -Interestingly, technology developed for one purpose is rarely divorced from technology used for another. For example, progress made in sports cameras so one person can record their snowboard ride down a ski slope also enables bodycams to help prevent human rights violations by police. Progress made in 3D printing so one person can prototype superhero action figures also makes it possible for volunteers to create oxygen ventilators for the infirm. Technology matters, and it affects us all. - -It's part of the job of open source to ensure that technological advancements are available to everyone, regardless of ethnicity, gender, nationality, physical abilities, religion, or wealth. Sadly, there are companies out there that view technology as a tool to farm data about its customers (that's you and me!), even while those customers finance the research and development of that technology. That's not what open source is about, though. Open source protects its users. - -Yes, home automation is a modern convenience. It's getting better every day. But it's your home. Open source home automation can make life a little easier, a little more like the future promised in all the sci-fi books and movies. But it can also improve the lives of those with different physical abilities than what an appliance manufacturer planned for. A simple Python script written as a minor convenience for one user can be a life-changer for someone else. - -Home automation is an exciting and fun branch of tech. Start designing your home automation solutions today with the help of this **[ebook][2]**, and then share your innovation with others so everyone can benefit. - -That's just what open source is really all about: taking care of each other. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/home-automation-ebook - -作者:[Alan Smithee][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alansmithee -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) -[2]: https://opensource.com/downloads/home-automation-ebook diff --git a/translated/talk/20210610 Why choose open source for your home automation project.md b/translated/talk/20210610 Why choose open source for your home automation project.md new file mode 100644 index 0000000000..7d99dd9f67 --- /dev/null +++ b/translated/talk/20210610 Why choose open source for your home automation project.md @@ -0,0 +1,45 @@ +[#]: subject: "Why choose open source for your home automation project" +[#]: via: "https://opensource.com/article/21/6/home-automation-ebook" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +为什么要为你的家庭自动化项目选择开源 +====== + +家庭自动化是一个令人兴奋的技术分支。现在开始用开源工具为你的家庭自动化设计一套解决方案吧。 + +![Working from home at a laptop][1] + +行动起来吧。科技的关键是让生活更加美好。 + +当然,“更好”的标准因人而异,取决于他们在特定时刻的需求。尽管如此,技术具有影响许多不同阶段生活的独特能力。对一些人来说,科技提供了一个轻松的下午娱乐,而对另一些人来说,它提供导航帮助、改善医疗保健或更精确的科学研究。 + +有趣的是,为一个目的开发的技术很少与用于另一个目的的技术分开。例如,运动相机的进步使得一个人可以记录她们在滑雪场上的化雪过程,也可以使得人体摄像头来帮助防止警察侵犯人权。3D 打印的进步可以让一个人可以制作超级英雄的动作手办,也使得志愿者可以为体弱者制造氧气呼吸机成为可能。技术很重要,它影响着我们所有人。 + +开源工作的一部分是确保每个人都能获得技术进步,无论种族、性别、国籍、身体能力、宗教信仰或财富如何。可悲的是,有些公司将技术视为一种工具来获取有关其客户(即您和我!)的数据,即使这些客户为该技术的研究和开发提供资金。不过,这不是开源的意义所在。 开源项目保护其用户。 + +是的,家庭自动化是一种现代便利,它正在变得一天比一天好。但这是你的家。开源家庭自动化可以让生活变得更轻松,更像是所有科幻书籍和电影中承诺的未来。但它也可以改善那些身体能力与电器制造商计划不同的人的生活。 一个简单的 Python 脚本对一个用户来说可能只是带来了一些便利,而对其他人来说却可能会改变生活。 + +家庭自动化是一个令人兴奋和有趣的技术分支。 借助这本**[电子书][2]**,立即开始设计您的家庭自动化解决方案,然后与他人分享您的创新,让每个人都能受益。 + +这就是开源的真正意义所在:可以帮助世界上的所有人。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/home-automation-ebook + +作者:[Alan Smithee][a] +选题:[lujun9972][b] +译者:[zepoch](https://github.com/zepoch) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy "Working from home at a laptop" +[2]: https://opensource.com/downloads/home-automation-ebook From 09115611007c9cb09dc50877da1f696425427be4 Mon Sep 17 00:00:00 2001 From: BoosterY <85090719+BoosterY@users.noreply.github.com> Date: Sun, 27 Jun 2021 19:12:37 +0800 Subject: [PATCH 215/870] Finished translating for 7_Git_Tricks --- ...01026 7 Git tricks that changed my life.md | 125 ++++++++---------- 1 file changed, 58 insertions(+), 67 deletions(-) diff --git a/sources/tech/20201026 7 Git tricks that changed my life.md b/sources/tech/20201026 7 Git tricks that changed my life.md index 7d106f7804..4f5bf9cafe 100644 --- a/sources/tech/20201026 7 Git tricks that changed my life.md +++ b/sources/tech/20201026 7 Git tricks that changed my life.md @@ -1,26 +1,26 @@ -[#]: collector: (lujun9972) -[#]: translator: (BoosterY) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (7 Git tricks that changed my life) -[#]: via: (https://opensource.com/article/20/10/advanced-git-tips) -[#]: author: (Rajeev Bera https://opensource.com/users/acompiler) +[#]: collector: "lujun9972" +[#]: translator: "BoosterY" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "7 Git tricks that changed my life" +[#]: via: "https://opensource.com/article/20/10/advanced-git-tips" +[#]: author: "Rajeev Bera https://opensource.com/users/acompiler" -7 Git tricks that changed my life +七个改变我生活的 Git 小技巧 ====== -These helpful tips will change the way you work with the popular version -control system. + +接下来这些有用的小技巧将改变你在当前最流行的版本控制系统下的工作方式。 + ![Computer screen with files or windows open][1] -Git is one of the most common version control systems available, and it's used on private systems and publicly hosted websites for all kinds of development work. Regardless of how proficient with Git I become, it seems there are always features left to discover. Here are seven tricks that have changed the way I work with Git. +Git 是当前可用的最流行最普遍的版本控制系统之一,它被应用于私有系统和公有网站上各种各样的开发工作。不论我变得对 Git 有多熟悉,似乎总有些功能等待着被发掘。下面分享下和 Git 相关的改变我工作方式的一些小技巧。 -### 1\. Autocorrection in Git +### 1\. Git 中的自动纠错 -We all make typos sometimes, but if you have Git's auto-correct feature enabled, you can let Git automatically fix a mistyped subcommand. - -Suppose you want to check the status with `git status` but you type `git stats` by accident. Under normal circumstances, Git tells you that 'stats' is not a valid command: +我们每个人都不时在输入时犯拼写错误,但是如果你使能了 Git 的自动纠错功能,你就能让 Git 自动纠正一些输入错误的子命令。 +假如你想用命令`git status`来检查状态,但是你恰巧错误地输入了 `git stats`。通常情况下,Git会告诉你 ‘stats’ 不是个有效的命令: ``` $ git stats @@ -30,17 +30,15 @@ The most similar command is status ``` -To avoid similar scenarios, enable Git autocorrection in your Git configuration: - +为了避免类似情形,只需要在你的 Git 配置中使能自动纠错功能。 ``` `$ git config --global help.autocorrect 1` ``` -If you want this to apply only to your current repository, omit the `--global` option. - -This command enables the autocorrection feature. An in-depth tutorial is available at [Git Docs][2], but trying the same errant command as above gives you a good idea of what this configuration does: +如果你只想对当前的仓库生效,就省略掉选项`--global`。 +这个命令会使能自动纠错功能。在相应的 [Git 官方文档][2] 中可以看到这个命令的详细说明,但是试着敲一下上面的错误命令会使你对这个设置干了什么有个直观的了解: ``` $ git stats @@ -51,21 +49,18 @@ Your branch is up to date with ‘origin/master’. nothing to commit, working tree clean ``` -Instead of suggesting an alternative subcommand, Git now just runs the top suggestion, which in this case was **git status**. +在上面的例子中,Git 直接运行了它建议命令的第一个,也就是 **git status**,而不是给你展示它所建议的子命令。 -### 2\. Count your commits - -There are many reasons you might need to count your commits. Many developers count the number of commits to judge when to increment the build number, for instance, or just to get a feel for how the project is progressing. - -To count your commits is really easy and straightforward; here is the Git command: +### 2\. 提交计数 +需要对提交进行计数的原因有很多。例如,一些开发人员利用提交计数来判断什么时候递增工程构建序号,也有一些开发人员用提交计数来对项目进展取得一个整体上的感观。 +对提交进行计数相当简单而且直接,下面就是相应的 Git 命令: ``` -`$ git rev-list --count` +`$ git rev-list --count branch-name` ``` -In the above command, the **branch-name** should be a valid branch name in your current repository. - +在上述命令中,参数 **branch-name** 必须是一个你当前仓库里的有效分支名。 ``` $ git rev-list –count master @@ -74,26 +69,25 @@ $ git rev-list –count dev 34 ``` -### 3\. Optimize your repo +### 3\. 仓库优化 -Your code repository is valuable not only for you but also for your organization. You can keep your repository clean and up to date with a few simple practices. One of the best practices is to [use the .gitignore file][3]. By using this file, you are telling Git not to store many unwanted files like binaries, temporary files, and so on. - -To optimize your repository further, you can use Git garbage collection. +你的代码仓不仅对你来说很宝贵,对你所在的组织也一样。通过少数几个惯例你就能使自己的仓库整洁并且保持最新。[使用 .gitignore 文件][3] 就是这些最好的惯例之一。通过使用这个文件你可以告诉 Git 不要保存一些不需要记录的文件,如二进制文件,临时文件等等。 +当然,你还可以使用Git的垃圾回收来进一步优化你的仓库。 ``` `$ git gc --prune=now --aggressive` ``` -This command helps when you or your team heavily uses **pull** or **push** commands. +这个命令在你和你的团队经常使用 **pull** 或者 **push** 操作的时候很有帮助。 -This command is an internal utility that cleans up unreachable or "orphaned" Git objects in your repository. +它是一个内部工具,能清理掉你的仓库里没法访问或者说”空悬“的 Git 对象。 -### 4\. Take a backup of untracked files +### 4\. 给未追踪的文件来个备份 -Most of the time, it's safe to delete all the untracked files. But many times, there is a situation wherein you want to delete, but also to create a backup of your untracked files just in case you need them later. +大多数时候,删除所有未追踪的文件使安全的。但很多时候也有这么一种场景,你想删掉这些未追踪的文件同时也想做个备份防止以后需要用到。 -Git, along with some Bash command piping, makes it easy to create a zip archive for your untracked files. +Git 组合一些Bash命令和管道操作,可以让你可以很容易地给那些未追踪的文件创建 zip 压缩包。 ``` @@ -101,30 +95,30 @@ $ git ls-files --others --exclude-standard -z |\ xargs -0 tar rvf ~/backup-untracked.zip ``` -The above command makes an archive (and excludes files listed in .gitignore) with the name backup-untracked.zip -### 5\. Know your .git folder +上面的命令就生成了一个名字为 backup-untracked.zip 的压缩包文件(当然,在 .gitignore 里面忽略了的文件不会包含在内)。 -Every repository has a .git folder. It is a special hidden folder. +### 5\. 了解你的 .git 文件夹 + +每个仓库都有一个 .git 文件夹,它是一个特殊的隐藏文件夹。 ``` $ ls -a . … .git ``` -Git mainly works with two things: +Git 主要处理两件事情: - 1. The working tree (the state of files in your current checkout) - 2. The path of your Git repository (specifically, the location of the .git folder, which contains the versioning information) +1. 当前工作树(你当前检出的文件状态) + 2. 你的 Git 仓库的文件夹(准确地说,包含版本信息的 .git 文件夹的位置) +这个文件夹存储了所有参考信息和一些其他的像配置,仓库数据,HEAD 状态,日志等更多诸如此类的重要细节。 -This folder stores all references and other important details like configurations, repository data, the state of HEAD, logs, and much more. +一旦你删除了这个文件夹,尽管你的源码没被删,但是类似你的工程历史记录等远程信息就没有了。删除这个文件夹意味着你的工程(至少本地的复制)不再在版本控制的范畴之内了。这也就意味着你没法追踪你的修改;你没法从远程仓拉取或推送到远程仓了。 -If you delete this folder, the current state of your source code is not deleted, but your remote information, such as your project history, is. Deleting this folder means your project (at least, the local copy) isn't under version control anymore. It means you cannot track your changes; you cannot pull or push from a remote. - -Generally, there's not much you need to do, or should do, in your .git folder. It's managed by Git and is considered mostly off-limits. However, there are some interesting artifacts in this directory, including the current state of HEAD: +通常而言,你需要或者应当对你的 .git 文件夹的操作并不多。它是被 Git 管理而且大多数时候是一个禁区。然而,在这个文件夹内还是有一些有趣的人工产物,比如说当前的 HEAD 状态在内的就在其中。 ``` @@ -132,43 +126,40 @@ $ cat .git/HEAD ref: refs/heads/master ``` -It also contains, potentially, a description of your repository: - +它也隐式地包含着一个对你仓库地描述: ``` `$ cat .git/description` ``` -This is an unnamed repository; edit this file 'description' to name the repository. +这是一个未命名的仓库;通过编辑文件 ‘description’ 可以给这个仓库命令。 -The Git hooks folder is also here, complete with example hook files. You can read these samples to get an idea of what's possible through Git hooks, and you can also [read this Git hook introduction by Seth Kenlon][4]. +Git 钩子文件夹连同一些钩子文件例子也在这里。参考这些例子你就能知道Git钩子能干什么了。当然,你也可以[参考这个 Seth Kenlon 写的Git钩子介绍][4]。 -### 6\. View a file of another branch +### 6\. 浏览另一个分支的文件 -Sometimes you want to view the content of the file from another branch. It's possible with a simple Git command, and without actually switching your branch. +有时,你会想要浏览另一个分支下某个文件的内容。这其实用一个简单的 Git 命令就可以实现,甚至都不用切换分支。 -Suppose you have a file called [README.md][5], and it's in the **main** branch. You're working on a branch called **dev**. -With the following Git command, you can do it from the terminal. +设想你有一个命名为 [README.md][5] 的文件,并且它在 **main** 分支上。当前你正工作在一个名为 **dev** 的分支。 +用下面的 Git 命令,在终端上就行。 ``` `$ git show main:README.md` ``` -Once you execute this command, you can view the content of the file in your terminal. +一旦你执行这个命令,你就能在你的终端上看到 **main** 分支上该文件的内容。 -### 7\. Search in Git - -You can search in Git like a pro with one simple command. Better still, you can search in Git even if you aren't sure which commit—or even branch—you made your changes. +### 7\. Git 中的搜索 +用一个简单的命令你就能在 Git 中像职业选手一样搜索了。更有甚者,尽管你不确定你的修改在哪次提交或者哪个分支上,你依然能搜索。 ``` `$ git rev-list --all | xargs git grep -F ‘’` ``` -For example, suppose you want to search for the string "font-size: 52 px;" in your repository: - +例如,假设你想在你的仓库中搜索字符串 “font-size: 52 px;" : ``` $ git rev-list –all | xargs git grep -F ‘font-size: 52 px;’ @@ -176,11 +167,11 @@ F3022…9e12:HtmlTemplate/style.css: font-size: 52 px; E9211…8244:RR.Web/Content/style/style.css: font-size: 52 px; ``` -### Try these tips +### 试试这些小技巧 -I hope these advanced tips are useful and boost your productivity, saving you lots of time. +我希望这些小技巧对你是有用的,或者增加你的生产力或者节省你的大量时间。 -Do you have [Git tips][6] you love? Share them in the comments. +你也有一些喜欢的 [Git 技巧][6] 吗?在评论区分享吧。 -------------------------------------------------------------------------------- @@ -188,7 +179,7 @@ via: https://opensource.com/article/20/10/advanced-git-tips 作者:[Rajeev Bera][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[BoosterY](https://github.com/BoosterY) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 73ea7f8ff1103b7685d7d4121417acc99e1bafc3 Mon Sep 17 00:00:00 2001 From: BoosterY <85090719+BoosterY@users.noreply.github.com> Date: Sun, 27 Jun 2021 19:27:55 +0800 Subject: [PATCH 216/870] Move file from Sources to Translated --- .../tech/20201026 7 Git tricks that changed my life.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20201026 7 Git tricks that changed my life.md (100%) diff --git a/sources/tech/20201026 7 Git tricks that changed my life.md b/translated/tech/20201026 7 Git tricks that changed my life.md similarity index 100% rename from sources/tech/20201026 7 Git tricks that changed my life.md rename to translated/tech/20201026 7 Git tricks that changed my life.md From 2afe75f7d5f0b7b5e14d4992909b3938284b99a8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 28 Jun 2021 05:03:11 +0800 Subject: [PATCH 217/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210628=20?= =?UTF-8?q?Forgot=20Linux=20Password=20on=20WSL=3F=20Here=E2=80=99s=20How?= =?UTF-8?q?=20to=20Reset=20it=20Easily?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md --- ...d on WSL- Here-s How to Reset it Easily.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md diff --git a/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md b/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md new file mode 100644 index 0000000000..207f502033 --- /dev/null +++ b/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md @@ -0,0 +1,139 @@ +[#]: subject: (Forgot Linux Password on WSL? Here’s How to Reset it Easily) +[#]: via: (https://itsfoss.com/reset-linux-password-wsl/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Forgot Linux Password on WSL? Here’s How to Reset it Easily +====== + +WSL (Windows Subsystem for Linux) is a handy tool for people who want to enjoy the power of Linux command line from the comfort of Windows. + +When you [install Linux using WSL on Windows][1], you are asked to create a username and password. This user is automatically logged on when you start Linux on WSL. + +Now, the problem is that if you haven’t used it for some time, you may forget the account password of WSL. And this will become a problem if you have to use a command with sudo because here you’ll need to enter the password. + +![][2] + +Don’t worry. You can easily reset it. + +### Reset forgotten password for Ubuntu or any other Linux distribution on WSL + +To reset the Linux password in WSL, you have to: + + * Switch the default user to root + * Reset the password for the normal user + * Switch back the default user to the normal user + + + +Let me show you the steps in detail and with screenshots. + +#### Step 1: Switch to root as default user + +It will be wise to note down your account’s normal/regular username. As you can see, my regular account’s username is abhishek. + +![Note down the account username][3] + +The root user in WSL is unlocked and doesn’t have a password set. This means that you can switch to the root user and then use the power of root to reset the password. + +Since you don’t remember the account password, switching to the root user is done by changing the configuration of your Linux WSL application and make it use root user by default. + +This is done through Windows Command Prompt and you’ll need to know which command you need to run for your Linux distribution. + +This information is usually provided in the description of the distribution app in the [Windows Store][4]. This is from where you had downloaded your distribution in the first place. + +![Know the command to run for your distribution app][5] + +From the Windows menu, start the command prompt: + +![Start Command Prompt][6] + +In here, use your distribution’s command in this fashion. If you were using the Ubuntu app from Windows store, the command would be: + +``` +ubuntu config --default-user root +``` + +In the screenshot, I am using Ubuntu 20.04 app from the Windows store. So, I have used ubuntu2004 command. + +![Set root as default user in Linux app’s configuration][7] + +To save you the trouble, I am listing some distributions and their respective commands in this table: + +Distribution App | Windows Command +---|--- +Ubuntu | ubuntu config –default-user root +Ubuntu 20.04 | ubuntu2004 config –default-user root +Ubuntu 18.04 | ubuntu1804 config –default-user root +Debian | debian config –default-user root +Kali Linux | kali config –default-user root + +#### Step 2: Reset the password for the account + +Now, if you start the Linux distribution app, you should be logged in as root. You can reset the password for the normal user account. + +Do you remember the username in WSL? If not, you can always check the contents of the /home directory. When you have the username, use this command: + +``` +passwd username +``` + +It will ask you to enter a new password. **When you type here, nothing will be displayed on the screen. That’s normal. Just type the new password and hit enter.** You’ll have to retype the new password to confirm and once again, nothing will be displayed on the screen while you type the password. + +![Reset the password for the regular user][8] + +Congratulations. The password for the user account has been reset. But you are done just yet. The default user is still root. You should change it back to your regular account user, otherwise it will keep on logging in as root user. + +#### Step 3: Set regular user as default again + +You’ll need the regular account username that you used with the [passwd command][9] in the previous step. + +Start the Windows command prompt once again. **Use your distribution’s command** in the similar manner you did in the step 1. However, this time, replace root with the regular user. + +``` +ubuntu config --default-user username +``` + +![Set regular user as default user][10] + +Now when you start your Linux distribution app in WSL, you’ll be logged in as the regular user. You have reset the password fresh and can use it to run commands with sudo. + +If you forgot the password again in the future, you know the steps to reset it. + +### If resetting WSL password is this easy, is this not a security risk? + +Not really. You need to have physical access to the computer along with access to the Windows account. If someone already has this much access, she/he can do a lot more than just changing the Linux password in WSL. + +### Were you able to reset WSL password? + +I gave you the commands and explained the steps. I hope this was helpful to you and you were able to reset the password of your Linux distribution in WSL. + +If you are still facing issues or if you have a question on this topic, please feel free to ask in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/reset-linux-password-wsl/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-bash-on-windows/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/reset-wsl-password.png?resize=800%2C450&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/username-wsl.png?resize=800%2C296&ssl=1 +[4]: https://www.microsoft.com/en-us/store/apps/windows +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/wsl-distro-command.png?resize=800%2C602&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/start-cmd-windows.jpg?resize=800%2C500&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/wsl-set-root-as-default.png?resize=800%2C288&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/resetting-wsl-password.png?resize=800%2C366&ssl=1 +[9]: https://linuxhandbook.com/passwd-command/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/set-regular-user-as-default-wsl.png?resize=800%2C288&ssl=1 From 24055b4c2f895aada345cfebd9b449743c024349 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 28 Jun 2021 05:04:20 +0800 Subject: [PATCH 218/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210627=20?= =?UTF-8?q?Try=20Chatwoot,=20an=20open=20source=20customer=20relationship?= =?UTF-8?q?=20platform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210627 Try Chatwoot, an open source customer relationship platform.md --- ...n source customer relationship platform.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/tech/20210627 Try Chatwoot, an open source customer relationship platform.md diff --git a/sources/tech/20210627 Try Chatwoot, an open source customer relationship platform.md b/sources/tech/20210627 Try Chatwoot, an open source customer relationship platform.md new file mode 100644 index 0000000000..30ee81bab9 --- /dev/null +++ b/sources/tech/20210627 Try Chatwoot, an open source customer relationship platform.md @@ -0,0 +1,154 @@ +[#]: subject: (Try Chatwoot, an open source customer relationship platform) +[#]: via: (https://opensource.com/article/21/6/chatwoot) +[#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Try Chatwoot, an open source customer relationship platform +====== +Chatwoot is an open source alternative to Intercom, Zendesk, Salesforce +Service Cloud, and other proprietary communications platforms. +![Digital images of a computer desktop][1] + +Chatwoot is an open source customer relationship platform built with Ruby and Vue.js. It was written from scratch to allow customer-relations teams to build end-to-end platforms for ticket management and support. + +This article looks at Chatwoot's architecture, installation, and key features. + +### Chatwoot's architecture + +Chatwoot requires the following components to function properly: + + * Chatwoot web servers + * Chatwoot workers + * PostgreSQL database + * Redis + * Email service (e.g., SMTP, SendGrid, Mailgun) + * Object storage (e.g., AWS S3, Azure, Google Cloud Storage, MinIO) + + + +The Chatwoot server and workers are the core components that integrate with everything else. PostgreSQL and Redis are specific, required components. + +![Chatwoot architecture][2] + +(Nitish Tiwari, [CC BY-SA 4.0][3]) + +The other components, like the email server and object storage, are loosely coupled, so you can use any compatible system. Therefore, you could choose any SMTP server, self-hosted or SaaS, as your email service. Similarly, for object storage, you can use public cloud platforms like AWS S3, Azure Blob Store, GCS, or private cloud platforms like MinIO. + +### Install Chatwoot + +Chatwoot is available on common platforms, including Linux virtual machines, Docker, and as a single-click install application on [Heroku][4] and [CapRover][5]. This how-to looks at the Docker installation process; for other platforms, refer to Chatwoot's [documentation][6]. + +To begin, ensure Docker Compose is installed on your machine. Then, download the `env` and `docker-compose` files from [Chatwoot's GitHub repo][7]: + + +``` +# Download the env file template +wget -O .env +# Download the Docker compose template +wget -O docker-compose.yml +``` + +Open the `env` file and fill in the env variables `REDIS_PASSWORD` and `POSTGRES_PASSWORD`; these will be the passwords for Redis and PostgreSQL, respectively. Then update the same PostgreSQL password in the `docker-compose.yaml` file.  + +Now, prepare PostgreSQL: + + +``` +`docker-compose run --rm rails bundle exec rails db:chatwoot_prepare` +``` + +Deploy Chatwoot: + + +``` +`docker-compose up -d` +``` + +You should now be able to access Chatwoot at `http://localhost:3000`. + +![Chatwoot welcome screen][8] + +(Nitish Tiwari, [CC BY-SA 4.0][3]) + +### Chatwoot features + +Fill in the details on the welcome page to create the admin user. After that, you should land on the Conversations page. + +![Chatwoot conversations screen][9] + +(Nitish Tiwari, [CC BY-SA 4.0][3]) + +The following are Chatwoot's key features: + +#### Channels + +Chatwoot supports a wide range of platforms as messaging Channels (including website widgets, Facebook, Twitter, WhatsApp, email, and others). To create an integration, click on the **Inboxes** button on the left-hand sidebar. Then select the platform you want to integrate with. + +![Chatwoot channels screen][10] + +(Nitish Tiwari, [CC BY-SA 4.0][3]) + +Each platform has its own set of human agents, teams, labels, and canned responses. This way, Chatwoot allows a unified interface for talking to customers, but each channel is as customizable as it can be in the background. + +#### Reporting + +Organizations take customer response service-level agreements (SLAs) very seriously—and rightly so. Chatwoot has an integrated dashboard that gives a birds-eye view of the most important metrics, like total messages, response times, resolution times, etc. Administrators can also download reports for specific agents. + +![Chatwoot reports screen][11] + +(Nitish Tiwari, [CC BY-SA 4.0][3]) + +#### Contacts + +Chatwoot also captures contact details from each incoming message and neatly arranges this information on a separate page called Contacts. This ensures all contact details are available for further follow-up or even syncing with an external, full-fledged customer relationship management (CRM) platform. + +![Chatwoot Contacts][12] + +(Nitish Tiwari, [CC BY-SA 4.0][3]) + +#### Integrations + +Channels enable integrations with external messaging systems so that Chatwoot can communicate using these systems. However, what if you want a team to be notified on Slack if there is a new chat message on Chatwoot? + +This is where Integration Webhooks come into the picture. This feature allows you to integrate Chatwoot into external systems so that it can send out relevant information. + +![Chatwoot Integrations][13] + +(Nitish Tiwari, [CC BY-SA 4.0][3]) + +### Learn more + +Chatwoot provides many of the key communications features customer relations teams want. To learn more about Chatwoot, take a look at its [GitHub repository][14] and [documentation][15]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/chatwoot + +作者:[Nitish Tiwari][a] +选题:[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/tiwarinitish86 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_desk_home_laptop_browser.png?itok=Y3UVpY0l (Digital images of a computer desktop) +[2]: https://opensource.com/sites/default/files/uploads/chatwoot_servicecalls.png (Chatwoot architecture) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://www.heroku.com/ +[5]: https://caprover.com/docs/get-started.html +[6]: https://www.chatwoot.com/docs/self-hosted/deployment/architecture#available-deployment-options +[7]: https://github.com/chatwoot/chatwoot +[8]: https://opensource.com/sites/default/files/uploads/chatwoot_welcome.png (Chatwoot welcome screen) +[9]: https://opensource.com/sites/default/files/uploads/chatwoot_conversations.png (Chatwoot conversations screen) +[10]: https://opensource.com/sites/default/files/uploads/chatwoot_channels.png (Chatwoot channels screen) +[11]: https://opensource.com/sites/default/files/uploads/chatwoot_reports.png (Chatwoot reports screen) +[12]: https://opensource.com/sites/default/files/uploads/chatwoot_contacts.png (Chatwoot Contacts) +[13]: https://opensource.com/sites/default/files/uploads/chatwoot_integrations.png (Chatwoot Integrations) +[14]: http://github.com/chatwoot/chatwoot +[15]: https://www.chatwoot.com/help-center From a3065d7dce904fcdb974358e6eba3fb32ffa3ffc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 28 Jun 2021 05:04:52 +0800 Subject: [PATCH 219/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210627=20?= =?UTF-8?q?Using=20Git=20Version=20Control=20as=20a=20Writer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210627 Using Git Version Control as a Writer.md --- ...7 Using Git Version Control as a Writer.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/news/20210627 Using Git Version Control as a Writer.md diff --git a/sources/news/20210627 Using Git Version Control as a Writer.md b/sources/news/20210627 Using Git Version Control as a Writer.md new file mode 100644 index 0000000000..478d975e97 --- /dev/null +++ b/sources/news/20210627 Using Git Version Control as a Writer.md @@ -0,0 +1,126 @@ +[#]: subject: (Using Git Version Control as a Writer) +[#]: via: (https://news.itsfoss.com/version-control-writers/) +[#]: author: (Theena https://news.itsfoss.com/author/theena/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Using Git Version Control as a Writer +====== + +I believe modern writers should begin thinking about their processes, or workflows. + +In a highly distracted world, it is imperative to take ownership over the chain of tasks we perform every day as writers. Traditionally, writers would put their writing to the hours where the distraction is less, and the focus high. Unfortunately advice from Hemingway, Atwood, et al., isn’t really applicable to us any more. The world we live in is far more connected, and thus have far more pitfalls for writers. Part of that is being disciplined enough to not let social media or cute videos of puppies and kittens distract us at the times we are writing. + +But disconnecting from the internet isn’t really an option if part of your writing requires quick fact-checks, spellings of uncommon and technical words, etc., – this is very true for me when I am writing. The other issue is the distractions that are within the writing app itself; as a life long MS Word user, I found it getting prettier, but slower and more distracting. I spoke about this at length as being among the [primary reasons for transitioning into Vim][1] in the first place, so I am not going to speak extensively on this. The point being that writing in the modern world, on modern devices can be far from ideal. + +Since I’ve already gone into detail on the [why I switched to Vim][2] and open source version control, I would like to use this article to talk about the **how**, specifically how to use open source version control technology such as git (and GitHub). + +### What is Version Control, again? + +![Source: https://git-scm.com/][3] + +The diagram above is a illustration of how we perform traditional version control. This +diagram assumes that you have one device and that you write only in that device. In my case, I write on a number of machines, including my Android phone and a selection of laptops of varying ages that I use for specific and in specific places. The one common task that I carry out between all these devices is writing – it is imperative, therefore, that my devices capture changes and version controls my files in sane manner. No more `file1V1_device1_date.doc` as I would name my files. + +The diagram above also doesn’t take into account the tools that we use to write.A word processor such as LibreOffice Write works across Linux, Mac, and Windows machines, but using a word processor on the phone is an unpleasant experience. Some of us writers also use other text tools, including Gmail or our email clients, to write little sketches for our writing. Keeping track of all of these files and emails in a logical order is exhausting – I wrote a book using such a process, and trust me: the time I spent figuring out file names, version changes, comments, notes to self, and emails with additional notes, was enough to drive me to distraction. + +Some of you reading this might rightly point out that cloud-based backup technology +exists. While the benefits of cloud-based storage are immense, and I continue using them, version control barely exists, or isn’t powerful. + +### A better workflow + +Like the rest of the planet, the start of the pandemic led to some anxiety and some soul +searching. I spent the time teaching myself web development on [The Odin Project][4] (highly recommended for those who are thinking of learning html, CSS, JavaScript/Ruby). + +Among the first modules was an introduction to Git: what version control was, and what problems it sought to address. Reading this chapter was a revelation. I knew immediately that this _git_ was exactly what I was looking for as a writer. + +The better way, then, isn’t localized version control but _distributed_ version control. ‘Distributed’ describes the distribution of the _devices_ that I will be accessing a file from, and editing/changing thereafter. The diagram below is a visual illustration of distributed version control. + +![Source: https://git-scm.com/][5] + +### My way + +My goals in building a version control system for writing were as follows: + + * Make my manuscript repository accessible from anywhere, from any device + * Ease of use + * Reduce or remove the friction that comes about from shifting context between writing, study and coding workflows – as much as possible, we will use the same tool (i.e. Vim) + * Scalable + * Easy to maintain + + + +Based on the above needs, the diagram below is my distributed version control system for my writing. + +![][6] + +As you can see, my version control system is a simplistic adaptation of distributed version control. By adding git version control to a folder on cloud storage ([pCloud][7]) in my case, I can now draw the benefits of both technologies. Thus my workflow can be visualized as follows: + +![][8] + +#### Advantages + + 1. I have one writing (and coding) tool + 2. I have version control of my manuscripts, no matter what device I access the file from + 3. It’s [super easy, barely an inconvenience][9] + 4. Easy to maintain. + + + +#### Drawbacks + +The writers among you must wonder what drawbacks exist in the system. Here are a few that I anticipate as I continue using and refining this workflow. + + * Comments on drafts: one of the more useful features of word processors is the ability to comment. I often leave comments for myself when I want to come back to a certain portion of the text. I still haven’t figured out a workaround for this. + * Collaboration: Word processors allow for collaboration between writers. During my advertising days, I would use Google Docs to write copy and share the link with my designers to extract the copy for ads and websites. Right now, my workaround for this writing the copy in markdown, and exporting the markdown file to a .doc file via Pandoc. More critically, when my manuscripts are completed, I’d need to still send the files in .doc format for my editors. Once my editor makes +those changes and sends it back, it makes little sense for me to try opening it again in Vim. At this point, the system’s limitations will become more obvious. + + + +In no way am I saying this is the best method, but this is the best method for _me_ at this +point in my career. I imagine I will be refining this further as I get more familiar and comfortable with my new [open source tools for writing][10] and version control. + +I hope this serves as a good introduction to writers wanting to use Git for their document version control. This is by no means an extensive article, but I will share some useful links to make the journey easier for you. + + 1. [Git Basics from The Odin Project:][11] + 2. [Getting started with Git][12] + 3. GitHub’s Basics of Git Tutorial + + + +As a bonus, here’s a screen recording of me using Vim on my Android device to work on a poem, pushing the changes to Git. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/version-control-writers/ + +作者:[Theena][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/theena/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/how-i-started-loving-vim/ +[2]: https://news.itsfoss.com/configuring-vim-writing/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://www.theodinproject.com/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgwMCIgd2lkdGg9IjY2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwNSIgd2lkdGg9IjYxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://itsfoss.com/recommends/pcloud/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc1MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[9]: https://www.youtube.com/watch?v=NtH-HhaLw-Q +[10]: https://itsfoss.com/open-source-tools-writers/ +[11]: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/introduction-to-git +[12]: https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control From 060c3dc0e2e09836adca3218575d00d494d0a219 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 28 Jun 2021 08:48:25 +0800 Subject: [PATCH 220/870] translated --- .../20210622 Replace du with dust on Linux.md | 152 ------------------ .../20210622 Replace du with dust on Linux.md | 151 +++++++++++++++++ 2 files changed, 151 insertions(+), 152 deletions(-) delete mode 100644 sources/tech/20210622 Replace du with dust on Linux.md create mode 100644 translated/tech/20210622 Replace du with dust on Linux.md diff --git a/sources/tech/20210622 Replace du with dust on Linux.md b/sources/tech/20210622 Replace du with dust on Linux.md deleted file mode 100644 index b7cf2e65dc..0000000000 --- a/sources/tech/20210622 Replace du with dust on Linux.md +++ /dev/null @@ -1,152 +0,0 @@ -[#]: subject: (Replace du with dust on Linux) -[#]: via: (https://opensource.com/article/21/6/dust-linux) -[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Replace du with dust on Linux -====== -The dust command is a more intuitive implementation of the du command -written in Rust. -![Sand dunes][1] - -If you work on the Linux command line, you will be familiar with the `du` command. Knowing commands like `du`, which returns information about disk usage quickly, is one of the ways the command line makes programmers more productive. Yet if you're looking for a way to save even more time and make your life even easier, take a look at [dust][2], which is `du` rewritten in Rust with more intuitiveness. - -In short, `dust` is a tool that provides a file's type and metadata. If you trigger `dust` in a directory, it will report that directory's disk utilization in a couple of ways. It provides a very informative graph that tells you which folder is using the most disk space. If there is a nested folder, you can see the percentage of space used by each folder. - -### Install dust - -You can install `dust` using Rust's Cargo package manager: - - -``` -`$ cargo install du-dust` -``` - -Alternately, you might find it in your software repository on Linux, and on macOS, use [MacPorts][3] or [Homebrew][4]. - -### Explore dust - -Issuing the `dust` command on a directory returns a graph that shows its contents and what percentage each item holds in a tree format. - - -``` -$ dust - 5.7M   ┌── exa                                                           │                                                ██ │   2% - 5.9M   ├── tokei                                                         │                                                ██ │   2% - 6.1M   ├── dust                                                          │                                                ██ │   2% - 6.2M   ├── tldr                                                          │                                                ██ │   2% - 9.4M   ├── fd                                                            │                                                ██ │   4% - 2.9M   │ ┌── exa                                                         │                                              ░░░█ │   1% -  15M   │ ├── rustdoc                                                     │                                              ░███ │   6% -  18M   ├─┴ bin                                                           │                                              ████ │   7% -  27M   ├── rg                                                            │                                            ██████ │  11% - 1.3M   │     ┌── libz-sys-1.1.3.crate                                    │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   0% - 1.4M   │     ├── libgit2-sys-0.12.19+1.1.0.crate                         │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   1% - 4.5M   │   ┌─┴ github.com-1ecc6299db9ec823                               │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   2% - 4.5M   │ ┌─┴ cache                                                       │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   2% - 1.0M   │ │   ┌── git2-0.13.18                                            │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   0% - 1.4M   │ │   ├── exa-0.10.1                                              │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 1.5M   │ │   │ ┌── src                                                   │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 2.2M   │ │   ├─┴ idna-0.2.3                                              │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 1.2M   │ │   │       ┌── linux                                           │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   0% - 1.6M   │ │   │     ┌─┴ linux_like                                        │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 2.6M   │ │   │   ┌─┴ unix                                                │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 3.1M   │ │   │ ┌─┴ src                                                   │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 3.1M   │ │   ├─┴ libc-0.2.94                                             │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 1.2M   │ │   │     ┌── test                                              │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   0% - 2.6M   │ │   │   ┌─┴ zlib-ng                                             │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 904K   │ │   │   │   ┌── vstudio                                         │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   0% - 2.0M   │ │   │   │ ┌─┴ contrib                                           │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 3.4M   │ │   │   ├─┴ zlib                                                │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 6.1M   │ │   │ ┌─┴ src                                                   │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │   2% - 6.1M   │ │   ├─┴ libz-sys-1.1.3                                          │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │   2% - 1.6M   │ │   │     ┌── pcre                                              │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 2.5M   │ │   │   ┌─┴ deps                                                │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 3.8M   │ │   │   ├── src                                                 │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │   1% - 7.4M   │ │   │ ┌─┴ libgit2                                               │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │   3% - 7.6M   │ │   ├─┴ libgit2-sys-0.12.19+1.1.0                               │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │   3% -  26M   │ │ ┌─┴ github.com-1ecc6299db9ec823                               │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │  10% -  26M   │ ├─┴ src                                                         │               ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │  10% - 932K   │ │   ┌── .cache                                                  │               ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ │   0% -  11M   │ │   │     ┌── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.idx │               ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███ │   4% - 135M   │ │   │     ├── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.pack│               ░░░░░░▓▓███████████████████████████ │  53% - 147M   │ │   │   ┌─┴ pack                                                │               ░░░░░░█████████████████████████████ │  57% - 147M   │ │   │ ┌─┴ objects                                               │               ░░░░░░█████████████████████████████ │  57% - 147M   │ │   ├─┴ .git                                                    │               ░░░░░░█████████████████████████████ │  57% - 147M   │ │ ┌─┴ github.com-1ecc6299db9ec823                               │               ░░░░░░█████████████████████████████ │  57% - 147M   │ ├─┴ index                                                       │               ░░░░░░█████████████████████████████ │  57% - 178M   ├─┴ registry                                                      │               ███████████████████████████████████ │  69% - 257M ┌─┴ .                                                               │██████████████████████████████████████████████████ │ 100% -$ -``` - -To apply `dust` to a specific directory: - - -``` -`$ dust ~/Work/` -``` - -![Dust output from a specific directory][5] - -(Sudeshna Sur, [CC BY-SA 4.0][6]) - -The `-r` option shows the output in reverse order, with root at the bottom: - - -``` -`$ dust -r ~/Work/` -``` - -Using `dust -d 3` returns three levels of subdirectories and their disk utilization: - - -``` -`$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes`[/code] [code] - -$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes - 4.0K     ┌── jaxrs.xml                                                           │                                         █ │   1% - 4.0K   ┌─┴ subsystem-templates                                                   │                                         █ │   1% - 4.0K   │   ┌── org.jboss.as.controller.transform.ExtensionTransformerRegistration│                                         █ │   1% - 4.0K   │   ├── org.jboss.as.controller.Extension                                 │                                         █ │   1% - 8.0K   │ ┌─┴ services                                                            │                                         █ │   2% - 8.0K   ├─┴ META-INF                                                              │                                         █ │   2% - 4.0K   │ ┌── jboss-as-jaxrs_1_0.xsd                                              │                                        ░█ │   1% - 8.0K   │ ├── jboss-as-jaxrs_2_0.xsd                                              │                                        ░█ │   2% -  12K   ├─┴ schema                                                                │                                        ██ │   3% - 408K   │   ┌── as                                                                │  ████████████████████████████████████████ │  94% - 408K   │ ┌─┴ jboss                                                               │  ████████████████████████████████████████ │  94% - 408K   ├─┴ org                                                                   │  ████████████████████████████████████████ │  94% - 432K ┌─┴ classes                                                                 │██████████████████████████████████████████ │ 100% -$ -``` - -### Conclusion - -The beauty of `dust` lies in being a small, simple, and easy-to-understand command. It uses a color scheme to denote the largest subdirectories, making it easy to visualize your directory. It's a popular project, and contributions are welcome. - -Have you used or considered using `dust`? If so, please let us know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/dust-linux - -作者:[Sudeshna Sur][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/sudeshna-sur -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/sand_dunes_desert_hills_landscape_nature.jpg?itok=wUByylBb -[2]: https://github.com/bootandy/dust -[3]: https://opensource.com/article/20/11/macports -[4]: https://opensource.com/article/20/6/homebrew-mac -[5]: https://opensource.com/sites/default/files/uploads/dust-work.png (Dust output from a specific directory) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/translated/tech/20210622 Replace du with dust on Linux.md b/translated/tech/20210622 Replace du with dust on Linux.md new file mode 100644 index 0000000000..2f4254c3c5 --- /dev/null +++ b/translated/tech/20210622 Replace du with dust on Linux.md @@ -0,0 +1,151 @@ +[#]: subject: (Replace du with dust on Linux) +[#]: via: (https://opensource.com/article/21/6/dust-linux) +[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 上用 dust 代替 du +====== +dust 命令是用 Rust 编写的对 du 命令的一个更直观实现。 +![Sand dunes][1] + +如果你在 Linux 命令行上工作,你会熟悉 `du` 命令。了解像 `du` 这样的可以快速返回磁盘使用情况命令,是命令行使程序员更有效率的方法之一。然而,如果你正在寻找一种方法来节省更多的时间,使你的生活更加容易,看看 [dust][2],它是用 Rust 重写的 `du`,具有更多的直观性。 + +简而言之,`dust` 是一个提供文件类型和元数据的工具。如果你在一个目录中触发了 `dust`,它将以几种方式报告该目录的磁盘利用率。它提供了一个信息量很大的图表,告诉你哪个文件夹使用的磁盘空间最大。如果有一个嵌套的文件夹,你可以看到每个文件夹使用的空间百分比。 + +### 安装 dust + +你可以使用 Rust 的 Cargo 包管理器安装 `dust`: + + +``` +`$ cargo install du-dust` +``` + +另外,你可以在 Linux 上的软件库中找到它,在 macOS 上,使用 [MacPorts][3] 或 [Homebrew][4]。 + +### 探索 dust + +在一个目录中执行 `dust` 命令,会返回一个图表,以树状格式显示其内容和每个项目所占的百分比。 + + +``` +$ dust +5.7M ┌── exa │ ██ │ 2% +5.9M ├── tokei │ ██ │ 2% +6.1M ├── dust │ ██ │ 2% +6.2M ├── tldr │ ██ │ 2% +9.4M ├── fd │ ██ │ 4% +2.9M │ ┌── exa │ ░░░█ │ 1% + 15M │ ├── rustdoc │ ░███ │ 6% + 18M ├─┴ bin │ ████ │ 7% + 27M ├── rg │ ██████ │ 11% +1.3M │ ┌── libz-sys-1.1.3.crate │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 0% +1.4M │ ├── libgit2-sys-0.12.19+1.1.0.crate │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 1% +4.5M │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 2% +4.5M │ ┌─┴ cache │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 2% +1.0M │ │ ┌── git2-0.13.18 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% +1.4M │ │ ├── exa-0.10.1 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +1.5M │ │ │ ┌── src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +2.2M │ │ ├─┴ idna-0.2.3 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +1.2M │ │ │ ┌── linux │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% +1.6M │ │ │ ┌─┴ linux_like │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +2.6M │ │ │ ┌─┴ unix │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +3.1M │ │ │ ┌─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +3.1M │ │ ├─┴ libc-0.2.94 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +1.2M │ │ │ ┌── test │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% +2.6M │ │ │ ┌─┴ zlib-ng │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +904K │ │ │ │ ┌── vstudio │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% +2.0M │ │ │ │ ┌─┴ contrib │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +3.4M │ │ │ ├─┴ zlib │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +6.1M │ │ │ ┌─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 2% +6.1M │ │ ├─┴ libz-sys-1.1.3 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 2% +1.6M │ │ │ ┌── pcre │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +2.5M │ │ │ ┌─┴ deps │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +3.8M │ │ │ ├── src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% +7.4M │ │ │ ┌─┴ libgit2 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 3% +7.6M │ │ ├─┴ libgit2-sys-0.12.19+1.1.0 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 3% + 26M │ │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │ 10% + 26M │ ├─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │ 10% +932K │ │ ┌── .cache │ ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ │ 0% + 11M │ │ │ ┌── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.idx │ ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███ │ 4% +135M │ │ │ ├── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.pack│ ░░░░░░▓▓███████████████████████████ │ 53% +147M │ │ │ ┌─┴ pack │ ░░░░░░█████████████████████████████ │ 57% +147M │ │ │ ┌─┴ objects │ ░░░░░░█████████████████████████████ │ 57% +147M │ │ ├─┴ .git │ ░░░░░░█████████████████████████████ │ 57% +147M │ │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░█████████████████████████████ │ 57% +147M │ ├─┴ index │ ░░░░░░█████████████████████████████ │ 57% +178M ├─┴ registry │ ███████████████████████████████████ │ 69% +257M ┌─┴ . │██████████████████████████████████████████████████ │ 100% +$ +``` + +将 `dust` 应用于一个特定的目录: + + +``` +`$ dust ~/Work/` +``` + +![Dust output from a specific directory][5] + +(Sudeshna Sur, [CC BY-SA 4.0][6]) + +`-r` 选项以相反的顺序显示输出,root 在底部: + + +``` +`$ dust -r ~/Work/` +``` + +使用 `dust -d 3` 会返回三层的子目录和它们的磁盘利用率: + + +``` +`$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes`[/code] [code] + +$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes +4.0K ┌── jaxrs.xml │ █ │ 1% +4.0K ┌─┴ subsystem-templates │ █ │ 1% +4.0K │ ┌── org.jboss.as.controller.transform.ExtensionTransformerRegistration│ █ │ 1% +4.0K │ ├── org.jboss.as.controller.Extension │ █ │ 1% +8.0K │ ┌─┴ services │ █ │ 2% +8.0K ├─┴ META-INF │ █ │ 2% +4.0K │ ┌── jboss-as-jaxrs_1_0.xsd │ ░█ │ 1% +8.0K │ ├── jboss-as-jaxrs_2_0.xsd │ ░█ │ 2% + 12K ├─┴ schema │ ██ │ 3% +408K │ ┌── as │ ████████████████████████████████████████ │ 94% +408K │ ┌─┴ jboss │ ████████████████████████████████████████ │ 94% +408K ├─┴ org │ ████████████████████████████████████████ │ 94% +432K ┌─┴ classes │██████████████████████████████████████████ │ 100% +$ +``` + +### 总结 + +`dust` 的魅力在于它是一个小的、简单的、易于理解的命令。它使用一种颜色方案来表示最大的子目录,使你的目录易于可视化。这是一个受欢迎的项目,欢迎大家来贡献。 + +你是否使用或考虑使用 `dust`?如果是,请在下面的评论中告诉我们你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/dust-linux + +作者:[Sudeshna Sur][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/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/sand_dunes_desert_hills_landscape_nature.jpg?itok=wUByylBb +[2]: https://github.com/bootandy/dust +[3]: https://opensource.com/article/20/11/macports +[4]: https://opensource.com/article/20/6/homebrew-mac +[5]: https://opensource.com/sites/default/files/uploads/dust-work.png (Dust output from a specific directory) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ From d15560453203ab834954904ed5a506d91d12df15 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 28 Jun 2021 08:50:36 +0800 Subject: [PATCH 221/870] translating --- sources/tech/20210624 Copy files between Linux and FreeDOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210624 Copy files between Linux and FreeDOS.md b/sources/tech/20210624 Copy files between Linux and FreeDOS.md index 20ad07c4ef..84a2620ecb 100644 --- a/sources/tech/20210624 Copy files between Linux and FreeDOS.md +++ b/sources/tech/20210624 Copy files between Linux and FreeDOS.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/copy-files-linux-freedos) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 16e1f3eca50b0dad4216ea9fae8e85d58cb13503 Mon Sep 17 00:00:00 2001 From: frstlis <48125063@qq.com> Date: Mon, 28 Jun 2021 09:44:17 +0800 Subject: [PATCH 222/870] =?UTF-8?q?=E8=AF=91=E6=96=87=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Music composition with Python and Linux.md | 109 ----------------- ...Music composition with Python and Linux.md | 110 ++++++++++++++++++ 2 files changed, 110 insertions(+), 109 deletions(-) delete mode 100644 sources/tech/20200210 Music composition with Python and Linux.md create mode 100644 translated/tech/20200210 Music composition with Python and Linux.md diff --git a/sources/tech/20200210 Music composition with Python and Linux.md b/sources/tech/20200210 Music composition with Python and Linux.md deleted file mode 100644 index c9c5cfbfec..0000000000 --- a/sources/tech/20200210 Music composition with Python and Linux.md +++ /dev/null @@ -1,109 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Music composition with Python and Linux) -[#]: via: (https://opensource.com/article/20/2/linux-open-source-music) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) - -Music composition with Python and Linux -====== -A chat with Mr. MAGFest—Brendan Becker. -![Wires plugged into a network switch][1] - -I met Brendan Becker working in a computer store in 1999. We both enjoyed building custom computers and installing Linux on them. Brendan was always involved in several technology projects at once, ranging from game coding to music composition. Fast-forwarding a few years from the days of computer stores, he went on to write [pyDance][2], an open source implementation of multiple dancing games, and then became the CEO of music and gaming event [MAGFest][3]. Sometimes referred to as "Mr. MAGFest" because he was at the helm of the event, Brendan now uses the music pseudonym "[Inverse Phase][4]" as a composer of chiptunes—music predominantly made on 8-bit computers and game consoles. - -I thought it would be interesting to interview him and ask some specifics about how he has benefited from Linux and open source software throughout his career. - -![Inverse Phase performance photo][5] - -Copyright Nickeledge, CC BY-SA 2.0. - -### Alan Formy-Duval: How did you get started in computers and software? - -Brendan Becker: There's been a computer in my household almost as far back as I can remember. My dad has fervently followed technology; he brought home a Compaq Portable when they first hit the market, and when he wasn't doing work on it, I would have access to it. Since I began reading at age two, using a computer became second nature to me—just read what it said on the disk, follow the instructions, and I could play games! Some of the time I would be playing with learning and education software, and we had a few disks full of games that I could play other times. I remember a single disk with a handful of free clones of popular titles. Eventually, my dad showed me that we could call other computers (BBS'ing at age 5!), and I saw where some of the games came from. One of the games I liked to play was written in BASIC, and all bets were off when I realized that I could simply modify the game by just reading a few things and re-typing them to make my game easier. - -### Formy-Duval: This was the 1980s? - -Becker: The Compaq Portable dropped in 1983 to give you a frame of reference. My dad had one of the first of that model. - -### Formy-Duval: How did you get into Linux and open source software? - -Becker: I was heavy into MODs and demoscene stuff in the early 90s, and I noticed that Walnut Creek ([cdrom.com][6]; now defunct) ran shop on FreeBSD. I was super curious about Unix and other operating systems in general, but didn't have much firsthand exposure, and thought it might be time to finally try something. DOOM had just released, and someone told me I might even be able to get it to run. Between that and being able to run cool internet servers, I started going down the rabbit hole. Someone saw me reading about FreeBSD and suggested I check out Linux, this new OS that was written from the ground up for x86, unlike BSD, which (they said) had some issues with compatibility. So, I joined #linuxhelp on undernet IRC and asked how to get started with Linux, pointing out that I had done a modicum of research (asking "what's the difference between Red Hat and Slackware?") and probing mainly about what would be easiest to use. The only person talking in the channel said that he was 13 years old and he could figure out Slackware, so I should not have an issue. A math teacher in my school gave me a hard disk, I downloaded the "A" disk sets and a boot disk, wrote it out, installed it, and didn't spend much time looking back. - -### Formy-Duval: How'd you become known as Mr. MAGFest? - -Becker: Well, this one is pretty easy. I became the acting head of MAGFest almost immediately after the first event. The former chairpeople were all going their separate ways, and I demanded the event not be canceled to the guy in charge. The solution was to run it myself, and that nickname became mine as I slowly molded the event into my own. - -### Formy-Duval: I remember attending in those early days. How large did MAGFest eventually become? - -Becker: The first MAGFest was 265 people. It is now a scary huge 20,000+ unique attendees. - -### Formy-Duval: That is huge! Can you briefly describe the MAGFest convention? - -Becker: One of my buddies, Hex, described it really well. He said, "It's like this video-game themed birthday party with all of your friends, but there happen to be a few thousand people there, and all of them can be your friends if you want, and then there are rock concerts." This was quickly adopted and shortened to "It's a four-day video game party with multiple video game rock concerts." Often the phrase "music and gaming festival" is all people need to get the idea. - -### Formy-Duval: How did you make use of open source software in running MAGFest? - -Becker: At the time I became the head of MAGFest, I had already written a game in Python, so I felt most comfortable also writing our registration system in Python. It was a pretty easy decision since there were no costs involved, and I already had the experience. Later on, our online registration system and rideshare interfaces were written in PHP/MySQL, and we used Kboard for our forums. Eventually, this evolved to us rolling our own registration system from scratch in Python, which we also use at the event, and running Drupal on the main website. At one point, I also wrote a system to manage the video room and challenge stations in Python. Oh, and we had a few game music listening stations that you could flip through tracks and liner notes of iconic game OSTs (Original Sound Tracks) and bands who played MAGFest. - -### Formy-Duval: I understand that a few years ago you reduced your responsibilities at MAGFest to pursue new projects. What was your next endeavor? - -Becker: I was always rather heavily into the game music scene and tried to bring as much of it to MAGFest as possible. As I became a part of those communities more and more, I wanted to participate. I wrote some medleys, covers, and arrangements of video game tunes using free, open source versions of the DOS and Windows demoscene tools that I had used before, which were also free but not necessarily open source. I released a few tracks in the first few years of running MAGFest, and then after some tough love and counseling from Jake Kaufman (also known as virt; Shovel Knight and Shantae are on his resume, among others), I switched gears to something I was much better at—chiptunes. Even though I had written PC speaker beeps and boops as a kid with my Compaq Portable and MOD files in the demoscene throughout the 90s, I released the first NES-spec track that I was truly proud to call my own in 2006. Several pop tributes and albums followed. - -In 2010, I was approached by multiple individuals for game soundtrack work. Even though the soundtrack work didn't affect it much, I began to scale back some of my responsibilities with MAGFest more seriously, and in 2011, I decided to take a much larger step into the background. I would stay on the board as a consultant and help people learn what they needed to run their departments, but I was no longer at the helm. At the same time, my part-time job, which was paying the bills, laid off all of their workers, and I suddenly found myself with a lot of spare time. I began writing Pretty Eight Machine, a Nine Inch Nails tribute, which I spent over a year on, and between that and the game soundtrack work, I proved to myself that I could put food on the table (if only barely) with music, and this is what I wanted to do next. - -### - -![Inverse Phase CTM Tracker][7] - -Copyright Inverse Phase, Used with permission. - -### Formy-Duval: What is your workspace like in terms of hardware and software? - -Becker: In my DOS/Windows days, I used mostly FastTracker 2. In Linux, I replaced that with SoundTracker (not Karsten Obarski's original, but a GTK rewrite; see [soundtracker.org][8]). These days, SoundTracker is in a state of flux—although I still need to try the new GTK3 version—but [MilkyTracker][9] is a good replacement when I can't use SoundTracker. Good old FastTracker 2 also runs in DOSBox, if I really need the original. This was when I started using Linux, however, so this is stuff I figured out 20-25 years ago. - -Within the last ten years, I've gravitated away from sample-based music and towards chiptunes—music synthesized by old sound chips from 8- and 16-bit game systems and computers. There is a very good cross-platform tool called [Deflemask][10] to write music for a lot of these systems. A few of the systems I want to write music for aren't supported, though, and Deflemask is closed source, so I've begun building my own music composition environment from scratch with Python and [Pygame][11]. I maintain my code tree using Git and will control hardware synthesizer boards using open source [KiCad][12]. - -### Formy-Duval: What projects are you currently focused on? - -Becker: I work on game soundtracks and music commissions off and on. While that's going on, I've also been working on starting an electronic entertainment museum called [Bloop][13]. We're doing a lot of cool things with archival and inventory, but perhaps the most exciting thing is that we've been building exhibits with Raspberry Pis. They're so versatile, and it's weird to think that, if I had tried to do this even ten years ago, I wouldn't have had small single-board computers to drive my exhibits; I probably would have bolted a laptop to the back of a flat-panel! - -### Formy-Duval: There are a lot more game platforms coming to Linux now, such as Steam, Lutris, and Play-on-Linux. Do you think this trend will continue, and these are here to stay? - -Becker: As someone who's been gaming on Linux for 25 years—in fact, I was brought to Linux _because_ of games—I think I find this question harder than most people would. I've been running Linux-native games for decades, and I've even had to eat my "either a Linux solution exists or can be written" words back in the day, but eventually, I did, and wrote a Linux game. - -Real talk: Android's been out since 2008. If you've played a game on Android, you've played a game on Linux. Steam's been available for Linux for eight years. The Steambox/SteamOS was announced only a year after Steam. I don't hear a whole lot about Lutris or Play-on-Linux, but I know they exist and hope they succeed. I do see a pretty big following for GOG, and I think that's pretty neat. I see a lot of quality game ports coming out of people like Ryan Gordon (icculus) and Ethan Lee (flibitijibibo), and some companies even port in-house. Game engines like Unity and Unreal already support Linux. Valve has incorporated Proton into the Linux version of Steam for something like two years now, so now Linux users don't even have to search for Linux-native versions of their games. - -I can say that I think most gamers expect and will continue to expect the level of support they're already receiving from the retail game market. Personally, I hope that level goes up and not down! - -_Learn more about Brendan's work as [Inverse Phase][14]._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/linux-open-source-music - -作者:[Alan Formy-Duval][a] -选题:[lujun9972][b] -译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alanfdoss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_other21x_cc.png?itok=JJJ5z6aB (Wires plugged into a network switch) -[2]: http://icculus.org/pyddr/ -[3]: http://magfest.org/ -[4]: http://www.inversephase.com/ -[5]: https://opensource.com/sites/default/files/uploads/inverse_phase_performance_bw.png (Inverse Phase performance photo) -[6]: https://en.wikipedia.org/wiki/Walnut_Creek_CDROM -[7]: https://opensource.com/sites/default/files/uploads/inversephase_ctm_tracker_screenshot.png (Inverse Phase CTM Tracker) -[8]: http://soundtracker.org -[9]: http://www.milkytracker.org -[10]: http://www.deflemask.com -[11]: http://www.pygame.org -[12]: http://www.kicad-pcb.org -[13]: http://bloopmuseum.com -[14]: https://www.inversephase.com diff --git a/translated/tech/20200210 Music composition with Python and Linux.md b/translated/tech/20200210 Music composition with Python and Linux.md new file mode 100644 index 0000000000..3813bda801 --- /dev/null +++ b/translated/tech/20200210 Music composition with Python and Linux.md @@ -0,0 +1,110 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Music composition with Python and Linux) +[#]: via: (https://opensource.com/article/20/2/linux-open-source-music) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +Music composition with Python and Linux +用 Python 和 Linux 进行音乐创作 +====== +与 MAGFest 先生的聊天——Brendan Becker。 +![接入网络交换机的网络线缆][1] + +1999 年,我遇到了在一家计算机商店工作的 Brendan Becker。我们都喜欢构建定制计算机并在其上安装 Linux。 Brendan 总是同时参与多个技术项目,从游戏编程到音乐创作。从电脑商店的日子快进几年,他继续编写[pyDance][2],一个多跳舞游戏的开源实现,然后成为音乐和游戏项目[MAGFest][3]的 CEO。有时被称为 “Mr. MAGFest”,因为他是项目的负责人,Brendan 现在使用音乐笔名 “[Inverse Phase][4]” 作为 `chiptunes`(电子和音)的作曲家——主要在8位计算机和游戏控制台上制作音乐。 + +我认为采访他并询问他在整个职业生涯中如何从 Linux 和开源软件中受益的一些细节会很有趣。 + +![Inverse Phase 表演照片][5] + +版权所有 Nickeledge, CC BY-SA 2.0. + +### Alan Formy-Duval: 您是如何开始使用计算机和软件的? + +Brendan Becker:从我记事起,我家就有一台电脑。我父亲热衷于技术;当 Compaq Portable 第一次大量上市时,他带了一台回家,当他不用它工作时,我可以使用它。自从我两岁开始阅读来,使用电脑就成了我的第二天性——只要阅读磁盘上的内容,按照说明进行操作,我就可以玩游戏了!有时我会玩学习和教育软件,我们有几张装满游戏的磁盘,我可以在其他时间玩。我记得有一个磁盘,里面有一些流行主题的免费克隆。最终,我父亲向我展示了我们可以调用其他计算机(5 岁时在 BBS 上!),我看到了一些游戏的来源。我喜欢玩的一款游戏是用 BASIC 编写的,当我意识到我可以简单地修改游戏时,只需阅读一些内容并重新输入它们以使我的游戏更容易,所有的赌注都被取消了。 + +### Formy-Duval: 这是 80 年代? + +Becker: Compaq Portable 康柏便携式电脑于 1983 年推出,为您提供了一个参考框架。我爸爸有第一个那个模型。 + +### Formy-Duval: 您是如何进入 Linux 和开源软件的? + +Becker:在 90 年代初我酷爱 MOD 和演示场景的东西,我注意到 Walnut Creek([cdrom.com][6];现已解散)在 FreeBSD 上运行商店。总的来说,我对 Unix 和其他操作系统非常好奇,但没有太多的第一手资料,认为是时候尝试一些东西了。DOOM 刚刚发布,有人告诉我甚至可以让它运行。在这与能够运行很酷的互联网服务器之间,我开始陷入困境。有人看到我在阅读有关 FreeBSD 的文章,并建议我检查 Linux,这是一个重新为 x86 编写的新操作系统,与 BSD 不同,后者(他们说)存在一些兼容性问题。因此,我加入了在线交谈网络 IRC 上的 `#linuxhelp` 并询问如何开始使用 Linux,指出我已经做了一些研究(询问 “Red Hat 和 Slackware 之间有什么区别?”)并主要探讨什么是最简单的使用。频道里唯一说话的人说他已经 13 岁了,他可以弄清楚 Slackware,所以我应该没有问题。学校的一个数学老师给了我一个硬盘,我下载了 “A” 盘组和一个启动盘,写了出来,安装了它,回头看并没有花太多时间。 + +### Formy-Duval: 你是如何被称为 MAGFest 先生的? + +Becker:嗯,这个很简单。在第一个项目后,我几乎立即成为了 MAGFest 的代理负责人。前任主席都各奔东西,我向负责人要求不要取消项目。解决方案是自己运行它,当我慢慢地将项目塑造成我自己的时,这个昵称就成了我的。 + +### Formy-Duval: 我记得在那些早期参加过。 MAGFest 到底有多大? + +Becker:第一届 MAGFest 是 265 人。现在是一个可怕的庞大的罕见的 20,000+ 出席者。 + +### Formy-Duval: 太棒了!您能简要描述一下 MAGFest 大会吗? + +Becker:我的一个朋友 Hex 描述得非常好。他说:“就像是和你所有的朋友一起举办这个以电子游戏为主题的生日派对,但那里恰好有几千人,如果你愿意,他们都可以成为你的朋友,然后还有摇滚音乐会。” 这很快被采用并缩短为 “这是一个为期四天的视频游戏派对,有多个视频游戏摇滚音乐会”。通常 “音乐和游戏节” 这个措词是人们所需要的。 + +### Formy-Duval: 您是如何利用开源软件来运行 MAGFest 的? + +Becker:当我成为 MAGFest 的负责人时,我已经用 Python 编写了一个游戏,所以我觉得用 Python 编写我们的注册系统最舒服。这是一个非常容易的决定,因为不涉及任何成本,而且我已经有了经验。后来,我们的在线注册系统和拼车界面都是用 PHP/MySQL 编写的,我们的论坛使用了 Kboard。最终,从无到有逐渐形成在 Python 中滚动我们自己的注册系统,我们也在项目中使用它,并在主网站上运行 Drupal。有一次,我还用 Python 编写了一个系统来管理视频室和邀请比赛站。哦,我们有一些游戏音乐收听站,你可以翻阅曲目,标志性游戏的班轮笔记 OST(原始音轨)和演奏 MAGFest 的乐队。 + +### Formy-Duval: 我知道几年前你减少了你在 MAGFest 的职责,去追求新的项目。你接下来的努力是什么? + +Becker:我一直非常投入游戏音乐领域,并试图将尽可能多的音乐带到 MAGFest 中。随着我越来越多地成为这些社区的一部分,我想参与其中。我使用我以前使用过的免费开源版本的 DOS 和 Windows 演示场景工具编写了一些视频游戏曲调的混合曲、封面和编曲,这些工具也是免费的,但不一定是开源的。我在运行 MAGFest 的最初几年发布了一些曲目,然后在 Jake Kaufman(也被称为 `virt`;其中包括 Shovel Knight 和 Shantae 等人在他的简历上)的一些严厉的爱和建议之后,我改变主题到我更擅长的—— `chiptunes`(电子和音)。尽管我在 90 年代的演示场景中用我的 Compaq Portable 和 MOD 文件编写了 PC 扬声器的哔哔声和嘘声,但我还是在 2006 年发布了第一首 NES-spec 曲目,我真的很自豪地称之为我自己的曲目。专辑紧随其后。 + +2010 年,有很多人找我做游戏配乐工作。尽管配乐工作对它没有太大影响,但我开始更认真地缩减我在 MAGFest 的一些职责,并且在 2011 年,我决定在后台采取更大的步骤。我会留在董事会担任顾问,帮助人们了解他们需要什么来管理他们的部门,但我不再掌舵了。与此同时,我的兼职工作,即支付账单,解雇了他们所有的工人,我突然发现自己有很多空闲时间。我开始写 Pretty Eight Machine, Nine Inch Nails 致敬,我花了一年多,在那和游戏配乐工作之间,我向自己证明了我可以用音乐把食物放在桌子上(如果只是勉强),这就是我接下来想做的。 + +### + +![Inverse Phase CTM 跟踪器][7] + +版权所有 Inverse Phase,经许可使用。 + +### Formy-Duval: 就硬件和软件而言,您的工作空间是什么样的? + +Becker:在我的 DOS/Windows 时代,我主要使用 FastTracker 2。在 Linux 中,我将其替换为 SoundTracker(不是 Karsten Obarski 的原始版本,而是 GTK 重写;参见 [soundtracker.org][8])。这些天,SoundTracker 处于不断变化的状态——虽然我仍然需要尝试新的 GTK3 版本——但是当我无法使用 SoundTracker 时,[MilkyTracker][9] 是一个很好的替代品。如果我真的需要原版,那么好老的 FastTracker 2 也可以在 DOSBox 中运行。然而,那是我开始使用 Linux 的时候,所以这是我在 20-25 年前发现的东西。 + +在过去的十年里,我已经从基于样本的音乐转向了`chiptunes`(电子和音)——由来自 8 位和 16 位游戏系统和计算机的旧声音芯片合成的音乐。有一个非常好的跨平台工具 [Deflemask][10] 可以为许多这些系统编写音乐。不过,我想为其创作音乐的一些系统不受支持,而且 Deflemask 是闭源的,因此我已经开始使用 Python 和 [Pygame][11] 从头开始构建自己的音乐创作环境。我使用 Git 维护我的代码树,并将使用开源 [KiCad][12] 控制硬件合成器板。 + +### Formy-Duval: 您目前专注于哪些项目? + +Becker:我断断续续地制作游戏配乐和音乐委员会。在此期间,我还一直致力于创办一个名为 [Bloop][13] 的电子娱乐博物馆。我们在档案和详细目录方面做了很多很酷的事情,但也许最令人兴奋的是我们一直在用 Raspberry Pi 构建展览。它们是如此多才多艺,而且很奇怪,如果我在十年前尝试这样做,我就不会拥有小型单板计算机来驱动我的展品;我可能会用螺栓将笔记本电脑固定在平板的背面! + +### Formy-Duval: 现在有更多游戏平台进入 Linux,例如 Steam、Lutris 和 Play-on-Linux。您认为这种趋势会持续下去吗?这些会一直存在吗? + +Becker:作为一个在 Linux 上玩了 25 年游戏的人——事实上,我被带到 Linux _是因为_ 游戏——我想我认为这个问题比大多数人更难。几十年来,我一直在运行 Linux 原生游戏,我甚至不得不对“存在 Linux 解决方案或可以编写”的话表示食言,但最终,我做到了,编写了一个 Linux 游戏。 + +真心话:Android 于 2008 年问世。如果您在 Android 上玩过游戏,那么您就在 Linux 上玩过游戏。Steam 已可用于 Linux 八年。Steambox/SteamOS 仅在 Steam 发布一年后发布。我没有听到很多关于 Lutris 或 Play-on-Linux 的消息,但我知道它们存在并希望它们成功。我确实看到 GOG 的追随者非常多,我认为这非常好。我看到很多高质量的游戏端口来自 Ryan Gordon (icculus) 和 Ethan Lee (flibitijibibo) 等人,甚至有些公司在内部移植。Unity 和 Unreal 等游戏引擎已经支持 Linux。Valve 已经将 Proton 纳入 Linux 版本的 Steam 已有两年左右的时间了,所以现在 Linux 用户甚至不必搜索他们游戏的 Linux 原生版本。 + +我可以说,我认为大多数游戏玩家期待并将继续期待他们已经从零售游戏市场获得的支持水平。就我个人而言,我希望这个水平增长而不是下降! + +_详细了解 Brendan 担任 [Inverse Phase][14] 的工作。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/linux-open-source-music + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[stevenzdg988](https://github.com/stevenzdg988) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_other21x_cc.png?itok=JJJ5z6aB (Wires plugged into a network switch) +[2]: http://icculus.org/pyddr/ +[3]: http://magfest.org/ +[4]: http://www.inversephase.com/ +[5]: https://opensource.com/sites/default/files/uploads/inverse_phase_performance_bw.png (Inverse Phase performance photo) +[6]: https://en.wikipedia.org/wiki/Walnut_Creek_CDROM +[7]: https://opensource.com/sites/default/files/uploads/inversephase_ctm_tracker_screenshot.png (Inverse Phase CTM Tracker) +[8]: http://soundtracker.org +[9]: http://www.milkytracker.org +[10]: http://www.deflemask.com +[11]: http://www.pygame.org +[12]: http://www.kicad-pcb.org +[13]: http://bloopmuseum.com +[14]: https://www.inversephase.com From 288cc51ae083686395d2baa32a24b38fd2f6ca63 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:50:09 +0800 Subject: [PATCH 223/870] Update 20200731 Why we open sourced our Python platform.md --- .../talk/20200731 Why we open sourced our Python platform.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200731 Why we open sourced our Python platform.md b/sources/talk/20200731 Why we open sourced our Python platform.md index fe76ac8487..b4d28773c6 100644 --- a/sources/talk/20200731 Why we open sourced our Python platform.md +++ b/sources/talk/20200731 Why we open sourced our Python platform.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4eba401d00be1f39d55791aa5aaa66204096082b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 28 Jun 2021 11:01:20 +0800 Subject: [PATCH 224/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @BoosterY 感谢您,完成了第一篇翻译贡献! --- ...01026 7 Git tricks that changed my life.md | 91 +++++++++---------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/translated/tech/20201026 7 Git tricks that changed my life.md b/translated/tech/20201026 7 Git tricks that changed my life.md index 4f5bf9cafe..bde5aa4417 100644 --- a/translated/tech/20201026 7 Git tricks that changed my life.md +++ b/translated/tech/20201026 7 Git tricks that changed my life.md @@ -1,6 +1,6 @@ [#]: collector: "lujun9972" [#]: translator: "BoosterY" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "7 Git tricks that changed my life" @@ -10,17 +10,17 @@ 七个改变我生活的 Git 小技巧 ====== -接下来这些有用的小技巧将改变你在当前最流行的版本控制系统下的工作方式。 +> 这些有用的小技巧将改变你在当前最流行的版本控制系统下的工作方式。 -![Computer screen with files or windows open][1] +![](https://img.linux.net.cn/data/attachment/album/202106/28/110029d64pblurlh5a4a50.jpg) -Git 是当前可用的最流行最普遍的版本控制系统之一,它被应用于私有系统和公有网站上各种各样的开发工作。不论我变得对 Git 有多熟悉,似乎总有些功能等待着被发掘。下面分享下和 Git 相关的改变我工作方式的一些小技巧。 +Git 是当前最流行最普遍的版本控制系统之一,它被应用于私有系统和公开网站上各种各样的开发工作。不论我变得对 Git 有多熟悉,似乎总有些功能等待着被发掘。下面分享下和 Git 相关的改变我工作方式的一些小技巧。 -### 1\. Git 中的自动纠错 +### 1、Git 中的自动纠错 我们每个人都不时在输入时犯拼写错误,但是如果你使能了 Git 的自动纠错功能,你就能让 Git 自动纠正一些输入错误的子命令。 -假如你想用命令`git status`来检查状态,但是你恰巧错误地输入了 `git stats`。通常情况下,Git会告诉你 ‘stats’ 不是个有效的命令: +假如你想用命令 `git status` 来检查状态,但是你恰巧错误地输入了 `git stats`。通常情况下,Git 会告诉你 ‘stats’ 不是个有效的命令: ``` $ git stats @@ -33,10 +33,10 @@ status 为了避免类似情形,只需要在你的 Git 配置中使能自动纠错功能。 ``` -`$ git config --global help.autocorrect 1` +$ git config --global help.autocorrect 1 ``` -如果你只想对当前的仓库生效,就省略掉选项`--global`。 +如果你只想对当前的仓库生效,就省略掉选项 `--global`。 这个命令会使能自动纠错功能。在相应的 [Git 官方文档][2] 中可以看到这个命令的详细说明,但是试着敲一下上面的错误命令会使你对这个设置干了什么有个直观的了解: @@ -49,18 +49,19 @@ Your branch is up to date with ‘origin/master’. nothing to commit, working tree clean ``` -在上面的例子中,Git 直接运行了它建议命令的第一个,也就是 **git status**,而不是给你展示它所建议的子命令。 +在上面的例子中,Git 直接运行了它建议命令的第一个,也就是 `git status`,而不是给你展示它所建议的子命令。 -### 2\. 提交计数 +### 2、对提交进行计数 需要对提交进行计数的原因有很多。例如,一些开发人员利用提交计数来判断什么时候递增工程构建序号,也有一些开发人员用提交计数来对项目进展取得一个整体上的感观。 对提交进行计数相当简单而且直接,下面就是相应的 Git 命令: + ``` -`$ git rev-list --count branch-name` +$ git rev-list --count branch-name ``` -在上述命令中,参数 **branch-name** 必须是一个你当前仓库里的有效分支名。 +在上述命令中,参数 `branch-name` 必须是一个你当前仓库里的有效分支名。 ``` $ git rev-list –count master @@ -69,97 +70,91 @@ $ git rev-list –count dev 34 ``` -### 3\. 仓库优化 +### 3、仓库优化 -你的代码仓不仅对你来说很宝贵,对你所在的组织也一样。通过少数几个惯例你就能使自己的仓库整洁并且保持最新。[使用 .gitignore 文件][3] 就是这些最好的惯例之一。通过使用这个文件你可以告诉 Git 不要保存一些不需要记录的文件,如二进制文件,临时文件等等。 +你的代码仓库不仅对你来说很宝贵,对你所在的组织也一样。通过少数几个惯例你就能使自己的仓库整洁并且保持最新。[使用 .gitignore 文件][3] 就是这些最好的惯例之一。通过使用这个文件你可以告诉 Git 不要保存一些不需要记录的文件,如二进制文件、临时文件等等。 -当然,你还可以使用Git的垃圾回收来进一步优化你的仓库。 +当然,你还可以使用 Git 的垃圾回收来进一步优化你的仓库。 ``` -`$ git gc --prune=now --aggressive` +$ git gc --prune=now --aggressive ``` -这个命令在你和你的团队经常使用 **pull** 或者 **push** 操作的时候很有帮助。 +这个命令在你和你的团队经常使用 `pull` 或者 `push` 操作的时候很有帮助。 -它是一个内部工具,能清理掉你的仓库里没法访问或者说”空悬“的 Git 对象。 +它是一个内部工具,能清理掉你的仓库里没法访问或者说“空悬”的 Git 对象。 -### 4\. 给未追踪的文件来个备份 +### 4、给未追踪的文件来个备份 -大多数时候,删除所有未追踪的文件使安全的。但很多时候也有这么一种场景,你想删掉这些未追踪的文件同时也想做个备份防止以后需要用到。 - -Git 组合一些Bash命令和管道操作,可以让你可以很容易地给那些未追踪的文件创建 zip 压缩包。 +大多数时候,删除所有未追踪的文件是安全的。但很多时候也有这么一种场景,你想删掉这些未追踪的文件同时也想做个备份防止以后需要用到。 +Git 组合一些 Bash 命令和管道操作,可以让你可以很容易地给那些未追踪的文件创建 zip 压缩包。 ``` $ git ls-files --others --exclude-standard -z |\ -xargs -0 tar rvf ~/backup-untracked.zip + xargs -0 tar rvf ~/backup-untracked.zip ``` +上面的命令就生成了一个名字为 `backup-untracked.zip` 的压缩包文件(当然,在 `.gitignore` 里面忽略了的文件不会包含在内)。 -上面的命令就生成了一个名字为 backup-untracked.zip 的压缩包文件(当然,在 .gitignore 里面忽略了的文件不会包含在内)。 +### 5、了解你的 .git 文件夹 - -### 5\. 了解你的 .git 文件夹 - -每个仓库都有一个 .git 文件夹,它是一个特殊的隐藏文件夹。 +每个仓库都有一个 `.git` 文件夹,它是一个特殊的隐藏文件夹。 ``` $ ls -a . … .git ``` -Git 主要处理两件事情: +Git 主要通过两个东西来工作: 1. 当前工作树(你当前检出的文件状态) - 2. 你的 Git 仓库的文件夹(准确地说,包含版本信息的 .git 文件夹的位置) +2. 你的 Git 仓库的文件夹(准确地说,包含版本信息的 `.git` 文件夹的位置) - -这个文件夹存储了所有参考信息和一些其他的像配置,仓库数据,HEAD 状态,日志等更多诸如此类的重要细节。 +这个文件夹存储了所有参考信息和一些其他的如配置、仓库数据、HEAD 状态、日志等更多诸如此类的重要细节。 一旦你删除了这个文件夹,尽管你的源码没被删,但是类似你的工程历史记录等远程信息就没有了。删除这个文件夹意味着你的工程(至少本地的复制)不再在版本控制的范畴之内了。这也就意味着你没法追踪你的修改;你没法从远程仓拉取或推送到远程仓了。 -通常而言,你需要或者应当对你的 .git 文件夹的操作并不多。它是被 Git 管理而且大多数时候是一个禁区。然而,在这个文件夹内还是有一些有趣的人工产物,比如说当前的 HEAD 状态在内的就在其中。 - +通常而言,你需要或者应当对你的 `.git` 文件夹的操作并不多。它是被 Git 管理的,而且大多数时候是一个禁区。然而,在这个文件夹内还是有一些有趣的工件,比如说当前的 HEAD 状态在内的就在其中。 ``` $ cat .git/HEAD ref: refs/heads/master ``` -它也隐式地包含着一个对你仓库地描述: +它也隐含着对你仓库地描述: ``` -`$ cat .git/description` +$ cat .git/description ``` -这是一个未命名的仓库;通过编辑文件 ‘description’ 可以给这个仓库命令。 +这是一个未命名的仓库;通过编辑文件 ‘description’ 可以给这个仓库命名。 -Git 钩子文件夹连同一些钩子文件例子也在这里。参考这些例子你就能知道Git钩子能干什么了。当然,你也可以[参考这个 Seth Kenlon 写的Git钩子介绍][4]。 +Git 钩子文件夹连同一些钩子文件例子也在这里。参考这些例子你就能知道 Git 钩子能干什么了。当然,你也可以 [参考这个 Seth Kenlon 写的 Git 钩子介绍][4]。 -### 6\. 浏览另一个分支的文件 +### 6、浏览另一个分支的文件 有时,你会想要浏览另一个分支下某个文件的内容。这其实用一个简单的 Git 命令就可以实现,甚至都不用切换分支。 - -设想你有一个命名为 [README.md][5] 的文件,并且它在 **main** 分支上。当前你正工作在一个名为 **dev** 的分支。 +设想你有一个命名为 [README.md][5] 的文件,并且它在 `main` 分支上。当前你正工作在一个名为 `dev` 的分支。 用下面的 Git 命令,在终端上就行。 ``` -`$ git show main:README.md` +$ git show main:README.md ``` -一旦你执行这个命令,你就能在你的终端上看到 **main** 分支上该文件的内容。 +一旦你执行这个命令,你就能在你的终端上看到 `main` 分支上该文件的内容。 -### 7\. Git 中的搜索 +### 7、Git 中的搜索 -用一个简单的命令你就能在 Git 中像职业选手一样搜索了。更有甚者,尽管你不确定你的修改在哪次提交或者哪个分支上,你依然能搜索。 +用一个简单的命令你就能在 Git 中像专业人士一样搜索了。更有甚者,尽管你不确定你的修改在哪次提交或者哪个分支上,你依然能搜索。 ``` -`$ git rev-list --all | xargs git grep -F ‘’` +$ git rev-list --all | xargs git grep -F '' ``` -例如,假设你想在你的仓库中搜索字符串 “font-size: 52 px;" : +例如,假设你想在你的仓库中搜索字符串 `“font-size: 52 px;"` : ``` $ git rev-list –all | xargs git grep -F ‘font-size: 52 px;’ @@ -180,7 +175,7 @@ via: https://opensource.com/article/20/10/advanced-git-tips 作者:[Rajeev Bera][a] 选题:[lujun9972][b] 译者:[BoosterY](https://github.com/BoosterY) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7d80e89b0f220f219b22cdf53c410587118bf100 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 28 Jun 2021 11:02:33 +0800 Subject: [PATCH 225/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @BoosterY 本文首发地址:https://linux.cn/article-13529-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/BoosterY --- .../20201026 7 Git tricks that changed my life.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201026 7 Git tricks that changed my life.md (99%) diff --git a/translated/tech/20201026 7 Git tricks that changed my life.md b/published/20201026 7 Git tricks that changed my life.md similarity index 99% rename from translated/tech/20201026 7 Git tricks that changed my life.md rename to published/20201026 7 Git tricks that changed my life.md index bde5aa4417..d7b1c17f59 100644 --- a/translated/tech/20201026 7 Git tricks that changed my life.md +++ b/published/20201026 7 Git tricks that changed my life.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "BoosterY" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13529-1.html" [#]: subject: "7 Git tricks that changed my life" [#]: via: "https://opensource.com/article/20/10/advanced-git-tips" [#]: author: "Rajeev Bera https://opensource.com/users/acompiler" From d1e2fea27f7068f7e756038d23c0e2f5ad25cc62 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Mon, 28 Jun 2021 11:46:04 +0800 Subject: [PATCH 226/870] Delete 20210517 How to look at the stack with gdb.md --- ...10517 How to look at the stack with gdb.md | 392 ------------------ 1 file changed, 392 deletions(-) delete mode 100644 sources/tech/20210517 How to look at the stack with gdb.md diff --git a/sources/tech/20210517 How to look at the stack with gdb.md b/sources/tech/20210517 How to look at the stack with gdb.md deleted file mode 100644 index 90d3f8a8ea..0000000000 --- a/sources/tech/20210517 How to look at the stack with gdb.md +++ /dev/null @@ -1,392 +0,0 @@ -[#]: subject: (How to look at the stack with gdb) -[#]: via: (https://jvns.ca/blog/2021/05/17/how-to-look-at-the-stack-in-gdb/) -[#]: author: (Julia Evans https://jvns.ca/) -[#]: collector: (lujun9972) -[#]: translator: (amwps290) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to look at the stack with gdb -====== - -I was chatting with someone yesterday and they mentioned that they don’t really understand exactly how the stack works or how to look at it. - -So here’s a quick walkthrough of how you can use gdb to look at the stack of a C program. I think this would be similar for a Rust program, but I’m going to use C because I find it a little simpler for a toy example and also you can do Terrible Things in C more easily. - -### our test program - -Here’s a simple C program that declares a few variables and reads two strings from standard input. One of the strings is on the heap, and one is on the stack. - -``` -#include -#include - -int main() { - char stack_string[10] = "stack"; - int x = 10; - char *heap_string; - - heap_string = malloc(50); - - printf("Enter a string for the stack: "); - gets(stack_string); - printf("Enter a string for the heap: "); - gets(heap_string); - printf("Stack string is: %s\n", stack_string); - printf("Heap string is: %s\n", heap_string); - printf("x is: %d\n", x); -} -``` - -This program uses the extremely unsafe function `gets` which you should never use, but that’s on purpose – we learn more when things go wrong. - -### step 0: compile the program. - -We can compile it with `gcc -g -O0 test.c -o test`. - -The `-g` flag compiles the program with debugging symbols, which is going to make it a lot easier to look at our variables. - -`-O0` tells gcc to turn off optimizations which I did just to make sure our `x` variable didn’t get optimized out. - -### step 1: start gdb - -We can start gdb like this: - -``` -$ gdb ./test -``` - -It prints out some stuff about the GPL and then gives a prompt. Let’s create a breakpoint on the `main` function. - -``` -(gdb) b main -``` - -Then we can run the program: - -``` -(gdb) b main -Starting program: /home/bork/work/homepage/test -Breakpoint 1, 0x000055555555516d in main () - -(gdb) run -Starting program: /home/bork/work/homepage/test - -Breakpoint 1, main () at test.c:4 -4 int main() { -``` - -Okay, great! The program is running and we can start looking at the stack - -### step 2: look at our variables’ addresses - -Let’s start out by learning about our variables. Each of them has an address in memory, which we can print out like this: - -``` -(gdb) p &x -$3 = (int *) 0x7fffffffe27c -(gdb) p &heap_string -$2 = (char **) 0x7fffffffe280 -(gdb) p &stack_string -$4 = (char (*)[10]) 0x7fffffffe28e -``` - -So if we look at the stack at those addresses, we should be able to see all of these variables! - -### concept: the stack pointer - -We’re going to need to use the stack pointer so I’ll try to explain it really quickly. - -There’s an x86 register called ESP called the “stack pointer”. Basically it’s the address of the start of the stack for the current function. In gdb you can access it with `$sp`. When you call a new function or return from a function, the value of the stack pointer changes. - -### step 3: look at our variables on the stack at the beginning of `main` - -First, let’s look at the stack at the start of the `main` function. Here’s the value of our stack pointer right now: - -``` -(gdb) p $sp -$7 = (void *) 0x7fffffffe270 -``` - -So the stack for our current function starts at `0x7fffffffe270`. Cool. - -Now let’s use gdb to print out the first 40 words (aka 160 bytes) of memory after the start of the current function’s stack. It’s possible that some of this memory isn’t part of the stack because I’m not totally sure how big the stack is here. But at least the beginning of this is part of the stack. - -``` -(gdb) x/40x $sp -0x7fffffffe270: 0x00000000 0x00000000 0x55555250 0x00005555 -0x7fffffffe280: 0x00000000 0x00000000 0x55555070 0x00005555 -0x7fffffffe290: 0xffffe390 0x00007fff 0x00000000 0x00000000 -0x7fffffffe2a0: 0x00000000 0x00000000 0xf7df4b25 0x00007fff -0x7fffffffe2b0: 0xffffe398 0x00007fff 0xf7fca000 0x00000001 -0x7fffffffe2c0: 0x55555169 0x00005555 0xffffe6f9 0x00007fff -0x7fffffffe2d0: 0x55555250 0x00005555 0x3cae816d 0x8acc2837 -0x7fffffffe2e0: 0x55555070 0x00005555 0x00000000 0x00000000 -0x7fffffffe2f0: 0x00000000 0x00000000 0x00000000 0x00000000 -0x7fffffffe300: 0xf9ce816d 0x7533d7c8 0xa91a816d 0x7533c789 -``` - -I’ve bolded approximately where the `stack_string`, `heap_string`, and `x` variables are and colour coded them: - - * `x` is red and starts at `0x7fffffffe27c` - * `heap_string` is blue and starts at `0x7fffffffe280` - * `stack_string` is purple and starts at `0x7fffffffe28e` - - - -I think I might have bolded the location of some of those variables a bit wrong here but that’s approximately where they are. - -One weird thing you might notice here is that `x` is the number `0x5555`, but we set `x` to 10! That because `x` doesn’t actually get set until after our `main` function starts, and we’re at the very beginning of `main`. - -### step 3: look at the stack again on line 10 - -Let’s skip a few lines and wait for our variables to actually get set to the values we initialized them to. By the time we get to line 10, `x` should be set to 10. - -First, we need to set another breakpoint: - -``` -(gdb) b test.c:10 -Breakpoint 2 at 0x5555555551a9: file test.c, line 11. -``` - -and continue the program running: - -``` -(gdb) continue -Continuing. - -Breakpoint 2, main () at test.c:11 -11 printf("Enter a string for the stack: "); -``` - -Okay! Let’s look at all the same things again! `gdb` is formatting the bytes in a slightly different way here and I don’t actually know why. Here’s a reminder of where to find our variables on the stack: - - * `x` is red and starts at `0x7fffffffe27c` - * `heap_string` is blue and starts at `0x7fffffffe280` - * `stack_string` is purple and starts at `0x7fffffffe28e` - - - -``` -(gdb) x/80x $sp -0x7fffffffe270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 -0x7fffffffe278: 0x50 0x52 0x55 0x55 0x0a 0x00 0x00 0x00 -0x7fffffffe280: 0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 -0x7fffffffe288: 0x70 0x50 0x55 0x55 0x55 0x55 0x73 0x74 -0x7fffffffe290: 0x61 0x63 0x6b 0x00 0x00 0x00 0x00 0x00 -0x7fffffffe298: 0x00 0x80 0xf7 0x8a 0x8a 0xbb 0x58 0xb6 -0x7fffffffe2a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 -0x7fffffffe2a8: 0x25 0x4b 0xdf 0xf7 0xff 0x7f 0x00 0x00 -0x7fffffffe2b0: 0x98 0xe3 0xff 0xff 0xff 0x7f 0x00 0x00 -0x7fffffffe2b8: 0x00 0xa0 0xfc 0xf7 0x01 0x00 0x00 0x00 -``` - -There are a couple of interesting things to discuss here before we go further in the program. - -### how `stack_string` is represented in memory - -Right now (on line 10) `stack_string` is set to “stack”. Let’s take a look at how that’s represented in memory. - -We can print out the bytes in the string like this: - -``` -(gdb) x/10x stack_string -0x7fffffffe28e: 0x73 0x74 0x61 0x63 0x6b 0x00 0x00 0x00 -0x7fffffffe296: 0x00 0x00 -``` - -The string “stack” is 5 characters which corresponds to 5 ASCII bytes – `0x73`, `0x74`, `0x61`, `0x63`, and `0x6b`. `0x73` is `s` in ASCII, `0x74` is `t`, etc. - -We can also get gdb to show us the string with `x/1s`: - -``` -(gdb) x/1s stack_string -0x7fffffffe28e: "stack" -``` - -### how `heap_string` and `stack_string` are different - -You’ll notice that `stack_string` and `heap_string` are represented in very different ways on the stack: - - * `stack_string` has the contents of the string (“stack”) - * `heap_string` is a pointer to an address somewhere else in memory - - - -Here are the bytes on the stack for the `heap_string` variable: - -``` -0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 -``` - -These bytes actually get read backwards because x86 is little-endian, so the memory address of `heap_string` is `0x5555555592a0` - -Another way to see the address of `heap_string` in gdb is just to print it out with `p`: - -``` -(gdb) p heap_string -$6 = 0x5555555592a0 "" -``` - -### the bytes that represent the integer `x` - -`x` is a 32-bit integer, and the bytes that represent it are `0x0a 0x00 0x00 0x00`. - -We need to read these bytes backwards again (the same way reason we read the bytes for `heap_string` address backwards), so this corresponds to the number `0x000000000a`, or `0xa`, which is 10. - -That makes sense! We set `int x = 10;`! - -### step 4: read input from standard input - -Okay, we’ve initialized the variables, now let’s see how the stack changes when this part of the C program runs: - -``` -printf("Enter a string for the stack: "); -gets(stack_string); -printf("Enter a string for the heap: "); -gets(heap_string); -``` - -We need to set another breakpoint: - -``` -(gdb) b test.c:16 -Breakpoint 3 at 0x555555555205: file test.c, line 16. -``` - -and continue running the program - -``` -(gdb) continue -Continuing. -``` - -We’re prompted for 2 strings, and I entered `123456789012` for the stack string and `bananas` for the heap. - -### let’s look at `stack_string` first (there’s a buffer overflow!) - -``` -(gdb) x/1s stack_string -0x7fffffffe28e: "123456789012" -``` - -That seems pretty normal, right? We entered `123456789012` and now it’s set to `123456789012`. - -But there’s something weird about this. Here’s what those bytes look like on the stack. They’re highlighted in purple again. - -``` -0x7fffffffe270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 -0x7fffffffe278: 0x50 0x52 0x55 0x55 0x0a 0x00 0x00 0x00 -0x7fffffffe280: 0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 -0x7fffffffe288: 0x70 0x50 0x55 0x55 0x55 0x55 0x31 0x32 -0x7fffffffe290: 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 -0x7fffffffe298: 0x31 0x32 0x00 0x8a 0x8a 0xbb 0x58 0xb6 -0x7fffffffe2a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 -0x7fffffffe2a8: 0x25 0x4b 0xdf 0xf7 0xff 0x7f 0x00 0x00 -0x7fffffffe2b0: 0x98 0xe3 0xff 0xff 0xff 0x7f 0x00 0x00 -0x7fffffffe2b8: 0x00 0xa0 0xfc 0xf7 0x01 0x00 0x00 0x00 -``` - -The weird thing about this is that **stack_string was only supposed to be 10 bytes**. But now suddenly we’ve put 13 bytes in it? What’s happening? - -This is a classic buffer overflow, and what’s happening is that `stack_string` wrote over other data from the program. This hasn’t caused a problem yet in our case, but it can crash your program or, worse, open you up to Very Bad Security Problems. - -For example, if `stack_string` were before `heap_string` in memory, then we could overwrite the address that `heap_string` points to. I’m not sure exactly what’s in memory after `stack_string` here but we could probably use this to do some kind of shenanigans. - -### something actually detects the buffer overflow - -When I cause this buffer overflow problem, here’s - -``` - ./test -Enter a string for the stack: 01234567891324143 -Enter a string for the heap: adsf -Stack string is: 01234567891324143 -Heap string is: adsf -x is: 10 -*** stack smashing detected ***: terminated -fish: Job 1, './test' terminated by signal SIGABRT (Abort) -``` - -My guess about what’s happening here is that the `stack_string` variable is actually at the end of this function’s stack, and so the extra bytes are going into a different region of memory. - -When you do this intentionally as a security exploit it’s called “stack smashing”, and somehow something is detecting that this is happening. I’m not totally sure how this is being detected. - -I also thing this is interesting because the program gets killed, but it doesn’t get killed immediately when the buffer overflow happens – a few more lines of code run after the buffer overflow and the program gets killed later. Weird! - -That’s all I have to say about buffer overflows. - -### now let’s look at `heap_string` - -We also read a value (`bananas`) into the `heap_string` variable. Let’s see what that looks like in memory. - -Here’s what `heap_string` looks on the stack after we read the variable in. - -``` -(gdb) x/40x $sp -0x7fffffffe270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 -0x7fffffffe278: 0x50 0x52 0x55 0x55 0x0a 0x00 0x00 0x00 -0x7fffffffe280: 0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 -0x7fffffffe288: 0x70 0x50 0x55 0x55 0x55 0x55 0x31 0x32 -0x7fffffffe290: 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 -``` - -The thing to notice here is that it looks exactly the same! It’s an address, and the address hasn’t changed. But let’s look at what’s at that address. - -``` -(gdb) x/10x 0x5555555592a0 -0x5555555592a0: 0x62 0x61 0x6e 0x61 0x6e 0x61 0x73 0x00 -0x5555555592a8: 0x00 0x00 -``` - -Those are the bytes for `bananas`! Those bytes aren’t in the stack at all, they’re somewhere else in memory (on the heap) - -### where are the stack and the heap? - -We’ve talked about how the stack and the heap are different regions of memory, but how can you tell where they are in memory? - -There’s a file for each process called `/proc/$PID/maps` that shows you the memory maps for each process. Here’s where you can see the stack and the heap in there. - -``` -$ cat /proc/24963/maps -... lots of stuff omitted ... -555555559000-55555557a000 rw-p 00000000 00:00 0 [heap] -... lots of stuff omitted ... -7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0 [stack] -``` - -One thing to notice is that here the heap addresses start with `0x5555` and the stack addresses start with `0x7fffff`. So it’s pretty easy to tell the difference between an address on the stack and an address on the heap. - -### playing about with gdb like this is really helpful - -This was kind of a whirlwind tour and I didn’t explain everything, but hopefully seeing what the data actually looks like in memory makes it a little more clear what the stack actually is. - -I really recommend playing around with gdb like this – even if you don’t understand every single thing that you see in memory, I find that actually seeing the data in my program’s memory like this makes these abstract concepts like “the stack” and “the heap” and “pointers” a lot easier to understand. - -### ideas for more exercises - -A few ideas (in no particular order) for followup exercises to think about the stack: - - * try adding another function to `test.c` and make a breakpoint at the beginning of that function and see if you can find the stack from `main`! They say that “the stack grows down” when you call a function, can you see that happening in gdb? - * return a pointer from a function to a string on the stack and see what goes wrong. Why is it bad to return a pointer to a string on the stack? - * try causing a stack overflow in C and try to understand exactly what happens when the stack overflows by looking at it in gdb! - * look at the stack in a Rust program and try to find the variables! - * try some of the buffer overflow challenges in the [nightmare course][1]. The README for each challenge is the solution so avoid reading it if you don’t want to be spoiled. The idea with all of those challenges is that you’re given a binary and you need to figure out how to cause a buffer overflow to get it to print out the “flag” string. - - - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2021/05/17/how-to-look-at-the-stack-in-gdb/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://github.com/guyinatuxedo/nightmare From 4b6e623c2e207f534f274c9f5c45a32d291069f0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 28 Jun 2021 12:00:56 +0800 Subject: [PATCH 227/870] PRF @geekpi --- ...ly Useful BitTorrent Application by KDE.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md b/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md index f27f16d3db..328e8a9918 100644 --- a/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md +++ b/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md @@ -3,18 +3,20 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -KTorrent:KDE 的一个非常有用的 BitTorrent 应用 +KTorrent:KDE 上的一个非常有用的 BitTorrent 应用 ====== -Linux 中有各种各样的 BitTorrent 应用。但是,找到一个好的、提供许多功能的应用应该可以为你节省一些时间。 +![](https://img.linux.net.cn/data/attachment/album/202106/28/120031cml79jimcs99ybpy.jpg) + +Linux 中有各种各样的 BitTorrent 应用。但是,找到一个好的、提供许多功能的应用将可以为你节省一些时间。 KDE 的 KTorrent 就是这样一个为 Linux 打造的 BitTorrent 应用。 -虽然有 [Linux 有几个 torrent 客户端][1],但我最近发现 KTorrent 对我而言很有趣。 +虽然 [Linux 有好几个 torrent 客户端][1],但我最近发现 KTorrent 对我而言很合适。 ### KTorrent: 适用于 Linux 的开源 BitTorrent 客户端 @@ -22,7 +24,7 @@ KDE 的 KTorrent 就是这样一个为 Linux 打造的 BitTorrent 应用。 KTorrent 是一个成熟的 torrent 客户端,主要为 KDE 桌面定制。无论你使用什么桌面环境,它都能很好地工作。 -当然,使用KDE桌面,你可以得到一个无缝的用户体验。 +当然,使用 KDE 桌面,你可以得到一个无缝的用户体验。 让我们来看看它的所有功能。 @@ -35,45 +37,43 @@ KTorrent 是一个成熟的 torrent 客户端,主要为 KDE 桌面定制。无 * 在一个队列中添加 torrent 下载 * 能够控制每次下载(或整体)的速度限制 * 视频和音频文件预览选项 - * 支持导入下载文件(部分/全部)。 + * 支持导入下载的文件(部分/全部) * 在下载多个文件时,能够对 torrent 下载进行优先排序 * 为多文件 torrent 选择要下载的特定文件 - * IP 过滤器,可选择踢走/禁止 peer。 + * IP 过滤器,可选择踢走/禁止对端。 * 支持 UDP 跟踪器 - * 支持 µTorrent peer + * 支持 µTorrent 对端 * 支持协议加密 - * 能够创建无 tracker 的 torrent + * 能够创建无跟踪器的 torrent * 脚本支持 * 系统托盘集成 * 通过代理连接 * 增加了插件支持 * 支持 IPv6 - - -KTorrent 听起来很有用,作为一个 torrent 客户端,你可以日常控制它在一个地方管理所有的 torrent 下载。 +KTorrent 看起来可以作为一个日常使用的 torrent 客户端,在一个地方管理所有的 torrent 下载。 ![][4] -除了上面提到的功能外,它还对客户端的行为提供了很大的控制。例如,调整指示下载/暂停/tracker 服务器的颜色。 +除了上面提到的功能外,它还对客户端的行为提供了很大的控制。例如,调整下载/暂停/跟踪器的指示颜色。 -如果你想禁用完成 torrent 下载的声音或得到活动通知,你还可以设置通知。 +如果你想禁用完成 torrent 下载时的声音或得到活动通知,你还可以设置通知。 ![][5] -虽然像协议加密支持这样的功能可能无法取代一些[最好的 VPN][6] 服务,但它对桌面客户端来说是一个重要的补充。 +虽然像协议加密支持这样的功能可能无法取代一些 [最好的私有专用网络][6] 服务,但它对桌面客户端来说是一个重要的补充。 ### 在 Linux 中安装 KTorrent KTorrent 应该可以通过包管理器(如 [Synaptic][7])或默认的仓库获得。你也可以在你的软件中心找到它并轻松安装。 -除此之外,它还在 [Flathub][9] 上提供了一个适用于任何 Linux 发行版的 [Flatpak][8] 官方包。如果你需要帮助,我们有一个 [Flatpak 指南][10]供参考。 +除此之外,它还在 [Flathub][9] 上提供了一个适用于任何 Linux 发行版的 [Flatpak][8] 官方包。如果你需要帮助,我们有一个 [Flatpak 指南][10] 供参考。 如果你喜欢的话,你也可以尝试可用的 [snap包][11]。 -要探索更多关于它和源码的信息,请前往它的[官方 KDE 应用页面][12]。 +要探索更多关于它和源码的信息,请前往它的 [官方 KDE 应用页面][12]。 -[KTorrent][12] +- [KTorrent][12] ### 结束语 @@ -90,7 +90,7 @@ via: https://itsfoss.com/ktorrent/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 198636dc8cdf756fb18aa379e8e8a1c3db0f4376 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 28 Jun 2021 12:01:35 +0800 Subject: [PATCH 228/870] PUB @geekpi https://linux.cn/article-13530-1.html --- ...ent- An Incredibly Useful BitTorrent Application by KDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md (98%) diff --git a/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md b/published/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md similarity index 98% rename from translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md rename to published/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md index 328e8a9918..fba3c69a7e 100644 --- a/translated/tech/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md +++ b/published/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13530-1.html) KTorrent:KDE 上的一个非常有用的 BitTorrent 应用 ====== From 5ae74cfd9b05bf168df3e797e22971825f3851ea Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Mon, 28 Jun 2021 12:04:52 +0800 Subject: [PATCH 229/870] Update and rename sources/talk/20200731 Why we open sourced our Python platform.md to translated/talk/20200731 Why we open sourced our Python platform.md --- ...Why we open sourced our Python platform.md | 105 ----------------- ...Why we open sourced our Python platform.md | 109 ++++++++++++++++++ 2 files changed, 109 insertions(+), 105 deletions(-) delete mode 100644 sources/talk/20200731 Why we open sourced our Python platform.md create mode 100644 translated/talk/20200731 Why we open sourced our Python platform.md diff --git a/sources/talk/20200731 Why we open sourced our Python platform.md b/sources/talk/20200731 Why we open sourced our Python platform.md deleted file mode 100644 index b4d28773c6..0000000000 --- a/sources/talk/20200731 Why we open sourced our Python platform.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why we open sourced our Python platform) -[#]: via: (https://opensource.com/article/20/7/why-open-source) -[#]: author: (Meredydd Luff https://opensource.com/users/meredydd-luff) - -Why we open sourced our Python platform -====== -Open source development philosophy makes Anvil's entire solution more -useful and trustworthy. -![neon sign with head outline and open source why spelled out][1] - -The team at Anvil recently open sourced the [Anvil App Server][2], a runtime engine for hosting web apps built entirely in Python. - -The community reaction has been overwhelmingly positive, and we, at Anvil, have already incorporated lots of that feedback into our [next release][3]. But one of the questions we keep getting asked is, "Why did you choose to open source such a core part of your product?" - -### Why we created Anvil - -[Anvil][4] is a tool that makes it as simple as possible to build a web app. We do that by enabling you to build the whole application in one language—Python. - -Before Anvil, if you wanted to build a web app, you'd have to write code using a bunch of technologies like HTML, Javascript, CSS, Python, SQL, React, Redux, Bootstrap, Sass, Webpack, etc. That's a lot to learn. And that's just for a simple app; trust me, it can get [way more complicated][5]. - -![A complex framework of development tools needed for a simple web app][6] - -Yes, really. All of these, for a simple web app. - -But even then, you're not done! You need to know all about Git and cloud hosting providers, how to secure the (most-likely) Linux operating system, how to tune the database, and then you're on call to keep it running. Forever. - -So, instead, we built Anvil, an online IDE where you can build your UI with a [drag-and-drop designer][7] and write all your [logic in Python][8], then Anvil takes care of the rest. We replace that whole teetering stack with "just write Python." - -### Simple web hosting is important, but not enough - -Anvil can also host your apps for you. And why not? There is so much complexity in deploying a web app, so running our own cloud hosting service was the only way to provide the simplicity we need. Build an app in the Anvil editor, [click a button][9], and it's live on the Internet. - -But we kept hearing from people who said, "That's great, but…" - - * "I need to run this on an offshore platform without reliable internet access." - * "I want to package my app into an IoT device I sell." - * "If I'm putting my eggs in this basket, how can I be sure I can still run my app in ten years?" - - - -These are all good points! A cloud service isn't the right solution for everyone. If we want to serve these users, there's got to be some way for them to get their apps out of Anvil and run them locally, under their own complete control. - -### Open source is an escape hatch, not an ejector seat - -At conferences, we sometimes get asked, "Can I export this as a Flask+JS app?" Sure, it would be possible to export an Anvil project into its respective Python and JavaScript—we could generate a server package, compile the client-side Python to Javascript, and spit out a classic web app. But it would have serious drawbacks, because: **code generation is an ejector seat.** - -![Code generation is an ejector seat from a structured platform][10] - -([Image][11] licensed as public domain) - -Generated code is better than nothing; at least you can edit it! But the moment you've edited that code, you've lost all the benefits of the system that generated it. If you're using Anvil because of its [drag-and-drop editor][12] and [Python in the browser][13], why should you have to use vim and Javascript in order to host your app locally? - -We believe in [escape hatches, not ejector seats][14]. So we did it the right way—we [open-sourced Anvil's runtime engine][2], which is the same code that serves your app in our hosted service. It's a standalone app; you can edit your code with a text editor and run it locally. But you can also `git push` it right back into our online IDE. It's not an ejector seat; there's no explosive transition. It's an escape hatch; you can climb out, do what you need to do, and climb right back in. - -### If it's open, is it reliable? - -A seeming contradiction in open source is that its free availability is its strength, but also sometimes creates a perception of instability. After all, if you're not charging for it, how are you keeping this platform up and healthy for the long term? - -We're doing what we always have—providing a development tool that makes it drastically simpler to build web applications, though the apps you build using Anvil are 100% yours. We provide hosting for Anvil apps and we offer the entire development and hosting platform onsite for [enterprise customers][15]. This enables us to offer a free plan so that everyone can use Anvil for hobby or educational purposes, or to start building something and see where it goes. - -### More to gain, little to lose - -Open sourcing our runtime engine isn't a detractor from our business—it makes our online IDE more useful and more trustworthy, today and in the future. We've open-sourced the Anvil App Server for the people who need it, and to provide the ultimate insurance policy. It's the right move for our users—now they can build with confidence, knowing that the open source code is [right there][3] if they need it. - -If our development philosophy resonates with you, why not try Anvil yourself? -  - -\----- - -_This post is an adaptation of [Why We Open Sourced the Anvil App Server][16] and is reused with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/7/why-open-source - -作者:[Meredydd Luff][a] -选题:[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/meredydd-luff -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUS_OSwhy_520x292_ma.png?itok=lqfhAs8L (neon sign with head outline and open source why spelled out) -[2]: https://anvil.works/blog/open-source -[3]: https://github.com/anvil-works/anvil-runtime -[4]: https://anvil.works/ -[5]: https://github.com/kamranahmedse/developer-roadmap#introduction -[6]: https://opensource.com/sites/default/files/uploads/frameworks.png (A complex framework of development tools needed for a simple web app) -[7]: https://anvil.works/docs/client/ui -[8]: https://anvil.works/docs/client/python -[9]: https://anvil.works/docs/deployment -[10]: https://opensource.com/sites/default/files/uploads/ejector-seat-opensourcecom.jpg (Code generation is an ejector seat from a structured platform) -[11]: https://commons.wikimedia.org/wiki/File:Crash.arp.600pix.jpg -[12]: https://anvil.works/docs/editor -[13]: https://anvil.works/docs/client -[14]: https://anvil.works/blog/escape-hatches-and-ejector-seats -[15]: https://anvil.works/docs/overview/enterprise -[16]: https://anvil.works/blog/why-open-source diff --git a/translated/talk/20200731 Why we open sourced our Python platform.md b/translated/talk/20200731 Why we open sourced our Python platform.md new file mode 100644 index 0000000000..f73dc7b29d --- /dev/null +++ b/translated/talk/20200731 Why we open sourced our Python platform.md @@ -0,0 +1,109 @@ +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Why we open sourced our Python platform" +[#]: via: "https://opensource.com/article/20/7/why-open-source" +[#]: author: "Meredydd Luff https://opensource.com/users/meredydd-luff" + +为什么我们要开源我们的 Python 平台 +====== + +Open source development philosophy makes Anvil's entire solution more +useful and trustworthy.开源开发的理念使得 Anvil 的整个解决方案更加有用且值得信赖。 +![neon sign with head outline and open source why spelled out][1] + +Anvil 团队最近开源了 [Anvil App Server][2], 一个用于托管 Python Web 程序的运行引擎。 + +社区的反应十分积极,我们 Anvil 团队已经将许多反馈纳入了我们的 [next release][3]。但是我们不断被问到的问题是,“为什么你们选择开源这个产品的核心呢?” + + + +### 我们为何创造 Anvil + +[Anvil][4] 是一个可以使得构建 web app 更加简单的工具。我们让你们有能力仅使用一种语言——Python 就可以来构建你的整个应用。 + +在 Anvil 之前,如果你想要构建一个 web app,你需要写很多代码,用很多的技术,比如 HTML、Javascript、CSS、Python、SQL、React、Redux、Bootstrap、Sass、Webpack 等。这需要花费很长时间来学习。对于一个简单的应用便是这样子;相信我,一般的应用其实[更加复杂][5]。 + +![A complex framework of development tools needed for a simple web app][6] + +是的。对于一个简单的 web app 便是需要如此多的技术。 + +但是从此之后,你便不再需要这样子做了。您仅仅需要了解有关 Git 和云托管提供商的所有信息、如何保护(最有可能的)Linux 操作系统、如何调整数据库,然后随时待命以保持其运行。 + +因此,相反的,我们开发出了 Anvil,一个在线 IDE,你可以在用一个[拖放编辑器][7]来设计你的 UI 界面,编写你的 [Python 逻辑][8],然后 Anvil 会负责其余的工作。我们将所有的繁杂的技术栈进行了替换,只用 Python 就行啦! + +### 简单的网络托管很重要,但还不够 + +Anvil 还可以为您托管您的应用程序。 那么为什么还不够呢? 部署 Web 应用程序非常复杂,因此运行我们自己的云托管服务是提供我们所需的简单性的唯一方法。 在 Anvil 编辑器中构建一个应用程序,[单击按钮][9],它就在网上发布了。 + +但我们不断听到有人说,“那太好了,但是……” + + * “我需要在不联网的本地平台来运行这个应用。” + * “我想要将我的应用程序嵌入到我售出的 IoT 设备中” + * "如果我把我的宝都压到你的 Anvil 上,我怎么能确定十年后我的应用仍然能够运行呢?” + + + +这些都是好点子!云服务并不是适合所有人的解决方案。如果我们想为这些用户提供服务,他们必须通过某种方式让他们的应用程序脱离 Anvil 并在他们自己的完全控制下在本地运行。 + +### 开源是一个逃生舱,而不是弹射座椅 + +在会议上,我们有时会被问到,“我可以将它导出为 Flask+JS 的应用程序吗?” 当然,我们可以将 Anvil 项目分别导出为一个单独的 Python 和 JavaScript ——我们可以生成一个服务器包,将客户端中的 Python 编译为 Javascript,然后生成一个经典的 Web 应用程序。 但它会有严重的缺点,因为:**代码生成是一个弹射座椅。** + +![Code generation is an ejector seat from a structured platform][10] + +([图片][11] 公共许可) + +生成的代码总比没有好;至少你可以编辑它!但是在您编辑该代码的那一刻,您就失去了生成它的系统的所有好处。如果您使用 Anvil 是因为它的[拖放编辑器][12] 和 [浏览器中的 Python][13],那么您为什么必须使用 vim 和 Javascript 才能在本地托管您的应用程序? + +我们相信[逃生舱口,而不是弹射座椅][14]。 所以我们选择了一个正确的方式——我们[开源了 Anvil 的运行引擎][2],这与在我们的托管服务中为您的应用程序提供服务的代码相同。这是一个独立的应用程序;您可以使用文本编辑器编辑代码并在本地运行。但是您也可以将它直接“git push”回我们的在线 IDE。这不是弹射座椅;没有爆炸性的转变。这是一个逃生舱口;你可以爬出来,做你需要做的事情,然后再爬回来。 + +### If it's open, is it reliable?如果它开源了,它还可靠吗 + +开源中的一个看似矛盾的是,它的免费可用性是它的优势,但有时也会产生不稳定的感觉。 毕竟,如果你不收费,你如何保持这个平台的长期健康运行? + +我们正在做我们一直在做的事情——提供一个开发工具,使构建 Web 应用程序变得非常简单,尽管您使用 Anvil 构建的应用程序 100% 是您的。 我们为 Anvil 应用程序提供托管,并为 [企业客户][15] 提供整个现场开发和托管平台。 这使我们能够提供免费计划,以便每个人都可以将 Anvil 用于业余爱好或教育目的,或者开始构建某些东西并查看它的去向。 + +### 得到的多,失去的少 + +开源我们的运行引擎并没有减少我们的业务——它使我们的在线 IDE 在今天和未来变得更有用、更值得信赖。我们为需要它的人开放了 Anvil App Server 的源代码,并提供最终的安全保障。 对于我们的用户来说,这是正确的举措——现在他们可以放心地进行构建,因为他们知道开源代码 [就在那里][3],如果他们需要的话。 + +如果我们的开发理念与您产生共鸣,何不亲自尝试 Anvil? + + +\----- + +这篇文章改编自 [Why We Open Sourced the Anvil App Server][16],经许可重复使用。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/7/why-open-source + +作者:[Meredydd Luff][a] +选题:[lujun9972][b] +译者:[zepoch](https://github.com/zepoch) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/meredydd-luff +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUS_OSwhy_520x292_ma.png?itok=lqfhAs8L "neon sign with head outline and open source why spelled out" +[2]: https://anvil.works/blog/open-source +[3]: https://github.com/anvil-works/anvil-runtime +[4]: https://anvil.works/ +[5]: https://github.com/kamranahmedse/developer-roadmap#introduction +[6]: https://opensource.com/sites/default/files/uploads/frameworks.png "A complex framework of development tools needed for a simple web app" +[7]: https://anvil.works/docs/client/ui +[8]: https://anvil.works/docs/client/python +[9]: https://anvil.works/docs/deployment +[10]: https://opensource.com/sites/default/files/uploads/ejector-seat-opensourcecom.jpg "Code generation is an ejector seat from a structured platform" +[11]: https://commons.wikimedia.org/wiki/File:Crash.arp.600pix.jpg +[12]: https://anvil.works/docs/editor +[13]: https://anvil.works/docs/client +[14]: https://anvil.works/blog/escape-hatches-and-ejector-seats +[15]: https://anvil.works/docs/overview/enterprise +[16]: https://anvil.works/blog/why-open-source + From bd1cf3a368ffe259fa55f5b52ae5f4da2af1efff Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Mon, 28 Jun 2021 12:09:38 +0800 Subject: [PATCH 230/870] Update 20200731 Why we open sourced our Python platform.md --- .../talk/20200731 Why we open sourced our Python platform.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/translated/talk/20200731 Why we open sourced our Python platform.md b/translated/talk/20200731 Why we open sourced our Python platform.md index f73dc7b29d..13be83b73a 100644 --- a/translated/talk/20200731 Why we open sourced our Python platform.md +++ b/translated/talk/20200731 Why we open sourced our Python platform.md @@ -10,8 +10,7 @@ 为什么我们要开源我们的 Python 平台 ====== -Open source development philosophy makes Anvil's entire solution more -useful and trustworthy.开源开发的理念使得 Anvil 的整个解决方案更加有用且值得信赖。 +开源开发的理念使得 Anvil 的整个解决方案更加有用且值得信赖。 ![neon sign with head outline and open source why spelled out][1] Anvil 团队最近开源了 [Anvil App Server][2], 一个用于托管 Python Web 程序的运行引擎。 From 73072422e83522368edcb049b0372ad9368162f5 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Mon, 28 Jun 2021 12:24:16 +0800 Subject: [PATCH 231/870] translated --- ...10517 How to look at the stack with gdb.md | 394 ++++++++++++++++++ 1 file changed, 394 insertions(+) create mode 100644 translated/tech/20210517 How to look at the stack with gdb.md diff --git a/translated/tech/20210517 How to look at the stack with gdb.md b/translated/tech/20210517 How to look at the stack with gdb.md new file mode 100644 index 0000000000..aa92897150 --- /dev/null +++ b/translated/tech/20210517 How to look at the stack with gdb.md @@ -0,0 +1,394 @@ +[#]: subject: "How to look at the stack with gdb" +[#]: via: "https://jvns.ca/blog/2021/05/17/how-to-look-at-the-stack-in-gdb/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 GDB 查看程序中栈空间 +====== + +昨天我和一些人在闲聊的时候,他们说他们并不了解栈是如何工作的,而且也不知道如何去查看栈空间。 + +这是一个快速教程,介绍如何使用 GDB 查看 C 程序的栈空间。我认为这对于 Rust 程序来说也是相似的。但我这里仍然使用 C 语言,因为我发现用它更简单,而且用 C 语言也更容易写出错误的程序。 + +### 我们的测试程序 + +这里是一个简单的 C 程序,声明了一些变量,从标准输入读取两个字符串。一个字符串在堆上,另一个字符串在栈上。 + +``` +#include +#include + +int main() { + char stack_string[10] = "stack"; + int x = 10; + char *heap_string; + + heap_string = malloc(50); + + printf("Enter a string for the stack: "); + gets(stack_string); + printf("Enter a string for the heap: "); + gets(heap_string); + printf("Stack string is: %s\n", stack_string); + printf("Heap string is: %s\n", heap_string); + printf("x is: %d\n", x); +} +``` + +这个程序使用了一个你可能从来不会使用的极为不安全的函数 `gets` 。但我是故意这样写的。当出现错误的时候,你就知道是为什么了。 + +### 第 0 步:编译这个程序 + +我们使用 `gcc -g -O0 test.c -o test` 命令来编译这个程序。 + +`-g` 选项会在编译程序中将调式信息也编译进去。这将会使我们查看我们的变量更加容易。 + +`-O0` 选项告诉 gcc 不要进行优化,我要确保我们的 `x` 变量不会被优化掉。 + +### 第一步:启动 GDB + +像这样启动 GDB + +``` +$ gdb ./test +``` + +它打印出一些 GPL 东西,然后给出一个提示符。让我们在 `main` 函数这里设置一个断点 + +``` +(gdb) b main +``` + +然后我们就可以运行程序: + +``` +(gdb) b main +Starting program: /home/bork/work/homepage/test +Breakpoint 1, 0x000055555555516d in main () + +(gdb) run +Starting program: /home/bork/work/homepage/test + +Breakpoint 1, main () at test.c:4 +4 int main() { +``` + +好了,现在程序已经运行起来了。我们就可以开始查看栈空间了。 + +### 第二步:查看我们变量的地址 + +让我们从了解我们的变量开始。 它们每个都在内存中有一个地址,我们可以像这样打印出来: + + +``` +(gdb) p &x +$3 = (int *) 0x7fffffffe27c +(gdb) p &heap_string +$2 = (char **) 0x7fffffffe280 +(gdb) p &stack_string +$4 = (char (*)[10]) 0x7fffffffe28e +``` + +因此,如果我们查看栈的地址,那我们应该能够看到所有的这些变量! + +### 概念:栈指针 + +我们将需要使用栈指针,因此我将尽力对其进行快速解释。 + +有一个名为 ESP 的 x86 寄存器,称为“栈指针”。 基本上,它是当前函数的栈起始地址。 在 GDB 中,您可以使用 `$sp` 来访问它。 当您调用新函数或从函数返回时,栈指针的值会更改。 + +### 第三步:在 `main` 函数开始的时候,我们查看一下在栈上的变量 + +首先,让我们看一下 main 函数开始时的栈。 现在是我们的堆栈指针的值: + +``` +(gdb) p $sp +$7 = (void *) 0x7fffffffe270 +``` + +因此,我们当前函数的栈起始地址是 `0x7fffffffe270`,酷极了。 + +现在,让我们使用 GDB 打印出当前函数堆栈开始后的前 40 个字(即160个字节)。 某些内存可能不是栈的一部分,因为我不太确定这里的堆栈有多大。 但是至少开始的地方是栈的一部分。 + +``` +(gdb) x/40x $sp +0x7fffffffe270: 0x00000000 0x00000000 0x55555250 0x00005555 +0x7fffffffe280: 0x00000000 0x00000000 0x55555070 0x00005555 +0x7fffffffe290: 0xffffe390 0x00007fff 0x00000000 0x00000000 +0x7fffffffe2a0: 0x00000000 0x00000000 0xf7df4b25 0x00007fff +0x7fffffffe2b0: 0xffffe398 0x00007fff 0xf7fca000 0x00000001 +0x7fffffffe2c0: 0x55555169 0x00005555 0xffffe6f9 0x00007fff +0x7fffffffe2d0: 0x55555250 0x00005555 0x3cae816d 0x8acc2837 +0x7fffffffe2e0: 0x55555070 0x00005555 0x00000000 0x00000000 +0x7fffffffe2f0: 0x00000000 0x00000000 0x00000000 0x00000000 +0x7fffffffe300: 0xf9ce816d 0x7533d7c8 0xa91a816d 0x7533c789 +``` + +我已粗体显示了 stack_string,heap_string 和 x 变量的位置,并改变了颜色(译者注:可以在原网页查看): + + * `x` 是红色字体,并且起始地址是 `0x7fffffffe27c` + * `heap_string` 是蓝色字体,起始地址是 `0x7fffffffe280` + * `stack_string` 是紫色字体,起始地址是 `0x7fffffffe28e` + +我想在此处将一些变量的位置加粗了一点点可能会有点偏差,但这大概是它们所在的位置。 + +您可能会在这里注意到的一件奇怪的事情是 x 的值是 0x5555,但是我们将 x 设置为 10! 那是因为直到我们的 `main` 函数运行之后才真正设置 `x` ,而我们现在才到了 `main` 最开始的地方。 + +### 第三步:运行到第十行代码后,再次查看一下我们的堆栈 + +让我们跳过几行,等待变量实际设置为其初始化值。 到第 10 行时,`x` 应该设置为10。 + +首先我们需要设置另一个断点: + +``` +(gdb) b test.c:10 +Breakpoint 2 at 0x5555555551a9: file test.c, line 11. +``` + +然后继续执行程序: + +``` +(gdb) continue +Continuing. + +Breakpoint 2, main () at test.c:11 +11 printf("Enter a string for the stack: "); +``` + +好的! 让我们再来看看堆栈里的内容! `gdb` 在这里格式化字节的方式略有不同,实际上我也不太关心这些(译者注:可以查看 GDB 手册中 x 命令,可以指定 c 来控制输出的格式)。 这里提醒一下您,我们的变量在栈上的位置: + + + * `x` 是红色字体,并且起始地址是 `0x7fffffffe27c` + * `heap_string` 是蓝色字体,起始地址是 `0x7fffffffe280` + * `stack_string` 是紫色字体,起始地址是 `0x7fffffffe28e` + + + +``` +(gdb) x/80x $sp +0x7fffffffe270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 +0x7fffffffe278: 0x50 0x52 0x55 0x55 0x0a 0x00 0x00 0x00 +0x7fffffffe280: 0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 +0x7fffffffe288: 0x70 0x50 0x55 0x55 0x55 0x55 0x73 0x74 +0x7fffffffe290: 0x61 0x63 0x6b 0x00 0x00 0x00 0x00 0x00 +0x7fffffffe298: 0x00 0x80 0xf7 0x8a 0x8a 0xbb 0x58 0xb6 +0x7fffffffe2a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 +0x7fffffffe2a8: 0x25 0x4b 0xdf 0xf7 0xff 0x7f 0x00 0x00 +0x7fffffffe2b0: 0x98 0xe3 0xff 0xff 0xff 0x7f 0x00 0x00 +0x7fffffffe2b8: 0x00 0xa0 0xfc 0xf7 0x01 0x00 0x00 0x00 +``` + +在继续往下看之前,这里有一些有趣的事情要讨论。 + +### `stack_string` 在内存中是如何表示的 + +现在(第10行),`stack_string` 被设置为 “stack”。 让我们看看它在内存中的表示方式。 + +我们可以像这样打印出字符串中的字节(译者注:可以通过 c 选项直接显示为字符): + +``` +(gdb) x/10x stack_string +0x7fffffffe28e: 0x73 0x74 0x61 0x63 0x6b 0x00 0x00 0x00 +0x7fffffffe296: 0x00 0x00 +``` + + +"stack" 是一个长度为 5 的字符串,相对应 5 个 ASCII 码-`0x73`, `0x74`, `0x61`, `0x63`, 和 `0x6b`。`0x73` 是字符 `s` 的 ASCII 码。 `0x74` 是 `t` 的 ASCII 码。等等... + +同时我们也使用 `x/1s` 可以让 GDB 以字符串的方式显示: + +``` +(gdb) x/1s stack_string +0x7fffffffe28e: "stack" +``` + + + +### `heap_string` 与 `stack_string` 有何不同 + +你已经注意到了 `stack_string` 和 `heap_string` 在栈上的表示非常不同: + +* `stack_string` 是一段字符串内容("stack") +* `heap_string` 是一个指针,指向内存中的某个位置 + +这里是 `heap_string` 变量在内存中的内容: + +``` +0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 +``` + +这些字节实际上应该是从右向左读:因为 X86 是小端模式,因此,`heap_string` 中所存放的内存地址 `0x5555555592a0` + +另一种方式查看 `heap_string` 中存放的内存地址就是使用 `p` 命令直接打印 : + +``` +(gdb) p heap_string +$6 = 0x5555555592a0 "" +``` + +### 整数 x 的字节表示 + +`x` 是一个 32 位的整数,可由 `0x0a 0x00 0x00 0x00` 来表示。 + +我们还是需要反向来读取这些字节(和我们读取 `heap_string` 需要反过来读是一样的),因此这个数表示的是 `0x000000000a` 或者是 `0x0a`, 它是一个 10; + +这就让我把把 x 设置成了 10; + +### 第四步:从标准输入读取 + +好了,现在我们已经初始化我们的变量,我们来看一下当这段程序运行的时候,栈空间会如何变化: + +``` +printf("Enter a string for the stack: "); +gets(stack_string); +printf("Enter a string for the heap: "); +gets(heap_string); +``` + +我们需要设置另外一个断点: + +``` +(gdb) b test.c:16 +Breakpoint 3 at 0x555555555205: file test.c, line 16. +``` + + +然后继续执行程序: + +``` +(gdb) continue +Continuing. +``` + +我们输入两个字符串,为栈上存储的变量输入 `123456789012` 并且为在堆上存储的变量输入 `bananas`; + +### 让我们先来看一下 `stack_string` (这里有一个缓存区溢出) + +``` +(gdb) x/1s stack_string +0x7fffffffe28e: "123456789012" +``` + +这看起来相当正常,对吗?我们输入了 `12345679012`,然后现在它也被设置成了 `12345679012`(译者注:实测 gcc 8.3 环境下,会直接段错误)。 + +但是现在有一些很奇怪的事。这是我们程序的栈空间的内容。有一些紫色高亮的内容。 + +``` +0x7fffffffe270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 +0x7fffffffe278: 0x50 0x52 0x55 0x55 0x0a 0x00 0x00 0x00 +0x7fffffffe280: 0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 +0x7fffffffe288: 0x70 0x50 0x55 0x55 0x55 0x55 0x31 0x32 +0x7fffffffe290: 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 +0x7fffffffe298: 0x31 0x32 0x00 0x8a 0x8a 0xbb 0x58 0xb6 +0x7fffffffe2a0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 +0x7fffffffe2a8: 0x25 0x4b 0xdf 0xf7 0xff 0x7f 0x00 0x00 +0x7fffffffe2b0: 0x98 0xe3 0xff 0xff 0xff 0x7f 0x00 0x00 +0x7fffffffe2b8: 0x00 0xa0 0xfc 0xf7 0x01 0x00 0x00 0x00 +``` + +令人奇怪的是 **stack_string 只支持 10 个字节**。但是现在当我们输入了 13 个字符以后,发生了什么? + +这是一个典型的缓冲区溢出,`stack_string` 将自己的数据写在了程序中的其他地方。在我们的案例中,这还没有造成问题,但它会使你的程序崩溃,或者更糟糕的是,使你面临非常糟糕的安全问题。 + +例如,假设 `stack_string` 在内存里的位置刚好在 `heap_string` 之前。那我们就可能覆盖 `heap_string` 所指向的地址。我并不确定 `stack_string` 之后的内存里有一些什么。但我们也许可以用它来做一些诡异的事情。 + +### 确实检测到了有缓存区溢出 + +当我故意写很多字符的时候: + +``` + ./test +Enter a string for the stack: 01234567891324143 +Enter a string for the heap: adsf +Stack string is: 01234567891324143 +Heap string is: adsf +x is: 10 +*** stack smashing detected ***: terminated +fish: Job 1, './test' terminated by signal SIGABRT (Abort) +``` + +这里我猜是 `stack_string` 已经到达了这个函数栈的底部,因此额外的字符将会被写在另一块内存中。 + +当你故意去使用这个安全漏洞时,它被称为“堆栈粉碎”,我也不完全了解这是如何检测到的。 + +我也觉得这很有趣,虽然程序被杀死了,但是当缓冲区溢出发生时它不会立即被杀死——在缓冲区溢出之后再运行几行代码,程序才会被杀死。 好奇怪! + +这些就是关于缓存区溢出的所有内容。 + +### 现在我们来看一下 `heap_string` + +我们仍然将 `bananas` 输入到 `heap_string` 变量中。让我们来看一下内存中的样子。 + +这是在我们读取了字符串以后,`heap_string` 在栈空间上的样子: + +``` +(gdb) x/40x $sp +0x7fffffffe270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 +0x7fffffffe278: 0x50 0x52 0x55 0x55 0x0a 0x00 0x00 0x00 +0x7fffffffe280: 0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 +0x7fffffffe288: 0x70 0x50 0x55 0x55 0x55 0x55 0x31 0x32 +0x7fffffffe290: 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 +``` + +需要注意的是,这里的值是一个地址。并且这个地址并没有改变,但是我们来看一下指向的内存上的内容。 + +``` +(gdb) x/10x 0x5555555592a0 +0x5555555592a0: 0x62 0x61 0x6e 0x61 0x6e 0x61 0x73 0x00 +0x5555555592a8: 0x00 0x00 +``` + +看到了吗,这就是字符串 `bananas` 的字节表示。这些字节并不在栈空间上。他们存在于内存中的堆上。 + +### 堆和栈到底在哪里? + +我们已经讨论过栈和堆是不同的内存区域,但是你怎么知道它们在内存中的位置呢? + +每个进程都有一个名为 `/proc/$PID/maps` 的文件,它显示了每个进程的内存映射。 在这里您可以看到其中的栈和堆。 + +``` +$ cat /proc/24963/maps +... lots of stuff omitted ... +555555559000-55555557a000 rw-p 00000000 00:00 0 [heap] +... lots of stuff omitted ... +7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0 [stack] +``` + +需要注意的一件事是,这里堆地址以 `0x5555` 开头,栈地址以 `0x7fffff` 开头。 所以很容易区分栈上的地址和堆上的地址之间的区别。 + +### 像这样使用 gdb 真的很有帮助 + +这有点像旋风之旅,虽然我没有解释所有内容,但希望看到数据在内存中的实际情况可以使你更清楚地了解堆栈的实际情况。 + +我真的建议像这样来把玩一下 gdb —— 即使你不理解你在内存中看到的每一件事,我发现实际上像这样看到我程序内存中的数据会使抽象的概念,比如“栈”和“ 堆”和“指针”更容易理解。 + +### 更多练习 + +一些关于思考栈的后续练习的想法(没有特定的顺序): + + * 尝试将另一个函数添加到 `test.c` 并在该函数的开头创建一个断点,看看是否可以从 `main` 中找到堆栈! 他们说当你调用一个函数时“堆栈会变小”,你能在 gdb 中看到这种情况吗? + * 从函数返回一个指向栈上字符串的指针,看看哪里出了问题。 为什么返回指向栈上字符串的指针是不好的? + * 尝试在 C 中引起堆栈溢出,并尝试通过在 gdb 中查看堆栈溢出来准确理解会发生什么! + * 查看 Rust 程序中的堆栈并尝试找到变量! + * 在 [噩梦课程][1] 中尝试一些缓冲区溢出挑战。每个问题的答案写在 README 文件中,因此如果您不想被宠坏,请避免先去看答案。 所有这些挑战的想法是给你一个二进制文件,你需要弄清楚如何导致缓冲区溢出以使其打印出 “flag” 字符串。 + + + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/05/17/how-to-look-at-the-stack-in-gdb/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[amwps290](https://github.com/amwps290) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://github.com/guyinatuxedo/nightmare From b12cac88b3756538d72570a20c00e9ad4f700f1f Mon Sep 17 00:00:00 2001 From: frstlis <48125063@qq.com> Date: Mon, 28 Jun 2021 16:13:55 +0800 Subject: [PATCH 232/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210517 Use open source tools to set up a private VPN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210517 Use open source tools to set up a private VPN.md b/sources/tech/20210517 Use open source tools to set up a private VPN.md index dcf18a65bc..d29ac43253 100644 --- a/sources/tech/20210517 Use open source tools to set up a private VPN.md +++ b/sources/tech/20210517 Use open source tools to set up a private VPN.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/open-source-private-vpn) [#]: author: (Lukas Janėnas https://opensource.com/users/lukasjan) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -190,7 +190,7 @@ via: https://opensource.com/article/21/5/open-source-private-vpn 作者:[Lukas Janėnas][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[stevenzdg988](https://github.com/stevenzdg988) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 69079850f466b52012c4682b6c9796c58be6e20a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 29 Jun 2021 03:34:47 +0800 Subject: [PATCH 233/870] PRF @geekpi --- .../20210622 Replace du with dust on Linux.md | 152 +++++++++--------- 1 file changed, 73 insertions(+), 79 deletions(-) diff --git a/translated/tech/20210622 Replace du with dust on Linux.md b/translated/tech/20210622 Replace du with dust on Linux.md index 2f4254c3c5..04cd818c7d 100644 --- a/translated/tech/20210622 Replace du with dust on Linux.md +++ b/translated/tech/20210622 Replace du with dust on Linux.md @@ -3,29 +3,30 @@ [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 在 Linux 上用 dust 代替 du ====== -dust 命令是用 Rust 编写的对 du 命令的一个更直观实现。 -![Sand dunes][1] -如果你在 Linux 命令行上工作,你会熟悉 `du` 命令。了解像 `du` 这样的可以快速返回磁盘使用情况命令,是命令行使程序员更有效率的方法之一。然而,如果你正在寻找一种方法来节省更多的时间,使你的生活更加容易,看看 [dust][2],它是用 Rust 重写的 `du`,具有更多的直观性。 +> dust 命令是用 Rust 编写的对 du 命令的一个更直观实现。 -简而言之,`dust` 是一个提供文件类型和元数据的工具。如果你在一个目录中触发了 `dust`,它将以几种方式报告该目录的磁盘利用率。它提供了一个信息量很大的图表,告诉你哪个文件夹使用的磁盘空间最大。如果有一个嵌套的文件夹,你可以看到每个文件夹使用的空间百分比。 +![](https://img.linux.net.cn/data/attachment/album/202106/29/033403l8x83x7a4tt4fq84.jpg) + +如果你在 Linux 命令行上工作,你会熟悉 `du` 命令。了解像 `du` 这样的命令,可以快速返回磁盘使用情况,是命令行使程序员更有效率的方法之一。然而,如果你正在寻找一种方法来节省更多的时间,使你的生活更加容易,看看 [dust][2],它是用 Rust 重写的 `du`,具有更多的直观性。 + +简而言之,`dust` 是一个提供文件类型和元数据的工具。如果你在一个目录中运行了 `dust`,它将以几种方式报告该目录的磁盘利用率。它提供了一个信息量很大的图表,告诉你哪个文件夹使用的磁盘空间最大。如果有嵌套的文件夹,你可以看到每个文件夹使用的空间百分比。 ### 安装 dust 你可以使用 Rust 的 Cargo 包管理器安装 `dust`: - ``` -`$ cargo install du-dust` +$ cargo install du-dust ``` -另外,你可以在 Linux 上的软件库中找到它,在 macOS 上,使用 [MacPorts][3] 或 [Homebrew][4]。 +另外,你可以在 Linux 上的软件库中找到它,在 macOS 上,可以使用 [MacPorts][3] 或 [Homebrew][4]。 ### 探索 dust @@ -34,99 +35,92 @@ dust 命令是用 Rust 编写的对 du 命令的一个更直观实现。 ``` $ dust -5.7M ┌── exa │ ██ │ 2% -5.9M ├── tokei │ ██ │ 2% -6.1M ├── dust │ ██ │ 2% -6.2M ├── tldr │ ██ │ 2% -9.4M ├── fd │ ██ │ 4% -2.9M │ ┌── exa │ ░░░█ │ 1% - 15M │ ├── rustdoc │ ░███ │ 6% - 18M ├─┴ bin │ ████ │ 7% - 27M ├── rg │ ██████ │ 11% -1.3M │ ┌── libz-sys-1.1.3.crate │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 0% -1.4M │ ├── libgit2-sys-0.12.19+1.1.0.crate │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 1% -4.5M │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 2% -4.5M │ ┌─┴ cache │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 2% -1.0M │ │ ┌── git2-0.13.18 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% -1.4M │ │ ├── exa-0.10.1 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -1.5M │ │ │ ┌── src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -2.2M │ │ ├─┴ idna-0.2.3 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -1.2M │ │ │ ┌── linux │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% -1.6M │ │ │ ┌─┴ linux_like │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -2.6M │ │ │ ┌─┴ unix │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -3.1M │ │ │ ┌─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -3.1M │ │ ├─┴ libc-0.2.94 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -1.2M │ │ │ ┌── test │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% -2.6M │ │ │ ┌─┴ zlib-ng │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -904K │ │ │ │ ┌── vstudio │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% -2.0M │ │ │ │ ┌─┴ contrib │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -3.4M │ │ │ ├─┴ zlib │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -6.1M │ │ │ ┌─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 2% -6.1M │ │ ├─┴ libz-sys-1.1.3 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 2% -1.6M │ │ │ ┌── pcre │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -2.5M │ │ │ ┌─┴ deps │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -3.8M │ │ │ ├── src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% -7.4M │ │ │ ┌─┴ libgit2 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 3% -7.6M │ │ ├─┴ libgit2-sys-0.12.19+1.1.0 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 3% - 26M │ │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │ 10% - 26M │ ├─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │ 10% -932K │ │ ┌── .cache │ ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ │ 0% - 11M │ │ │ ┌── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.idx │ ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███ │ 4% -135M │ │ │ ├── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.pack│ ░░░░░░▓▓███████████████████████████ │ 53% -147M │ │ │ ┌─┴ pack │ ░░░░░░█████████████████████████████ │ 57% -147M │ │ │ ┌─┴ objects │ ░░░░░░█████████████████████████████ │ 57% -147M │ │ ├─┴ .git │ ░░░░░░█████████████████████████████ │ 57% -147M │ │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░█████████████████████████████ │ 57% -147M │ ├─┴ index │ ░░░░░░█████████████████████████████ │ 57% -178M ├─┴ registry │ ███████████████████████████████████ │ 69% -257M ┌─┴ . │██████████████████████████████████████████████████ │ 100% + 5.7M ┌── exa │ ██ │ 2% + 5.9M ├── tokei │ ██ │ 2% + 6.1M ├── dust │ ██ │ 2% + 6.2M ├── tldr │ ██ │ 2% + 9.4M ├── fd │ ██ │ 4% + 2.9M │ ┌── exa │ ░░░█ │ 1% + 15M │ ├── rustdoc │ ░███ │ 6% + 18M ├─┴ bin │ ████ │ 7% + 27M ├── rg │ ██████ │ 11% + 1.3M │ ┌── libz-sys-1.1.3.crate │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 0% + 1.4M │ ├── libgit2-sys-0.12.19+1.1.0.crate │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 1% + 4.5M │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 2% + 4.5M │ ┌─┴ cache │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │ 2% + 1.0M │ │ ┌── git2-0.13.18 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% + 1.4M │ │ ├── exa-0.10.1 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 1.5M │ │ │ ┌── src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 2.2M │ │ ├─┴ idna-0.2.3 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 1.2M │ │ │ ┌── linux │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% + 1.6M │ │ │ ┌─┴ linux_like │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 2.6M │ │ │ ┌─┴ unix │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 3.1M │ │ │ ┌─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 3.1M │ │ ├─┴ libc-0.2.94 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 1.2M │ │ │ ┌── test │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% + 2.6M │ │ │ ┌─┴ zlib-ng │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 904K │ │ │ │ ┌── vstudio │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 0% + 2.0M │ │ │ │ ┌─┴ contrib │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 3.4M │ │ │ ├─┴ zlib │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 6.1M │ │ │ ┌─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 2% + 6.1M │ │ ├─┴ libz-sys-1.1.3 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 2% + 1.6M │ │ │ ┌── pcre │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 2.5M │ │ │ ┌─┴ deps │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 3.8M │ │ │ ├── src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓█ │ 1% + 7.4M │ │ │ ┌─┴ libgit2 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 3% + 7.6M │ │ ├─┴ libgit2-sys-0.12.19+1.1.0 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓██ │ 3% + 26M │ │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │ 10% + 26M │ ├─┴ src │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████ │ 10% + 932K │ │ ┌── .cache │ ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ │ 0% + 11M │ │ │ ┌── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.idx │ ░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███ │ 4% + 135M │ │ │ ├── pack-c3e3a51a17096a3078196f3f014e02e5da6285aa.pack│ ░░░░░░▓▓███████████████████████████ │ 53% + 147M │ │ │ ┌─┴ pack │ ░░░░░░█████████████████████████████ │ 57% + 147M │ │ │ ┌─┴ objects │ ░░░░░░█████████████████████████████ │ 57% + 147M │ │ ├─┴ .git │ ░░░░░░█████████████████████████████ │ 57% + 147M │ │ ┌─┴ github.com-1ecc6299db9ec823 │ ░░░░░░█████████████████████████████ │ 57% + 147M │ ├─┴ index │ ░░░░░░█████████████████████████████ │ 57% + 178M ├─┴ registry │ ███████████████████████████████████ │ 69% + 257M ┌─┴ . │██████████████████████████████████████████████████ │ 100% $ ``` 将 `dust` 应用于一个特定的目录: - ``` -`$ dust ~/Work/` +$ dust ~/Work/ ``` ![Dust output from a specific directory][5] -(Sudeshna Sur, [CC BY-SA 4.0][6]) - -`-r` 选项以相反的顺序显示输出,root 在底部: - +`-r` 选项以相反的顺序显示输出,“根”在底部: ``` -`$ dust -r ~/Work/` +$ dust -r ~/Work/ ``` 使用 `dust -d 3` 会返回三层的子目录和它们的磁盘利用率: - ``` -`$ dust -d 3 ~/Work/wildfly/jaxrs/target/classes`[/code] [code] - $ dust -d 3 ~/Work/wildfly/jaxrs/target/classes -4.0K ┌── jaxrs.xml │ █ │ 1% -4.0K ┌─┴ subsystem-templates │ █ │ 1% -4.0K │ ┌── org.jboss.as.controller.transform.ExtensionTransformerRegistration│ █ │ 1% -4.0K │ ├── org.jboss.as.controller.Extension │ █ │ 1% -8.0K │ ┌─┴ services │ █ │ 2% -8.0K ├─┴ META-INF │ █ │ 2% -4.0K │ ┌── jboss-as-jaxrs_1_0.xsd │ ░█ │ 1% -8.0K │ ├── jboss-as-jaxrs_2_0.xsd │ ░█ │ 2% - 12K ├─┴ schema │ ██ │ 3% -408K │ ┌── as │ ████████████████████████████████████████ │ 94% -408K │ ┌─┴ jboss │ ████████████████████████████████████████ │ 94% -408K ├─┴ org │ ████████████████████████████████████████ │ 94% -432K ┌─┴ classes │██████████████████████████████████████████ │ 100% + 4.0K ┌── jaxrs.xml │ █ │ 1% + 4.0K ┌─┴ subsystem-templates │ █ │ 1% + 4.0K │ ┌── org.jboss.as.controller.transform.ExtensionTransformerRegistration│ █ │ 1% + 4.0K │ ├── org.jboss.as.controller.Extension │ █ │ 1% + 8.0K │ ┌─┴ services │ █ │ 2% + 8.0K ├─┴ META-INF │ █ │ 2% + 4.0K │ ┌── jboss-as-jaxrs_1_0.xsd │ ░█ │ 1% + 8.0K │ ├── jboss-as-jaxrs_2_0.xsd │ ░█ │ 2% + 12K ├─┴ schema │ ██ │ 3% + 408K │ ┌── as │ ████████████████████████████████████████ │ 94% + 408K │ ┌─┴ jboss │ ████████████████████████████████████████ │ 94% + 408K ├─┴ org │ ████████████████████████████████████████ │ 94% + 432K ┌─┴ classes │██████████████████████████████████████████ │ 100% $ ``` ### 总结 -`dust` 的魅力在于它是一个小的、简单的、易于理解的命令。它使用一种颜色方案来表示最大的子目录,使你的目录易于可视化。这是一个受欢迎的项目,欢迎大家来贡献。 +`dust` 的魅力在于它是一个小而简单的、易于理解的命令。它使用颜色方案来表示最大的子目录,使你的目录易于可视化。这是一个受欢迎的项目,欢迎大家来贡献。 你是否使用或考虑使用 `dust`?如果是,请在下面的评论中告诉我们你的想法。 @@ -137,7 +131,7 @@ via: https://opensource.com/article/21/6/dust-linux 作者:[Sudeshna Sur][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ffca9861ac5aa6fb0c2ec77869e976bb0dd60189 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 29 Jun 2021 03:35:33 +0800 Subject: [PATCH 234/870] PUB @geekpi https://linux.cn/article-13532-1.html --- .../20210622 Replace du with dust on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210622 Replace du with dust on Linux.md (99%) diff --git a/translated/tech/20210622 Replace du with dust on Linux.md b/published/20210622 Replace du with dust on Linux.md similarity index 99% rename from translated/tech/20210622 Replace du with dust on Linux.md rename to published/20210622 Replace du with dust on Linux.md index 04cd818c7d..ba59483df1 100644 --- a/translated/tech/20210622 Replace du with dust on Linux.md +++ b/published/20210622 Replace du with dust on Linux.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13532-1.html) 在 Linux 上用 dust 代替 du ====== From 0ecc25b333c644e7d566b775a4a3197e0f2f8768 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 29 Jun 2021 04:12:37 +0800 Subject: [PATCH 235/870] PRF @zepoch --- ...Why we open sourced our Python platform.md | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/translated/talk/20200731 Why we open sourced our Python platform.md b/translated/talk/20200731 Why we open sourced our Python platform.md index 13be83b73a..f9a3ad1428 100644 --- a/translated/talk/20200731 Why we open sourced our Python platform.md +++ b/translated/talk/20200731 Why we open sourced our Python platform.md @@ -1,6 +1,6 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Why we open sourced our Python platform" @@ -10,69 +10,63 @@ 为什么我们要开源我们的 Python 平台 ====== -开源开发的理念使得 Anvil 的整个解决方案更加有用且值得信赖。 -![neon sign with head outline and open source why spelled out][1] +> 开源开发的理念使得 Anvil 的整个解决方案更加有用且值得信赖。 -Anvil 团队最近开源了 [Anvil App Server][2], 一个用于托管 Python Web 程序的运行引擎。 - -社区的反应十分积极,我们 Anvil 团队已经将许多反馈纳入了我们的 [next release][3]。但是我们不断被问到的问题是,“为什么你们选择开源这个产品的核心呢?” +![](https://img.linux.net.cn/data/attachment/album/202106/29/041151fpvlz4a75ihlr0lv.jpg) +Anvil 团队最近开源了 [Anvil App Server][2], 一个用于托管完全用 Python 构建的 Web 程序的运行时引擎。 +社区的反应十分积极,我们 Anvil 团队已经将许多反馈纳入了我们的 [下一个版本][3]。但是我们不断被问到的问题是,“为什么你们选择开源这个产品的核心呢?” ### 我们为何创造 Anvil -[Anvil][4] 是一个可以使得构建 web app 更加简单的工具。我们让你们有能力仅使用一种语言——Python 就可以来构建你的整个应用。 +[Anvil][4] 是一个可以使得构建 Web 应用更加简单的工具。我们让你们有能力仅使用一种语言—— Python —— 就可以来构建你的整个应用。 -在 Anvil 之前,如果你想要构建一个 web app,你需要写很多代码,用很多的技术,比如 HTML、Javascript、CSS、Python、SQL、React、Redux、Bootstrap、Sass、Webpack 等。这需要花费很长时间来学习。对于一个简单的应用便是这样子;相信我,一般的应用其实[更加复杂][5]。 +在 Anvil 之前,如果你想要构建一个 Web app,你需要写很多代码,用很多的技术,比如 HTML、Javascript、CSS、Python、SQL、React、Redux、Bootstrap、Sass、Webpack 等。这需要花费很长时间来学习。对于一个简单的应用便是这样子;相信我,一般的应用其实 [更加复杂][5]。 ![A complex framework of development tools needed for a simple web app][6] -是的。对于一个简单的 web app 便是需要如此多的技术。 +*是的。对于一个简单的 web 应用便是需要如此多的技术。* -但是从此之后,你便不再需要这样子做了。您仅仅需要了解有关 Git 和云托管提供商的所有信息、如何保护(最有可能的)Linux 操作系统、如何调整数据库,然后随时待命以保持其运行。 +但即使如此,你还没有完成!你需要了解有关 Git 和云托管提供商的所有信息、如何保护(很有可能是)Linux 操作系统、如何调整数据库,然后随时待命以保持其运行。一直如此。 -因此,相反的,我们开发出了 Anvil,一个在线 IDE,你可以在用一个[拖放编辑器][7]来设计你的 UI 界面,编写你的 [Python 逻辑][8],然后 Anvil 会负责其余的工作。我们将所有的繁杂的技术栈进行了替换,只用 Python 就行啦! +因此,我们开发出了 Anvil,这是一个在线 IDE,你可以在用 [拖放编辑器][7] 来设计你的 UI 界面,用 Python 编写你的 [逻辑][8],然后 Anvil 会负责其余的工作。我们将所有的繁杂的技术栈进行了替换,只用 Python 就行啦! -### 简单的网络托管很重要,但还不够 +### 简单的 Web 托管很重要,但还不够 -Anvil 还可以为您托管您的应用程序。 那么为什么还不够呢? 部署 Web 应用程序非常复杂,因此运行我们自己的云托管服务是提供我们所需的简单性的唯一方法。 在 Anvil 编辑器中构建一个应用程序,[单击按钮][9],它就在网上发布了。 +Anvil 还可以为你托管你的应用程序。为什么不呢?部署 Web 应用程序非常复杂,因此运行我们自己的云托管服务是提供我们所需的简单性的唯一方法。在 Anvil 编辑器中构建一个应用程序,[单击按钮][9],它就在网上发布了。 但我们不断听到有人说,“那太好了,但是……” - * “我需要在不联网的本地平台来运行这个应用。” + * “我需要在没有可靠互联网接入的海外平台上运行这个应用。” * “我想要将我的应用程序嵌入到我售出的 IoT 设备中” * "如果我把我的宝都压到你的 Anvil 上,我怎么能确定十年后我的应用仍然能够运行呢?” - - -这些都是好点子!云服务并不是适合所有人的解决方案。如果我们想为这些用户提供服务,他们必须通过某种方式让他们的应用程序脱离 Anvil 并在他们自己的完全控制下在本地运行。 +这些都是很好的观点!云服务并不是适合所有人的解决方案。如果我们想为这些用户提供服务,就必须有一些方法让他们把自己的应用从 Anvil 中取出来,在本地运行,由他们自己完全控制。 ### 开源是一个逃生舱,而不是弹射座椅 -在会议上,我们有时会被问到,“我可以将它导出为 Flask+JS 的应用程序吗?” 当然,我们可以将 Anvil 项目分别导出为一个单独的 Python 和 JavaScript ——我们可以生成一个服务器包,将客户端中的 Python 编译为 Javascript,然后生成一个经典的 Web 应用程序。 但它会有严重的缺点,因为:**代码生成是一个弹射座椅。** +在会议上,我们有时会被问到,“我可以将它导出为 Flask+JS 的应用程序吗?” 当然,我们可以将 Anvil 项目分别导出为 Python 和 JavaScript —— 我们可以生成一个服务器包,将客户端中的 Python 编译为 Javascript,然后生成一个经典的 Web 应用程序。但它会有严重的缺点,因为:**代码生成是一个弹射座椅。** ![Code generation is an ejector seat from a structured platform][10] -([图片][11] 公共许可) +生成的代码聊胜于无;至少你可以编辑它!但是在你编辑该代码的那一刻,你就失去了生成它的系统的所有好处。如果你使用 Anvil 是因为它的 [拖放编辑器][12] 和 [运行在浏览器中的 Python][13],那么你为什么必须使用 vim 和 Javascript 才能在本地托管你的应用程序? -生成的代码总比没有好;至少你可以编辑它!但是在您编辑该代码的那一刻,您就失去了生成它的系统的所有好处。如果您使用 Anvil 是因为它的[拖放编辑器][12] 和 [浏览器中的 Python][13],那么您为什么必须使用 vim 和 Javascript 才能在本地托管您的应用程序? +我们相信 [逃生舱,而不是弹射座椅][14]。所以我们选择了一个正确的方式——我们 [开源了 Anvil 的运行引擎][2],这与在我们的托管服务中为你的应用程序提供服务的代码相同。这是一个独立的应用程序;你可以使用文本编辑器编辑代码并在本地运行。但是你也可以将它直接用 `git` 推回到我们的在线 IDE。这不是弹射座椅;没有爆炸性的转变。这是一个逃生舱;你可以爬出来,做你需要做的事情,然后再爬回来。 -我们相信[逃生舱口,而不是弹射座椅][14]。 所以我们选择了一个正确的方式——我们[开源了 Anvil 的运行引擎][2],这与在我们的托管服务中为您的应用程序提供服务的代码相同。这是一个独立的应用程序;您可以使用文本编辑器编辑代码并在本地运行。但是您也可以将它直接“git push”回我们的在线 IDE。这不是弹射座椅;没有爆炸性的转变。这是一个逃生舱口;你可以爬出来,做你需要做的事情,然后再爬回来。 +### 如果它开源了,它还可靠吗 -### If it's open, is it reliable?如果它开源了,它还可靠吗 +开源中的一个看似矛盾的是,它的免费可用性是它的优势,但有时也会产生不稳定的感觉。毕竟,如果你不收费,你如何保持这个平台的长期健康运行? -开源中的一个看似矛盾的是,它的免费可用性是它的优势,但有时也会产生不稳定的感觉。 毕竟,如果你不收费,你如何保持这个平台的长期健康运行? - -我们正在做我们一直在做的事情——提供一个开发工具,使构建 Web 应用程序变得非常简单,尽管您使用 Anvil 构建的应用程序 100% 是您的。 我们为 Anvil 应用程序提供托管,并为 [企业客户][15] 提供整个现场开发和托管平台。 这使我们能够提供免费计划,以便每个人都可以将 Anvil 用于业余爱好或教育目的,或者开始构建某些东西并查看它的去向。 +我们正在做我们一直在做的事情 —— 提供一个开发工具,使构建 Web 应用程序变得非常简单,尽管你使用 Anvil 构建的应用程序 100% 是你的。我们为 Anvil 应用程序提供托管,并为 [企业客户][15] 提供整个现场开发和托管平台。这使我们能够提供免费计划,以便每个人都可以将 Anvil 用于业余爱好或教育目的,或者开始构建某些东西并查看它的发展。 ### 得到的多,失去的少 -开源我们的运行引擎并没有减少我们的业务——它使我们的在线 IDE 在今天和未来变得更有用、更值得信赖。我们为需要它的人开放了 Anvil App Server 的源代码,并提供最终的安全保障。 对于我们的用户来说,这是正确的举措——现在他们可以放心地进行构建,因为他们知道开源代码 [就在那里][3],如果他们需要的话。 +开源我们的运行引擎并没有减少我们的业务 —— 它使我们的在线 IDE 在今天和未来变得更有用、更值得信赖。我们为需要它的人开放了 Anvil App Server 的源代码,并提供最终的安全保障。对于我们的用户来说,这是正确的举措 —— 现在他们可以放心地进行构建,因为他们知道开源代码 [就在那里][3],如果他们需要的话。 -如果我们的开发理念与您产生共鸣,何不亲自尝试 Anvil? +如果我们的开发理念与你产生共鸣,何不亲自尝试 Anvil? - -\----- +----- 这篇文章改编自 [Why We Open Sourced the Anvil App Server][16],经许可重复使用。 @@ -83,7 +77,7 @@ via: https://opensource.com/article/20/7/why-open-source 作者:[Meredydd Luff][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b80f2d100c3e43a7289ce483857d21da510b4573 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 29 Jun 2021 04:13:42 +0800 Subject: [PATCH 236/870] PUB @zepoch https://linux.cn/article-13533-1.html --- .../20200731 Why we open sourced our Python platform.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20200731 Why we open sourced our Python platform.md (99%) diff --git a/translated/talk/20200731 Why we open sourced our Python platform.md b/published/20200731 Why we open sourced our Python platform.md similarity index 99% rename from translated/talk/20200731 Why we open sourced our Python platform.md rename to published/20200731 Why we open sourced our Python platform.md index f9a3ad1428..75e6c2cb59 100644 --- a/translated/talk/20200731 Why we open sourced our Python platform.md +++ b/published/20200731 Why we open sourced our Python platform.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13533-1.html" [#]: subject: "Why we open sourced our Python platform" [#]: via: "https://opensource.com/article/20/7/why-open-source" [#]: author: "Meredydd Luff https://opensource.com/users/meredydd-luff" From 6790294ed1dd59787851c9d20833ab43f28acc81 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 29 Jun 2021 05:03:06 +0800 Subject: [PATCH 237/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210628=20?= =?UTF-8?q?Introduction=20to=20image=20builder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210628 Introduction to image builder.md --- .../20210628 Introduction to image builder.md | 304 ++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 sources/tech/20210628 Introduction to image builder.md diff --git a/sources/tech/20210628 Introduction to image builder.md b/sources/tech/20210628 Introduction to image builder.md new file mode 100644 index 0000000000..d484b866f3 --- /dev/null +++ b/sources/tech/20210628 Introduction to image builder.md @@ -0,0 +1,304 @@ +[#]: subject: (Introduction to image builder) +[#]: via: (https://fedoramagazine.org/introduction-to-image-builder/) +[#]: author: (Andy Mott https://fedoramagazine.org/author/amott/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Introduction to image builder +====== + +![][1] + +Photo by [Marcel Strauß][2] on [Unsplash][3] + +Image Builder is a tool that allows you to create custom OS images (based on the upstream project Weldr), and it’s included in the base repos so you can build images right from the start. + +You can use the command line or a Cockpit plugin, and it’s a fairly simple and straightforward process which allows you to create images for most of the major platforms – Libvirt/KVM (RHV or general Linux virtualisation), VMware, Openstack, AWS and Azure. You can also deploy these images from Satellite. + +### Installing Image Builder + +To install Image Builder, run this command: + +``` +sudo dnf install -y osbuild-composer composer-cli cockpit-composer +``` + +If you’re not using Cockpit then omit that last package and you’ll just have the cli tool. + +If you are using Cockpit, then make sure you add the service to firewalld to allow access like this: + +``` +sudo firewall-cmd --add-service=cockpit && sudo firewall-cmd --runtime-to-permanent +``` + +You need to enable the osbuild-composer socket (and cockpit if you installed it and haven’t yet enabled it): + +``` +sudo systemctl enable --now osbuild-composer.socket +sudo systemctl enable --now cockpit.socket +``` + +Image Builder is now running and ready to use so let’s create an image using the cli first, then move on to using Cockpit. + +### Image Builder CLI + +The main cli command is _composer-cli,_ which you use to create, list, examine and delete blueprints. It is also used to build, list, delete and download images for upload to their intended platform. + +#### Available commands + +The following is a list of the Image Builder commands and their functions: + +**Blueprint manipulation** | +---|--- +List all available blueprints | sudo composer-cli blueprints list +Show a blueprint contents in the toml format | sudo composer-cli blueprints show _blueprint-name_ +Save (export) blueprint contents in the toml format into a file _blueprint-name.toml_ | sudo composer-cli blueprints save _blueprint-name_ +Remove a blueprint | sudo composer-cli blueprints delete _blueprint-name_ +Push (import) a blueprint file in the toml format into Image Builder | sudo composer-cli blueprints push _blueprint-name_ +**Composing images from blueprints** | +Start a compose | sudo composer-cli compose start _blueprint-name_ _image-type_ +List all composes | sudo composer-cli compose list +List all composes and their status | sudo composer-cli compose status +Cancel a running compose | sudo composer-cli compose cancel _compose-uuid_ +Delete a finished compose | sudo composer-cli compose delete _compose-uuid_ +Show detailed information about a compose | sudo composer-cli compose info _compose-uuid_ +Download image file of a compose | sudo composer-cli compose image _compose-uuid_ +**Additional resources** | +The composer-cli man page provides a full list of the available subcommands and options | man composer-cli +The composer-cli command provides help on the subcommands and options | sudo composer-cli help + +#### Creating an image blueprint + +The first step in using Image Builder is to use your favorite editor to create the blueprint of the image itself. The blueprint includes everything the image needs to run. Let’s create a really simple one to begin with, then take it from there. + +##### **Create the blueprint file** + +Blueprint files are .toml files, created in your favorite editor, and the minimal required information is shown here: + +``` +name = "image-name" +description = "my image blueprint" +version = "0.0.1" +modules = [] +groups = [] +``` + +The file above can be used to create a minimal image with just the essential software required to run. Typically, images need a few more things, so let’s add in some additional packages. Add in the following below the groups item to add in extra packages: + +``` +[[packages]] +name = "bash-completion" +version = "*" +``` + +You will need to repeat this block for every package you wish to install. The version can be a specific version or the asterisk to denote the latest. + +Going into a bit more detail, the groups declaration is used to add any groups you might need in the image. If you’re not adding any you can use the format above, but if you need to create a group remove the line shown above: + +``` +groups = [] +``` + +and add this: + +``` +[[groups]] +name = "mygroup" +``` + +Again, you need to repeat this block for every group you want to add. + +It is recommended that you create at least a “root” user using something similar to this: + +``` +[[customizations.user]] + name = "root" + description = "root" + password = "$6$ZkdAX1t8QwEAc/GH$Oi3NY3fyTH/87ALiPfCzZTwpCoKv7P3bCVnoD9JnI8f5gV9I3A0bq5mZrKrw6isuYatmRQ.SVq3Vq27v3X2yu." + home = "/home/root/" + shell = "/usr/bin/bash" + groups = ["root"] +``` + +An example blueprint is available at and it contains an explanation for creating the password hash. It doesn’t cover everything, but has the majority of the options shown. + +##### **Push the blueprint to Image Builder** + +Once you have your blueprint ready, you need to push it to Image Builder. This command pushes file _blueprint-name.toml_ to Image Builder: + +``` +sudo composer-cli blueprints push blueprint-name.toml +``` + +Check that it has been pushed with the _blueprints list_ command: + +``` +sudo composer-cli blueprints list +``` + +##### Generate the image + +Now you have your blueprint uploaded and can use it to generate images. Use the _compose-cli start_ command for this, giving the blueprint name and the output format you want (qcow, ami, vmdk, etc): + +``` +sudo composer-cli compose start blueprint-name qcow2 +``` + +You can obtain a list of image types with: +``` + +``` + +sudo composer-cli compose types +``` + +``` + +The _compose_ step creates a minimally-sized image – if you want more space on your OS disk then add _–size_ and a size, in Gb, to the command. + +The image compose will take a short time, and you can see the status of any images with the + +compose status + +command: + +``` +sudo composer-cli compose status +``` + +##### Using the image + +When the image build is complete the status will show “FINISHED” and you can download it and use it to build your VM: + +``` +sudo composer-cli compose image image-uuid +``` + +The image UUID is displayed when you start the compose. It can also be found at the beginning of the compose status command output. + +The downloaded image file is named with the UUID of the image plus the appropriate extension for the image type. You can copy this file to an image repository and rename as appropriate before creating a VM with it. + +A simple qemu/kvm machine is started like this: + +``` +sudo qemu-kvm --name test-image -m 1024 -hda ./UUID-disk.qcow2 +``` + +Alternatively, you can copy this image to a new file and use that file as the OS disk for a new VM. + +### Image Builder in Cockpit + +If you want to use Image Builder in Cockpit, you need to install the cockpit-composer package as described in the installation section above. + +After installation, log into your Cockpit URL (localhost:9090) and select _Image Builder_ in the _Tools>Applications_ section. This will take you to the initial Image Builder page, where you can create new blueprints: + +![][4] + +#### Create a blueprint + +Selecting the _Create blueprint_ button will display a dialogue box where you need to enter a name for your blueprint plus an optional description: + +![][5] + +After you enter a name and select _Create_, you move to the add packages page. Create a minimal image here by simply selecting the _Create Image_ button, or add extra packages by entering the name in the search box under _Available Components_ and then selecting the + button to add it to your image. Any dependencies required by the package will also be added to the image. Add as many packages as you require. + +![][6] + +After adding your packages, select the _Commit_ button to save your blueprint. You will be shown the changes your actions will make with the option to continue with your commit or discard the changes next. + +When the commit has been made, you will be returned to the same screen where you can add more packages. If you’re done with that, select the name of your blueprint in the breadcrumbs at the top left of the screen to go to the main screen for that blueprint. From here you can add customizations (users, groups etc), more packages, or create the image: + +![][7] + +If your image requires any specific users, or if you want to edit the root user (I’d recommend this, either to set a password or add an ssh key so you can log in without having to further edit or customize the image), then you can do this here. You can also create a hostname, which is useful for a single-use image but less so if the image will be used as the base for multiple deployments. + +To add a user, select the _Create user_ _account_ button. If you name this user root you can update the root account as you need. Enter a user name, description, any password and/or ssh public key, and if this user will be an administrative user (like root) then tick the box to signify this: + +![][8] + +Select the _Create_ button at the bottom to create the user and return to the main blueprint page. Here you will see the new user, and can create more as necessary. Once you’ve created all your users and added all your packages you can create am image from the blueprint by selecting the _Create image_ button at the upper right. + +![][9] + +#### Create an image + +In the Create image dialogue select an image type from the dropdown list, then select a size. This will effectively be the size of the disk available in the OS, just like you’d specify the virtual disk size when creating a VM manually. This will be thin-provisioned, so the actual image file won’t be this size! Select _Creat_e, when finished, to add your image to a build queue. + +![][10] + +Building images takes a little time, and you can check progress or view completed images in the Images page: + +![][11] + +You can create multiple image types from the same blueprint, so you can deploy the exact same image on multiple platforms, increasing your security and making maintenance and administration easier. + +#### Download the image + +To use your image, you need to download it, then upload to your chosen platform. To download the image, select the 3-dot menu next to the image and choose _Download_: + +![][12] + +That’s it – your image is ready to deploy. For a simple QEMU/KVM example use the same command from the CLI section above. + +``` +sudo qemu-kvm --name test-image -m 1024 -hda ./UUID-disk.qcow2 +``` + +#### Final thoughts + + * You can always edit your blueprints at a later date. The Cockpit UI will automatically increment the version number, but you will need to do this yourself in the toml file if using the CLI. Once you’ve edited the blueprint you will also need to create a new image. + * You may verify the TOML format using this web site Note that this verifies only the file formatting, not correctness of the content. + * You can create images with different sizes if your environment has such requirements. + * Create a different blueprint for each specific image you need – don’t update the same one with different packages and version numbers then create images from those. + * Image Builder does not allow disks to be partitioned. The output types that have a partitioned disk will have a single partition and additionally any platform-specific partitions that are required to boot the system image. For example, qcow2 image type has a single root partition, and possibly a platform specific boot partition – like PReP for PPC64 system – that the image requires to boot. + * Images types that may be created are listed in the following table: + +**Description** | **CLI name** | **File Extension** +---|---|--- +QEMU QCOW2 Image | qcow2 | .qcow2 +Ext4 File System Image | 80 | .qcow2 +Raw Partitioned Disk Image | partitiond-disk | .img +Live Bootable ISO | live-iso | .iso +TAR Archive | tar | .tar +Amazon Machine Image Disk | ami | .ami +VMware Virtual Machine Disk | vmdk | .vmdk +Openstack | openstack | .qcow2 + +Image Builder is a fantastic tool for anyone who needs to have repeatable based images for their environment. It’s definitely still a work in progress, but new features are coming all the time, with plans to allow uploading directly into various hypervisors and cloud platforms and other cool stuff. + +#### Image Builder documentation + +Official Weldr documentation: + +RHEL 8: + +RHEL 7: + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/introduction-to-image-builder/ + +作者:[Andy Mott][a] +选题:[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/amott/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/image_builder-816x345.jpg +[2]: https://unsplash.com/@martzzl?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/builder?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/wp-content/uploads/2021/05/image-builder-start-page-1024x198.png +[5]: https://fedoramagazine.org/wp-content/uploads/2021/05/Screenshot-from-2021-05-25-10-20-34.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/05/image-builder-add-components-1024x456.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/05/image-builder-main-blueprint-page-1024x226.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/05/image-builder-add-user.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/05/image-builder-main-page-2-1024x303.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/05/image-builder-create-image-2-1024x701.png +[11]: https://fedoramagazine.org/wp-content/uploads/2021/05/image-builder-images-page-1024x252.png +[12]: https://fedoramagazine.org/wp-content/uploads/2021/05/image-builder-download-image-1024x255.png From b1c24aac5af47e684b08404d027cfb694b54af30 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 29 Jun 2021 05:03:28 +0800 Subject: [PATCH 238/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210629=20?= =?UTF-8?q?Fotoxx:=20An=20Open=20Source=20App=20for=20Managing=20and=20Edi?= =?UTF-8?q?ting=20Large=20Photo=20Collection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md --- ...ging and Editing Large Photo Collection.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md diff --git a/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md b/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md new file mode 100644 index 0000000000..5c86dba634 --- /dev/null +++ b/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md @@ -0,0 +1,91 @@ +[#]: subject: (Fotoxx: An Open Source App for Managing and Editing Large Photo Collection) +[#]: via: (https://itsfoss.com/fotoxx/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fotoxx: An Open Source App for Managing and Editing Large Photo Collection +====== + +When it comes to [photo management software in Linux][1], Shotwell is perhaps the most famous of them all. No wonder it comes preinstalled in many distributions. + +But if you are looking for a Shotwell like application which is a bit faster, Fotoxx could be a good choice. + +It may not have a modern user interface, but it is fast in handling a large collection of photos. And it matters because indexing and showing thumbnails for thousands of photos could take considerable time and computing resources. + +### Manage photos and edit them in Linux with Fotoxx + +![Fotoxx interface][2] + +As you can see in the screenshot above, it is not the nicest interface. Looks more like an application from around 2010. What it lacks in the visual department, it makes up with features and performance. + +You can import a huge collection of photos, including RAW images. The images stay where they are. They are not copied or moved. They just get indexed in the application. + +You can edit image metadata like tags, geotags, dates, ratings, captions etc. You can search images based on these matadata. + +It also has a map feature that groups and displays images belonging to a certain location (based on geotag data on the images). + +![Map view][3] + +Since it focuses on managing large collection of photos, it has several batch functions to rename, resize, copy/move, convert image format and edit metadata. + +You can select images to create albums and slideshows and all this happens without duplicating the images. Photos can be combined to create 360-degree panoramas. + +Fotoxx also has several editing functions that can be used to retouch the images, add effect (like sketching, painting), trim, rotate and more. + +There is also options for removing red eyes and dust spots from the old, scanned photo prints. + +I can go on with the features list but it won’t end. Its website describes its full capabilities and you should check it out. + +[Fotoxx Feature Overview][4] + +If it interests you, you can watch this video that demonstrates the features of Fotoxx: + +[Subscribe to It’s FOSS YouTube channel][5] + +### Installing Fotoxx on Linux + +Please keep in mind that **Fotoxx developer recommends a strong computer** with 4+ CPU cores, 16+ GB memory for proper functioning. Lesser computers may be slow or may fail to edit large images. + +Fotoxx is available in the repositories of most Linux distributions like Debian, Ubuntu, Fedora and Arch Linux. Just use your distribution’s package manager or software center to search for Fotoxx and install it. + +On Ubuntu and Debian based distributions, you can use the apt command to install it like this: + +``` +sudo apt install fotoxx +``` + +When you first run it, it will ask to search the home directory for images. You may continue with it or limit the search location to selected folders. + +![][6] + +I noticed that despite indexing over 4,700 in a minute or so, it didn’t start displaying the images immediately. I had to **click on Gallery->All Folders and the select the folder(s) and then it showed the images**. So, this is something to keep in mind. + +Fotoxx is an extensive tool and it will take some time in getting used to it and explore all its features. Its webapge lists several examples that you should have a look at. + +[Fotoxx Feature Examples][4] + +As I said earlier, it is not the prettiest application, but it gets the job done with a huge list of features. If you are a photographer or have a large collection of images, you may give Fotoxx a try and see if it fits your need. And when you do that, please do share your experience with it in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fotoxx/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-photo-management-software/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-interface.jpg?resize=800%2C561&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-geotag-map-view.jpg?resize=800%2C466&ssl=1 +[4]: https://kornelix.net/fotoxx/fotoxx.html +[5]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-indexing.png?resize=800%2C617&ssl=1 From da909e52bebf964b418a102bcef068bd03bb676d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 29 Jun 2021 05:03:52 +0800 Subject: [PATCH 239/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210628=20?= =?UTF-8?q?Query=20your=20Linux=20operating=20system=20like=20a=20database?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210628 Query your Linux operating system like a database.md --- ... Linux operating system like a database.md | 343 ++++++++++++++++++ 1 file changed, 343 insertions(+) create mode 100644 sources/tech/20210628 Query your Linux operating system like a database.md diff --git a/sources/tech/20210628 Query your Linux operating system like a database.md b/sources/tech/20210628 Query your Linux operating system like a database.md new file mode 100644 index 0000000000..a23d19eba8 --- /dev/null +++ b/sources/tech/20210628 Query your Linux operating system like a database.md @@ -0,0 +1,343 @@ +[#]: subject: (Query your Linux operating system like a database) +[#]: via: (https://opensource.com/article/21/6/osquery-linux) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Query your Linux operating system like a database +====== +Use database-style queries to get system information easily. +![Magnifying glass on code][1] + +Linux offers a lot of commands to help users gather information about their host operating system: listing files or directories to check attributes; querying to see what packages are installed, processes are running, and services start at boot; or learning about the system's hardware. + +Each command uses its own output format to list this information. You need to use tools like `grep`, `sed`, and `awk` to filter the results to find specific information. Also, a lot of this information changes frequently, leading to changes in the system's state. + +It would be helpful to view all of this information formatted like the output of a database SQL query. Imagine that you could query the output of the `ps` and `rpm` commands as if you were querying an SQL database table with similar names. + +Fortunately, there is a tool that does just that and much more: [Osquery][2] is an [open source][3] "SQL powered operating system instrumentation, monitoring, and analytics framework." + +Many applications that handle security, DevOps, compliance, and inventory management (to name a few) depend upon the core functionalities provided by Osquery at their heart. + +### Install Osquery + +Osquery is available for Linux, macOS, Windows, and FreeBSD. Install the latest version for your operating system by following its [installation instructions][4]. (I'll use version 4.7.0 in these examples.) + +After installation, verify it's working: + + +``` +$ rpm -qa | grep osquery +osquery-4.7.0-1.linux.x86_64 +$ +$ osqueryi --version +osqueryi version 4.7.0 +$ +``` + +### Osquery components + +Osquery has two main components: + + * **osqueri** is an interactive SQL query console. It is a standalone utility that does not need super-user privileges (unless you are querying tables that need that level of access). + * **osqueryd** is like a monitoring daemon for the host it is installed on. This daemon can schedule queries to execute at regular intervals to gather information from the infrastructure. + + + +You can run the osqueri utility without having the osqueryd daemon running. Another utility, **osqueryctl**, controls starting, stopping, and checking the status of the daemon. + + +``` +$ rpm -ql osquery-4.8.0-1.linux.x86_64 | grep bin +/usr/bin/osqueryctl +/usr/bin/osqueryd +/usr/bin/osqueryi +$ +``` + +### Use the osqueryi interactive prompt + +You interact with Osquery much like you would use an SQL database. In fact, osqueryi is a modified version of the SQLite shell. Running the `osqueryi` command drops you into an interactive shell where you can run commands specific to Osquery, which often start with a `.`: + + +``` +$ osqueryi +Using a virtual database. Need help, type '.help' +osquery> +``` + +To quit the interactive shell, run the `.quit` command to get back to the operating system's shell: + + +``` +osquery> +osquery> .quit +$ +``` + +### Find out what tables are available + +As mentioned, Osquery makes data available as the output of SQL queries. Information in databases is often saved in tables. But how can you query these tables if you don't know their names? Well, you can run the `.tables` command to list all the tables that you can query. If you are a long-time Linux user or a sysadmin, the table names will be familiar, as you have been using operating system commands to get this information: + + +``` +osquery> .tables +  => acpi_tables +  => apparmor_events +  => apparmor_profiles +  => apt_sources + +<< snip >> + +  => arp_cache +  => user_ssh_keys +  => users +  => yara +  => yara_events +  => ycloud_instance_metadata +  => yum_sources +osquery> +``` + +### Check the schema for individual tables + +Now that you know the table names, you can see what information each table provides. As an example, choose `processes`, since the `ps` command is used quite often to get this information. Run the `.schema` command followed by the table name to see what information is saved in this table. If you want to check the results, you could quickly run `ps -ef` or `ps aux` and compare the output with the contents of the table: + + +``` +osquery> .schema processes +CREATE TABLE processes(`pid` BIGINT, `name` TEXT, `path` TEXT, `cmdline` TEXT, `state` TEXT, `cwd` TEXT, `root` TEXT, `uid` BIGINT, `gid` BIGINT, `euid` BIGINT, `egid` BIGINT, `suid` BIGINT, `sgid` BIGINT, `on_disk` INTEGER, `wired_size` BIGINT, `resident_size` BIGINT, `total_size` BIGINT, `user_time` BIGINT, `system_time` BIGINT, `disk_bytes_read` BIGINT, `disk_bytes_written` BIGINT, `start_time` BIGINT, `parent` BIGINT, `pgroup` BIGINT, `threads` INTEGER, `nice` INTEGER, `is_elevated_token` INTEGER HIDDEN, `elapsed_time` BIGINT HIDDEN, `handle_count` BIGINT HIDDEN, `percent_processor_time` BIGINT HIDDEN, `upid` BIGINT HIDDEN, `uppid` BIGINT HIDDEN, `cpu_type` INTEGER HIDDEN, `cpu_subtype` INTEGER HIDDEN, `phys_footprint` BIGINT HIDDEN, PRIMARY KEY (`pid`)) WITHOUT ROWID; +osquery> +``` + +To drive home the point, use the following command to see the schema for the RPM packages and compare the information with `rpm -qa` and `rpm -qi` operating system commands: + + +``` +osquery> +osquery> .schema rpm_packages +CREATE TABLE rpm_packages(`name` TEXT, `version` TEXT, `release` TEXT, `source` TEXT, `size` BIGINT, `sha1` TEXT, `arch` TEXT, `epoch` INTEGER, `install_time` INTEGER, `vendor` TEXT, `package_group` TEXT, `pid_with_namespace` INTEGER HIDDEN, `mount_namespace_id` TEXT HIDDEN, PRIMARY KEY (`name`, `version`, `release`, `arch`, `epoch`, `pid_with_namespace`)) WITHOUT ROWID; +osquery> +``` + +You learn more in Osquery's [tables documentation][5]. + +### Use the PRAGMA command + +In case that schema information is too cryptic for you, there is another way to print the table information in a verbose, tabular format: the `PRAGMA` command. For example, I'll use `PRAGMA` to see information for the `rpm_packages` table in a nice format: + + +``` +`osquery> PRAGMA table_info(rpm_packages);` +``` + +One benefit of this tabular information is that you can focus on the field you want to query and see the type of information that it provides: + + +``` +osquery> PRAGMA table_info(users); ++-----+-------------+--------+---------+------------+----+ +| cid | name        | type   | notnull | dflt_value | pk | ++-----+-------------+--------+---------+------------+----+ +| 0   | uid         | BIGINT | 1       |            | 1  | +| 1   | gid         | BIGINT | 0       |            | 0  | +| 2   | uid_signed  | BIGINT | 0       |            | 0  | +| 3   | gid_signed  | BIGINT | 0       |            | 0  | +| 4   | username    | TEXT   | 1       |            | 2  | +| 5   | description | TEXT   | 0       |            | 0  | +| 6   | directory   | TEXT   | 0       |            | 0  | +| 7   | shell       | TEXT   | 0       |            | 0  | +| 8   | uuid        | TEXT   | 1       |            | 3  | ++-----+-------------+--------+---------+------------+----+ +osquery> +``` + +### Run your first query + +Now that you have all the required information from the table, the schema, and the items to query, run your first SQL query to view the information. The query below returns the users that are present on the system and each one's user ID, group ID, home directory, and default shell. Linux users could get this information by viewing the contents of the `/etc/passwd` file and doing some `grep`, `sed`, and `awk` magic. + + +``` +osquery> +osquery> select uid,gid,directory,shell,uuid FROM users LIMIT 7; ++-----+-----+----------------+----------------+------+ +| uid | gid | directory      | shell          | uuid | ++-----+-----+----------------+----------------+------+ +| 0   | 0   | /root          | /bin/bash      |      | +| 1   | 1   | /bin           | /sbin/nologin  |      | +| 2   | 2   | /sbin          | /sbin/nologin  |      | +| 3   | 4   | /var/adm       | /sbin/nologin  |      | +| 4   | 7   | /var/spool/lpd | /sbin/nologin  |      | +| 5   | 0   | /sbin          | /bin/sync      |      | +| 6   | 0   | /sbin          | /sbin/shutdown |      | ++-----+-----+----------------+----------------+------+ +osquery> +``` + +### Run queries without entering interactive mode + +What if you want to run a query without entering the osqueri interactive mode? This could be very useful if you are writing shell scripts around it. In this case, you could `echo` the SQL query and pipe it to osqueri right from the Bash shell: + + +``` +$ echo "select uid,gid,directory,shell,uuid FROM users LIMIT 7;" | osqueryi ++-----+-----+----------------+----------------+------+ +| uid | gid | directory      | shell          | uuid | ++-----+-----+----------------+----------------+------+ +| 0   | 0   | /root          | /bin/bash      |      | +| 1   | 1   | /bin           | /sbin/nologin  |      | +| 2   | 2   | /sbin          | /sbin/nologin  |      | +| 3   | 4   | /var/adm       | /sbin/nologin  |      | +| 4   | 7   | /var/spool/lpd | /sbin/nologin  |      | +| 5   | 0   | /sbin          | /bin/sync      |      | +| 6   | 0   | /sbin          | /sbin/shutdown |      | ++-----+-----+----------------+----------------+------+ +$ +``` + +### Learn what services start when booting up + +Osquery can also return all the services set to start at boot. For example, to query the `startup_items` table and get the name, status, and path of the first five services that run at startup: + + +``` +osquery> SELECT name,type,status,path FROM startup_items LIMIT 5; +  name = README +  type = Startup Item +status = enabled +  path = /etc/rc.d/init.d/README + +  name = anamon +  type = Startup Item +status = enabled +  path = /etc/rc.d/init.d/anamon + +  name = functions +  type = Startup Item +status = enabled +  path = /etc/rc.d/init.d/functions + +  name = osqueryd +  type = Startup Item +status = enabled +  path = /etc/rc.d/init.d/osqueryd + +  name = AT-SPI D-Bus Bus +  type = Startup Item +status = enabled +  path = /usr/libexec/at-spi-bus-launcher --launch-immediately +osquery> +``` + +### Look up ELF information for a binary + +Imagine you want to find out more details about the `ls` binary. Usually, you would do it with the `readelf -h` command followed by the `ls` command's path. You can query the `elf_info` table with Osquery and get the same information: + + +``` +osquery> SELECT * FROM elf_info WHERE path="/bin/ls"; +      class = 64 +        abi = sysv +abi_version = 0 +       type = dyn +    machine = 62 +    version = 1 +      entry = 24064 +      flags = 0 +       path = /bin/ls +osquery> +``` + +Now you have a taste of how to use osqueri to look for information of interest to you. However, this information is stored on a huge number of tables; one system I queried had 156 different tables, which can be overwhelming: + + +``` +$ echo ".tables" | osqueryi | wc -l +156 +$ +``` + +To make things easier, you can start with these tables to get information about your Linux system: + +**System information table** + + +``` +`osquery> select * from system_info;` +``` + +**System limit information** + + +``` +`osquery> select * from ulimit_info;` +``` + +**Files opened by various processes** + + +``` +`osquery> select * from process_open_files;` +``` + +**Open ports on a system** + + +``` +`osquery> select * from listening_ports;` +``` + +**Running processes information** + + +``` +`osquery> select * from processes;` +``` + +**Installed packages information** + + +``` +`osquery> select * from rpm_packages;` +``` + +**User login information** + + +``` +`osquery> select * from last;` +``` + +**System log information** + + +``` +`osquery> select * from syslog_events;` +``` + +### Learn more + +Osquery is a powerful tool that provides a lot of host information that can be used to solve various use cases. You can learn more about Osquery by [reading its documentation][6]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/osquery-linux + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code) +[2]: https://osquery.io/ +[3]: https://github.com/osquery/osquery +[4]: https://osquery.io/downloads/official +[5]: https://osquery.io/schema/4.8.0/ +[6]: https://osquery.readthedocs.io/en/latest/ From 16fe631ae33f58d45a0088c34e8daa7daacc5641 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 29 Jun 2021 05:04:06 +0800 Subject: [PATCH 240/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210628=20?= =?UTF-8?q?How=20to=20parse=20Bash=20program=20configuration=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210628 How to parse Bash program configuration files.md --- ... parse Bash program configuration files.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/tech/20210628 How to parse Bash program configuration files.md diff --git a/sources/tech/20210628 How to parse Bash program configuration files.md b/sources/tech/20210628 How to parse Bash program configuration files.md new file mode 100644 index 0000000000..8051badb1b --- /dev/null +++ b/sources/tech/20210628 How to parse Bash program configuration files.md @@ -0,0 +1,155 @@ +[#]: subject: (How to parse Bash program configuration files) +[#]: via: (https://opensource.com/article/21/6/bash-config) +[#]: author: (David Both https://opensource.com/users/dboth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to parse Bash program configuration files +====== +Separating config files from code enables anyone to change their +configurations without any special programming skills. +![bash logo on green background][1] + +Keeping program configurations separate from code is important. It enables non-programmers to alter configurations without having to modify the program's code. With compiled binary executables, that would be impossible for non-programmers because it not only requires access to source files (which we do have with open source programs) but also a programmer's skill set. Few people have that, and most people don't want to learn. + +With shell languages such as Bash, source code access is available by definition since shell scripts are not compiled into binary formats. Despite that openness, it is not a particularly good idea for non-programmers to root around in shell scripts and alter them. Even knowledgeable developers and sysadmins can make accidental changes that cause errors or worse. + +So placing configuration items into easily maintained text files provides separation and allows non-programmers to edit configuration elements without the danger of making unintentional changes to the code. Many developers do this for programs written in compiled languages because they don't expect the users to be developers. For many of the same reasons, it also makes sense to do this with interpreted shell languages. + +### The usual way + +As with many other languages, you can write code for a Bash program that reads and parses ASCII text configuration files, reads the variable name, and sets values as the program code executes. For example, a configuration file might look like this: + + +``` +var1=LinuxGeek46 +var2=Opensource.com +``` + +The program would read that file, parse each line, and set the values into each variable. + +### Sourcing + +Bash uses a much easier method for parsing and setting variables called _sourcing_. Sourcing an external file from an executable shell program is a simple method for including the content of that file into a shell program in its entirety. In one sense, this is very much like compiled language `include` statements that include library files at runtime. Such a file can include any type of Bash code, including variable assignments. + +As usual, it is easier to demonstrate than to explain. + +First, create a `~/bin` directory (if it does not already exist), and make it the present working directory (PWD). The [Linux Filesystem Hierarchical Standard][2] defines `~/bin` as the appropriate place for users to store their executable files. + +Create a new file in this directory. Name it `main` and make it executable: + + +``` +[dboth@david bin]$ touch main +[dboth@david bin]$ chmod +x main +[dboth@david bin]$ +``` + +Add the following content to this executable file: + + +``` +#!/bin/bash +Name="LinuxGeek" +echo $Name +``` + +And execute this Bash program: + + +``` +[dboth@david bin]$ ./main +LinuxGeek +[dboth@david bin]$ +``` + +Create a new file and call it `~/bin/data`. This file does not need to be executable. Add the following information to it: + + +``` +# Sourced code and variables +echo "This is the sourced code from the data file." +FirstName="David" +LastName="Both" +``` + +Add three lines to the `main` program so that it looks like this: + + +``` +#!/bin/bash +Name="LinuxGeek" +echo $Name +source ~/bin/data +echo "First name: $FirstName" +echo "LastName: $LastName" +``` + +Rerun the program: + + +``` +[dboth@david bin]$ ./main +LinuxGeek +This is the sourced code from the data file. +First name: David +LastName: Both +[dboth@david bin]$ +``` + +There is one more really cool thing to know about sourcing. You can use a single dot (`.`) as a shortcut for the `source` command. Change the `main` file to substitute the `.` in place of `source`: + + +``` +#!/bin/bash +Name="LinuxGeek" +echo $Name +. ~/bin/data +echo "First name: $FirstName" +echo "LastName: $LastName" +``` + +And run the program again. The result should be exactly the same as the previous run. + +### Starting Bash + +Every Linux host that uses Bash—which is pretty much all of them since Bash is the default shell for all distributions—includes some excellent, built-in examples of sourcing. + +Whenever a Bash shell starts, its environment must be configured so that it is usable. There are five main files and one directory that are used to configure the Bash environment. They are listed here along with their main functions: + + * `/etc/profile`: System-wide environment and startup programs + * `/etc/bashrc`: System-wide functions and aliases + * `/etc/profile.d/`: Directory that contains system-wide scripts for configuring various command-line tools such as `vim` and `mc` and any custom configuration scripts a sysadmin creates + * `~/.bash_profile`: User-specific environment and startup programs + * `~/.bashrc`: User-specific aliases and functions + * `~/.bash_logout`: User-specific commands to execute when the user logs out + + + +Try to trace the execution sequence through these files and determine which sequence it uses for a non-login Bash initialization versus a log-in Bash initialization. I did this in Chapter 17 of Volume 1 in my Linux training series, [_Using and administering Linux: Zero to sysadmin_][3]. + +I'll give you one hint. It all starts with the `~/.bashrc` script. + +### Conclusion + +This article explored sourcing for pulling code and variable assignments into a Bash program. This method of parsing variables from a configuration file is fast, easy, and flexible. It provides a method for separating Bash code from variable assignments to allow non-programmers to set the values of those variables. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/bash-config + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: http://refspecs.linuxfoundation.org/fhs.shtml +[3]: http://www.both.org/?page_id=1183 From 6badcca5121d50ef7e03553417e20145ddebda62 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 29 Jun 2021 05:04:19 +0800 Subject: [PATCH 241/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210628=20?= =?UTF-8?q?How=20to=20archive=20files=20on=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210628 How to archive files on FreeDOS.md --- ...0210628 How to archive files on FreeDOS.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20210628 How to archive files on FreeDOS.md diff --git a/sources/tech/20210628 How to archive files on FreeDOS.md b/sources/tech/20210628 How to archive files on FreeDOS.md new file mode 100644 index 0000000000..fcf999663f --- /dev/null +++ b/sources/tech/20210628 How to archive files on FreeDOS.md @@ -0,0 +1,91 @@ +[#]: subject: (How to archive files on FreeDOS) +[#]: via: (https://opensource.com/article/21/6/archive-files-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to archive files on FreeDOS +====== +There's a version of tar on FreeDOS, but the de facto standard archiver +on DOS is Zip and Unzip. +![Filing cabinet for organization][1] + +On Linux, you may be familiar with the standard Unix archive command: `tar`. There's a version of `tar` on FreeDOS too (and a bunch of other popular archive programs), but the de facto standard archiver on DOS is Zip and Unzip. Both Zip and Unzip are installed in FreeDOS 1.3 RC4 by default. + +The Zip file format was originally conceived in 1989 by Phil Katz of PKWARE, for the PKZIP and PKUNZIP pair of DOS archive utilities. Katz released the specification for Zip files as an open standard, so anyone could create Zip archives. As a result of the open specification, Zip became a standard archive on DOS. The [Info-ZIP][2] project implements an open source set of `ZIP` and `UNZIP` programs. + +### Zipping files and directories + +You can use `ZIP` at the DOS command line to create archives of files and directories. This is a handy way to make a backup copy of your work or to release a "package" to use in a future FreeDOS distribution. For example, let's say I wanted to make a backup of my project source code, which contains these source files: + +![dir][3] + +I'd like to archive these files +(Jim Hall, [CC-BY SA 4.0][4]) + +`ZIP` sports a ton of command-line options to do different things, but the command line options I use most are `-r` to process directories and subdirectories _recursively_, and `-9` to provide the maximum compression possible. `ZIP` and `UNZIP` use a Unix-like command line, so you can combine options behind the dash: `-9r` will give maximum compression and include subdirectories in the Zip file. + +![zip][5] + +Zipping a directory tree +(Jim Hall, [CC-BY SA 4.0][4]) + +In my example, `ZIP` was able to compress my source files from about 33 kilobytes down to about 22 kilobytes, saving me 11 kilobytes of valuable disk space. You might get different compression ratios depending on what options you give to `ZIP` or what files (and how many) you are trying to store in a Zip file. Generally, very long text files (such as source code) yield good compression—very small text files (like DOS "batch" files of only a few lines) are usually too short to compress well. + +### Unzipping files and directories + +Saving files into a Zip file is great, but you'll eventually need to extract those files somewhere. Let's start by examining what's inside the Zip file we just created. For this, use the `UNZIP` command. You can use a bunch of different options with `UNZIP`, but I find I use just a few common options. + +To list the contents of a Zip file, use the `-l` ("list") option: + +![unzip -l][6] + +Listing the archive file contents with unzip +(Jim Hall, [CC-BY SA 4.0][4]) + +The output allows me to see the 14 entries in the Zip file: 13 files plus the `SRC` directory entry. + +If I want to extract the entire Zip file, I could just use the `UNZIP` command and provide the Zip file as a command-line option. That extracts the Zip file starting at my current working directory. Unless I'm restoring a previous version of something, I usually don't want to overwrite my current files. In that case, I will want to extract the Zip file to a new directory. You can specify the destination path with the `-d` ("destination") command-line option: + +![unzip -d temp][7] + +You can unzip into a destination path with -d +(Jim Hall, [CC-BY SA 4.0][4]) + +Sometimes I want to extract a single file from a Zip file. In this example, let's say I wanted to extract `TEST.EXE`, a DOS executable program. To extract a single file, you specify the full path _from the Zip file_ that you want to extract. By default, `UNZIP` will extract this file using the path provided in the Zip file. To omit the path information, you can add the `-j` ("junk the path") option. + +You can also combine options. Let's extract the `SRC\TEST.EXE` program from the Zip file, but omit the full path and save it in the `TEMP` directory: + +![unzip -j][8] + +Combining options with unzip +(Jim Hall, [CC-BY SA 4.0][4]) + +Because Zip files are an open standard, we continue to see Zip files today. Every Linux distribution supports Zip files using the Info-ZIP programs. Your Linux file manager may also have Zip file support—on the GNOME file manager, you should be able to right-click on a folder and select "Compress" from the drop-down menu. You'll have the option to create a new archive file, including a Zip file. + +Creating and managing Zip files is a key skill for any DOS user. You can learn more about `ZIP` and `UNZIP` at the Info-ZIP website, or use the `-h` ("help") option on the command line to print out a list of options. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/archive-files-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) +[2]: http://infozip.sourceforge.net/ +[3]: https://opensource.com/sites/default/files/uploads/dir.png (I'd like to archive these files) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/zip-9r.png (Zipping a directory tree) +[6]: https://opensource.com/sites/default/files/uploads/unzip-l.png (Listing the archive file contents with unzip) +[7]: https://opensource.com/sites/default/files/uploads/unzip-d.png (You can unzip into a destination path with -d) +[8]: https://opensource.com/sites/default/files/uploads/unzip-j.png (Combining options with unzip) From 16afbe83a692b473fc733ecd01c2e7d943e5c45a Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 29 Jun 2021 08:36:39 +0800 Subject: [PATCH 242/870] translated --- ...210623 Python 3.10 beta in Fedora Linux.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {sources => translated}/tech/20210623 Python 3.10 beta in Fedora Linux.md (63%) diff --git a/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md b/translated/tech/20210623 Python 3.10 beta in Fedora Linux.md similarity index 63% rename from sources/tech/20210623 Python 3.10 beta in Fedora Linux.md rename to translated/tech/20210623 Python 3.10 beta in Fedora Linux.md index fc46e0e7f5..10f94bf23d 100644 --- a/sources/tech/20210623 Python 3.10 beta in Fedora Linux.md +++ b/translated/tech/20210623 Python 3.10 beta in Fedora Linux.md @@ -7,32 +7,32 @@ [#]: publisher: ( ) [#]: url: ( ) -Python 3.10 beta in Fedora Linux +Fedora Linux 中的 Python 3.10 测试版 ====== ![][1] -The Python developers have already released three beta versions of Python 3.10.0. You can try the latest one in Fedora Linux today! Test your Python code with 3.10 early to be ready for the final 3.10.0 release in October. +Python 开发者已经发布了 Python 3.10.0 的三个测试版本。今天,你可以在 Fedora Linux 中试用最新的版本 尽早用 3.10 测试你的 Python 代码,为 10 月份的 3.10.0 最终版本做好准备。 -### Install Python 3.10 on Fedora Linux +### 在 Fedora Linux 上安装 Python 3.10 -If you run Fedora Linux, you can install Python 3.10 from the official software repository with _dnf_: +如果你运行 Fedora Linux,你可以用 _dnf_ 从官方仓库安装 Python 3.10: ``` $ sudo dnf install python3.10 ``` -You might need to enable the _updates-testing_ repository to get the very latest pre-release: +你可能需要启用 _updates-testing_ 仓库来获得最新的预发布版本: ``` $ sudo dnf install --enablerepo=updates-testing python3.10 ``` -As more betas and release candidates [will be released][2], the Fedora package will receive updates. No need to compile your own development version of Python, just install it and have it up to date. The Python developers will add no new features starting with the first beta; you can already enjoy all the new things. +随着更多的测试版和候选版[将被发布][2],Fedora 包将得到更新。不需要编译你自己的 Python 开发版本,只要安装它就可以获得最新。从第一个测试版开始,Python 开发者将不增加新的功能。你已经可以享受所有的新东西了。 -### Test your projects with Python 3.10 +### 用 Python 3.10 测试你的项目 -Run the _python3.10_ command to use Python 3.10 or create virtual environments with the [builtin _venv_ module, tox][3] or with [pipenv][4] and [poetry][5]. Here’s an example using _tox_: +运行 _python3.10_ 命令来使用 Python 3.10,或者用[内置的 _venv_ 模块 tox][3] 或用 [pipenv][4] 和 [poetry][5] 创建虚拟环境。下面是一个使用 _tox_ 的例子: ``` $ git clone https://github.com/benjaminp/six.git @@ -56,11 +56,11 @@ ________________________ summary _________________________ congratulations :) ``` -If you find a problem with Python 3.10 on Fedora Linux, please do [file bug reports at Fedora’s bugzilla][6] or in the [Python’s issue tracker][7]. If you aren’t sure if it is a problem in Python, you can [contact the Fedora’s Python maintainers][8] directly via email or IRC. +如果您在 Fedora Linux 上发现了 Python 3.10 的问题,请[在 Fedora 的 bugzilla 上提交 bug 报告][6]或在 [Python 的问题追踪][7]上提交。如果你不确定这是否是 Python 的问题,你可以[通过电子邮件或 IRC 直接联系 Fedora 的 Python 维护者][8] 。 -### What’s new in Python 3.10 +### Python 3.10 中的新内容 -See the [full list of news in Python 3.10][9]. You can, for example, try out [structural pattern matching][10]: +参见 [Python 3.10 的全部新闻列表][9]。例如,你可以尝试一下[结构模式匹配][10]: ``` $ python3.10 @@ -87,7 +87,7 @@ X=3, Y=10 10 ``` -And stay tuned for [Python 3.10 as _python3_ in Fedora Linux 35][11]! +请继续关注 [Fedora Linux 35 中将采用 Python 3.10 作为 _python3_][11]! -------------------------------------------------------------------------------- @@ -95,7 +95,7 @@ via: https://fedoramagazine.org/python-3-10-beta-in-fedora-linux/ 作者:[Miro Hrončok][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e2409412fc7dc17da991bb535d98431aaee4d3f3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 29 Jun 2021 08:42:19 +0800 Subject: [PATCH 243/870] translating --- ...rgot Linux Password on WSL- Here-s How to Reset it Easily.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md b/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md index 207f502033..bf434603ee 100644 --- a/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md +++ b/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/reset-linux-password-wsl/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 35c38391cd96ea4972b88b44280c9772b11d33da Mon Sep 17 00:00:00 2001 From: frstlis <48125063@qq.com> Date: Tue, 29 Jun 2021 10:26:10 +0800 Subject: [PATCH 244/870] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...en source tools to set up a private VPN.md | 230 ------------------ ...en source tools to set up a private VPN.md | 225 +++++++++++++++++ 2 files changed, 225 insertions(+), 230 deletions(-) delete mode 100644 sources/tech/20210517 Use open source tools to set up a private VPN.md create mode 100644 translated/tech/20210517 Use open source tools to set up a private VPN.md diff --git a/sources/tech/20210517 Use open source tools to set up a private VPN.md b/sources/tech/20210517 Use open source tools to set up a private VPN.md deleted file mode 100644 index d29ac43253..0000000000 --- a/sources/tech/20210517 Use open source tools to set up a private VPN.md +++ /dev/null @@ -1,230 +0,0 @@ -[#]: subject: (Use open source tools to set up a private VPN) -[#]: via: (https://opensource.com/article/21/5/open-source-private-vpn) -[#]: author: (Lukas Janėnas https://opensource.com/users/lukasjan) -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Use open source tools to set up a private VPN -====== -Use OpenWRT and Wireguard to create your own virtual private network on -your router. -![scrabble letters used to spell "VPN"][1] - -Getting from one place to another over a computer network can be a tricky thing. Aside from knowing the right address and opening the right ports, there's the question of security. For Linux, SSH is a popular default, and while there's a lot you can do with SSH it's still "just" a secure shell (that's what SSH stands for, in fact.) A broader protocol for encrypted traffic is VPN, which creates a unique, virtual private network between two points. With it, you can log in to a computer on another network and use all of its services (file shares, printers, and so on) just as if you were physically sitting in the same room, and every bit of data is encrypted from point to point. - -Normally, in order to make a VPN connection possible, the gateways into each network must accept VPN traffic, and some computer on your target network must be listening for VPN traffic. However, it's possible to run your own router firmware that runs a VPN server, enabling you to connect to your target network without having to worry about forwarding ports or thinking at all about internal topography. My favorite firmware is OpenWrt, and in this article I demonstrate how to set it up, and how to enable VPN on it. - -### What is OpenWrt? - -[OpenWrt][2] is an open source project that uses Linux to target embedded devices. It's been around for more than 15 years and has a large and active community. - -There are many ways to use OpenWrt, but its main purpose is in routers. It provides a fully writable filesystem with package management, and because it is open source, you can see and modify the code and contribute to the ecosystem. If you would like to have more control over your router, this is the system you want to use. - -OpenWrt supports many routers, including famous brands such as [Cisco][3], [ASUS][4], [MikroTik][5], [Teltonika Networks][6], [D-Link][7], [TP-link][8], [Buffalo][9], [Ubiquiti][10], and [many others][11]. - -### What is Wireguard? - -[Wireguard][12] is open source virtual private network (VPN) software that is much faster, simpler, and more secure than other options such as OpenVPN. It uses state-of-the-art cryptography: ChaCha20 for symmetric cryptography; Curve 25519 (which uses elliptic curves) for key agreement; and BLAKE2 for hashing. These algorithms are designed in a way that is efficient on embedded systems. WIreguard is also available on a wide variety of operating system [platforms][13]. - -### Prerequisites - -For this project, you will need: - - * [Teltonika RUT955][14] or another router supported by OpenWrt - * A public IP address to connect to your VPN from outside your network - * An Android phone - - - -### Install OpenWrt - -To get started, download the OpenWrt image for your router. Use the [firmware selector][15] to check if OpenWrt supports your router and download the firmware. Enter your router's model, and it will show your options: - -![OpenWRT firmware selector][16] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -Select the firmware version you want to download by using the drop-down input on the right side of the search box. - -Download the factory image. - -![Downloading the Factory Image][18] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -Many routers allow you to flash unauthorized firmware from the web interface, but Teltonika Networks does not. To flash the OpenWrt firmware to a router like this, you need to use the bootloader. To do so, follow these steps: - - 1. Unplug the router's power cable. - 2. Press and hold the Reset button. - 3. Plug in the router's power cable. - 4. Continue holding the reset button for 5 to 8 seconds after you plug the power cable in. - 5. Set computer's IP address to `192.168.1.15` and the netmask to `255.255.255.0`. - 6. Connect the router and your computer with an Ethernet cable over a LAN port. - 7. Open a web browser and enter `192.168.1.1:/index.html`. - 8. Upload and flash the firmware. - - - -The flashing process can take up to three minutes. Afterward, you should be able to reach the router's web interface by entering `192.168.1.1` in a browser. There is no password set by default. - -![OpenWrt authorization][19] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -### Configure network connectivity - -Network connectivity is a requirement. If your Internet service provider (ISP) assigns your IP address automatically using DHCP, you just need to plug your Ethernet cable into the WAN port of your router. - -If you need to assign the IP address manually, navigate to **Network → Interfaces**. Select **Edit** to edit your WAN interface. From the **Protocol** field, select **Static address**, and select **Switch protocol**. - -![Assigning IP address manually][20] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -In the **IPv4 address** field, enter your router's address. Set **IPv4 netmask** to match your network subnet; enter the **IPv4 gateway** address you will use to connect to the network; and enter the DNS server's address in the **Use custom DNS servers** field. Save the configuration. - -That's it! You have successfully configured your WAN interface to get network connectivity. - -### Install the necessary packages - -The firmware doesn't include many packages by default, but OpenWrt has a package manager with a selection of packages you can install. Navigate to **System → Software** and update your package manager by selecting **Update lists…** - -![OpenWrt package manager][21] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -In the Filter input, type **Wireguard**, and wait until the system finds all the packages that include this keyword. Find and install the package named **luci-app-wireguard**. - -![luci-app-wireguard package][22] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -This package includes a web interface to configure Wireguard and installs all the dependencies necessary for Wireguard to work. - -If you get a warning that a package is missing and can't be found in the repositories before installing the Wireguard package, just ignore it and proceed. - -Next, find and install the package named **luci-app-ttyd**. This will be used to access the terminal later. - -After these packages are installed, reboot your router for the changes to take effect. - -### Configure the Wireguard interface - -Next, create the Wireguard interface. Navigate to **Network → Interfaces** and select **Add new interface…** on the bottom-left. In the pop-up window, enter your desired name for the interface, choose **Wireguard VPN** from the drop-down list, and select **Create interface** on the lower-right. - -![Creating Wireguard interface][23] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -In the new pop-up window, select **Generate Key** to generate a private key for the Wireguard interface. In the **Listen Port** field, enter your desired port. I will use the default Wireguard port, **51820**. In the **IP Addresses** field, assign the IP address which will be used for the Wireguard interface. In this example, I use `10.0.0.1/24`. The number **24** indicates the size of my subnet. - -![Creating Wireguard interface][24] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -Save the configuration and restart the interface. - -Navigate to **Services → Terminal**, log into the shell, and enter the command `wg show`. You will see some information about your Wiregaurd interface, including its public key. Copy down the public key—you will need it to create peers later. - -![Wireguard public key][25] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -### Configure the firewall - -Navigate to **Network → Firewall** and select the **Traffic Rules** tab. On the bottom of the page, select **Add**. In the **Name** field of the pop-up window, give your rule a name, e.g., **Allow-wg**. Next, change the **Destination zone** from **Lan** to **Device**, and set the **Destination port** to 51820. - -![Wireguard firewall setup][26] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -Save the configuration. - -### Configure Wireguard on an Android phone - -Install the [Wireguard app][27] on your phone from Google Play. Once it's installed, open the app and create a new interface from scratch. In the **Name** field, enter the name you want to use for your interface. In the **Private key** field, press the double-arrow icon on the right to generate a key pair. You will need the public key from above to create a peer between your phone and router. In the **Addresses** field, assign the IP address you will use to reach the phone over VPN. I will use `10.0.0.2/24`. In **Listen port**, enter a port; I will again use the default port. - -![Setting up VPN interface on Android][28] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -Save the configuration. - -To add a peer to the configuration, select **Add peer**. In the **Public key** field, enter your router's Wireguard public key. In the **Endpoint** field, enter your router's public IP address and port separated by a colon, e.g., `12.34.56.78:51820`. In the **Allowed IP**s field, enter the IP addresses you want to reach through the Wireguard interface. (You can enter your router's VPN interface IP address and LAN interface address.) The IP addresses must be separated by commas. You can also define the size of the subnet. - -![Adding a VPN peer on an Android][29] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -Save the configuration. - -There's one last step left in the configuration: adding a peer on the router. - -### Add a peer on the router - -Navigate to **Network → Interfaces** and select your Wireguard interface. Go to the **Peers** tab and select **Add peer**. In the **Description** field, enter the peer's name. In the **Public Key** field, enter your phone's Wireguard interface public key, and in the **Allowed IPs** field, enter your phone's Wireguard interface IP address. Check the **Route Allowed IPs** checkbox. - -![Adding a peer on the router][30] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -Save the configuration and restart the interface. - -### Test the configuration - -Open a web browser on your phone. In the URL bar, enter the IP address `10.0.0.1` or `192.168.1.1`. You should be able to reach your router's website. - -![Logging into the VPN from Android][31] - -(Lukas Janenas, [CC BY-SA 4.0][17]) - -### Your very own VPN - -There are lots of VPN services being advertised these days, but there's a lot to be said for owning and controlling your own infrastructure, especially when that infrastructure only exists to boost security. There's no need to rely on somebody else to provide you with a secure connection to your data. Using OpenWrt and Wireguard, you can have your own open source VPN solution. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/open-source-private-vpn - -作者:[Lukas Janėnas][a] -选题:[lujun9972][b] -译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lukasjan -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/vpn_scrabble_networking.jpg?itok=pdsUHw5N (scrabble letters used to spell "VPN") -[2]: https://openwrt.org/ -[3]: https://www.cisco.com/c/en/us/products/routers/index.html -[4]: https://www.asus.com/Networking-IoT-Servers/WiFi-Routers/All-series/ -[5]: https://mikrotik.com/ -[6]: https://teltonika-networks.com/ -[7]: https://www.dlink.com/en/consumer -[8]: https://www.tp-link.com/us/ -[9]: https://www.buffalotech.com/products/category/wireless-networking -[10]: https://www.ui.com/ -[11]: https://openwrt.org/toh/views/toh_fwdownload -[12]: https://www.wireguard.com/ -[13]: https://www.wireguard.com/install/ -[14]: https://teltonika-networks.com/product/rut955/ -[15]: https://firmware-selector.openwrt.org/ -[16]: https://opensource.com/sites/default/files/uploads/openwrt_firmware-selector.png (OpenWRT firmware selector) -[17]: https://creativecommons.org/licenses/by-sa/4.0/ -[18]: https://opensource.com/sites/default/files/uploads/downloadfactoryimage.png (Downloading the Factory Image) -[19]: https://opensource.com/sites/default/files/uploads/openwrt_authorization.png (OpenWrt authorization) -[20]: https://opensource.com/sites/default/files/uploads/openwrt_staticaddress.png (Assigning IP address manually) -[21]: https://opensource.com/sites/default/files/uploads/openwrt_update-lists.png (OpenWrt package manager) -[22]: https://opensource.com/sites/default/files/uploads/wireguard-package.png (luci-app-wireguard package) -[23]: https://opensource.com/sites/default/files/uploads/wireguard_createinterface.png (Creating Wireguard interface) -[24]: https://opensource.com/sites/default/files/uploads/wireguard_createinterface2.png (Creating Wireguard interface) -[25]: https://opensource.com/sites/default/files/uploads/wireguard_publickey.png (Wireguard public key) -[26]: https://opensource.com/sites/default/files/uploads/wireguard-firewallsetup.png (Wireguard firewall setup) -[27]: https://play.google.com/store/apps/details?id=com.wireguard.android&hl=lt&gl=US -[28]: https://opensource.com/sites/default/files/uploads/vpn_inferfacesetup.png (Setting up VPN interface on Android) -[29]: https://opensource.com/sites/default/files/uploads/addpeeronphone.png (Adding a VPN peer on an Android) -[30]: https://opensource.com/sites/default/files/uploads/addpeeronrouter.png (Adding a peer on the router) -[31]: https://opensource.com/sites/default/files/uploads/android-vpn-login.png (Logging into the VPN from Android) diff --git a/translated/tech/20210517 Use open source tools to set up a private VPN.md b/translated/tech/20210517 Use open source tools to set up a private VPN.md new file mode 100644 index 0000000000..d238935ee9 --- /dev/null +++ b/translated/tech/20210517 Use open source tools to set up a private VPN.md @@ -0,0 +1,225 @@ +[#]: subject: (Use open source tools to set up a private VPN) +[#]: via: (https://opensource.com/article/21/5/open-source-private-vpn) +[#]: author: (Lukas Janėnas https://opensource.com/users/lukasjan) +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用开源工具创建私有 VPN +====== +使用 OpenWRT 和 Wireguard 在路由器上创建自己的虚拟专用网络。 +![拼写为 “VPN”][1] + +通过计算机网络从一个地方到另一个地方可能是一件棘手的事情。除了知道正确的地址和打开正确的端口之外,还有安全问题。 对于 Linux,SSH 是一种流行的默认设置,虽然您可以使用 SSH 做很多事情,但它仍然“只是”一个安全外壳(实际上,这就是 SSH 代表的)。用于加密流量的更广泛的协议是 VPN,它创建了一个独特的两点之间的虚拟专用网络。有了它,您可以登录到另一个网络上的计算机并使用它的所有服务(文件共享、打印机,等等),就像您坐在同一个房间里一样,并且全部的数据都是从点到点加密的。 + +通常,为了使 VPN 连接成为可能,进入每个网络的网关必须接受 VPN 流量,并且必须侦听目标网络上的某些计算机的 VPN 流量。但是,可以运行您自己的运行 VPN 服务器的路由器固件,使您能够连接到目标网络,而无需担心转发端口或完全考虑内部拓扑。我最喜欢的固件是 OpenWrt,在本文中我将演示如何设置它,以及如何启用 VPN。 + +### 什么是 OpenWrt? + +[OpenWrt][2] 是一个使用 Linux 面向嵌入式设备的开源项目。它已经存在超过 15 年,拥有庞大而活跃的社区。 + +使用 OpenWrt 的方法有很多种,但它的主要用途是在路由器中。它提供了一个具有包管理功能的完全可写的文件系统,并且由于它是开源的,您可以查看和修改代码并为生态系统做出贡献。如果您想对路由器进行更多控制,这就是您想要使用的系统。 + +OpenWrt 支持很多路由器,包括 [Cisco][3],[ASUS][4],[MikroTik][5],[Teltonika Networks][6],[D-Link][7],[TP-link][8],[Buffalo][9],[Ubiquiti][10] 等知名品牌和 [许多其他品牌][11]。 + +### Wireguard 是什么? + +[Wireguard][12] 是开源虚拟专用网络 (VPN) 软件,它比 OpenVPN 等其他选项更快、更简单且更安全。它使用最先进的密码学:ChaCha20 用于对称密码学;用于密钥协商的曲线 25519(使用椭圆曲线);和用于散列的 BLAKE2 。这些算法的设计方式在嵌入式系统上是高效的。WIreguard 也可用于各种操作系统[平台][13]。 + +### 先决条件 + +对于这个项目,你需要: + + * [Teltonika RUT955][14] 或支持 OpenWrt 的其他路由器 + * 用于从外部网络连接到 VPN 的公网 IP 地址 + * 一部安卓手机 + +### 安装 OpenWrt + +首先,下载路由器的 OpenWrt 镜像。使用[固件选择器][15]检查 OpenWrt 是否支持您的路由器并下载固件。输入您的路由器型号,将显示选项: + +![OpenWRT 固件选择器][16] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +使用搜索框右侧的下拉输入选择要下载的固件版本。 + +下载出厂镜像。 + +![下载出厂镜像][18] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +许多路由器允许您从 Web 界面刷入未经授权的固件,但 Teltonika Networks 不允许。要将 OpenWrt 固件刷入这样的路由器,您需要使用引导加载程序。为此,请按照下列步骤操作: + + 1. 拔掉路由器的电源线。 + 2. 按住重置按钮。 + 3. 插入路由器的电源线。 + 4. 插入电源线后,继续按住重置按钮 5 到 8 秒。 + 5. 将计算机的 IP 地址设置为 `192.168.1.15`,将网络掩码设置为 `255.255.255.0`。 + 6. 使用以太网电缆通过 LAN 端口连接路由器和计算机。 + 7. 打开网页浏览器并输入`192.168.1.1:/index.html`。 + 8. 上传并刷写固件。 + +刷机过程可能占用三分钟。之后,您应该可以通过在浏览器中输入 `192.168.1.1` 来访问路由器的 Web 界面。 默认情况下没有设置密码 + +![OpenWrt 授权][19] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +### 配置网络连接 + +网络连接是必要条件。如果您的 Internet 服务提供商 (ISP) 使用 DHCP 自动分配您的 IP 地址,您只需将以太网电缆插入路由器的 WAN 端口。 + +如果您需要手动分配 IP 地址,导航至 **Network → Interfaces**。选择 **Edit** 编辑您的 WAN 接口。从 **Protocol** 字段中,选择 **Static address**,然后选择 **Switch protocol**。 + +![手动分配 IP 地址][20] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +在 **IPv4 address** 字段中,输入您的路由器地址。设置 **IPv4 netmask** 以匹配您的网络子网;输入您将用于连接到网络的 **IPv4 gateway** 地址; 并在 **Use custom DNS servers** 字段中输入 DNS 服务器的地址。保存配置。 + +就是这样!您已成功配置 WAN 接口以获得网络连接。 + +### 安装必要的包 + +默认情况下,固件不包含很多包,但 OpenWrt 有一个选择可安装的包管理器。导航到 **System → Software** 并通过选择 **Update list...** 更新您的包管理器。 + +![OpenWrt 包管理器][21] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +在过滤器输入中,键入 **Wireguard**,等待系统找到所有包含该关键字的包。找到并安装名为 **luci-app-wireguard** 的包。 + +![luci-app-wireguard 包][22] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +该软件包包括一个用于配置 Wireguard 的 Web 界面,并安装 Wireguard 所必需的所有依赖项。 + +如果您在安装 Wireguard 软件包之前收到一个软件包丢失的警告并且在存储库中找不到,请忽略它并继续。 + +接下来,找到并安装名为 **luci-app-ttyd** 的包。这将用于稍后访问终端。 + +安装这些软件包后,重新启动路由器以使更改生效。 + +### 配置 Wireguard 接口 + +接下来,创建 Wireguard 接口。导航到 **Network → Interfaces** 并选择左下角的 **Add new interface...**。在弹出窗口中,输入您想要的接口名称,从下拉列表中选择 **Wireguard VPN**,然后选择右下角的 **Create interface**。 + +![创建 Wireguard 接口][23] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +在新弹出的窗口中,选择 **Generate Key** 为 Wireguard 接口生成私钥。在 **Listen Port** 字段中,输入所需的端口。我将使用默认的 Wireguard 端口,**51820**。在 **IP Addresses** 字段中,分配将用于 Wireguard 接口的 IP 地址。在这个例子中,我使用了 `10.0.0.1/24`。数字 **24** 表明我的子网的大小。 + +![创建 Wireguard 接口][24] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +保存配置并重启接口。 + +导航到 **Services → Terminal**,登录到 shell,然后输入命令 `wg show`。您将看到有关 Wiregaurd 接口的一些信息,包括其公钥。复制公钥——稍后您将需要它来创建对等点。 + +![Wireguard 公钥][25] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +### 配置防火墙 + +导航到 **Network → Firewall** 并选择 **Traffic Rules** 选项卡。在页面底部,选择 **Add**。在弹出窗口的 **Name** 字段中,为您的规则命名,例如 **Allow-wg**。接下来,将 **Destination zone** 从 **Lan** 更改为 **Device**,并将 **Destination port** 设置为 51820。 + +![Wireguard 防火墙设置][26] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +保存配置。 + +### 手机上配置 Wireguard + +从 Google Play 在您的手机上安装 [Wireguard 应用程序][27]。安装后,打开应用程序并从头开始创建一个新接口。在 **Name** 字段中,输入要用于接口的名称。在 **Private key** 字段中,按右侧的双箭头图标生成密钥对。您将需要上面的公钥来在您的手机和路由器之间创建一个对等点。在 **Addresses** 字段中,分配您将用于通过 VPN 访问电话的 IP 地址。我将使用 `10.0.0.2/24`。在 **Listen port**中,输入端口;我将再次使用默认端口。 + +![在 Android 上设置 VPN 接口][28] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +保存配置。 + +要向配置中添加对等点,请选择 **Add peer**。在 **Public key** 字段中,输入路由器的 Wireguard 公钥。在 **Endpoint** 字段中,输入路由器的公共 IP 地址和端口,以冒号分隔,例如 `12.34.56.78:51820`。在 **Allowed IP** 字段中,输入要通过 Wireguard 接口访问的 IP 地址。 (您可以输入路由器的 VPN 接口 IP 地址和 LAN 接口地址。)IP 地址必须用逗号分隔。您还可以定义子网的大小。 + +![在 Android 上添加 VPN 对等点][29] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +保存配置。 + +配置中还剩下最后一步:在路由器上添加一个对等点。 + +### 在路由器上添加一个对等点 + +导航到 **Network → Interfaces** 并选择您的 Wireguard 接口。转到 **Peers** 选项卡并选择 **Add peer**。 在 **Description** 字段中,输入对等方的名称。在 **Public Key** 字段中输入手机的 Wireguard 接口公钥,在 **Allowed IPs** 字段中输入手机的 Wireguard 接口 IP 地址。选中 **Route Allowed IPs** 复选框。 + +![在路由器上添加一个对等点][30] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +保存配置并重启接口。 + +### 测试配置 + +在手机上打开网络浏览器。在 URL 栏中,输入 IP 地址 `10.0.0.1` 或 `192.168.1.1`。您应该能够访问路由器的网站。 + +![从 Android 登录 VPN][31] + +(Lukas Janenas, [CC BY-SA 4.0][17]) + +### 您自己的 VPN + +这些天有很多 VPN 服务商在做广告,但是拥有和控制自己的基础设施还有很多话要说,尤其是当该基础设施仅用于提高安全性时。无需依赖其他人为您提供安全的数据连接。使用 OpenWrt 和 Wireguard,您可以拥有自己的开源 VPN 解决方案。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/open-source-private-vpn + +作者:[Lukas Janėnas][a] +选题:[lujun9972][b] +译者:[stevenzdg988](https://github.com/stevenzdg988) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lukasjan +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/vpn_scrabble_networking.jpg?itok=pdsUHw5N (scrabble letters used to spell "VPN") +[2]: https://openwrt.org/ +[3]: https://www.cisco.com/c/en/us/products/routers/index.html +[4]: https://www.asus.com/Networking-IoT-Servers/WiFi-Routers/All-series/ +[5]: https://mikrotik.com/ +[6]: https://teltonika-networks.com/ +[7]: https://www.dlink.com/en/consumer +[8]: https://www.tp-link.com/us/ +[9]: https://www.buffalotech.com/products/category/wireless-networking +[10]: https://www.ui.com/ +[11]: https://openwrt.org/toh/views/toh_fwdownload +[12]: https://www.wireguard.com/ +[13]: https://www.wireguard.com/install/ +[14]: https://teltonika-networks.com/product/rut955/ +[15]: https://firmware-selector.openwrt.org/ +[16]: https://opensource.com/sites/default/files/uploads/openwrt_firmware-selector.png (OpenWRT firmware selector) +[17]: https://creativecommons.org/licenses/by-sa/4.0/ +[18]: https://opensource.com/sites/default/files/uploads/downloadfactoryimage.png (Downloading the Factory Image) +[19]: https://opensource.com/sites/default/files/uploads/openwrt_authorization.png (OpenWrt authorization) +[20]: https://opensource.com/sites/default/files/uploads/openwrt_staticaddress.png (Assigning IP address manually) +[21]: https://opensource.com/sites/default/files/uploads/openwrt_update-lists.png (OpenWrt package manager) +[22]: https://opensource.com/sites/default/files/uploads/wireguard-package.png (luci-app-wireguard package) +[23]: https://opensource.com/sites/default/files/uploads/wireguard_createinterface.png (Creating Wireguard interface) +[24]: https://opensource.com/sites/default/files/uploads/wireguard_createinterface2.png (Creating Wireguard interface) +[25]: https://opensource.com/sites/default/files/uploads/wireguard_publickey.png (Wireguard public key) +[26]: https://opensource.com/sites/default/files/uploads/wireguard-firewallsetup.png (Wireguard firewall setup) +[27]: https://play.google.com/store/apps/details?id=com.wireguard.android&hl=lt&gl=US +[28]: https://opensource.com/sites/default/files/uploads/vpn_inferfacesetup.png (Setting up VPN interface on Android) +[29]: https://opensource.com/sites/default/files/uploads/addpeeronphone.png (Adding a VPN peer on an Android) +[30]: https://opensource.com/sites/default/files/uploads/addpeeronrouter.png (Adding a peer on the router) +[31]: https://opensource.com/sites/default/files/uploads/android-vpn-login.png (Logging into the VPN from Android) From 07507a30070b30c5bfd800cb88fbf59b9c3aea8c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 29 Jun 2021 21:54:20 +0800 Subject: [PATCH 245/870] PRF @zepoch --- ...en source for your home automation project.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/talk/20210610 Why choose open source for your home automation project.md b/translated/talk/20210610 Why choose open source for your home automation project.md index 7d99dd9f67..a86158df2c 100644 --- a/translated/talk/20210610 Why choose open source for your home automation project.md +++ b/translated/talk/20210610 Why choose open source for your home automation project.md @@ -3,28 +3,28 @@ [#]: author: "Alan Smithee https://opensource.com/users/alansmithee" [#]: collector: "lujun9972" [#]: translator: "zepoch" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 为什么要为你的家庭自动化项目选择开源 ====== -家庭自动化是一个令人兴奋的技术分支。现在开始用开源工具为你的家庭自动化设计一套解决方案吧。 +> 家庭自动化是一个令人兴奋的技术分支。现在开始用开源工具为你的家庭自动化设计一套解决方案吧。 -![Working from home at a laptop][1] +![](https://img.linux.net.cn/data/attachment/album/202106/29/215353tk85i7m1myggvu8g.jpg) 行动起来吧。科技的关键是让生活更加美好。 当然,“更好”的标准因人而异,取决于他们在特定时刻的需求。尽管如此,技术具有影响许多不同阶段生活的独特能力。对一些人来说,科技提供了一个轻松的下午娱乐,而对另一些人来说,它提供导航帮助、改善医疗保健或更精确的科学研究。 -有趣的是,为一个目的开发的技术很少与用于另一个目的的技术分开。例如,运动相机的进步使得一个人可以记录她们在滑雪场上的化雪过程,也可以使得人体摄像头来帮助防止警察侵犯人权。3D 打印的进步可以让一个人可以制作超级英雄的动作手办,也使得志愿者可以为体弱者制造氧气呼吸机成为可能。技术很重要,它影响着我们所有人。 +有趣的是,为一个目的开发的技术很少与用于另一个目的的技术完全无关。例如,运动相机的进步使得一个人可以记录她们在滑雪场上的滑雪过程,也可以使得人体摄像头来帮助防止警察侵犯人权。3D 打印的进步可以让一个人可以制作超级英雄的动作手办,也使得志愿者可以为体弱者制造氧气呼吸机成为可能。技术很重要,它影响着我们所有人。 -开源工作的一部分是确保每个人都能获得技术进步,无论种族、性别、国籍、身体能力、宗教信仰或财富如何。可悲的是,有些公司将技术视为一种工具来获取有关其客户(即您和我!)的数据,即使这些客户为该技术的研究和开发提供资金。不过,这不是开源的意义所在。 开源项目保护其用户。 +开源的工作之一是确保每个人都能获得技术进步,无论种族、性别、国籍、身体能力、宗教信仰或财富如何。可悲的是,有些公司将技术视为一种工具来获取有关其客户(即你和我!)的数据,即使这些客户为该技术的研究和开发提供资金。不过,这不是开源的目标,开源项目保护其用户。 -是的,家庭自动化是一种现代便利,它正在变得一天比一天好。但这是你的家。开源家庭自动化可以让生活变得更轻松,更像是所有科幻书籍和电影中承诺的未来。但它也可以改善那些身体能力与电器制造商计划不同的人的生活。 一个简单的 Python 脚本对一个用户来说可能只是带来了一些便利,而对其他人来说却可能会改变生活。 +是的,家庭自动化是一种现代便利,它正在变得一天比一天好。但这是你的家。开源家庭自动化可以让生活变得更轻松,更像是所有科幻书籍和电影中承诺的未来。但它也可以改善那些身体能力与电器制造商计划不同的人的生活。一个简单的 Python 脚本对一个用户来说可能只是带来了一些便利,而对其他人来说却可能会改变生活。 -家庭自动化是一个令人兴奋和有趣的技术分支。 借助这本**[电子书][2]**,立即开始设计您的家庭自动化解决方案,然后与他人分享您的创新,让每个人都能受益。 +家庭自动化是一个令人兴奋和有趣的技术分支。 借助这本 **[电子书][2]**,立即开始设计你的家庭自动化解决方案,然后与他人分享你的创新,让每个人都能受益。 这就是开源的真正意义所在:可以帮助世界上的所有人。 @@ -35,7 +35,7 @@ via: https://opensource.com/article/21/6/home-automation-ebook 作者:[Alan Smithee][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From efd5df5b06067ea4f042b570360d6c9c0b18e891 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 29 Jun 2021 21:54:59 +0800 Subject: [PATCH 246/870] PUB @zepoch https://linux.cn/article-13535-1.html --- ...Why choose open source for your home automation project.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210610 Why choose open source for your home automation project.md (97%) diff --git a/translated/talk/20210610 Why choose open source for your home automation project.md b/published/20210610 Why choose open source for your home automation project.md similarity index 97% rename from translated/talk/20210610 Why choose open source for your home automation project.md rename to published/20210610 Why choose open source for your home automation project.md index a86158df2c..ef10c47064 100644 --- a/translated/talk/20210610 Why choose open source for your home automation project.md +++ b/published/20210610 Why choose open source for your home automation project.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13535-1.html" 为什么要为你的家庭自动化项目选择开源 ====== From fb9359b96342748733a697db7d08191650a8a192 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 29 Jun 2021 22:16:44 +0800 Subject: [PATCH 247/870] PRF&PUB @geekpi https://linux.cn/article-13536-1.html --- ...210623 Python 3.10 beta in Fedora Linux.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20210623 Python 3.10 beta in Fedora Linux.md (70%) diff --git a/translated/tech/20210623 Python 3.10 beta in Fedora Linux.md b/published/20210623 Python 3.10 beta in Fedora Linux.md similarity index 70% rename from translated/tech/20210623 Python 3.10 beta in Fedora Linux.md rename to published/20210623 Python 3.10 beta in Fedora Linux.md index 10f94bf23d..8d900cd460 100644 --- a/translated/tech/20210623 Python 3.10 beta in Fedora Linux.md +++ b/published/20210623 Python 3.10 beta in Fedora Linux.md @@ -3,36 +3,36 @@ [#]: author: (Miro Hrončok https://fedoramagazine.org/author/churchyard/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13536-1.html) Fedora Linux 中的 Python 3.10 测试版 ====== ![][1] -Python 开发者已经发布了 Python 3.10.0 的三个测试版本。今天,你可以在 Fedora Linux 中试用最新的版本 尽早用 3.10 测试你的 Python 代码,为 10 月份的 3.10.0 最终版本做好准备。 +Python 开发者已经发布了 Python 3.10.0 的三个测试版本。现在,你可以在 Fedora Linux 中试用最新的版本尽早用 3.10 测试你的 Python 代码,为 10 月份的 3.10.0 最终版本做好准备。 ### 在 Fedora Linux 上安装 Python 3.10 -如果你运行 Fedora Linux,你可以用 _dnf_ 从官方仓库安装 Python 3.10: +如果你运行 Fedora Linux,你可以用 `dnf` 从官方仓库安装 Python 3.10: ``` $ sudo dnf install python3.10 ``` -你可能需要启用 _updates-testing_ 仓库来获得最新的预发布版本: +你可能需要启用 `updates-testing` 仓库来获得最新的预发布版本: ``` $ sudo dnf install --enablerepo=updates-testing python3.10 ``` -随着更多的测试版和候选版[将被发布][2],Fedora 包将得到更新。不需要编译你自己的 Python 开发版本,只要安装它就可以获得最新。从第一个测试版开始,Python 开发者将不增加新的功能。你已经可以享受所有的新东西了。 +随着更多的测试版和候选版 [发布][2],Fedora 包将得到更新。不需要编译你自己的 Python 开发版本,只要安装它就可以获得最新。从第一个测试版开始,Python 开发者不会再增加新的功能了。你已经可以享受所有的新东西了。 ### 用 Python 3.10 测试你的项目 -运行 _python3.10_ 命令来使用 Python 3.10,或者用[内置的 _venv_ 模块 tox][3] 或用 [pipenv][4] 和 [poetry][5] 创建虚拟环境。下面是一个使用 _tox_ 的例子: +运行 `python3.10` 命令来使用 Python 3.10,或者用 [内置的 venv 模块 tox][3] 或用 [pipenv][4] 和 [poetry][5] 创建虚拟环境。下面是一个使用 `tox` 的例子: ``` $ git clone https://github.com/benjaminp/six.git @@ -56,11 +56,11 @@ ________________________ summary _________________________ congratulations :) ``` -如果您在 Fedora Linux 上发现了 Python 3.10 的问题,请[在 Fedora 的 bugzilla 上提交 bug 报告][6]或在 [Python 的问题追踪][7]上提交。如果你不确定这是否是 Python 的问题,你可以[通过电子邮件或 IRC 直接联系 Fedora 的 Python 维护者][8] 。 +如果你在 Fedora Linux 上发现了 Python 3.10 的问题,请 [在 Fedora 的 bugzilla 上提交 bug 报告][6] 或在 [Python 的问题追踪][7] 上提交。如果你不确定这是否是 Python 的问题,你可以 [通过电子邮件或 IRC 直接联系 Fedora 的 Python 维护者][8] 。 ### Python 3.10 中的新内容 -参见 [Python 3.10 的全部新闻列表][9]。例如,你可以尝试一下[结构模式匹配][10]: +参见 [Python 3.10 的全部新闻列表][9]。例如,你可以尝试一下 [结构模式匹配][10]: ``` $ python3.10 @@ -87,7 +87,7 @@ X=3, Y=10 10 ``` -请继续关注 [Fedora Linux 35 中将采用 Python 3.10 作为 _python3_][11]! +敬请期待 [Fedora Linux 35 中的 python3 —— Python 3.10][11]! -------------------------------------------------------------------------------- @@ -96,7 +96,7 @@ via: https://fedoramagazine.org/python-3-10-beta-in-fedora-linux/ 作者:[Miro Hrončok][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9e078d82f74ea22b149b8e5064507c8ec42ed8c1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 30 Jun 2021 05:03:23 +0800 Subject: [PATCH 248/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210629=20?= =?UTF-8?q?Try=20Linux=20on=20any=20operating=20system=20with=20VirtualBox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210629 Try Linux on any operating system with VirtualBox.md --- ...on any operating system with VirtualBox.md | 325 ++++++++++++++++++ 1 file changed, 325 insertions(+) create mode 100644 sources/tech/20210629 Try Linux on any operating system with VirtualBox.md diff --git a/sources/tech/20210629 Try Linux on any operating system with VirtualBox.md b/sources/tech/20210629 Try Linux on any operating system with VirtualBox.md new file mode 100644 index 0000000000..ccf231735e --- /dev/null +++ b/sources/tech/20210629 Try Linux on any operating system with VirtualBox.md @@ -0,0 +1,325 @@ +[#]: subject: (Try Linux on any operating system with VirtualBox) +[#]: via: (https://opensource.com/article/21/6/try-linux-virtualbox) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Try Linux on any operating system with VirtualBox +====== +VirtualBox helps anyone—even a command line novice—set up a virtual +machine. +![Person programming on a laptop on a building][1] + +VirtualBox makes it easy for anyone to try Linux. You don't even need experience with the command line to set up a simple virtual machine to tinker with Linux. I'm kind of a power user when it comes to virtual machines, but this article will show even novices how to virtualize a Linux system. In addition, it provides an overview of how to run and install a Linux system for testing purposes with the open source hypervisor [VirtualBox][2]. + +### Terms + +Before starting, you should understand the difference between the two operating systems (OSes) in this setup: + + * **Host system:** This is your actual OS on which you install VirtualBox. + * **Guest system:** This is the system you want to run virtualized on top of your host system. + + + +Both systems, host and guest, must interact with each other when it comes to input/output, networking, file access, clipboard, audio, and video. + +In this tutorial, I'll use Windows 10 as the _host system_ and [Fedora 33][3] as the _guest system_. + +### Prerequisites + +When we talk about virtualization, we actually mean [hardware-assisted virtualization][4]. Hardware-assisted virtualization requires a compatible CPU. Almost every ordinary x86 CPU from the last decade comes which this feature. AMD calls it **AMD-V,** and Intel calls it **VT-x**. The virtualization feature adds some additional CPU instructions, and it can be enabled or disabled in the BIOS. + +To start with virtualization: + + * Make sure that AMD-V or VT-x is enabled in the BIOS. + * Download and install [VirtualBox][5]. + + + +### Prepare the virtual machine + +Download the image of the Linux distribution you want to try out. It does not matter if it's a 32-bit or 64-bit OS image. You can even start a 64-bit OS image on a 32-bit host system (with limitations in memory usage, of course) and vice versa. + +> **Considerations:** If possible, choose a Linux distribution that comes with the [Logical Volume Manager][6] (LVM). LVM decouples the filesystem from the physical hard drives. This allows you to increase the size of your guest system's hard drive if you are running out of space. + +Now, open VirtualBox and click on the yellow **New** button: + +![VirtualBox New VM][7] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Next, configure how much memory the guest OS is allowed to use: + +![Set VM memory size][9] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +My recommendation: **Don't skimp on memory!** When memory is low, the guest system will start paging memory from RAM to the hard drive, worsening the system's performance and responsiveness extremely. If the underlying host system starts paging, you might not notice. For a Linux workstation system with a graphical desktop environment, I recommend at least 4GB of memory. + +Next, create the hard disk: + +![Create virtual hard disk][10] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Choose the default option, **VDI**: + +![Selecting hard disk file type][11] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +In this window, I recommend choosing **dynamically allocated**, as this allows you to increase the size later. If you choose **fixed size**, the disk will be probably faster, but you won't be able to modify it: + +![Dynamically allocating hard disk][12] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +With a Linux distribution that uses LVM, you can start with a small hard disk. If you are running out of space, you can increase it on demand. + +> **Note**: Fedora's website says [it requires][13] a minimum of 20GB free disk space. I highly recommend you stick to that specification. I chose 8GB here so that I can demonstrate how to increase it later. If you are new to Linux or inexperienced with the command line, choose 20GB. + +![Setting hard disk size][14] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +After creating the hard drive, select the newly created virtual machine from the list in VirtualBox's main window and click on **Settings**. In the Settings menu, go to **System** and select the **Processor** tab. By default, VirtualBox assigns only one CPU core to the guest system. On a modern multicore CPU, it should not be any problem to assign at least two cores, which will speed up the guest system significantly: + +![Assigning cores to guest system][15] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +#### Network adapter setup + +The next thing to take care of is the network setup. By default, VirtualBox creates one NAT connection, which should be OK for most use cases: + +![Network settings][16] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +You can create more than one network adapter. Here are the most common types: + + * **NAT:** The NAT adapter performs a [network address translation][17]. From the outside, it looks like the host and the guest system use the same IP address. You are not able to access the guest system from within the host system over the network. (Although you could define [port forwarding][18] to access certain services.) When your host system has access to the internet, the guest system will have access, too. NAT requires no further configuration. + * _Choose **NAT** if you only need internet access for the guest system._ + * **Bridged adapter:** Here, the guest and the host system share the same physical Ethernet device. Both systems will have independent IP addresses. From the outside, it looks like there are two separate systems in the network, both sharing the same physical Ethernet adapter. This setup is more flexible but requires more configuration. + * _Choose **Bridged adapter** if you want to share the guest system's network services._ + * **Host-only adapter:** In this configuration, the guest system can only talk to the host or other guest systems running on the same host. The host system can also connect to the guest system. There is no internet nor physical network access for the guest. + * _Choose **Host-only adapter** for advanced security._ + + + +#### Assign the OS image + +Navigate to **Storage** and select the virtual optical drive. Click on the **CD icon** on the right, and select **Choose a disk file…**. Then assign the downloaded Linux distribution image you want to install: + +![Assigning OS image][19] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +### Install Linux + +The virtual machine is now configured. Leave the **Settings** menu and go back to the main window. Click on the **Green arrow** (i.e., the start button). The virtual machine will start up and boot from the virtual optical drive, and you will find yourself in your Linux distribution's installer: + +![VirtualBox Fedora installer][20] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +#### Partitioning + +The installer will ask you for partitioning information during the installation process. Choose **Custom**: + +![Selecting Custom partition configuration][21] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +> **Note:** I'm assuming you're creating this virtual machine just for testing purposes. Also you don't need to care about hibernation for your guest system, as this function is implicitly provided by VirtualBox. Therefore, you can omit the swap partition to save disk space on your host system. Keep in mind that you can add a swap partition later if needed. In [_An introduction to swap space on Linux systems_][22], David Both explains how to add a swap partition and choose the correct size. + +Fedora 33 and later offer a [zram][23] partition, a compressed part of the memory used for paging and swap. The zram partition is resized on demand, and it is much faster than a hard disk swap partition. + +To keep it simple, just add these two mount points: + +![Adding mount points][24] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Apply the changes and proceed with the installation. + +### Install VirtualBox Guest Additions + +After you finish the installation, boot from the hard drive and log in. Now you can install VirtualBox Guest Additions, which include special device drivers and system applications that provide: + + * Shared clipboard + * Shared folders + * Better performance + * Freely scalable window size + + + +To install them, click on the top menu in **Devices** and select **Insert Guest Additions CD image…**: + +![Selecting Guest Additions CD image][25] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +On most Linux distributions, the CD image with the Guest Additions is mounted automatically, and they are available in the file browser. Fedora will ask you if you want to run the installation script. Click **Run** and enter your credentials to grant the process root rights: + +![Enabling Guest Additions autorun][26] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +When the installation is finished, reboot the system. + +### LVM: Enlarge disk space + +Creating an 8GB hard disk was a dumb decision, as Fedora quickly starts signaling that it is running out of space: + +![Fedora hard disk running out of space][27] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +As I mentioned, a disk space of 20GB is recommended, and 8GB is the _absolute_ minimum for a Fedora 33 installation to boot up. A fresh installation with no additional software (except the VirtualBox Guest Additions) takes nearly the whole 8GB of available space. Don't open the GNOME Software center or anything else that might download files from the internet in this condition. + +Luckily, I chose to use LVM, so I can easily fix this mishap. + +To increase the filesystem's space within the virtual machine, you must first increase the virtual hard drive on your host system. + +Shut down the virtual machine. If your host system is running Windows, open a command prompt and navigate to `C:\Program Files\Oracle\VirtualBox`. Resize the disk to 12,000MB with the following command: + + +``` +`VBoxManage.exe modifyhd "C:\Users\StephanA\VirtualBox VMs\Fedora_33\Fedora_33.vdi" --resize 12000` +``` + +Boot the virtual machine and open the **Disks** utility. You should see the newly created unassigned free space. Select **Free Space** and click the **+** button: + +![Free space before adding][28] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Now, create a new partition. Select the amount of free space you want to use: + +![Creating a new partition and setting size][29] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +You don't want to create a filesystem or anything else on your new partition, so select **Other**: + +![Selecting "other" for partition volume type][30] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Select **No Filesystem**: + +![Setting "No filesystem" on new partition][31] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +The overview should now look like this: + +![VirtualBox after adding new partition][32] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +There is a new partition device, **/dev/sda3**. Check your LVM volume group by typing `vgscan`: + +![Checking LVM volume group by typing vgscan:][33] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Now you have everything you need. Extend the volume group in the new partition: + + +``` +`vgextend fedora_localhost-live /dev/sda3` +``` + +![vgextend command output][34] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Because the volume group is larger, you can increase the size of the logical volume. The command `vgdisplay` shows that it has 951 free extends available: + +![vgdisplay command output][35] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Increase the logical volume by 951 extends: + + +``` +`lvextend -l+951 /dev/mapper/fedora_localhost--live-root` +``` + +![lvextend command output][36] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +After you increase the logical volume, the last thing to do is to resize the filesystem: + + +``` +`resize2fs /dev/mapper/fedora_localhost--live-root` +``` + +![resize2fs command output][37] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Done! Check the **Disk Usage Analyzer**, and you should see that the extended space is available for the filesystem. + +### Summary + +With a virtual machine, you can check how a piece of software behaves with a specific operating system or a specific version of an operating system. Besides that, you can also try out any Linux distribution you want to test without worrying about breaking your system. For advanced users, VirtualBox offers a wide range of possibilities when it comes to testing, networking, and simulation. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/try-linux-virtualbox + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) +[2]: https://www.virtualbox.org/ +[3]: https://getfedora.org/ +[4]: https://en.wikipedia.org/wiki/Hardware-assisted_virtualization +[5]: https://www.virtualbox.org/wiki/Downloads +[6]: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) +[7]: https://opensource.com/sites/default/files/uploads/virtualbox_new_vm.png (VirtualBox New VM) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://opensource.com/sites/default/files/uploads/virtualbox_memory_size_1.png (Set VM memory size) +[10]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_1.png (Create virtual hard disk) +[11]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_2.png (Selecting hard disk file type) +[12]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_3.png (Dynamically allocating hard disk) +[13]: https://getfedora.org/en/workstation/download/ +[14]: https://opensource.com/sites/default/files/uploads/virtualbox_create_hd_4.png (Setting hard disk size) +[15]: https://opensource.com/sites/default/files/uploads/virtualbox_cpu_settings.png (Assigning cores to guest system) +[16]: https://opensource.com/sites/default/files/uploads/virtualbox_network_settings2.png (Network settings) +[17]: https://en.wikipedia.org/wiki/Network_address_translation +[18]: https://www.virtualbox.org/manual/ch06.html#natforward +[19]: https://opensource.com/sites/default/files/uploads/virtualbox_choose_image3.png (Assigning OS image) +[20]: https://opensource.com/sites/default/files/uploads/virtualbox_running.png (VirtualBox Fedora installer) +[21]: https://opensource.com/sites/default/files/uploads/virtualbox_partitioning_1.png (Selecting Custom partition configuration) +[22]: https://opensource.com/article/18/9/swap-space-linux-systems +[23]: https://fedoraproject.org/wiki/Changes/SwapOnZRAM +[24]: https://opensource.com/sites/default/files/uploads/virtualbox_partitioning_2.png (Adding mount points) +[25]: https://opensource.com/sites/default/files/uploads/virtualbox_guest_additions_2.png (Selecting Guest Additions CD image) +[26]: https://opensource.com/sites/default/files/uploads/virtualbox_guest_additions_autorun.png (Enabling Guest Additions autorun) +[27]: https://opensource.com/sites/default/files/uploads/virtualbox_disk_usage_1.png (Fedora hard disk running out of space) +[28]: https://opensource.com/sites/default/files/uploads/virtualbox_disks_before.png (Free space before adding) +[29]: https://opensource.com/sites/default/files/uploads/virtualbox_new_partition_1.png (Creating a new partition and setting size) +[30]: https://opensource.com/sites/default/files/uploads/virtualbox_new_partition_2.png (Selecting "other" for partition volume type) +[31]: https://opensource.com/sites/default/files/uploads/virtualbox_no_partition_3.png (Setting "No filesystem" on new partition) +[32]: https://opensource.com/sites/default/files/uploads/virtualbox_disk_after.png (VirtualBox after adding new partition) +[33]: https://opensource.com/sites/default/files/uploads/virtualbox_vgscan.png (Checking LVM volume group by typing vgscan:) +[34]: https://opensource.com/sites/default/files/uploads/virtualbox_vgextend_2.png (vgextend command output) +[35]: https://opensource.com/sites/default/files/uploads/virtualbox_vgdisplay.png (vgdisplay command output) +[36]: https://opensource.com/sites/default/files/uploads/virtualbox_lvextend.png (lvextend command output) +[37]: https://opensource.com/sites/default/files/uploads/virtualbox_resizefs.png (resize2fs command output) From 1e34fb3c2ab4a2393e67d5b8d5beab2fa483cd79 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 30 Jun 2021 05:03:43 +0800 Subject: [PATCH 249/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210629=20?= =?UTF-8?q?A=20brief=20history=20of=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210629 A brief history of FreeDOS.md --- .../20210629 A brief history of FreeDOS.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20210629 A brief history of FreeDOS.md diff --git a/sources/tech/20210629 A brief history of FreeDOS.md b/sources/tech/20210629 A brief history of FreeDOS.md new file mode 100644 index 0000000000..2586f79cfd --- /dev/null +++ b/sources/tech/20210629 A brief history of FreeDOS.md @@ -0,0 +1,110 @@ +[#]: subject: (A brief history of FreeDOS) +[#]: via: (https://opensource.com/article/21/6/history-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A brief history of FreeDOS +====== +Throughout its nearly 30-year journey, FreeDOS has been the modern DOS. +![Person typing on a 1980's computer][1] + +A master was explaining the nature of [The Tao of Programming][2] to one of his novices. "The Tao is embodied in all software—regardless of how insignificant," said the master. + +"Is Tao in a hand-held calculator?" asked the novice. + +"It is," came the reply. + +"Is the Tao in a video game?" continued the novice. + +"It is even in a video game," said the master. + +"And is the Tao in the DOS for a personal computer?" + +The master coughed and shifted his position slightly. "The lesson is over for today," he said. + +The Tao of Programming, Geoffrey James, InfoBooks, 1987 + +Computing used to be limited only to expensive mainframes and "Big Iron" computer systems like the PDP11. But the advent of the microprocessor brought about a computing revolution in the 1970s. You could finally have a computer in your home—the "personal computer" had arrived! + +The earliest personal computers I remember seeing included the Commodore, TRS-80, and Apple. The personal computer became such a hot topic that IBM decided to enter the market. After a rapid development cycle, IBM released the IBM 5150 Personal Computer (the original "IBM PC") in August 1981. + +Creating a computer from scratch is no easy task, so IBM famously used "off-the-shelf" hardware to build the PC, and licensed other components from outside developers. One of those was the operating system, licensed from Microsoft. In turn, Microsoft acquired 86-DOS from Seattle Computer Products, applied various updates, and debuted the new version with the IBM PC as IBM PC-DOS. + +### Early DOS + +Running in memory _up to_ 640 kilobytes, DOS really couldn't do much more than manage the hardware and allow the user to launch applications. As a result, the PC-DOS 1.0 command line was pretty anemic, only including a few commands to set the date and time, manage files, control the terminal, and format floppy disks. DOS also included a BASIC language interpreter, which was a standard feature in all personal computers of the era. + +It wasn't until PC-DOS 2.0 that DOS became more interesting, adding new commands to the command line, and including other useful tools. But for me, it wasn't until MS-DOS 5.0 in 1991 that DOS began to feel "modern." Microsoft overhauled DOS in this release, updating many of the commands and replacing the venerable Edlin editor with a new full-screen editor that was more user-friendly. DOS 5 included other features that I liked, as well, such as a new BASIC interpreter based on Microsoft QuickBASIC Compiler, simply called QBASIC. If you've ever played the Gorillas game on DOS, it was probably in MS-DOS 5.0. + +Despite these upgrades, I wasn't entirely satisfied with the DOS command line. DOS never strayed far from the original design, which proved limiting. DOS gave the user a few tools to do some things from the command line—otherwise, you were meant to use the DOS command line to launch applications. Microsoft assumed the user would spend most of their time in a few key applications, such as a word processor or spreadsheet. + +But developers wanted a more functional DOS, and a sub-industry sprouted to offer neat tools and programs. Some were full-screen applications, but many were command-line utilities that enhanced the DOS command environment. When I learned a bit of C programming, I started writing my own utilities that extended or replaced the DOS command line. And despite the rather limited underpinnings of MS-DOS, I found that the third-party utilities, plus my own, created a powerful DOS command line. + +### FreeDOS + +In early 1994, I started seeing a lot of interviews with Microsoft executives in tech magazines saying the next version of Windows would totally do away with DOS. I'd used Windows before—but if you remember the era, you know Windows 3.1 wasn't a great platform. Windows 3.1 was clunky and buggy—if an application crashed, it might take down the entire Windows system. And I didn't like the Windows graphical user interface, either. I preferred doing my work at the command line, not with a mouse. + +I considered Windows and decided, “If Windows 3.2 or Windows 4.0 will be anything like Windows 3.1, I want nothing to do with it.” But what were my options? I'd already experimented with Linux at this point, and thought [Linux was great][3]—but Linux didn't have any applications. My word processor, spreadsheet, and other programs were on DOS. I needed DOS. + +Then I had an idea! I thought, “If developers can come together over the internet to write a complete Unix operating system, surely we can do the same thing with DOS.” After all, DOS was a fairly straightforward operating system compared to Unix. DOS ran one task at a time (single-tasking) and had a simpler memory model. It shouldn't be _that_ hard to write our own DOS. + +So on June 29, 1994, I [posted an announcement][4] to `comp.os.msdos.apps`, on a message board network called Usenet: + +ANNOUNCEMENT OF PD-DOS PROJECT: + +A few months ago, I posted articles relating to starting a public domain version of DOS. The general support for this at the time was strong, and many people agreed with the statement, "start writing!" So, I have... + +Announcing the first effort to produce a PD-DOS. I have written up a "manifest" describing the goals of such a project and an outline of the work, as well as a "task list" that shows exactly what needs to be written. I'll post those here, and let discussion follow. + +_* A note about the name—I wanted this new DOS to be something that everyone could use, and I naively assumed that when everyone could use it, it was "public domain." I quickly realized the difference, and we renamed "PD-DOS" to "Free-DOS"—and later dropped the hyphen to become "FreeDOS."_ + +A few developers reached out to me, to offer utilities they had created to replace or enhance the DOS command line, similar to my own efforts. We pooled our utilities and created a useful system that we released as "Alpha 1" in September 1994, just a few months after announcing the project. Development was pretty swift in those days, and we followed up with "Alpha 2" in December 1994, "Alpha 3" in January 1995, and "Alpha 4" in June 1995. + +### A modern DOS + +Since then, we've always focused on making FreeDOS a "modern" DOS. And much of that modernization is centered on creating a rich command-line environment. Yes, DOS still needs to support applications, but we believe FreeDOS needs a strong command-line environment, as well. That's why FreeDOS includes dozens of useful tools, including commands to navigate directories, manage files, play music, connect to networks, ... and a collection of Unix-like utilities such as `less`, `du`, `head`, `tail`, `sed`, and `tr`. + +While FreeDOS development has slowed, it has not stopped. Developers continue to write new programs for FreeDOS, and add new features to FreeDOS. I'm particularly excited about several great additions to FreeDOS 1.3 RC4, the latest release candidate for the forthcoming FreeDOS 1.3. A few recent updates: + + * Mateusz Viste created a new ebook reader called Ancient Machine Book (AMB) that we've leveraged as the new help system in FreeDOS 1.3 RC4 + * Rask Ingemann Lambertsen, Andrew Jenner, TK Chia, and others are updating the IA-16 version of GCC, including a new _libi86_ library that provides some degree of compatibility with the Borland Turbo C++ compiler's C library + * Jason Hood has updated an unloadable CD-ROM redirector substitute for Microsoft's MSCDEX, supporting up to 10 drives + * SuperIlu has created DOjS, a Javascript development canvas with an integrated editor, graphics and sound output, and mouse, keyboard, and joystick input + * Japheth has created a DOS32PAE extender that is able to use huge amounts of memory through PAE paging + + + +Despite all of the new development on FreeDOS, we remain true to our DOS roots. As we continue working toward FreeDOS 1.3 "final," we carry several core assumptions, including: + + * **Compatibility is key**—FreeDOS isn't really "DOS" if it can't run classic DOS applications. While we provide many great open source tools, applications, and games, you can run your legacy DOS applications, too. + * **Continue to run on old PCs (XT, '286, '386, etc)**—FreeDOS 1.3 will remain 16-bit Intel but will support new hardware with expanded driver support, where possible. For this reason, we continue to focus on a single-user command-line environment. + * **FreeDOS is open source software**—I've always said that FreeDOS isn't a "free DOS" if people can't access, study, and modify the source code. FreeDOS 1.3 will include software that uses recognized open source licenses as much as possible. But DOS actually pre-dates the GNU General Public License (1989) and the Open Source Definition (1998) so some DOS software might use its own "free with source code" license that isn't a standard "open source" license. As we consider packages to include in FreeDOS, we continue to evaluate any licenses to ensure they are suitably "open source," even if they are not officially recognized. + + + +We welcome your help in making FreeDOS great! Please join us on our email list—we welcome all newcomers and contributors. We communicate over an email list, but the list is fairly low volume so is unlikely to fill up your Inbox. + +Visit the FreeDOS website at [www.freedos.org][5]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/history-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://www.mit.edu/~xela/tao.html +[3]: https://opensource.com/article/17/5/how-i-got-started-linux-jim-hall-freedos +[4]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ +[5]: https://www.freedos.org/ From 470a62826fc45bd9fd0de4807d8fc15a929582ea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 30 Jun 2021 05:04:19 +0800 Subject: [PATCH 250/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210629=20?= =?UTF-8?q?Nextcloud=20Alternative=20Twake=20Adds=20New=20Features=20and?= =?UTF-8?q?=20Privacy=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md --- ...s New Features and Privacy Improvements.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md diff --git a/sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md b/sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md new file mode 100644 index 0000000000..7b446a5a80 --- /dev/null +++ b/sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md @@ -0,0 +1,88 @@ +[#]: subject: (Nextcloud Alternative Twake Adds New Features and Privacy Improvements) +[#]: via: (https://news.itsfoss.com/twake-2021-q2-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Nextcloud Alternative Twake Adds New Features and Privacy Improvements +====== + +If you did not know about Twake, you might want to check out our quick review on [Twake app][1] on our main portal. + +To give you a quick introduction, I would say that Twake aims to be a modern, open-source Nextcloud alternative with Slack-like features in the mix. In other words, it could be an all-in-one solution for your requirements. + +Now, after several updates to the platform, there’s a big release that addresses some improvements and adds a couple of new features. + +Here, let me give you some highlights of the latest release. + +### New and Improved Channels + +If you are using Twake to collaborate and communicate as an [open-source alternative to Slack][2], there are some significant improvements to the way everyone interacts with channels. + +It is now super easy to leave and join channels, which needed attention in its early implementation. + +![][3] + +The channel access rights have been tweaked to let the team members create a channel as per their requirements. If you have a lot of channels and want to add some of them for quick access, you can now add them to favorites to do just that. + +Also, if you are in dire need of multiple channels, you will have to ability to create groups of channels to better organize them. + +![][4] + +If you create a public channel, you can invite all your workspace members to it in one go. Also, if a new user joins, they will be added to all the public channels by default. + +### Colleagues and Guest Management + +![][5] + +You get a new add colleague button to add collaborators using their email addresses. While it makes things convenient, it is also great to see that you can invite anyone not in your workplace as a guest to a direct channel when needed. + +### Privacy and Other Improvements + +![][6] + +Originally, they used Amazon Web Services (AWS) to host everything. Now, they have switched to a France-based server (OVH Cloud) as someone with a better privacy policy in place. + +Under-the-hood, they have also transitioned from using PHP to NodeJS in the back end to make things faster. + +They have made several technical improvements to ensure security of users’ data and also improved the notifications. + +To learn more about what’s coming next and about this specific release, you can check out their [official announcement][7] or the [GitHub page][8]. + +[Twake.app][9] + +If you haven’t tried Twake yet, it is an interesting choice to go for. While there are some room for improvements like the addition of two-factor authentication for free and standard users, it is an impressive experience. + +_What do you think about Twake? Feel free to share your thoughts in the comments down below._ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/twake-2021-q2-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/twake-app/ +[2]: https://itsfoss.com/open-source-slack-alternative/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQxNCIgd2lkdGg9IjU1MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzMiIgd2lkdGg9Ijc1MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://www.linagora.com/en/post/2021/06/22/twake-q2-505-product-update-en +[8]: https://github.com/linagora/Twake +[9]: https://twake.app/en/ From b449192ccb038e39073c575b3d23b1984f471ca2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 30 Jun 2021 05:04:33 +0800 Subject: [PATCH 251/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210629=20?= =?UTF-8?q?Dark=20and=20Light=20Only!=20Ubuntu=2021.10=20Looks=20to=20Ditc?= =?UTF-8?q?h=20the=20Standard=20Mixed=20Color=20Theme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md --- ...to Ditch the Standard Mixed Color Theme.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md diff --git a/sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md b/sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md new file mode 100644 index 0000000000..d7967cb687 --- /dev/null +++ b/sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md @@ -0,0 +1,86 @@ +[#]: subject: (Dark and Light Only! Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme) +[#]: via: (https://news.itsfoss.com/ubuntu-21-10-theme-change/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Dark and Light Only! Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme +====== + +Ubuntu’s default “Yaru” community theme is an excellent choice. However, Ubuntu’s team has been tweaking it for a while since Ubutu 19.10 to match their branding and offer a good-looking experience. + +I liked the default themes available with Ubuntu 20.04. Up until now, you got standard, light, and dark theme options to choose from. + +![][1] + +But starting with [Ubuntu 21.10][2], you will no longer find the “**Standard**” (or mixed) theme available to pick. It all comes down to two choices that include light and dark theme only. + +Now, why is this happening? What exactly is the Standard theme offering now? + +Here’s what you need to know … + +### Ubuntu’s Standard Theme is Problematic + +![][1] + +If you have used Ubuntu, you probably know that Ubuntu’s Standard theme refers to a mixed theme. It features a dark window bar (or the titlebar of applications) and the rest follows a light theme pattern. + +With **Ubuntu and GNOME’s default theme color conflicts** and **lack of theming API** for GTK (and Gnome shell), it is already [problematic][3] to customize and work on Ubuntu’s desktop theme. + +Moreover, GTK 3 and GTK 4 do not support having a separate background color for the headerbar from the rest of the window. Hence, it is tough to keep bug-free implementations for every GTK application. + +And that is the reason the Yaru community design team recently [proposed][4] to remove the mixed theme. + +Ubuntu’s team has agreed to this decision and the change has been merged. You should no longer find the mixed theme in Ubuntu 21.10 but only the dark and light themes as your option. + +In other words, “Yaru” will be the light theme, and “Yaru dark” will be the dark theme when using [GNOME Tweaks][5]. There will be no “Yaru-light” anymore. + +### Will They Bring Back the Mixed Theme? + +Unless there are changes in the upstream — GNOME providing a theming API and GTK 3/4 supporting more customizability for headerbar, the mixed theme is gone for good. + +So, with Ubuntu 21.10 and any future releases, you get fully light and fully dark themes, which should offer a seamless user experience across any GTK application. + +### A Potential Rebranding in Ubuntu 21.10 + +While the Brand and Visual team at Canonical agreed to the default Yaru theme changes, they also want to work closely with the Yaru community design team for the upcoming rebranding, as mentioned by a designer in this [GitHub thread][4]: + +![][6] + +So, what exactly do we know about the upcoming rebranding for Ubuntu 21.10? Nothing yet. + +But considering that Ubuntu 20.04 shaped up with attractive branding and visuals, I’m excited about this one. Most probably, the default color scheme will change – but what what will it change to? + +Let’s wait for that! Feel free to share your thoughts on this development on Ubuntu’s future design in the comments below. + +First noticed at: [OMG! Ubuntu][7] + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-21-10-theme-change/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/ +[3]: https://github.com/ubuntu/yaru/discussions/2677 +[4]: https://github.com/ubuntu/yaru/issues/2913 +[5]: https://itsfoss.com/gnome-tweak-tool/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://www.omgubuntu.co.uk/2021/06/ubuntu-21-10-yarn-theme-change From 09a38566540500be74bf2426c25a9b44eb6cc7ba Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 30 Jun 2021 05:42:19 +0800 Subject: [PATCH 252/870] Rename sources/tech/20210629 A brief history of FreeDOS.md to sources/talk/20210629 A brief history of FreeDOS.md --- sources/{tech => talk}/20210629 A brief history of FreeDOS.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210629 A brief history of FreeDOS.md (100%) diff --git a/sources/tech/20210629 A brief history of FreeDOS.md b/sources/talk/20210629 A brief history of FreeDOS.md similarity index 100% rename from sources/tech/20210629 A brief history of FreeDOS.md rename to sources/talk/20210629 A brief history of FreeDOS.md From 7ae9744c5d4ae70abe8bcb672832c8d6431f1de2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 30 Jun 2021 08:37:38 +0800 Subject: [PATCH 253/870] translated --- ...24 Copy files between Linux and FreeDOS.md | 129 ------------------ ...24 Copy files between Linux and FreeDOS.md | 127 +++++++++++++++++ 2 files changed, 127 insertions(+), 129 deletions(-) delete mode 100644 sources/tech/20210624 Copy files between Linux and FreeDOS.md create mode 100644 translated/tech/20210624 Copy files between Linux and FreeDOS.md diff --git a/sources/tech/20210624 Copy files between Linux and FreeDOS.md b/sources/tech/20210624 Copy files between Linux and FreeDOS.md deleted file mode 100644 index 84a2620ecb..0000000000 --- a/sources/tech/20210624 Copy files between Linux and FreeDOS.md +++ /dev/null @@ -1,129 +0,0 @@ -[#]: subject: (Copy files between Linux and FreeDOS) -[#]: via: (https://opensource.com/article/21/6/copy-files-linux-freedos) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Copy files between Linux and FreeDOS -====== -Here's how I transfer files between my FreeDOS virtual machine and my -Linux desktop system. -![Files in a folder][1] - -I run Linux as my primary operating system, and I boot FreeDOS in a virtual machine. Most of the time, I use QEMU as my PC emulator, but sometimes I'll run other experiments with GNOME Boxes (which uses QEMU as a back-end virtual machine) or with VirtualBox. - -I like to play classic DOS games, and sometimes I'll bring up a favorite DOS application. I teach a Management Information Systems (MIS) class where I talk about the history of computing, and I'll sometimes record a demonstration using FreeDOS and a legacy DOS application, such as As-Easy-As (my favorite DOS spreadsheet—once released as "shareware" but now available [for free from TRIUS, Inc][2]). - -But using FreeDOS this way means I need to transfer files between my FreeDOS virtual machine and my Linux desktop system. Let me show you how I do that. - -### Accessing the image with guestmount - -I used to access my virtual disk image by calculating the offset to the first DOS partition, then calling the Linux `mount` command with the right mix of options to match that offset. This was always error-prone and not very flexible. Fortunately, there's an easier way to do it. The `guestmount` program from the [libguestfs-tools][3] package lets you access or _mount_ the virtual disk image from Linux. You can install `libguestfs-tools` using this command on Fedora: - - -``` -`$ yum install libguestfs-tools libguestfs` -``` - -Using `guestmount` is not as easy as double-clicking the file from the GNOME file manager, but the command line isn't too difficult to use. The basic usage of `guestmount` is: - - -``` -`$ guestmount -a image -m device mountpoint` -``` - -In this usage, _image_ is the virtual disk image to use. On my system, I created my QEMU virtual disk image with the `qemu-img` command. The g`uestmount` program can read this disk image format, as well as the QCOW2 image format used by GNOME Boxes, or the VDI image format used in VirtualBox. - -The _device_ option indicates the partition on the virtual disk. Imagine using this virtual disk as a real hard drive. You would access the first partition as `/dev/sda1`, the second partition as `/dev/sda2`, and so on. That's the syntax for `guestmount`. By default, FreeDOS 1.3 RC4 creates one partition on an empty drive, so access that partition as `/dev/sda1`. - -And _mountpoint_ is the location to "mount" the DOS filesystem on your local Linux system. I'll usually create a temporary directory to work with. You only need the mount point while you're accessing the virtual disk. - -Putting that all together, I use this set of commands to access my FreeDOS virtual disk image from Linux: - - -``` -$ mkdir /tmp/freedos -$ guestmount -a freedos.img -m /dev/sda1 /tmp/freedos -``` - -After that, I can access my FreeDOS files via the `/tmp/freedos` directory, using normal tools on Linux. I might use `ls /tmp/freedos` at the command line, or open the `/tmp/freedos` mount point using the desktop file manager. - - -``` -$ ls -l /tmp/freedos -total 216 -drwxr-xr-x.  5 root root  8192 May 10 15:53 APPS --rwxr-xr-x.  1 root root 85048 Apr 30 07:54 COMMAND.COM --rwxr-xr-x.  1 root root   103 May 13 15:48 CONFIG.SYS -drwxr-xr-x.  5 root root  8192 May 15 16:52 DEVEL -drwxr-xr-x.  2 root root  8192 May 15 13:36 EDLIN --rwxr-xr-x.  1 root root  1821 May 10 15:57 FDAUTO.BAT --rwxr-xr-x.  1 root root   740 May 13 15:47 FDCONFIG.SYS -drwxr-xr-x. 10 root root  8192 May 10 15:49 FDOS --rwxr-xr-x.  1 root root 46685 Apr 30 07:54 KERNEL.SYS -drwxr-xr-x.  2 root root  8192 May 10 15:57 SRC --rwxr-xr-x.  1 root root  3190 May 16 08:34 SRC.ZIP -drwxr-xr-x.  3 root root  8192 May 11 18:33 TEMP -``` - -![GNOME file manager][4] - -Using GNOME file manager to access the virtual disk -(Jim Hall, [CC-BY SA 4.0][5]) - -For example, to copy several C source files from my Linux `projects` directory into `C:\SRC` on the virtual disk image, so I can use the files under FreeDOS later, I can use the Linux `cp` command: - - -``` -`$ cp /home/jhall/projects/*.c /tmp/freedos/SRC` -``` - -The files and directories on the virtual drive are technically _case insensitive_, so you can refer to them using uppercase or lowercase letters. However, I find it more natural to type DOS files and directories using all uppercase. - - -``` -$ ls /tmp/freedos -APPS         CONFIG.SYS  EDLIN       FDCONFIG.SYS  KERNEL.SYS  SRC.ZIP -COMMAND.COM  DEVEL       FDAUTO.BAT  FDOS          SRC         TEMP - -$ ls /tmp/freedos/EDLIN -EDLIN.EXE  MAKEFILE.OW - -$ ls /tmp/freedos/edlin -EDLIN.EXE  MAKEFILE.OW -``` - -### Unmounting with guestmount - -You should always _unmount_ the virtual disk image before you use it again in your virtual machine. If you leave the image mounted while you run QEMU or VirtualBox, you risk messing up your files. - -The companion command to `guestmount` is `guestunmount`, to unmount the disk image. Just give the mount point that you wish to unmount: - - -``` -`$ guestunmount /tmp/freedos` -``` - -Note that this command is spelled slightly differently from the Linux `umount` system command. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/copy-files-linux-freedos - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) -[2]: http://www.triusinc.com/forums/viewtopic.php?t=10 -[3]: https://libguestfs.org/ -[4]: https://opensource.com/sites/default/files/uploads/gnome-file-manager.png (Using GNOME file manager to access the virtual disk) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/translated/tech/20210624 Copy files between Linux and FreeDOS.md b/translated/tech/20210624 Copy files between Linux and FreeDOS.md new file mode 100644 index 0000000000..d8a383e4c9 --- /dev/null +++ b/translated/tech/20210624 Copy files between Linux and FreeDOS.md @@ -0,0 +1,127 @@ +[#]: subject: (Copy files between Linux and FreeDOS) +[#]: via: (https://opensource.com/article/21/6/copy-files-linux-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 和 FreeDOS 之间复制文件 +====== +下面是我如何在我的 FreeDOS 虚拟机和 Linux 桌面系统之间传输文件。 +![Files in a folder][1] + +我运行 Linux 作为我的主要操作系统,我在一个虚拟机中启动 FreeDOS。大多数时候,我使用 QEMU 作为我的 PC 模拟器,但有时我会用 GNOME Boxes(它使用 QEMU 作为后端虚拟机)或用 VirtualBox 运行其他实验。 + +我喜欢玩经典的 DOS 游戏,有时我也会调出一个最喜欢的 DOS 应用。我在管理信息系统 (MIS) 课上讲计算机的历史,有时我会用 FreeDOS 和一个传统的 DOS 应用录制一个演示,比如 As-Easy-As(我最喜欢的 DOS 电子表格,曾经作为“共享软件”发布,但现在可以[从 TRIUS 公司免费获得)][2])。 + +但是以这种方式使用 FreeDOS 意味着我需要在我的 FreeDOS 虚拟机和我的 Linux桌 面系统之间传输文件。让我来展示是如何做到这一点的。 + +### 用 guestmount 访问镜像 + +我曾经通过计算第一个 DOS 分区的偏移量来访问我的虚拟磁盘镜像,然后用正确的选项组合来调用 Linux 的 `mount` 命令来匹配这个偏移量。这总是很容易出错,而且不是很灵活。幸运的是,有一个更简单的方法可以做到这一点。来自 [libguestfs-tools][3] 包的 `guestmount` 程序可以让你从 Linux 中访问或_挂载_虚拟磁盘镜像。你可以在 Fedora 上用这个命令安装 `libguestfs-tools`: + + +``` +`$ yum install libguestfs-tools libguestfs` +``` + +使用 `guestmount` 并不像从 GNOME 文件管理器中双击文件那么简单,但命令行的使用并不难。`guestmount` 的基本用法是: + + +``` +`$ guestmount -a image -m device mountpoint` +``` + +在这个用法中,_image_ 是要使用的虚拟磁盘镜像。在我的系统中,我用 `qemu-img` 命令创建了 QEMU 虚拟磁盘镜像。`guestmount` 程序可以读取这种磁盘镜像格式,以及 GNOME Boxes 使用的 QCOW2 镜像格式,或者 VirtualBox 使用的 VDI 镜像格式。 + +_device_ 选项表示虚拟磁盘上的分区。想象一下,把这个虚拟磁盘当作一个真正的硬盘使用。你可以用 `/dev/sda1` 访问第一个分区,用 `/dev/sda2` 访问第二个分区,以此类推。这就是 `guestmount` 的语法。默认情况下,FreeDOS 1.3 RC4 在一个空的驱动器上创建了一个分区,所以访问这个分区的时候要用 `/dev/sda1`。 + +而 _mountpoint_ 是在你的本地 Linux 系统上“挂载” DOS 文件系统的位置。我通常会创建一个临时目录来工作。你只在访问虚拟磁盘时需要挂载点。 + +综上所述,我使用这组命令从 Linux 访问我的 FreeDOS 虚拟磁盘镜像: + + +``` +$ mkdir /tmp/freedos +$ guestmount -a freedos.img -m /dev/sda1 /tmp/freedos +``` + +之后,我可以通过 `/tmp/freedos` 目录访问我的 FreeDOS 文件,使用 Linux 上的普通工具。我可以在命令行中使用 `ls /tmp/freedos`,或者使用桌面文件管理器打开 `/tmp/freedos` 挂载点。 + + +``` +$ ls -l /tmp/freedos +total 216 +drwxr-xr-x. 5 root root 8192 May 10 15:53 APPS +-rwxr-xr-x. 1 root root 85048 Apr 30 07:54 COMMAND.COM +-rwxr-xr-x. 1 root root 103 May 13 15:48 CONFIG.SYS +drwxr-xr-x. 5 root root 8192 May 15 16:52 DEVEL +drwxr-xr-x. 2 root root 8192 May 15 13:36 EDLIN +-rwxr-xr-x. 1 root root 1821 May 10 15:57 FDAUTO.BAT +-rwxr-xr-x. 1 root root 740 May 13 15:47 FDCONFIG.SYS +drwxr-xr-x. 10 root root 8192 May 10 15:49 FDOS +-rwxr-xr-x. 1 root root 46685 Apr 30 07:54 KERNEL.SYS +drwxr-xr-x. 2 root root 8192 May 10 15:57 SRC +-rwxr-xr-x. 1 root root 3190 May 16 08:34 SRC.ZIP +drwxr-xr-x. 3 root root 8192 May 11 18:33 TEMP +``` + +![GNOME file manager][4] + +使用 GNOME 文件管理器来访问虚拟磁盘 +(Jim Hall, [CC-BY SA 4.0][5]) + +例如,要从我的 Linux `projects` 目录中复制几个 C 源文件到虚拟磁盘镜像上的 `C:\SRC`,以便我以后能在 FreeDOS 下使用这些文件,我可以使用 Linux `cp` 命令: + + +``` +`$ cp /home/jhall/projects/*.c /tmp/freedos/SRC` +``` + +虚拟驱动器上的文件和目录在技术上是不分大小写的,所以你可以用大写或小写字母来引用它们。然而,我发现使用所有大写字母来输入 DOS 文件和目录更为自然。 + + +``` +$ ls /tmp/freedos +APPS CONFIG.SYS EDLIN FDCONFIG.SYS KERNEL.SYS SRC.ZIP +COMMAND.COM DEVEL FDAUTO.BAT FDOS SRC TEMP + +$ ls /tmp/freedos/EDLIN +EDLIN.EXE MAKEFILE.OW + +$ ls /tmp/freedos/edlin +EDLIN.EXE MAKEFILE.OW +``` + +### 用 guestmount 卸载 + +在你再次在虚拟机中使用虚拟磁盘镜像之前,你应该总是先_卸载_。如果你在运行 QEMU 或 VirtualBox 时让镜像挂载,你有可能弄乱你的文件。 + +与 `guestmount` 配套的命令是 `guestunmount`,用来卸载磁盘镜像。只要给出你想卸载的挂载点就可以了: + +``` +`$ guestunmount /tmp/freedos` +``` + +请注意命令拼写与 Linux 的 `umount` 稍有不同。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/copy-files-linux-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) +[2]: http://www.triusinc.com/forums/viewtopic.php?t=10 +[3]: https://libguestfs.org/ +[4]: https://opensource.com/sites/default/files/uploads/gnome-file-manager.png (Using GNOME file manager to access the virtual disk) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ From cd15c2495a3727a7e6599415d96e4549b607ad94 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 30 Jun 2021 08:40:18 +0800 Subject: [PATCH 254/870] translating --- ...ource App for Managing and Editing Large Photo Collection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md b/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md index 5c86dba634..8abc8ba509 100644 --- a/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md +++ b/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/fotoxx/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 25cd548a38843e42f6c66d813ec60d8175d09bd1 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Wed, 30 Jun 2021 14:07:37 +0800 Subject: [PATCH 255/870] Update 20210625 Use Python to parse configuration files.md --- .../tech/20210625 Use Python to parse configuration files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210625 Use Python to parse configuration files.md b/sources/tech/20210625 Use Python to parse configuration files.md index c062d105b7..eaf0c699cc 100644 --- a/sources/tech/20210625 Use Python to parse configuration files.md +++ b/sources/tech/20210625 Use Python to parse configuration files.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/parse-configuration-files-python) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fd14501762be5c03a1d23f8567a7ba669e724909 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 30 Jun 2021 16:13:45 +0800 Subject: [PATCH 256/870] PRF&PUB:20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations (#22378) --- ...ghting Effects and Other Configurations.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/tech => published}/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md (84%) diff --git a/translated/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md b/published/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md similarity index 84% rename from translated/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md rename to published/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md index 1e35619f17..bdad8451e8 100644 --- a/translated/tech/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md +++ b/published/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md @@ -3,16 +3,16 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13538-1.html) 如何在 Linux 上设置雷蛇设备的灯光效果和其他配置 ====== -你有一个闪亮的新雷蛇硬件,但你找不到 Linux 的 Razer Synapse 软件。而你最终没有正确的 RGB 同步,也没有办法定制它。你会怎么做呢? +你有了一个闪亮的新雷蛇硬件,但你找不到 Linux 的 Razer Synapse 软件。而你最终没有正确 RGB 同步,也没有办法定制它。你会怎么做呢? -好吧,对于某些功能,比如给你的鼠标添加宏,你仍然需要访问 Razer Synapse(在 Windows 或 MacOS上)。 +好吧,对于某些功能,比如给你的鼠标添加宏,你仍然需要(在 Windows 或 MacOS 上)访问 Razer Synapse。 但是,要调整其他一些选项,如键盘的宏,改变鼠标的 DPI,或灯光效果,你可以在 Linux 上轻松设置你的雷蛇外设。 @@ -36,11 +36,11 @@ 虽然这不是官方 Linux 驱动,但它在各种设备上工作良好。 -**它为各种 Linux 发行版提供支持,包括 Solus、openSUSE、Fedora、Debian、Arch Linux、Ubuntu 和其他一些发行版。** +它为各种 Linux 发行版提供支持,包括 Solus、openSUSE、Fedora、Debian、Arch Linux、Ubuntu 和其他一些发行版。 -在这里,我将重点介绍在任何基于 Ubuntu 的发行版上安装它的步骤,对于其他发行版,你可能想参考[官方说明][8]。 +在这里,我将重点介绍在任何基于 Ubuntu 的发行版上安装它的步骤,对于其他发行版,你可能想参考 [官方说明][8]。 -你需要在 Ubuntu 上[使用 PPA][9] 安装 OpenRazer,下面是如何做的: +你需要在 Ubuntu 上 [使用 PPA][9] 安装 OpenRazer,下面是如何做的: ``` sudo apt install software-properties-gtk @@ -49,7 +49,7 @@ sudo apt update sudo apt install openrazer-meta ``` -它也提供了一个[守护进程][10],你可以选择让它工作,你要把你的用户加入到 **plugdev** 组,它给了设备的特权访问: +它也提供了一个 [守护进程][10],你可以选择让它工作,你要把你的用户加入到 `plugdev` 组,它给了设备的特权访问: ``` sudo gpasswd -a $USER plugdev @@ -57,7 +57,7 @@ sudo gpasswd -a $USER plugdev 我不需要用上述命令中配置/添加一个守护程序,但我仍然可以很好地使用这些设备。守护进程主要是确保驱动保持活跃。 -[下载 OpenRazer][11] +- [下载 OpenRazer][11] ### 步骤 2:安装一个 GUI 来管理和调整选项 @@ -79,13 +79,13 @@ sudo apt install polychromatic 对于 Arch Linux 用户,你可以在 [AUR][14] 中找到它。关于更多的安装说明,你可以参考[官方下载页面][15]。 -[下载 Polychromatic][16] +- [下载 Polychromatic][16] 你会得到不同设备的不同选项。在这里,我试着改变 DPI,自定义颜色周期,以及我的雷蛇 Basilisk v2 鼠标的轮询率,它完全正常。 ![Customization options for a mouse][17] -如果你知道你想做什么,它还为你提供了轻松重启或停止[守护进程][10]、改变小程序图标和执行高级配置选项的能力。 +如果你知道你想做什么,它还为你提供了轻松重启或停止 [守护进程][10]、改变小程序图标和执行高级配置选项的能力。 另外,你可以试试 [RazerGenie][18]、[Snake][19] 或 [OpenRGB][20] (用于改变颜色)来调整鼠标的颜色或任何其他设置。 @@ -104,7 +104,7 @@ via: https://itsfoss.com/set-up-razer-devices-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f147bad325c0e2036423711157a54630b424801f Mon Sep 17 00:00:00 2001 From: YungeGuo <578618446@qq.com> Date: Wed, 30 Jun 2021 23:33:49 +0800 Subject: [PATCH 257/870] Update 20210628 Query your Linux operating system like a database.md (#22379) translating --- ...0210628 Query your Linux operating system like a database.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210628 Query your Linux operating system like a database.md b/sources/tech/20210628 Query your Linux operating system like a database.md index a23d19eba8..176edd5733 100644 --- a/sources/tech/20210628 Query your Linux operating system like a database.md +++ b/sources/tech/20210628 Query your Linux operating system like a database.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/osquery-linux) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (YungeG) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2ceddf46a5951b0719ee7805707e0fa501c5db22 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Jul 2021 05:03:12 +0800 Subject: [PATCH 258/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210630=20?= =?UTF-8?q?Is=20remmina=20useful=20for=20your=20daily=20work=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210630 Is remmina useful for your daily work.md --- ...0 Is remmina useful for your daily work.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20210630 Is remmina useful for your daily work.md diff --git a/sources/tech/20210630 Is remmina useful for your daily work.md b/sources/tech/20210630 Is remmina useful for your daily work.md new file mode 100644 index 0000000000..a800764706 --- /dev/null +++ b/sources/tech/20210630 Is remmina useful for your daily work.md @@ -0,0 +1,139 @@ +[#]: subject: (Is remmina useful for your daily work?) +[#]: via: (https://fedoramagazine.org/is-remmina-useful-for-your-daily-work/) +[#]: author: (zexcon https://fedoramagazine.org/author/zexcon/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Is remmina useful for your daily work? +====== + +![][1] + +Photo by [Oğuzhan Akdoğan][2] on [Unsplash][3] + +[Remmina][4] is a Remote Desktop Client that supports numerous protocols allowing you to connect to many remote systems. This full featured client program allows you to set up a shared folder, select the screen size and type of connection being used. There are many more options that give you the ability to customize your connection to fit your individual needs. In this article we will utilize Remote Desktop Protocol (RDP) to demonstrate its capabilities. RDP is commonly used for logging into Microsoft Windows machines remotely and that will be used as an example. + +### How I came to use remmina + +Using _remmina_ has become a staple of my work and personal life. At one point I’m sitting at my desk looking at a 13″ monitor trying to perform work on an inadequate laptop. To my left is a 34″ ultra-wide connected to my personal box running Fedora Linux. Then it dawned on me, I should see if I can remote in and use my 34″ monitor to make my life better and offload resource intensive processes. The answer is yes, maybe? Lets try it out and see if it works for you. + +### Installing remmina + +The _remmina_ software is available in the Fedora Linux repository by default. Install it by running the following. +``` + +``` + +sudo dnf install remmina +``` + +``` + +### Collecting Windows Information + +On the the Windows computer you are going to remote into you will need to get the IP address, domain name and username. Type the _Windows Key + r_ and this will display the run box. Type _cmd_ and select OK. + +![][5] + +The terminal (command line) displayed allows us to obtain the IP address. At the prompt type _ipconfig_. +``` + +``` + +ipconfig +``` + +``` + +You will see options labeled “IPv6 Address” or “IPv4 Address” or both. Keep this address handy for the next section. In the terminal enter _set user_ to obtain the Server, Domain and Username. +``` + +``` + +set user +``` + +``` + +This displays the USERDOMAIN and USERNAME. Make note of this along with the IP address you captured in the last step. You will have the following three items. + + * Server = IPv4 or IPv6 + * USERDOMAIN = Domain + * USERNAME = Username + + + +With these three pieces of information you are ready to move to creating the connection. + +### Running remmina + +Execute the following command to start _remmina:_ +``` + +``` + +remmina +``` + +``` + +![Remnina startup screen][6] + +### Creating the connection + +Lets look at creating a connection. Select the icon to the left of the magnifying class at the top to create a connection profile (middle icon of the three). + +![][7] + +In the Remote Connection Profile you provide all the options to create the connection. Provide a meaningful title under the Name field. You can also add your connection to a Group if you are going to manage several connections with _remmina_. For the Protocol select “RDP – Remote Desktop Protocol”. + +Under the Basic options you will need to provide your IPv4 or IPv6 address for the host computer, your login name for the Username and the corresponding password. Use of the Domain will be specific to your situation and may not be needed. + +At this point, you are ready to connect to your remote desktop and can click “Save and Connect” at the bottom or you can continue reading and learn about some of the additional options. + +### The fun stuff “options” + +Here is where all the fun begins. Under Basic you can select Enable multi monitor, Span screen over multiple monitors and List monitor IDs. This allows you to use one or more monitors in many different configurations. You can even set the resolution or select a Color depth. + +One of my favorite options available is the Share folder that allows you to setup a folder on your local machine and it will automatically mount on the remote computer. This affords you the opportunity to move files back and forth easily and no more emailing yourself! + +![][8] + +We will only cover two items under the Advanced section one is Quality and allows you to select performance over visual appeal or vise versa. The second option is the security protocol negotiation that I recommend leaving set to Automatic negotiation. + +![][9] + +### Alternative + +In all fairness I didn’t start with _remmina_. It took using others, notably [FreeRDP,][10] for me to see that the learning curve could be substantial and I didn’t want it to effect my availability and productivity at work. With a little bit of time and research you can dig in and learn the many features of FreeRDP and see if it might be the better choice for you. + +### Conclusion + +A basic setup for an RDP connection to a Windows system was described. Some options were discussed, such as setting the Resolution, Share folder, and Quality. We only touched on a minimal set available among an abundance of options. If you find that _remmina_ is right for you, I highly recommend you go through the remaining options. Many of the options can help tweak the desktop to fit your personal preferences and create a better experience. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/is-remmina-useful-for-your-daily-work/ + +作者:[zexcon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/zexcon/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/06/remote_display-816x345.jpg +[2]: https://unsplash.com/@jeffgry?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/remote-display?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://remmina.org/ +[5]: https://fedoramagazine.org/wp-content/uploads/2021/06/Remmina05.jpg +[6]: https://fedoramagazine.org/wp-content/uploads/2021/06/Remmina01.jpg +[7]: https://fedoramagazine.org/wp-content/uploads/2021/06/Remmina02.jpg +[8]: https://fedoramagazine.org/wp-content/uploads/2021/06/Rammina03.jpg +[9]: https://fedoramagazine.org/wp-content/uploads/2021/06/Remmina04.jpg +[10]: https://www.freerdp.com/ From be0917f564bedbfce4eb5215743870ef95c1264d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Jul 2021 05:03:43 +0800 Subject: [PATCH 259/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210630=20?= =?UTF-8?q?9=20reasons=20I=20love=20to=20use=20the=20Qt=20Creator=20IDE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md --- ...easons I love to use the Qt Creator IDE.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md diff --git a/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md b/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md new file mode 100644 index 0000000000..44a5b4ad73 --- /dev/null +++ b/sources/tech/20210630 9 reasons I love to use the Qt Creator IDE.md @@ -0,0 +1,209 @@ +[#]: subject: (9 reasons I love to use the Qt Creator IDE) +[#]: via: (https://opensource.com/article/21/6/qtcreator) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +9 reasons I love to use the Qt Creator IDE +====== +Qt Creator is the glue between Qt's rich set of libraries and the +programmer. +![Business woman on laptop sitting in front of window][1] + +Qt Creator is the Qt framework's default integrated development environment (IDE) and hence the glue between Qt's rich set of libraries and the user. In addition to its basic features such as intelligent code completion, debugging, and project administration, Qt Creator offers a lot of nice features that make software development easier. + +In this article, I will highlight some of my favorite [Qt Creator][2] features. + +### Dark mode + +My first question when working with a new application is: _Is there a dark mode?_ Qt Creator answers with: _Which dark mode do you prefer?_ + +You can activate dark mode in the Options menu. On the top menu bar, go to **Tools**, select **Options**, and go to the **Environment** section. Here is where you can select the general appearance: + +![ QT Creator dark mode][3] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +### Custom appearance + +Like every Qt application, Qt Creator's appearance is highly customizable with style sheets. Below, you can follow along with my approach to give Qt Creator a fancy look. + +Create the file `mycustomstylesheet.css` with the following content: + + +``` +QMenuBar { background-color: olive } +QMenuBar::item { background-color: olive } +QMenu { background-color : beige; color : black } +QLabel { color: green } +``` + +Then start Qt Creator from the command line and pass the style sheet as a parameter with: + + +``` +`qtcreator -stylesheet=mycustomstylesheet.css` +``` + +It should look like this: + +![QT Creator custom stylesheet][5] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +Read more about style sheets in the [documentation][6]. + +### Command-line parameters + +Qt Creator accepts many command-line options. For example, if you want to automatically load your current project at startup, pass the path to the `*.pro-file`: + + +``` +`qtcreator ~/MyProject/MyQtProject.pro` +``` + +You can even pass the file and the line number that should be opened by default. This command opens the file `main.cpp` at line 20: + + +``` +`qtcreator ~/MyProject/main.cpp:20` +``` + +Read more about the Qt Creator-specific command-line options in the [documentation][7]. + +Qt Creator is an ordinary Qt application, so, in addition to its own command-line arguments, it also accepts the generic arguments for [QApplication][8] and [QGuiApplication][9]. + +### Cross-compiling + +Qt Creator allows you to define several toolchains, called **Kits**. A kit defines the binaries and SDK for building and running an application: + +![QT Creator kits][10] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +This allows you to switch between completely different toolchains with just two clicks: + +![Switching between Kits in Qt Creator][11] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +Read more about kits in the [manual][12]. + +### Analyzer + +Qt Creator integrates several of the most popular analyzers, such as: + + * [Linux Performance Analyzer][13] (requires a special kernel)  + * [Valgrind][14] memory profiler + * [Clang-Tidy and Clazy][15], a linter for C/C++ + + + +![Qt Creator analyzer][16] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +### Debugger + +When it comes to debugging, Qt Creator has a nice interface for GNU Debugger (GDB). I like its easy way of inspecting container types and creating conditional breakpoints: + +![Qt Creator debugger][17] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +### FakeVim + +If you like Vim, enable FakeVim in the settings to control Qt Creator like Vim. Go to **Tools** and select **Options**. In the **FakeVim** section, you can find many switches to customize FakeVim's behavior. In addition to the editor functions, you can also map your own functions to custom Vim commands. + +For example, you can map the function **Build Project** to the `build` command: + +![FakeVim in Qt Creator][18] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +Back in the editor, when you press the colon button and enter `build`, Qt Creator starts a build process with the configured toolchain: + +![FakeVim in Qt Creator][19] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +You can find more information about FakeVim [in the docs][20]. + +### Class inspector + +When developing in C++, open the right window by clicking on the button in the bottom-right corner of Qt Creator. Then choose **Outline** from the dropdown menu on the top border. If you have a header file open on the left pane, you get a nice overview of the defined classes or types. If you switch to a source file (`*.cpp`), the right pane will list all defined methods, and you can jump to one by double-clicking on it: + +![List of classes in Qt Creator][21] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +### Project configuration + +Qt Creator projects are built around the `*.pro-file` in the project's directory. You can add your own custom configuration to the project's `*.pro-file` of your project. I added `my_special_config` to the `*.pro-file`, which adds `MY_SPECIAL_CONFIG` to the compiler defined: + + +``` +QT -= gui + +CONFIG += c++11 console +CONFIG -= app_bundle + +CONFIG += my_special_config + +my_special_config { +DEFINES += MY_SPECIAL_CONFIG +} +``` + +Qt Creator automatically highlights the code according to the active configuration: + +![Special configuration in Qt Creator][22] + +(Stephan Avenwedde, [CC BY-SA 4.0][4]) + +The `*.pro-file` is written in the [qmake language][23]. + +### Summary + +These features are only the tip of the iceberg of what Qt Creator provides. Beginners shouldn't feel overwhelmed by the many features, as Qt Creator is absolutely beginner-friendly. It may even be the easiest way to start developing in C++. To get a complete overview of its features, refer to the [official Qt Creator documentation][24]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/qtcreator + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://www.qt.io/product/development-tools +[3]: https://opensource.com/sites/default/files/uploads/qt_creator_dark_mode.png ( QT Creator dark mode) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/qt_creator_custom_stylesheet2.png (QT Creator custom stylesheet) +[6]: https://doc.qt.io/qt-5/stylesheet-reference.html +[7]: https://doc.qt.io/qtcreator/creator-cli.html +[8]: https://doc.qt.io/qt-5/qapplication.html#QApplication +[9]: https://doc.qt.io/qt-5/qguiapplication.html#supported-command-line-options +[10]: https://opensource.com/sites/default/files/uploads/qt_creator_cross_compiling.png (QT Creator kits) +[11]: https://opensource.com/sites/default/files/uploads/qt_creator_select_kits.png (Switching between Kits in Qt Creator) +[12]: https://doc.qt.io/qtcreator/creator-targets.html +[13]: https://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html +[14]: https://doc.qt.io/qtcreator/creator-valgrind-overview.html +[15]: https://doc.qt.io/qtcreator/creator-clang-tools.html +[16]: https://opensource.com/sites/default/files/uploads/qt_creator_analyzer.png (Qt Creator analyzer) +[17]: https://opensource.com/sites/default/files/uploads/qt_creator_debugger2.png (Qt Creator debugger) +[18]: https://opensource.com/sites/default/files/uploads/qt_creator_fakevim_ex_commands.png (FakeVim in Qt Creator) +[19]: https://opensource.com/sites/default/files/uploads/qt_creator_fakevim_build_commands.png (FakeVim in Qt Creator) +[20]: https://doc.qt.io/qtcreator/creator-editor-fakevim.html +[21]: https://opensource.com/sites/default/files/uploads/qtcreator_class_overview.png (List of classes in Qt Creator) +[22]: https://opensource.com/sites/default/files/uploads/qtcreater_special_config.png (Special configuration in Qt Creator) +[23]: https://doc.qt.io/qt-5/qmake-language.html +[24]: https://doc.qt.io/qtcreator/ From 02f92c0dbfb131b95c800359264ada689d952643 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Jul 2021 05:04:04 +0800 Subject: [PATCH 260/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210630=20?= =?UTF-8?q?Parse=20JSON=20configuration=20files=20with=20Groovy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210630 Parse JSON configuration files with Groovy.md --- ...se JSON configuration files with Groovy.md | 312 ++++++++++++++++++ 1 file changed, 312 insertions(+) create mode 100644 sources/tech/20210630 Parse JSON configuration files with Groovy.md diff --git a/sources/tech/20210630 Parse JSON configuration files with Groovy.md b/sources/tech/20210630 Parse JSON configuration files with Groovy.md new file mode 100644 index 0000000000..d3fccc1976 --- /dev/null +++ b/sources/tech/20210630 Parse JSON configuration files with Groovy.md @@ -0,0 +1,312 @@ +[#]: subject: (Parse JSON configuration files with Groovy) +[#]: via: (https://opensource.com/article/21/6/groovy-parse-json) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Parse JSON configuration files with Groovy +====== +Sidestep the debate on whether or not to use JSON as a configuration +format and just learn how to parse it using Groovy. +![Looking back with binoculars][1] + +Applications typically include some type of default or "out-of-the-box" state or configuration, as well as some way for users to customize that configuration for their needs. + +For example, [LibreOffice Writer][2] gives access to stuff like user data, fonts, language settings, and (much) more through **Tools > Options** on its menu bar. Some applications (like LibreOffice) provide a point-and-click user interface to manage these settings. Some, like [Tracker][3] (the GNOME task that indexes files), use XML files. And some, especially JavaScript-based applications, use JSON, despite the protestations of many (for example, [this writer][4] and [this other writer][5]). + +In this article, I'll sidestep the debate about whether or not to use JSON as a configuration file format and explain how to parse this kind of information using the [Groovy programming language][6]. Groovy is based on Java but with a different set of design priorities that make Groovy feel more like Python. + +### Install Groovy + +Since Groovy is based on Java, it also requires a Java installation. You might find recent and decent versions of Java and Groovy in your Linux distribution's repositories. Or you can install Groovy following the [instructions][7] on its website. A nice alternative for Linux users is [SDKMan][8], which you can use to get multiple versions of Java, Groovy, and many other related tools. For this article, I'll use my distro's OpenJDK11 release and SDKMan's Groovy 3.0.7 release. + +### The demo JSON configuration file + +For this demonstration, I snagged this JSON from [Drupal][9]—it's the main configuration file used by the Drupal CMS—and saved it in the file `config.json`: + + +``` +{ +  "vm": { +    "ip": "192.168.44.44", +    "memory": "1024", +    "synced_folders": [ +      { +        "host_path": "data/", +        "guest_path": "/var/www", +        "type": "default" +      } +    ], +    "forwarded_ports": [] +  }, +  "vdd": { +    "sites": { +      "drupal8": { +        "account_name": "root", +        "account_pass": "root", +        "account_mail": "[box@example.com][10]", +        "site_name": "Drupal 8", +        "site_mail": "[box@example.com][10]", +        "vhost": { +          "document_root": "drupal8", +          "url": "drupal8.dev", +          "alias": ["www.drupal8.dev"] +        } +      }, +      "drupal7": { +        "account_name": "root", +        "account_pass": "root", +        "account_mail": "[box@example.com][10]", +        "site_name": "Drupal 7", +        "site_mail": "[box@example.com][10]", +        "vhost": { +          "document_root": "drupal7", +          "url": "drupal7.dev", +          "alias": ["www.drupal7.dev"] +        } +      } +    } +  } +} +``` + +This is a nice, complex JSON file with several levels of structure, like: + + +``` +`<>.vdd.sites.drupal8.account_name` +``` + +and some lists like: + + +``` +`<>.vm.synced_folders` +``` + +Here, `<>` represents the unnamed top level. Let's see how Groovy handles that. + +### Parsing JSON with Groovy + +Groovy comes with the `groovy.json` package, which is full of all sorts of cool stuff. One of the best parts is the `JsonSlurper` class, which includes several `parse()` methods that convert JSON to a Groovy `Map`—a data structure with values stored against keys. + +Here's a nice, short Groovy program named `config1.groovy` that creates a `JsonSlurper` instance, then calls one of its `parse()` methods to parse the JSON in a file and convert it to a `Map` instance called `config`, and finally writes out that map: + + +``` +import groovy.json.JsonSlurper + +def jsonSlurper = new JsonSlurper() + +def config = jsonSlurper.parse(new File('config.json')) + +println "config = $config" +``` + +Run this program on the command line in a terminal: + + +``` +$ groovy config1.groovy +config = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +$ +``` + +The output shows a top-level map with two keys: `vm` and `vdd`. Each key references its own map of values. Notice the empty list referenced by the `forwarded_ports` key. + +Huh. That was easy, but all it did was print things out. How do you get at the various components? Here's another program that shows how to access the value stored at `config.vm.ip`: + + +``` +import groovy.json.JsonSlurper + +def jsonSlurper = new JsonSlurper() + +def config = jsonSlurper.parse(new File('config.json')) + +println "config.vm.ip = ${config.vm.ip}" +``` + +Run it: + + +``` +$ groovy config2.groovy +config.vm.ip = 192.168.44.44 +$ +``` + +Yup, that's easy, too. This takes advantage of Groovy shorthand that means: + + +``` +`config.vm.ip` +``` + +in Groovy is equivalent to: + + +``` +`config['vm']['ip']` +``` + +when `config` and `config.vm` are both instances of `Map`, and both are equivalent to: + + +``` +`config.get("vm").get("ip")` +``` + +in Java. + +So much for just handling the JSON. What if you want to have a standard configuration and let the user override it? In that case, you might want to have a JSON configuration hard-coded in the program, then read the user configuration and override any of the standard configuration settings. + +Say the above configuration is standard, and the user wants to override only a bit of it, just the `ip` and `memory` values in the `vm` structure, and put that in the `userConfig.json` file: + + +``` +{ +  "vm": { +    "ip": "201.201.201.201", +    "memory": "4096", +  } +} +``` + +You could do that using this program: + + +``` +import groovy.json.JsonSlurper + +def jsonSlurper = new JsonSlurper() + +// use parseText() to parse a string rather than reading from a file +// this gives us the “standard configuration” + +def standardConfig = jsonSlurper.parseText(""" +{ +  "vm": { +    "ip": "192.168.44.44", +    "memory": "1024", +    "synced_folders": [ +      { +        "host_path": "data/", +        "guest_path": "/var/www", +        "type": "default" +      } +    ], +    "forwarded_ports": [] +  }, +  "vdd": { +    "sites": { +      "drupal8": { +        "account_name": "root", +        "account_pass": "root", +        "account_mail": "[box@example.com][10]", +        "site_name": "Drupal 8", +        "site_mail": "[box@example.com][10]", +        "vhost": { +          "document_root": "drupal8", +          "url": "drupal8.dev", +          "alias": ["www.drupal8.dev"] +        } +      }, +      "drupal7": { +        "account_name": "root", +        "account_pass": "root", +        "account_mail": "[box@example.com][10]", +        "site_name": "Drupal 7", +        "site_mail": "[box@example.com][10]", +        "vhost": { +          "document_root": "drupal7", +          "url": "drupal7.dev", +          "alias": ["www.drupal7.dev"] +        } +      } +    } +  } +} +""") + +// print out the standard configuration + +println "standardConfig = $standardConfig" + +// read in and parse the user configuration information + +def userConfig = jsonSlurper.parse(new File('userConfig.json')) + +// print out the user configuration information + +println "userConfig = $userConfig" + +// a function to merge the user configuration with the standard + +def mergeMaps(Map input, Map merge) { +    merge.each { k, v -> +        if (v instanceof Map) +            mergeMaps(input[k], v) +        else +            input[k] = v +    } +} + +// merge the configurations and print out the modified +// standard configuration + +mergeMaps(standardConfig, userConfig) + +println "modified standardConfig $standardConfig" +``` + +Run this as: + + +``` +$ groovy config3.groovy +standardConfig = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +userConfig = [vm:[ip:201.201.201.201, memory:4096]] +modified standardConfig [vm:[ip:201.201.201.201, memory:4096, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +$ +``` + +The line beginning `modified standardConfig` shows that the `vm.ip` and `vm.memory` values were overridden. + +Sharp-eyed readers will notice that I did not check for malformed JSON , nor was I careful to ensure that the user configuration makes sense (doesn't create new fields, provides reasonable values, and so on). So the cute little recursive method to merge the two maps probably isn't all that practical in the real world. + +Well I had to leave _something_ for homework, didn't I? + +### Groovy resources + +The Apache Groovy site has a lot of great [documentation][11]. Another great Groovy resource is [Mr. Haki][12]. And a really great reason to learn Groovy is to go on and learn [Grails][13], which is a wonderfully productive full-stack web framework built on top of excellent components like Hibernate, Spring Boot, and Micronaut. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/groovy-parse-json + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/look-binoculars-sight-see-review.png?itok=NOw2cm39 (Looking back with binoculars) +[2]: https://www.libreoffice.org/discover/writer/ +[3]: https://gitlab.gnome.org/GNOME/tracker +[4]: https://www.lucidchart.com/techblog/2018/07/16/why-json-isnt-a-good-configuration-language/ +[5]: https://medium.com/trabe/stop-using-json-config-files-ab9bc55d82fa +[6]: https://groovy-lang.org/ +[7]: https://groovy.apache.org/download.html +[8]: https://sdkman.io/ +[9]: https://www.drupal.org/node/2008800 +[10]: mailto:box@example.com +[11]: http://groovy-lang.org/documentation.html +[12]: https://blog.mrhaki.com/ +[13]: https://grails.org/ From 3ebf9ebf6d6375615a315550ac442a60f8203a8b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Jul 2021 05:04:22 +0800 Subject: [PATCH 261/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210630=20?= =?UTF-8?q?How=20a=20college=20student=20founded=20a=20free=20and=20open?= =?UTF-8?q?=20source=20operating=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210630 How a college student founded a free and open source operating system.md --- ...a free and open source operating system.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 sources/tech/20210630 How a college student founded a free and open source operating system.md diff --git a/sources/tech/20210630 How a college student founded a free and open source operating system.md b/sources/tech/20210630 How a college student founded a free and open source operating system.md new file mode 100644 index 0000000000..67d33c7b4a --- /dev/null +++ b/sources/tech/20210630 How a college student founded a free and open source operating system.md @@ -0,0 +1,150 @@ +[#]: subject: (How a college student founded a free and open source operating system) +[#]: via: (https://opensource.com/article/21/6/freedos-founder) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How a college student founded a free and open source operating system +====== +An interview with FreeDOS founder Jim Hall. +![Puzzle pieces coming together to form a computer screen][1] + +[Jim Hall][2] is best known as the computer programmer who founded the FreeDOS project. Jim began the project in 1994 as a replacement for MS-DOS while he was still a student at the University of Wisconsin–River Falls. Jim created FreeDOS in response to Microsoft ending support for MS-DOS in 1994. Recently Jim agreed to an email interview. Correspondent Joshua Allen Holm joined me in posing the following questions to Jim. + +**Don Watkins: What kind of skill set invites you to write your own operating system?** + +I think even a beginner can get started writing an operating system like FreeDOS, although it would take a more advanced programmer to write the kernel. + +[I am a self-taught programmer][3]. I learned about programming from an early age by tinkering on our Apple II computer at home. Much later, I learned C programming—my brother was a computer science student when I was a physics student, and he introduced me to C. I picked up the rest by reading books and writing my own programs. + +I wrote a lot of small utilities that enhanced my command line on MS-DOS or even replaced certain DOS commands. And you can write a lot of those programs even with a basic level of programming experience. You can write file utilities like FIND, FC, CHOICE, TYPE, MORE, or COPY—or user commands like ECHO or CLS—with only an introduction to C programming. With a bit of practice, you can write system-level programs like ATTRIB, or the COMMAND shell. + +**DW: Were you inspired by Linus Torvalds when you decided to write your own version of DOS and how did that contribute to your licensing decision?** + +In a way, yes. I really liked DOS and had been using it since the early 1980s. I ran MS-DOS on my personal computer at university. But in 1993, I discovered Linux. + +I really liked the Unix systems in our campus computer lab, where I spent much of my time as an undergraduate university student. When I heard about Linux, a free version of Unix that I could run on my ’386 computer at home, I immediately wanted to try it out. [My first Linux distribution][4] was Softlanding Linux System (SLS) 1.03, with Linux kernel 0.99 alpha patch level 11. That required a whopping 2MB of RAM, or 4MB if you wanted to compile programs, and 8MB to run X windows. + +I dual-booted Linux with MS-DOS. I booted into Linux most of the time, but I still booted back into MS-DOS to write papers in a word processor, to use a spreadsheet program to analyze data for my lab classes or to play my favorite DOS games. + +In 1994, I heard that Microsoft planned to “do away” with MS-DOS. The next version of Windows would eliminate DOS. I didn’t like that, and I still wanted to run DOS. I decided that if folks could come together over the Internet to write something like Linux, surely, we could do the same with DOS. After all, DOS was fairly simple compared to Linux. + +On June 29, 1994, [I announced the “PD-DOS” project][5] to write our own DOS. I called it “PD” because I thought it would be in the public domain. But I quickly learned about the GNU General Public License that the Linux kernel used, and decided that was a much better license. No one could take our source code and create a proprietary version of DOS. We changed the name to “Free-DOS” after another week or so. We later dropped the hyphen to become “FreeDOS.” + +**Joshua Allen Holm: What are the advantages of using FreeDOS over alternative ways of running DOS applications (e.g., DOSBox)?** + +Using DOSBox to run DOS applications in Linux is a great way to run certain DOS applications. But DOSBox is really intended to launch a single DOS program, like a game. The DOS command line is pretty limited in DOSBox. + +In contrast, FreeDOS provides a full DOS command line. We include all of the commands you remember from classic DOS, and added other commands and utilities to do new things. FreeDOS also includes compilers and assemblers so developers can write new programs, utilities, and tools to make your DOS experience more useful, Internet programs to help you get on a network, and even open source games. + +**JAH: Looking back over the years you have worked on FreeDOS, is there anything you would have done differently?** + +There’s only one event that I wish I could take back. I occasionally reach out to companies that sold DOS applications in the 1980s and 1990s and ask them if they will release the source code to their old DOS programs under an open source software license. That’s a great way to contribute to the open source community. + +One popular DOS program was a replacement for the MS-DOS COMMAND shell. 4DOS, by JP Software, was an extremely powerful DOS shell and included many modern features. For example, 4DOS supported built-in aliases, color-coded directory listings, and a “swapping” mechanism that freed up more conventional memory to run programs. + +I contacted JP Software to ask if they would release the source code to 4DOS under an open source software license. JP Software had stopped supporting DOS, and instead focused on a similar replacement for the CMD shell in Windows NT, called 4NT. They were interested in releasing the source code to 4DOS but were concerned that someone might take the 4DOS source code and release a version for Windows. In effect, that would put JP Software in competition with their older product. + +I still didn’t understand the fine points of open source software licenses, and I gave them bad advice. I suggested they might start with an existing open source license and add a term that said you could only run it on DOS. They then released the 4DOS source code under a modified version of the MIT license. + +Unfortunately, limiting where you can run the software violates one of the tenets of open source software and free software. Users should be able to run open source software anywhere, and for any use. An open source license isn’t “open source” if you are limited to running it only on one operating system. + +So despite best intentions, I gave JP Software really bad advice there, and 4DOS isn’t actually open source software. We used to include 4DOS in FreeDOS—but as we are preparing the FreeDOS 1.3 release, we want to be careful to only include open source software. So FreeDOS 1.3 RC4 (“release candidate 4”) does not include 4DOS.  + +**JAH: What are some interesting ways people are using FreeDOS?** + +Over the years, I’ve seen people use FreeDOS to do a lot of really interesting things! + +One of the earliest cool examples was someone who built pinball machines like you used to see in arcades. He embedded a version of FreeDOS to track the score and update the video screen on the back of the machine. I don’t know exactly how he did this, but my guess is every target or bumper on the pinball board probably generated a keyboard event. You can write a DOS application to read the “keyboard” and update the score based on that. + +A few years ago, a user found a video of a train control system in Russia [that ran on a FreeDOS PC][6]. They rebooted the computer, and if you freeze the video at the right point, you can briefly see the FreeDOS kernel starting up. It disappears quickly, but you can see it at 0:07 in the video. + +More recently, I saw someone had managed to boot an original IBM PC 5150 with FreeDOS [from a vinyl record][7], using the 5150’s rarely used cassette tape storage port. It’s really cool to see FreeDOS being used this way. It’s a method that I would never have thought to try, but sometimes you have to do something just for the fun of it. + +**JAH: Why work on DOS in 2021?** + +We still work on DOS in 2021 for a few reasons. I guess the first reason is that DOS is still interesting. We’ve added a lot to FreeDOS over the years. Where the original MS-DOS had a limited set of commands, FreeDOS includes dozens of useful utilities and tools, including editors, compilers, assemblers, games, and other neat programs. + +But it has to be more than just a cool hobby. I find that working on FreeDOS makes for a very interesting programming challenge. In modern systems like Linux, you can take advantage of a lot of memory at once, and you can address it all in one big block. As a result, many programmers will load a lot of libraries and other code to create their projects. This is a very easy way to build a complicated project. You can build a very complex system in a very short time this way. And for many systems, time to market is the most important factor. + +Loading a bunch of libraries and other code blocks is very inefficient, however. You may have the same basic functionality implemented half a dozen ways across the different libraries because each library implements something their own way. So your code grows and requires more memory. + +Maybe that’s not a problem on a desktop PC. I run Linux, and my modern desktop PC has 32GB of memory. Loading a bunch of stuff into memory isn’t a big deal. But on a shared server, where you might have multiple instances of that project running, you’ll quickly run into memory limitations. How many instances can you run at the same time on a server? That 32GB of memory starts to look pretty slim. + +You can’t load all of that into memory on a DOS machine. To remain compatible with the original DOS, FreeDOS has all the limitations of DOS. When MS-DOS was popular, a powerful PC might have had 4MB, 8MB, or even 16MB of extended memory. But the computer only had 640kb of “main” memory, due to how DOS addressed memory. And that’s megabytes and kilobytes, not gigabytes. A kilobyte is a thousand bytes (the basic unit of memory). A megabyte is a thousand kilobytes. And a gigabyte is a thousand megabytes. So today’s computers have memory that is about 1,000,000 more than a DOS computer. + +By programming on a limited system like FreeDOS, you constantly have to think about the tradeoffs. How much memory does my program really need to do its job? Is it faster to read a file into memory to work on it, or process the file one bit at a time? And you’re always keeping in mind what libraries and other code you use in your program. A DOS program can only be so big, so you need to be careful about how you write a DOS program. + +When you write DOS programs all the time, you get really good at optimizing a program. You think about programming in a different way, because you’re always considering how to do something more efficiently. That’s a challenge, but an interesting one. + +**DW: How big is the FreeDOS community?** + +FreeDOS was a very popular project throughout the 1990s and into the early 2000s, but the community isn’t as big these days. But it’s great that we are still an engaged and active group. If you look at the news items on our website, you’ll see we post updates on a fairly regular basis. + +It’s hard to estimate the size of the community. I’d say we have a few dozen members who are very active. And we have a few dozen others who reappear occasionally to post new versions of their programs. I think to maintain an active community that’s still working on an open source DOS from 1994 is a great sign. + +Some members have been with us from the very beginning, and I’m really thankful to count them as friends. We do [video hangouts on a semi-regular basis][8]. It’s great to finally “meet” the folks I’ve only exchanged emails with over the years. + +It's meetings like this when I remember open source is more than just writing code; it's about a community. And while I've always done well with our virtual community that communicates via email, I really appreciated getting to talk to people without the asynchronous delay or artificial filter of email—making that real-time connection means a lot to me. + +**DW: How does someone get involved in the community?** + +I think our community is very welcoming, so anyone is free to join. We communicate via an email list, which you can find on the [FreeDOS website][9]. Join the freedos-user email list if you want to talk about FreeDOS or ask for help. Developers should join the freedos-devel email list; that’s where most of the FreeDOS developers hang out. Our email list volume is pretty low, so you aren’t likely to fill up your inbox by subscribing to either email list. + +A great way to get started is by writing or updating documentation, or by fixing bugs. I think that’s true of pretty much every open source project out there. We always need folks to work on the documentation and fix bugs. But for a project like FreeDOS, I think reading through the documentation is important if you’re new to DOS. A common mistake for newcomers is thinking of FreeDOS as a stripped-down version of Linux, when in fact DOS uses a different memory and execution model. You can learn about that by reading the documentation, which is why I recommend new contributors start there. + +For the more adventurous, we maintain a list of priority projects on our website. If you’d like to contribute to FreeDOS, but aren’t sure what needs work, you might consider tackling one or more of these projects: + + * If you’ve got some programming experience: + * Port FreeDOS utilities to OpenWatcom C and NASM—our preferred C compiler and Assembler for FreeDOS. (Some older FreeDOS programs were probably written for Borland C or Turbo C or Microsoft C, or Microsoft ASM or Turbo ASM) + + * Port GNU utilities to FreeDOS, such as using IA-16 GCC (while IA-16 GCC requires a ’386 or better to compile, programs compiled with IA-16 GCC run on all CPUs) + + * Create a new alternative shell, similar to COMMAND.COM but with expanded BAT programming + + * Add international language support to a FreeDOS program that currently only supports one language. + + * If you’re a highly-skilled DOS developer: + * Write a guest tool like VMSMOUNT for VirtualBox + + * Write a driver for modern sound cards + + * Add some kind of UEFI bootstrap BIOS emulator, perhaps implemented as a CSM + + + + +We like to make it easy for new contributors to get started in FreeDOS, and we welcome everyone who wants to work on FreeDOS. If you still don’t know how to contribute, feel free to ask on the email list. + +You can find FreeDOS at [www.freedos.org][10] +Join FreeDOS on Facebook at [facebook.com/groups/freedos/][11]  +Follow FreeDOS on Twitter at [twitter.com/freedos_project][12] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/freedos-founder + +作者:[Joshua Allen Holm][a] +选题:[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/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://opensource.com/users/jim-hall +[3]: https://opensource.com/article/20/8/learn-open-source +[4]: https://opensource.com/article/17/8/linux-anniversary +[5]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ?pli=1 +[6]: https://www.youtube.com/watch?v=eAate0v8hDE +[7]: https://www.youtube.com/watch?v=bqz65_YfcJg +[8]: https://opensource.com/article/20/8/meet-open-source-collaborators +[9]: https://www.freedos.org/ +[10]: http://www.freedos.org/ +[11]: https://www.facebook.com/groups/freedos/ +[12]: http://twitter.com/freedos_project From cc18b17e5c4c3e248f7b6f9c9b77c1baa19fad4f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 1 Jul 2021 05:05:25 +0800 Subject: [PATCH 262/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210630=20?= =?UTF-8?q?Children=E2=80=99s=20Drawing=20App=20Tux=20Paint=20Now=20Has=20?= =?UTF-8?q?Gradient=20Fill=20and=20Pixel=20Art=20Options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md --- ...Has Gradient Fill and Pixel Art Options.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md diff --git a/sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md b/sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md new file mode 100644 index 0000000000..0a4e076a1b --- /dev/null +++ b/sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md @@ -0,0 +1,86 @@ +[#]: subject: (Children’s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options) +[#]: via: (https://news.itsfoss.com/tux-paint-0-9-26/) +[#]: author: (Abhishek https://news.itsfoss.com/author/root/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Children’s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options +====== + +Tux Paint is an [open source drawing application][1] and an alternative to Microsoft Paint on Linux. It is a cross-platform application and you can also use it on Windows and macOS. + +[Tux Paint][2] primarily intends to be used by children between the age of 3 and 12. It is actually used in schools worldwide. It features easy to use interface, sound effect and a Tux mascot that works as guide in an entertaining way. + +Of course, this doesn’t mean that you cannot use Tux Paint if you are 13 or older. + +The developers of Tux Paint have just released the version 0.9.26. Let’s see what new features you get in the latest release. + +### What’s new in Tux Paint 0.9.26? + +Here are the main new features in improvement added in the version 0.9.26. + +#### Fill tool now has gradient option + +![][3] + +Gradient colors have gained quite some popularity lately. Keeping that in mind, Tux Paint’s Fill tool now can fill the selected area with gradient colors. + +There are two kinds of gradients filling available. The “Radial” fill creates a circular gradient centered around the mouse click, while the “Linear” fill allows the interactive creation of gradients at different angles and sizes. + +#### Magic tools now has pixel and checkerboard options + +The Magic tool now has “pixel” options that makes it easier to create retro-gaming style pixel art. It doesn’t give the capability of full-fledged pixel tool like [Pixelorama][4] but at pixelating is available as an option. + +There is also a Checkerboard option that fills the entire canvas with a check pattern and the “Clone” option allows duplicating parts of the picture via brush strokes. + +#### Accessibility improvements + +![][5] + +The new version has two accessibility options added. The entire user interface of Tux Paint can now be enlarged. This is going to benefit users with impaired vision. This will also make the program more suitable to very HiDPI displays. + +Another option is to re-organize the color palette. It can also be helpful to users of coarse input devices, such as eye-gaze tracking systems. + +#### What else? + +Tux Paint’s user documentation has been overhauled and this makes localization easier. So if you are interested, please contact the Tux Paint team and help with localization efforts. + +#### Getting Tux Paint 0.9.26 + +On Linux, you can get the latest Tux Paint in [Flatpak package format][6]. If you have Flatpak support enabled, you can use the following command to install it: + +``` +flatpak install flathub org.tuxpaint.Tuxpaint +``` + +For Windows and macOS, you can [download it from its website][7]. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/tux-paint-0-9-26/ + +作者:[Abhishek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/open-source-paint-apps/ +[2]: http://www.tuxpaint.org/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://itsfoss.com/pixelorama/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYyNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://flathub.org/apps/details/org.tuxpaint.Tuxpaint +[7]: http://www.tuxpaint.org/download/ From 29e32415aeb23ea56845d07c8517b19c55ea8e06 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 1 Jul 2021 08:48:08 +0800 Subject: [PATCH 263/870] translated --- ...d on WSL- Here-s How to Reset it Easily.md | 139 ------------------ ...d on WSL- Here-s How to Reset it Easily.md | 139 ++++++++++++++++++ 2 files changed, 139 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md create mode 100644 translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md diff --git a/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md b/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md deleted file mode 100644 index bf434603ee..0000000000 --- a/sources/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: subject: (Forgot Linux Password on WSL? Here’s How to Reset it Easily) -[#]: via: (https://itsfoss.com/reset-linux-password-wsl/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Forgot Linux Password on WSL? Here’s How to Reset it Easily -====== - -WSL (Windows Subsystem for Linux) is a handy tool for people who want to enjoy the power of Linux command line from the comfort of Windows. - -When you [install Linux using WSL on Windows][1], you are asked to create a username and password. This user is automatically logged on when you start Linux on WSL. - -Now, the problem is that if you haven’t used it for some time, you may forget the account password of WSL. And this will become a problem if you have to use a command with sudo because here you’ll need to enter the password. - -![][2] - -Don’t worry. You can easily reset it. - -### Reset forgotten password for Ubuntu or any other Linux distribution on WSL - -To reset the Linux password in WSL, you have to: - - * Switch the default user to root - * Reset the password for the normal user - * Switch back the default user to the normal user - - - -Let me show you the steps in detail and with screenshots. - -#### Step 1: Switch to root as default user - -It will be wise to note down your account’s normal/regular username. As you can see, my regular account’s username is abhishek. - -![Note down the account username][3] - -The root user in WSL is unlocked and doesn’t have a password set. This means that you can switch to the root user and then use the power of root to reset the password. - -Since you don’t remember the account password, switching to the root user is done by changing the configuration of your Linux WSL application and make it use root user by default. - -This is done through Windows Command Prompt and you’ll need to know which command you need to run for your Linux distribution. - -This information is usually provided in the description of the distribution app in the [Windows Store][4]. This is from where you had downloaded your distribution in the first place. - -![Know the command to run for your distribution app][5] - -From the Windows menu, start the command prompt: - -![Start Command Prompt][6] - -In here, use your distribution’s command in this fashion. If you were using the Ubuntu app from Windows store, the command would be: - -``` -ubuntu config --default-user root -``` - -In the screenshot, I am using Ubuntu 20.04 app from the Windows store. So, I have used ubuntu2004 command. - -![Set root as default user in Linux app’s configuration][7] - -To save you the trouble, I am listing some distributions and their respective commands in this table: - -Distribution App | Windows Command ----|--- -Ubuntu | ubuntu config –default-user root -Ubuntu 20.04 | ubuntu2004 config –default-user root -Ubuntu 18.04 | ubuntu1804 config –default-user root -Debian | debian config –default-user root -Kali Linux | kali config –default-user root - -#### Step 2: Reset the password for the account - -Now, if you start the Linux distribution app, you should be logged in as root. You can reset the password for the normal user account. - -Do you remember the username in WSL? If not, you can always check the contents of the /home directory. When you have the username, use this command: - -``` -passwd username -``` - -It will ask you to enter a new password. **When you type here, nothing will be displayed on the screen. That’s normal. Just type the new password and hit enter.** You’ll have to retype the new password to confirm and once again, nothing will be displayed on the screen while you type the password. - -![Reset the password for the regular user][8] - -Congratulations. The password for the user account has been reset. But you are done just yet. The default user is still root. You should change it back to your regular account user, otherwise it will keep on logging in as root user. - -#### Step 3: Set regular user as default again - -You’ll need the regular account username that you used with the [passwd command][9] in the previous step. - -Start the Windows command prompt once again. **Use your distribution’s command** in the similar manner you did in the step 1. However, this time, replace root with the regular user. - -``` -ubuntu config --default-user username -``` - -![Set regular user as default user][10] - -Now when you start your Linux distribution app in WSL, you’ll be logged in as the regular user. You have reset the password fresh and can use it to run commands with sudo. - -If you forgot the password again in the future, you know the steps to reset it. - -### If resetting WSL password is this easy, is this not a security risk? - -Not really. You need to have physical access to the computer along with access to the Windows account. If someone already has this much access, she/he can do a lot more than just changing the Linux password in WSL. - -### Were you able to reset WSL password? - -I gave you the commands and explained the steps. I hope this was helpful to you and you were able to reset the password of your Linux distribution in WSL. - -If you are still facing issues or if you have a question on this topic, please feel free to ask in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/reset-linux-password-wsl/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-bash-on-windows/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/reset-wsl-password.png?resize=800%2C450&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/username-wsl.png?resize=800%2C296&ssl=1 -[4]: https://www.microsoft.com/en-us/store/apps/windows -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/wsl-distro-command.png?resize=800%2C602&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/start-cmd-windows.jpg?resize=800%2C500&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/wsl-set-root-as-default.png?resize=800%2C288&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/resetting-wsl-password.png?resize=800%2C366&ssl=1 -[9]: https://linuxhandbook.com/passwd-command/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/set-regular-user-as-default-wsl.png?resize=800%2C288&ssl=1 diff --git a/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md b/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md new file mode 100644 index 0000000000..b89dfb5aca --- /dev/null +++ b/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md @@ -0,0 +1,139 @@ +[#]: subject: (Forgot Linux Password on WSL? Here’s How to Reset it Easily) +[#]: via: (https://itsfoss.com/reset-linux-password-wsl/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 WSL 上忘记了 Linux 密码?下面是如何轻松重设的方法 +====== + +对于那些想从舒适的 Windows 中享受 Linux 命令行的人来说,WSL(Windows Subsystem for Linux) 是一个方便的工具。 + +当你[在 Windows 上使用 WSL 安装 Linux][1]时,会要求你创建一个用户名和密码。当你在 WSL 上启动 Linux 时,这个用户会自动登录。 + +现在的问题是,如果你有一段时间没有使用它,你可能会忘记 WSL 的账户密码。而如果你要使用 sudo 的命令,这将成为一个问题,因为这里你需要输入密码。 + +![][2] + +不要担心。你可以很容易地重置它。 + +### 在 Ubuntu 或任何其他 Linux 发行版上重置遗忘的 WSL 密码 + +要在 WSL 中重设 Linux 密码,你需要: + + * 将默认用户切换为 root + * 重置普通用户的密码 + * 将默认用户切换回正常用户 + + + +让我向你展示详细的步骤和截图。 + +#### 步骤 1:将默认用户切换为 root + +记下你的普通/常规用户名将是明智之举。如你所见,我的普通帐户的用户名是 abhishek。 + +![Note down the account username][3] + +WSL 中的 root 用户是解锁的,没有设置密码。这意味着你可以切换到 root 用户,然后利用 root 的能力来重置密码。 + +由于你不记得帐户密码,切换到根用户是通过改变你的 Linux WSL 应用的配置,使其默认使用 root 用户来完成。 + +这是通过 Windows 命令提示符完成的,你需要知道你的 Linux 发行版需要运行哪个命令。 + +这个信息通常在 [Windows Store][4] 中的发行版应用的描述中提供。这是你首次下载发行版的地方。 + +![Know the command to run for your distribution app][5] + +从 Windows 菜单中,启动命令提示符: + +![Start Command Prompt][6] + +在这里,以这种方式使用你的发行版的命令。如果你使用的是 Windows 商店中的 Ubuntu 应用,那么该命令将是: + +``` +ubuntu config --default-user root +``` + +截图中,我正在使用 Windows 商店中的 Ubuntu 20.04 应用。所以,我使用了 ubuntu2004 命令。 + +![Set root as default user in Linux app’s configuration][7] + +为了减少你的麻烦,我在这个表格中列出了一些发行版和它们各自的命令: + +发行版应用 | Windows 命令 +---|--- +Ubuntu | ubuntu config –default-user root +Ubuntu 20.04 | ubuntu2004 config –default-user root +Ubuntu 18.04 | ubuntu1804 config –default-user root +Debian | debian config –default-user root +Kali Linux | kali config –default-user root + +#### 步骤 2:重设帐户密码 + +现在,如果你启动 Linux 发行程序,你应该以 root 身份登录。你可以重新设置普通用户帐户的密码。 + +你还记得 WSL 中的用户名吗?如果没有,你可以随时检查 /home 目录的内容。当你有了用户名后,使用这个命令: + +``` +passwd username +``` + +它将要求你输入一个新的密码。**当你输入时,屏幕上将不会显示任何内容。这很正常。只要输入新的密码,然后点击回车就可以了。**你必须重新输入新的密码来确认,当你输入密码时,屏幕上也不会显示任何东西。 + +![Reset the password for the regular user][8] + +恭喜你。用户账户的密码已经被重置。但你还没有完成。默认用户仍然是 root。你应该把它改回你的普通用户帐户,否则它将一直以 root 用户的身份登录。 + +#### 步骤 3:再次将普通用户设置为默认用户 + +你需要你在上一步中用 [passwd 命令][9]使用的普通帐户用户名。 + +再次启动 Windows 命令提示符。**使用你的发行版命令**,方式与第 1 步中类似。然而,这一次,用普通用户代替 root。 + +``` +ubuntu config --default-user username +``` + +![Set regular user as default user][10] + +现在,当你在 WSL 中启动你的 Linux 发行版时,你将以普通用户的身份登录。你已经重新设置了密码,可以用它来运行 sudo 的命令。 + +如果你将来再次忘记了密码,你知道重置密码的步骤。 + +### 如果重设 WSL 密码如此简单,这难道不是一种安全风险吗? + +并非如此。你需要有对计算机的物理访问权以及对 Windows 帐户的访问权。如果有人已经有这么多的访问权,他/她可以做很多事情,而不仅仅是改变 WSL 中的 Linux 密码。 + +### 你是否能够重新设置 WSL 密码? + +我给了你命令并解释了步骤。我希望这对你有帮助,并能够在 WSL 中重置你的 Linux 发行版的密码。 + +如果你仍然遇到问题,或者你对这个话题有疑问,请随时在评论区提问。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/reset-linux-password-wsl/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-bash-on-windows/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/reset-wsl-password.png?resize=800%2C450&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/username-wsl.png?resize=800%2C296&ssl=1 +[4]: https://www.microsoft.com/en-us/store/apps/windows +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/wsl-distro-command.png?resize=800%2C602&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/start-cmd-windows.jpg?resize=800%2C500&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/wsl-set-root-as-default.png?resize=800%2C288&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/resetting-wsl-password.png?resize=800%2C366&ssl=1 +[9]: https://linuxhandbook.com/passwd-command/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/set-regular-user-as-default-wsl.png?resize=800%2C288&ssl=1 From 5f19421c7192adaf5d5a227b4f0690dbe46d05bd Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 1 Jul 2021 08:51:36 +0800 Subject: [PATCH 264/870] translating --- sources/tech/20210628 How to archive files on FreeDOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210628 How to archive files on FreeDOS.md b/sources/tech/20210628 How to archive files on FreeDOS.md index fcf999663f..93c4dfbdae 100644 --- a/sources/tech/20210628 How to archive files on FreeDOS.md +++ b/sources/tech/20210628 How to archive files on FreeDOS.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/archive-files-freedos) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 25338d8814555dc6e26605ec8cf7cad2726af0aa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 1 Jul 2021 09:54:06 +0800 Subject: [PATCH 265/870] Rename sources/tech/20210630 How a college student founded a free and open source operating system.md to sources/talk/20210630 How a college student founded a free and open source operating system.md --- ...ege student founded a free and open source operating system.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210630 How a college student founded a free and open source operating system.md (100%) diff --git a/sources/tech/20210630 How a college student founded a free and open source operating system.md b/sources/talk/20210630 How a college student founded a free and open source operating system.md similarity index 100% rename from sources/tech/20210630 How a college student founded a free and open source operating system.md rename to sources/talk/20210630 How a college student founded a free and open source operating system.md From e2e34d048ce609aabb8e774ae1c3c509112e4037 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 1 Jul 2021 10:16:55 +0800 Subject: [PATCH 266/870] PRF @stevenzdg988 --- ...en source tools to set up a private VPN.md | 110 +++++++----------- 1 file changed, 42 insertions(+), 68 deletions(-) diff --git a/translated/tech/20210517 Use open source tools to set up a private VPN.md b/translated/tech/20210517 Use open source tools to set up a private VPN.md index d238935ee9..ca5d8cd034 100644 --- a/translated/tech/20210517 Use open source tools to set up a private VPN.md +++ b/translated/tech/20210517 Use open source tools to set up a private VPN.md @@ -3,56 +3,54 @@ [#]: author: (Lukas Janėnas https://opensource.com/users/lukasjan) [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -使用开源工具创建私有 VPN +使用开源工具创建私有的虚拟专用网络 ====== -使用 OpenWRT 和 Wireguard 在路由器上创建自己的虚拟专用网络。 -![拼写为 “VPN”][1] -通过计算机网络从一个地方到另一个地方可能是一件棘手的事情。除了知道正确的地址和打开正确的端口之外,还有安全问题。 对于 Linux,SSH 是一种流行的默认设置,虽然您可以使用 SSH 做很多事情,但它仍然“只是”一个安全外壳(实际上,这就是 SSH 代表的)。用于加密流量的更广泛的协议是 VPN,它创建了一个独特的两点之间的虚拟专用网络。有了它,您可以登录到另一个网络上的计算机并使用它的所有服务(文件共享、打印机,等等),就像您坐在同一个房间里一样,并且全部的数据都是从点到点加密的。 +> 使用 OpenWRT 和 Wireguard 在路由器上创建自己的虚拟专用网络。 -通常,为了使 VPN 连接成为可能,进入每个网络的网关必须接受 VPN 流量,并且必须侦听目标网络上的某些计算机的 VPN 流量。但是,可以运行您自己的运行 VPN 服务器的路由器固件,使您能够连接到目标网络,而无需担心转发端口或完全考虑内部拓扑。我最喜欢的固件是 OpenWrt,在本文中我将演示如何设置它,以及如何启用 VPN。 +![](https://img.linux.net.cn/data/attachment/album/202107/01/101629ym69mwpmcmetdp99.jpg) + +通过计算机网络从一个地方到另一个地方可能是一件棘手的事情。除了知道正确的地址和打开正确的端口之外,还有安全问题。 对于 Linux,SSH 是一种流行的默认方式,虽然你可以使用 SSH 做很多事情,但它仍然“只是”一个安全外壳(实际上,这就是 SSH 的含义)。用于加密流量的更广泛的协议是“虚拟专用网络”,它创建了一个独特的两点之间的虚拟的专用网络。有了它,你可以登录到另一个网络上的计算机并使用它的所有服务(文件共享、打印机等等),就像你坐在同一个房间里一样,并且全部的数据都是从点到点加密的。 + +通常,为了使虚拟专用网络连接成为可能,进入每个网络的网关必须接受虚拟专用网络流量,并且必须侦听目标网络上的某些计算机的虚拟专用网络流量。然而,你可以运行自己的带有虚拟专用网络服务器的路由器固件,使你能够连接到目标网络,而无需担心转发端口或考虑内部拓扑。我最喜欢的固件是 OpenWrt,在本文中我将演示如何设置它,以及如何启用虚拟专用网络。 ### 什么是 OpenWrt? [OpenWrt][2] 是一个使用 Linux 面向嵌入式设备的开源项目。它已经存在超过 15 年,拥有庞大而活跃的社区。 -使用 OpenWrt 的方法有很多种,但它的主要用途是在路由器中。它提供了一个具有包管理功能的完全可写的文件系统,并且由于它是开源的,您可以查看和修改代码并为生态系统做出贡献。如果您想对路由器进行更多控制,这就是您想要使用的系统。 +使用 OpenWrt 的方法有很多种,但它的主要用途是在路由器中。它提供了一个具有包管理功能的完全可写的文件系统,并且由于它是开源的,你可以查看和修改代码并为生态系统做出贡献。如果你想对路由器进行更多控制,这就是你想要使用的系统。 -OpenWrt 支持很多路由器,包括 [Cisco][3],[ASUS][4],[MikroTik][5],[Teltonika Networks][6],[D-Link][7],[TP-link][8],[Buffalo][9],[Ubiquiti][10] 等知名品牌和 [许多其他品牌][11]。 +OpenWrt 支持很多路由器,包括 [思科][3]、[华硕][4]、[MikroTik][5]、[Teltonika Networks][6]、[D-Link][7]、[TP-link][8]、[Buffalo][9]、[Ubiquiti][10] 等知名品牌和 [许多其他品牌][11]。 ### Wireguard 是什么? -[Wireguard][12] 是开源虚拟专用网络 (VPN) 软件,它比 OpenVPN 等其他选项更快、更简单且更安全。它使用最先进的密码学:ChaCha20 用于对称密码学;用于密钥协商的曲线 25519(使用椭圆曲线);和用于散列的 BLAKE2 。这些算法的设计方式在嵌入式系统上是高效的。WIreguard 也可用于各种操作系统[平台][13]。 +[Wireguard][12] 是开源的虚拟专用网络软件,它比 OpenVPN 等其他选项更快、更简单且更安全。它使用最先进的密码学:用于对称加密的 ChaCha20;用于密钥协商的 Curve 25519(使用椭圆曲线),和用于散列的 BLAKE2。这些算法的设计方式在嵌入式系统上是高效的。Wireguard 也可用于各种操作系统 [平台][13]。 ### 先决条件 对于这个项目,你需要: * [Teltonika RUT955][14] 或支持 OpenWrt 的其他路由器 - * 用于从外部网络连接到 VPN 的公网 IP 地址 + * 一个公网 IP 地址,用于从外部网络连接到虚拟专用网络 * 一部安卓手机 ### 安装 OpenWrt -首先,下载路由器的 OpenWrt 镜像。使用[固件选择器][15]检查 OpenWrt 是否支持您的路由器并下载固件。输入您的路由器型号,将显示选项: +首先,下载路由器的 OpenWrt 镜像。使用 [固件选择器][15] 检查 OpenWrt 是否支持你的路由器并下载固件。输入你的路由器型号,将显示选项: ![OpenWRT 固件选择器][16] -(Lukas Janenas, [CC BY-SA 4.0][17]) - 使用搜索框右侧的下拉输入选择要下载的固件版本。 下载出厂镜像。 ![下载出厂镜像][18] -(Lukas Janenas, [CC BY-SA 4.0][17]) - -许多路由器允许您从 Web 界面刷入未经授权的固件,但 Teltonika Networks 不允许。要将 OpenWrt 固件刷入这样的路由器,您需要使用引导加载程序。为此,请按照下列步骤操作: +许多路由器允许你从 Web 界面刷入未经授权的固件,但 Teltonika Networks 不允许。要将 OpenWrt 固件刷入这样的路由器,你需要使用引导加载器。为此,请按照下列步骤操作: 1. 拔掉路由器的电源线。 2. 按住重置按钮。 @@ -60,98 +58,78 @@ OpenWrt 支持很多路由器,包括 [Cisco][3],[ASUS][4],[MikroTik][5], 4. 插入电源线后,继续按住重置按钮 5 到 8 秒。 5. 将计算机的 IP 地址设置为 `192.168.1.15`,将网络掩码设置为 `255.255.255.0`。 6. 使用以太网电缆通过 LAN 端口连接路由器和计算机。 - 7. 打开网页浏览器并输入`192.168.1.1:/index.html`。 + 7. 打开网页浏览器并输入 `192.168.1.1:/index.html`。 8. 上传并刷写固件。 -刷机过程可能占用三分钟。之后,您应该可以通过在浏览器中输入 `192.168.1.1` 来访问路由器的 Web 界面。 默认情况下没有设置密码 +刷机过程可能占用三分钟。之后,你应该可以通过在浏览器中输入 `192.168.1.1` 来访问路由器的 Web 界面。 默认情况下没有设置密码 ![OpenWrt 授权][19] -(Lukas Janenas, [CC BY-SA 4.0][17]) - ### 配置网络连接 -网络连接是必要条件。如果您的 Internet 服务提供商 (ISP) 使用 DHCP 自动分配您的 IP 地址,您只需将以太网电缆插入路由器的 WAN 端口。 +网络连接是必要条件。如果你的 Internet 服务提供商(ISP) 使用 DHCP 自动分配你的 IP 地址,你只需将以太网电缆插入路由器的 WAN 端口。 -如果您需要手动分配 IP 地址,导航至 **Network → Interfaces**。选择 **Edit** 编辑您的 WAN 接口。从 **Protocol** 字段中,选择 **Static address**,然后选择 **Switch protocol**。 +如果你需要手动分配 IP 地址,导航至 “Network → Interfaces”。选择 “Edit” 编辑你的 WAN 接口。从 “Protocol” 字段中,选择 “Static address”,然后选择 “Switch protocol”。 ![手动分配 IP 地址][20] -(Lukas Janenas, [CC BY-SA 4.0][17]) +在 “IPv4 address” 字段中,输入你的路由器地址。设置 “IPv4 netmask” 以匹配你的网络子网;输入你将用于连接到网络的 “IPv4 gateway” 地址; 并在 “Use custom DNS servers” 字段中输入 DNS 服务器的地址。保存配置。 -在 **IPv4 address** 字段中,输入您的路由器地址。设置 **IPv4 netmask** 以匹配您的网络子网;输入您将用于连接到网络的 **IPv4 gateway** 地址; 并在 **Use custom DNS servers** 字段中输入 DNS 服务器的地址。保存配置。 - -就是这样!您已成功配置 WAN 接口以获得网络连接。 +就是这样!你已成功配置 WAN 接口以获得网络连接。 ### 安装必要的包 -默认情况下,固件不包含很多包,但 OpenWrt 有一个选择可安装的包管理器。导航到 **System → Software** 并通过选择 **Update list...** 更新您的包管理器。 +默认情况下,该固件不包含很多包,但 OpenWrt 有一个包管理器和可选安装的软件包。导航到 “System → Software” 并通过选择 “Update list...” 更新你的包管理器。 ![OpenWrt 包管理器][21] -(Lukas Janenas, [CC BY-SA 4.0][17]) - -在过滤器输入中,键入 **Wireguard**,等待系统找到所有包含该关键字的包。找到并安装名为 **luci-app-wireguard** 的包。 +在“Filter”输入中,键入 “Wireguard”,等待系统找到所有包含该关键字的包。找到并安装名为 “luci-app-wireguard” 的包。 ![luci-app-wireguard 包][22] -(Lukas Janenas, [CC BY-SA 4.0][17]) - 该软件包包括一个用于配置 Wireguard 的 Web 界面,并安装 Wireguard 所必需的所有依赖项。 -如果您在安装 Wireguard 软件包之前收到一个软件包丢失的警告并且在存储库中找不到,请忽略它并继续。 +如果你在安装 Wireguard 软件包之前收到一个软件包丢失的警告并且在存储库中找不到,请忽略它并继续。 -接下来,找到并安装名为 **luci-app-ttyd** 的包。这将用于稍后访问终端。 +接下来,找到并安装名为 “luci-app-ttyd” 的包。这将用于稍后访问终端。 安装这些软件包后,重新启动路由器以使更改生效。 ### 配置 Wireguard 接口 -接下来,创建 Wireguard 接口。导航到 **Network → Interfaces** 并选择左下角的 **Add new interface...**。在弹出窗口中,输入您想要的接口名称,从下拉列表中选择 **Wireguard VPN**,然后选择右下角的 **Create interface**。 +接下来,创建 Wireguard 接口。导航到 “Network → Interfaces” 并选择左下角的 “Add new interface...”。在弹出窗口中,输入你想要的接口名称,从下拉列表中选择 “WireguardVPN”,然后选择右下角的 “Create interface”。 ![创建 Wireguard 接口][23] -(Lukas Janenas, [CC BY-SA 4.0][17]) - -在新弹出的窗口中,选择 **Generate Key** 为 Wireguard 接口生成私钥。在 **Listen Port** 字段中,输入所需的端口。我将使用默认的 Wireguard 端口,**51820**。在 **IP Addresses** 字段中,分配将用于 Wireguard 接口的 IP 地址。在这个例子中,我使用了 `10.0.0.1/24`。数字 **24** 表明我的子网的大小。 +在新弹出的窗口中,选择 “Generate Key” 为 Wireguard 接口生成私钥。在 “Listen Port” 字段中,输入所需的端口。我将使用默认的 Wireguard 端口,“51820”。在 “IP Addresses” 字段中,分配将用于 Wireguard 接口的 IP 地址。在这个例子中,我使用了 `10.0.0.1/24`。数字 “24” 表明我的子网的大小。 ![创建 Wireguard 接口][24] -(Lukas Janenas, [CC BY-SA 4.0][17]) - 保存配置并重启接口。 -导航到 **Services → Terminal**,登录到 shell,然后输入命令 `wg show`。您将看到有关 Wiregaurd 接口的一些信息,包括其公钥。复制公钥——稍后您将需要它来创建对等点。 +导航到 “Services → Terminal”,登录到 shell,然后输入命令 `wg show`。你将看到有关 Wiregaurd 接口的一些信息,包括其公钥。复制公钥——稍后你将需要它来创建对等点。 ![Wireguard 公钥][25] -(Lukas Janenas, [CC BY-SA 4.0][17]) - ### 配置防火墙 -导航到 **Network → Firewall** 并选择 **Traffic Rules** 选项卡。在页面底部,选择 **Add**。在弹出窗口的 **Name** 字段中,为您的规则命名,例如 **Allow-wg**。接下来,将 **Destination zone** 从 **Lan** 更改为 **Device**,并将 **Destination port** 设置为 51820。 +导航到 “Network → Firewall” 并选择 “Traffic Rules” 选项卡。在页面底部,选择 “Add”。在弹出窗口的 “Name” 字段中,为你的规则命名,例如 “Allow-wg”。接下来,将 “Destination zone” 从 “Lan” 更改为 “Device”,并将 “Destination port” 设置为 “51820”。 ![Wireguard 防火墙设置][26] -(Lukas Janenas, [CC BY-SA 4.0][17]) - 保存配置。 ### 手机上配置 Wireguard -从 Google Play 在您的手机上安装 [Wireguard 应用程序][27]。安装后,打开应用程序并从头开始创建一个新接口。在 **Name** 字段中,输入要用于接口的名称。在 **Private key** 字段中,按右侧的双箭头图标生成密钥对。您将需要上面的公钥来在您的手机和路由器之间创建一个对等点。在 **Addresses** 字段中,分配您将用于通过 VPN 访问电话的 IP 地址。我将使用 `10.0.0.2/24`。在 **Listen port**中,输入端口;我将再次使用默认端口。 +从 Google Play 在你的手机上安装 [Wireguard 应用程序][27]。安装后,打开应用程序并从头开始创建一个新接口。在 “Name” 字段中,输入要用于接口的名称。在 “Private key” 字段中,按右侧的双向箭头图标生成密钥对。你将需要上面的公钥来在你的手机和路由器之间创建一个对等点。在 “Addresses” 字段中,分配你将用于通过虚拟专用网络访问电话的 IP 地址。我将使用 `10.0.0.2/24`。在 “Listen port” 中,输入端口;我将再次使用默认端口。 -![在 Android 上设置 VPN 接口][28] - -(Lukas Janenas, [CC BY-SA 4.0][17]) +![在 Android 上设置虚拟专用网络接口][28] 保存配置。 -要向配置中添加对等点,请选择 **Add peer**。在 **Public key** 字段中,输入路由器的 Wireguard 公钥。在 **Endpoint** 字段中,输入路由器的公共 IP 地址和端口,以冒号分隔,例如 `12.34.56.78:51820`。在 **Allowed IP** 字段中,输入要通过 Wireguard 接口访问的 IP 地址。 (您可以输入路由器的 VPN 接口 IP 地址和 LAN 接口地址。)IP 地址必须用逗号分隔。您还可以定义子网的大小。 +要向配置中添加对等点,请选择 “Add peer”。在 “Public key” 字段中,输入路由器的 Wireguard 公钥。在 “Endpoint” 字段中,输入路由器的公共 IP 地址和端口,以冒号分隔,例如 `12.34.56.78:51820`。在 “Allowed IP” 字段中,输入要通过 Wireguard 接口访问的 IP 地址。 (你可以输入路由器的虚拟专用网络接口 IP 地址和 LAN 接口地址。)IP 地址必须用逗号分隔。你还可以定义子网的大小。 -![在 Android 上添加 VPN 对等点][29] - -(Lukas Janenas, [CC BY-SA 4.0][17]) +![在 Android 上添加虚拟专用网络对等点][29] 保存配置。 @@ -159,25 +137,21 @@ OpenWrt 支持很多路由器,包括 [Cisco][3],[ASUS][4],[MikroTik][5], ### 在路由器上添加一个对等点 -导航到 **Network → Interfaces** 并选择您的 Wireguard 接口。转到 **Peers** 选项卡并选择 **Add peer**。 在 **Description** 字段中,输入对等方的名称。在 **Public Key** 字段中输入手机的 Wireguard 接口公钥,在 **Allowed IPs** 字段中输入手机的 Wireguard 接口 IP 地址。选中 **Route Allowed IPs** 复选框。 +导航到 “Network → Interfaces” 并选择你的 Wireguard 接口。转到 “Peers” 选项卡并选择 “Add peer”。在 “Description” 字段中,输入对等方的名称。在 “Public Key” 字段中输入手机的 Wireguard 接口公钥,在 “Allowed IPs” 字段中输入手机的 Wireguard 接口 IP 地址。选中 “Route Allowed IPs” 复选框。 ![在路由器上添加一个对等点][30] -(Lukas Janenas, [CC BY-SA 4.0][17]) - 保存配置并重启接口。 ### 测试配置 -在手机上打开网络浏览器。在 URL 栏中,输入 IP 地址 `10.0.0.1` 或 `192.168.1.1`。您应该能够访问路由器的网站。 +在手机上打开 Web 浏览器。在 URL 栏中,输入 IP 地址 `10.0.0.1` 或 `192.168.1.1`。你应该能够访问路由器的网站。 -![从 Android 登录 VPN][31] +![从 Android 登录 虚拟专用网络][31] -(Lukas Janenas, [CC BY-SA 4.0][17]) +### 你自己的虚拟专用网络 -### 您自己的 VPN - -这些天有很多 VPN 服务商在做广告,但是拥有和控制自己的基础设施还有很多话要说,尤其是当该基础设施仅用于提高安全性时。无需依赖其他人为您提供安全的数据连接。使用 OpenWrt 和 Wireguard,您可以拥有自己的开源 VPN 解决方案。 +这些天有很多虚拟专用网络服务商在做广告,但是拥有和控制自己的基础设施还有很多话要说,尤其是当该基础设施仅用于提高安全性时。无需依赖其他人为你提供安全的数据连接。使用 OpenWrt 和 Wireguard,你可以拥有自己的开源虚拟专用网络解决方案。 -------------------------------------------------------------------------------- @@ -186,13 +160,13 @@ via: https://opensource.com/article/21/5/open-source-private-vpn 作者:[Lukas Janėnas][a] 选题:[lujun9972][b] 译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/lukasjan [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/vpn_scrabble_networking.jpg?itok=pdsUHw5N (scrabble letters used to spell "VPN") +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/vpn_scrabble_networking.jpg?itok=pdsUHw5N (scrabble letters used to spell "V") [2]: https://openwrt.org/ [3]: https://www.cisco.com/c/en/us/products/routers/index.html [4]: https://www.asus.com/Networking-IoT-Servers/WiFi-Routers/All-series/ @@ -219,7 +193,7 @@ via: https://opensource.com/article/21/5/open-source-private-vpn [25]: https://opensource.com/sites/default/files/uploads/wireguard_publickey.png (Wireguard public key) [26]: https://opensource.com/sites/default/files/uploads/wireguard-firewallsetup.png (Wireguard firewall setup) [27]: https://play.google.com/store/apps/details?id=com.wireguard.android&hl=lt&gl=US -[28]: https://opensource.com/sites/default/files/uploads/vpn_inferfacesetup.png (Setting up VPN interface on Android) -[29]: https://opensource.com/sites/default/files/uploads/addpeeronphone.png (Adding a VPN peer on an Android) +[28]: https://opensource.com/sites/default/files/uploads/vpn_inferfacesetup.png (Setting up V interface on Android) +[29]: https://opensource.com/sites/default/files/uploads/addpeeronphone.png (Adding a V peer on an Android) [30]: https://opensource.com/sites/default/files/uploads/addpeeronrouter.png (Adding a peer on the router) -[31]: https://opensource.com/sites/default/files/uploads/android-vpn-login.png (Logging into the VPN from Android) +[31]: https://opensource.com/sites/default/files/uploads/android-vpn-login.png (Logging into the V from Android) From 9f3cbcc326136915f8da3110966fc929c5bc96bd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 1 Jul 2021 10:17:50 +0800 Subject: [PATCH 267/870] PUB @stevenzdg988 https://linux.cn/article-13539-1.html --- .../20210517 Use open source tools to set up a private VPN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210517 Use open source tools to set up a private VPN.md (99%) diff --git a/translated/tech/20210517 Use open source tools to set up a private VPN.md b/published/20210517 Use open source tools to set up a private VPN.md similarity index 99% rename from translated/tech/20210517 Use open source tools to set up a private VPN.md rename to published/20210517 Use open source tools to set up a private VPN.md index ca5d8cd034..416c8d5aef 100644 --- a/translated/tech/20210517 Use open source tools to set up a private VPN.md +++ b/published/20210517 Use open source tools to set up a private VPN.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13539-1.html) 使用开源工具创建私有的虚拟专用网络 ====== From 54dd137dc6b86921c107f20acc97dce9f2204999 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Thu, 1 Jul 2021 19:13:59 +0800 Subject: [PATCH 268/870] Update 20210621 Jim Hall- How Do You Fedora.md --- sources/talk/20210621 Jim Hall- How Do You Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210621 Jim Hall- How Do You Fedora.md b/sources/talk/20210621 Jim Hall- How Do You Fedora.md index 24c2219ffc..b70cbca599 100644 --- a/sources/talk/20210621 Jim Hall- How Do You Fedora.md +++ b/sources/talk/20210621 Jim Hall- How Do You Fedora.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/jim-hall-how-do-you-fedora/) [#]: author: (Karimi Hari Priya https://fedoramagazine.org/author/haripriya21/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zz-air) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -60,7 +60,7 @@ via: https://fedoramagazine.org/jim-hall-how-do-you-fedora/ 作者:[Karimi Hari Priya][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zz-air](https://github.com/zz-air) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1f733eef89de63d47dcdb03db3948478d436af4d Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Thu, 1 Jul 2021 19:24:30 +0800 Subject: [PATCH 269/870] Update and rename sources/tech/20210625 Use Python to parse configuration files.md to translated/tech/20210625 Use Python to parse configuration files.md --- ...Use Python to parse configuration files.md | 205 ------------------ ...Use Python to parse configuration files.md | 205 ++++++++++++++++++ 2 files changed, 205 insertions(+), 205 deletions(-) delete mode 100644 sources/tech/20210625 Use Python to parse configuration files.md create mode 100644 translated/tech/20210625 Use Python to parse configuration files.md diff --git a/sources/tech/20210625 Use Python to parse configuration files.md b/sources/tech/20210625 Use Python to parse configuration files.md deleted file mode 100644 index eaf0c699cc..0000000000 --- a/sources/tech/20210625 Use Python to parse configuration files.md +++ /dev/null @@ -1,205 +0,0 @@ -[#]: subject: (Use Python to parse configuration files) -[#]: via: (https://opensource.com/article/21/6/parse-configuration-files-python) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Use Python to parse configuration files -====== -The first step is choosing a configuration format: INI, JSON, YAML, or -TOML. -![Python programming language logo with question marks][1] - -Sometimes, a program needs enough parameters that putting them all as command-line arguments or environment variables is not pleasant nor feasible. In those cases, you will want to use a configuration file. - -There are several popular formats for configuration files. Among them are the venerable (although occasionally under-defined) `INI` format, the popular but sometimes hard to write by hand `JSON` format, the extensive yet occasionally surprising in details `YAML` format, and the newest addition, `TOML`, which many people have not heard of yet. - -Your first task is to choose a format and then to document that choice. With this easy part out of the way, it is time to parse the configuration. - -It is sometimes a good idea to have a class that corresponds to the "abstract" data in the configuration. Because this code will do nothing with the configuration, this is the simplest way to show parsing logic. - -Imagine the configuration for a file processor: it includes an input directory, an output directory, and which files to pick up. - -The abstract definition for the configuration class might look something like: - - -``` -`from __future__ import annotations`[/code] [code] - -import attr - -@attr.frozen -class Configuration: -    @attr.frozen -    class Files: -        input_dir: str -        output_dir: str -    files: Files -    @attr.frozen -    class Parameters: -        patterns: List[str] -    parameters: Parameters -``` - -To make the format-specific code simpler, you will also write a function to parse this class out of dictionaries. Note that this assumes the configuration will use dashes, not underscores. This kind of discrepancy is not uncommon. - - -``` -def configuration_from_dict(details): -    files = Configuration.Files( -        input_dir=details["files"]["input-dir"], -        output_dir=details["files"]["output-dir"], -    ) -    parameters = Configuration.Paraneters( -        patterns=details["parameters"]["patterns"] -    ) -    return Configuration( -        files=files, -        parameters=parameters, -    ) -``` - -### JSON - -JSON (JavaScript Object Notation) is a JavaScript-like format. - -Here is an example configuration in JSON format: - - -``` -json_config = """ -{ -    "files": { -        "input-dir": "inputs", -        "output-dir": "outputs" -    }, -    "parameters": { -        "patterns": [ -            "*.txt", -            "*.md" -        ] -    } -} -""" -``` - -The parsing logic parses the JSON into Python's built-in data structures (dictionaries, lists, strings) using the `json` module and then creates the class from the dictionary: - - -``` -import json -def configuration_from_json(data): -    parsed = json.loads(data) -    return configuration_from_dict(parsed) -``` - -### INI - -The INI format, originally popular on Windows, became a de facto configuration standard. - -Here is the same configuration as an INI: - - -``` -ini_config=""" -[files] -input-dir = inputs -output-dir = outputs - -[parameters] -patterns = ['*.txt', '*.md'] -""" -``` - -Python can parse it using the built-in `configparser` module. The parser behaves as a `dict`-like object, so it can be passed directly to `configuration_from_dict`: - - -``` -import configparser - -def configuration_from_ini(data): -    parser = configparser.ConfigParser() -    parser.read_string(data) -    return configuration_from_dict(parser) -``` - -### YAML - -YAML (Yet Another Markup Language) is an extension of JSON that is designed to be easier to write by hand. It accomplishes this, in part, by having a long specification. - -Here is the same configuration in YAML: - - -``` -yaml_config = """ -files: -  input-dir: inputs -  output-dir: outputs -parameters: -  patterns: -  - '*.txt' -  - '*.md' -""" -``` - -For Python to parse this, you will need to install a third-party module. The most popular is `PyYAML` (`pip install pyyaml`). The YAML parser also returns built-in Python data types that can be passed to `configuration_from_dict`. However, the YAML parser expects a stream, so you need to convert the string into a stream. - - -``` -import io -import yaml -def configuration_from_yaml(data): -    fp = io.StringIO(data) -    parsed = yaml.safe_load(fp) -    return configuration_from_dict(parsed) -``` - -### TOML - -TOML (Tom's Own Markup Language) is designed to be a lightweight alternative to YAML. The specification is shorter, and it is already popular in some places (for example, Rust's package manager, Cargo, uses it for package configuration). - -Here is the same configuration as a TOML: - - -``` -toml_config = """ -[files] -input-dir = "inputs" -output-dir = "outputs" - -[parameters] -patterns = [ "*.txt", "*.md",] -""" -``` - -In order to parse TOML, you need to install a third-party package. The most popular one is called, simply, `toml`. Like YAML and JSON, it returns basic Python data types. - - -``` -import toml -def configuration_from_toml(data): -    parsed = toml.loads(data) -    return configuration_from_dict(parsed) -``` - -### Summary - -Choosing a configuration format is a subtle tradeoff. However, once you make the decision, Python can parse most of the popular formats using a handful of lines of code. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/parse-configuration-files-python - -作者:[Moshe Zadka][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r (Python programming language logo with question marks) diff --git a/translated/tech/20210625 Use Python to parse configuration files.md b/translated/tech/20210625 Use Python to parse configuration files.md new file mode 100644 index 0000000000..c6be0c7288 --- /dev/null +++ b/translated/tech/20210625 Use Python to parse configuration files.md @@ -0,0 +1,205 @@ +[#]: subject: "Use Python to parse configuration files" +[#]: via: "https://opensource.com/article/21/6/parse-configuration-files-python" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用Python解析配置文件 +====== +第一步是选择配置文件的格式:INI、JSON、YAML 或 TOML。 + +![Python programming language logo with question marks][1] + +有时,程序需要足够的参数,将它们全部作为命令行参数或环境变量既不让人愉快也不可行。 在这些情况下,您将需要使用配置文件。 + +有几种流行的配置文件格式。 其中包括古老的(虽然偶尔定义不足)`INI`格式,虽然流行但有时难以手写的`JSON`格式,广泛但偶尔在细节方面令人惊讶的`YAML`格式,以及最新添加的`TOML `,很多人还没有听说过。 + +您的首要任务是选择一种格式,然后记录该选择。 解决了这个简单的部分之后就是时候解析配置了。 + +有时,在配置中拥有一个与“抽象“数据相对应的类是一个不错的想法。 因为这段代码不会对配置做任何事情,所以这是展示解析逻辑最简单的方式。 + +想象一下文件处理器的配置:它包括一个输入目录、一个输出目录和要提取的文件。 + +配置类的抽象定义可能类似于: + + +``` +`from __future__ import annotations`[/code] [code] + +import attr + +@attr.frozen +class Configuration: + @attr.frozen + class Files: + input_dir: str + output_dir: str + files: Files + @attr.frozen + class Parameters: + patterns: List[str] + parameters: Parameters +``` + +为了使特定于格式的代码更简单,您还将编写一个函数来从字典中解析此类。 请注意,这假设配置将使用破折号,而不是下划线。 这种差异并不少见。 + + +``` +def configuration_from_dict(details): + files = Configuration.Files( + input_dir=details["files"]["input-dir"], + output_dir=details["files"]["output-dir"], + ) + parameters = Configuration.Paraneters( + patterns=details["parameters"]["patterns"] + ) + return Configuration( + files=files, + parameters=parameters, + ) +``` + +### JSON + +JSON(JavaScript Object Notation)是一种类似于 JavaScript 的格式。 + +以下是 JSON 格式的示例配置: + + +``` +json_config = """ +{ + "files": { + "input-dir": "inputs", + "output-dir": "outputs" + }, + "parameters": { + "patterns": [ + "*.txt", + "*.md" + ] + } +} +""" +``` + +解析逻辑使用 `json` 模块将 JSON 解析为 Python 的内置数据结构(字典、列表、字符串),然后从字典中创建类: + + +``` +import json +def configuration_from_json(data): + parsed = json.loads(data) + return configuration_from_dict(parsed) +``` + +### INI + +INI 格式,最初只在 Windows 上流行,之后成为配置标准格式。 + +这是与 INI 相同的配置: + + +``` +ini_config=""" +[files] +input-dir = inputs +output-dir = outputs + +[parameters] +patterns = ['*.txt', '*.md'] +""" +``` + +Python 可以使用内置的 `configparser` 模块解析它。解析器充当类似 `dict` 的对象,因此可以直接传递给 `configuration_from_dict`: + + +``` +import configparser + +def configuration_from_ini(data): + parser = configparser.ConfigParser() + parser.read_string(data) + return configuration_from_dict(parser) +``` + +### YAML + +YAML (Yet Another Markup Language) 是 JSON 的扩展,旨在更易于手动编写。 部分 YAML 需要通过具有较长的规范来实现这一点。 + +以下是 YAML 中的相同配置: + + +``` +yaml_config = """ +files: + input-dir: inputs + output-dir: outputs +parameters: + patterns: + - '*.txt' + - '*.md' +""" +``` + +要让 Python 解析它,您需要安装第三方模块。 最受欢迎的是`PyYAML`(`pip install pyyaml`)。 YAML 解析器还返回可以传递给 `configuration_from_dict` 的内置 Python 数据类型。 但是,YAML 解析器需要一个字节流,因此您需要将字符串转换为字节流。 + + +``` +import io +import yaml +def configuration_from_yaml(data): + fp = io.StringIO(data) + parsed = yaml.safe_load(fp) + return configuration_from_dict(parsed) +``` + +### TOML + +TOML(Tom's Own Markup Language)旨在成为 YAML 的轻量级替代品。 规范比较短,已经在一些地方流行了(比如 Rust 的包管理器 Cargo 就用它来进行包配置)。 + +这是与 TOML 相同的配置: + + +``` +toml_config = """ +[files] +input-dir = "inputs" +output-dir = "outputs" + +[parameters] +patterns = [ "*.txt", "*.md",] +""" +``` + +为了解析 TOML,您需要安装第三方包。 最流行的一种被简单地称为 `toml`。 与 YAML 和 JSON 一样,它返回基本的 Python 数据类型。 + + +``` +import toml +def configuration_from_toml(data): + parsed = toml.loads(data) + return configuration_from_dict(parsed) +``` + +### Summary总结 + +选择配置格式是一种微妙的权衡。 但是,一旦您做出决定,Python 就可以使用少量代码来解析大多数流行的格式。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/parse-configuration-files-python + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[zepoch](https://github.com/zepoch) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r "Python programming language logo with question marks" From aacb70d60c8782118a5514c0fc19d588187ce1c7 Mon Sep 17 00:00:00 2001 From: MM-BCY <86788030+MM-BCY@users.noreply.github.com> Date: Thu, 1 Jul 2021 22:19:50 +0800 Subject: [PATCH 270/870] Update 20210508 My weird jobs before tech.md --- sources/talk/20210508 My weird jobs before tech.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210508 My weird jobs before tech.md b/sources/talk/20210508 My weird jobs before tech.md index f275af1766..01010f501c 100644 --- a/sources/talk/20210508 My weird jobs before tech.md +++ b/sources/talk/20210508 My weird jobs before tech.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/weird-jobs-tech) [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MM-BCY) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -36,7 +36,7 @@ via: https://opensource.com/article/21/5/weird-jobs-tech 作者:[Chris Hermansen][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MM-BCY](https://github.com/MM-BCY) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d83d361fbaf575f0b112293133e124f5490794b8 Mon Sep 17 00:00:00 2001 From: MM-BCY <86788030+MM-BCY@users.noreply.github.com> Date: Thu, 1 Jul 2021 22:27:12 +0800 Subject: [PATCH 271/870] Update 20210508 My weird jobs before tech.md --- sources/talk/20210508 My weird jobs before tech.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210508 My weird jobs before tech.md b/sources/talk/20210508 My weird jobs before tech.md index 01010f501c..a878cfed51 100644 --- a/sources/talk/20210508 My weird jobs before tech.md +++ b/sources/talk/20210508 My weird jobs before tech.md @@ -36,7 +36,7 @@ via: https://opensource.com/article/21/5/weird-jobs-tech 作者:[Chris Hermansen][a] 选题:[lujun9972][b] -译者:[MM-BCY](https://github.com/MM-BCY) +译者:[MM-BCY](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From eb3a5364707ed31f71f7a078db176b7e2fdcedd9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 2 Jul 2021 05:03:11 +0800 Subject: [PATCH 272/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210702=20?= =?UTF-8?q?Creating=20a=20PKGBUILD=20to=20Make=20Packages=20for=20Arch=20L?= =?UTF-8?q?inux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md --- ...KGBUILD to Make Packages for Arch Linux.md | 271 ++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md diff --git a/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md b/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md new file mode 100644 index 0000000000..c3078135ca --- /dev/null +++ b/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md @@ -0,0 +1,271 @@ +[#]: subject: (Creating a PKGBUILD to Make Packages for Arch Linux) +[#]: via: (https://itsfoss.com/create-pkgbuild/) +[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Creating a PKGBUILD to Make Packages for Arch Linux +====== + +PKGBUILD files are how packages are built and created for Arch Linux and its derivatives such as Manjaro. + +You may have even come across them a bit yourself if you’ve ever used the [AUR][1], Arch Linux’s user-curated repository of PKGBUILDs. + +But how exactly do you go from a PKGBUILD to an installable package? What exactly is going on between the two, and how can you make them for your own packages? You’ll learn them in this article. + +### PKGBUILD basics + +For those who are familiar with Bash or other shells, you’ll be delighted to know, if you didn’t already, that a PKGBUILD is pretty much just a shell script with some variables. + +PKGBUILD files consist of variables and functions, all of which are used to define the package itself, and how to build it. + +To create a package from a PKGBUILD, the makepkg command line utility is used. After obtaining a PKGBUILD, you simply run `makepkg` inside the directory containing the PKGBUILD, and voila, you have an installable package! + +![][2] + +In this tutorial, you’ll be going over the package I just made, which prints “Hello World!” when run: + +![][3] + +### Getting set up + +To follow along with this tutorial, you need to create a couple of files. + +First, you need to make a file called **PKGBUILD**. If it wasn’t already made clear, this will serve as the “recipe” for building your package. + +The other file you’ll need to make is a file called **hello-world.sh**. I’ll explain its purpose a bit later. + +You can create both of these files with a single command as well. + +``` +touch PKGBUILD hello-world.sh +``` + +You can check that the files were created with the ls command: + +![][4] + +And you’re ready to go! + +### Setting up your PKGBUILD file + +**Instead of having you copy paste the whole file, I’ll be going over entering every line with you, so you can better understand the purpose of everything that’s happening. If you don’t prefer to learn this way, I’d highly recommend the** [Arch Wiki article][5] _**on creating packages for Arch Linux.**_ + +_**This article also doesn’t go over every single option you can set in a PKGBUILD, but rather some commonly used ones so you can get going as quickly as possible.**_ + +With that out of the way, open up your text editor, and let’s get straight into it! + +#### pkgname + +First things first, the pkgname variable. This is what defines the name of your package when installing, and how [Arch Linux’s package manager pacman][6] keeps track of the package. + +The format of this variable (and some others) takes the form of variable=value, with the variable name on the left, the value of the variable on the right, separated by an equals sign. + +To set the package name, enter the following into the PKGBUILD: + +``` +pkgname="hello-world" +``` + + * To set a different package name, replace `hello-world` with the name of the package. + * This doesn’t set the command used to run the program. That’s handled a bit below in the `package()` section. + + + +#### pkgver + +As is stated in the variable name itself, this sets the version of your package (i.e. 1.0.0). This is useful when a user updates their system, as setting a higher version will result in the user being prompted for an upgrade. + +To set, enter the following into the PKGBUILD (after the previous line): + +``` +pkgver="1.0.0" +``` + +#### pkgrel + +This is related to the pkgver variable, and isn’t normally important to know about. Like the pkgver variable though, it will notify users for upgrades if it’s moved to a higher number. + +It serves for any changes that require the pkgver to remain the same, such as any changes to the PKGBUILD itself. This would be useful if you’ve created a PKGBUILD for a program you use (and want to keep the version the same as the package’s), and you need to fix a bug in the PKGBUILD itself. + +To set the variable, enter the following in the PKGBUILD: + +``` +pkgver="1" +``` + +This variable should **always** start at 1, and then move up one at a time. When the **pkgver** itself moves up, this can (and should) be reset to 1, as the pkgver itself will notify users that upgrades are available. + +#### pkgdesc + +This will set the description of the package, which is used to help better identify the package. + +To set it, just put the description inside of quotation marks: + +``` +pkgdesc="Hello world in your terminal!" +``` + +#### arch + +This variable sets the [architecture][7] the package is compatible with. It’s fine if you don’t understand what an architecture is, as it’s pretty much useless in most cases. + +Regardless, makepkg still needs it to be set so it knows the package is compatible with our system. + +This variable supports setting multiple values, so makepkg requires a different syntax as shown below. + +To set it, enter the following in the PKGBUILD: + +``` +arch=("x86_64") +``` + +If you were to set multiple values for this, you would separate each value with a space and quotation marks like so: **arch=(“x86_x64” “arm”)** + +#### depends + +This lists all of the packages that our package needs to function. Like **arch**, it can also contain multiple values, and thus must use the parenthesis syntax. + +Since our package won’t have any dependencies, we don’t have to enter this field in the PKGBUILD. If our package did have dependencies however, we’d just use the same syntax as **arch**. + +#### optdepends + +This lists packages that aren’t required to function, but that are needed for extra functionality. + +This follows the same syntax as **depends**. + +#### conflicts + +This tells pacman what packages would cause our package to act up or behave in a way we wouldn’t want. + +Any package listed here would be uninstalled before ours is installed. + +This follows the same syntax as **depends** as well. + +#### license + +This defines the [software license][8] that your program is licensed under. The [Arch Wiki][9] has some info if you need help choosing a license. Setting this to `custom` will work if you don’t know what to set this to. + +This takes the same syntax as **arch** and **depends**: + +``` +license=("custom") +``` + +#### source + +This is how makepkg knows what files to use to build our package. This can contain a variety of different kinds of sources, including local files and URLs. + +When adding local files, enter the file’s name relative to the PKGBUILD i.e. consider the following directory layout: + +``` +PKGBUILD +file.txt +src/file.sh +``` + +If you wanted to include **file.sh** in our PKGBUILD, you would enter **src/file.sh** as its name. + +When entering URLs, you simply enter the full URL, i.e. . + +Your package only needs the hello-world.sh file, and since it’s in the same directory as the PKGBUILD, you just type its name as the value for **source**. + +This variable also uses the same syntax as **arch** and **depends**: + +``` +source=("hello-world.sh") +``` + +#### sha512sums + +This is used to verify that the files in **source** haven’t been modified or downloaded incorrectly. Information on obtaining the values for this can be found in the [Arch Wiki article on PKGBUILDs][10]. + +If you’d rather just not set this (or you just don’t need to, i.e. for local files), you can just enter SKIP for every file in the **source** variable: + +``` +sha512sums=("SKIP") +``` + +#### package() + +This is the last, and most important part to actually making our package. It’s important to know two variables when working with this: + + * **${srcdir}**: This is where makepkg puts the files in the **source** variable. This is the directory where you can interact with the files, and do any other needed modification to the files. + + + * ${pkgdir}: This is where we place the files that will be installed on our system. +The folder structure for ${pkgdir} is set up as if it was on an actual system (i.e. ${pkgdir}/usr/bin/hello-world would create the file /usr/bin/hello-world when installing with pacman. + + + +package() contains a list of commands used create a package. + +So, if (hypothetically) you needed to have a file that reads Linux is superior to Windows at /usr/share/motto.txt, you would run something like this: + +``` +package() { + mkdir -p "${pkgdir}/usr/share" + echo "Linux is superior to Windows" | tee "${pkgdir}/usr/share/motto.txt" +} +``` + +A few notes on the above command: + + * ${pkgdir} contains **no** directories inside it at first. If you skipped the [mkdir command][11], tee would output an error saying the directory doesn’t exist. + + + * When specifying directories, **always** prepend them with the **${pkgdir}** or **${srcdir}** variable. Entering something like /usr/share/motto.txt without such would point to the literal directory /usr/share/motto.txt on your currently running system. + + + +For your PKGBUILD, you’re going to place the file hello-world.sh at /usr/bin/hello-world on your target system. You’ll also be making the file say “Hello to you!” when ran. + +To do so, enter the following into your PKGBUILD: + +``` +package() { + echo 'Hello to you!' > "${srcdir}/hello-world.sh" + mkdir -p "${pkgdir}/usr/bin" + cp "${srcdir}/hello-world.sh" "${pkgdir}/usr/bin/hello-world" + chmod +x "${pkgdir}/usr/bin/hello-world" +} +``` + +And you’re done! **Build and install the package with makepkg -si**, and then run hello-world in your terminal to see its output. + +![][12] + +### Wrapping Up + +And just like that, you have made your first PKGBUILD! You’re on your way to making actual packages for yourself, and maybe even the AUR. + +Got any questions, or something just not working right? Feel free to post it in the comment section below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/create-pkgbuild/ + +作者:[Hunter Wittenborn][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/aur-arch-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/image.png?resize=748%2C689&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/image-2.png?resize=682%2C260&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/image-3.png?resize=682%2C265&ssl=1 +[5]: https://wiki.archlinux.org/title/Creating_packages +[6]: https://itsfoss.com/pacman-command/ +[7]: https://www.quora.com/What-is-CPU-architecture +[8]: https://en.wikipedia.org/wiki/Software_license +[9]: https://wiki.archlinux.org/title/PKGBUILD#license +[10]: https://wiki.archlinux.org/title/PKGBUILD#Integrity +[11]: https://linuxhandbook.com/mkdir-command/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/image-1.png?resize=561%2C281&ssl=1 From 79219775edf4c857189db375d41328d2604df7c3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 2 Jul 2021 05:03:39 +0800 Subject: [PATCH 273/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210701=20?= =?UTF-8?q?How=20I=20build=20my=20personal=20website=20using=20containers?= =?UTF-8?q?=20with=20a=20Makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210701 How I build my personal website using containers with a Makefile.md --- ...ebsite using containers with a Makefile.md | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 sources/tech/20210701 How I build my personal website using containers with a Makefile.md diff --git a/sources/tech/20210701 How I build my personal website using containers with a Makefile.md b/sources/tech/20210701 How I build my personal website using containers with a Makefile.md new file mode 100644 index 0000000000..12233855c7 --- /dev/null +++ b/sources/tech/20210701 How I build my personal website using containers with a Makefile.md @@ -0,0 +1,212 @@ +[#]: subject: (How I build my personal website using containers with a Makefile) +[#]: via: (https://opensource.com/article/21/7/manage-containers-makefile) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How I build my personal website using containers with a Makefile +====== +Simplify container management by combining the commands to build, test, +and deploy a project in a Makefile. +![Parts, modules, containers for software][1] + +The `make` utility and its related [Makefile][2] have been used to build software for a long time. The Makefile defines a set of commands to run, and the `make` utility runs them. It is similar to a Dockerfile or Containerfile—a set of commands used to build container images. + +Together, a Makefile and Containerfile are an excellent way to manage a container-based project. The Containerfile describes the contents of the container image, and the Makefile describes how to manage the project itself: kicking the image build, testing, and deployment, among other helpful commands. + +### Make targets + +The Makefile consists of "targets": one or more commands grouped under a single command. You can run each target by running the `make` command followed by the target you want to run: + + +``` +# Runs the "build_image" make target from the Makefile +$ make build_image +``` + +This is the beauty of the Makefile. You can build a collection of targets for each task that needs to be performed manually. In the context of a container-based project, this includes building the image, pushing it to a registry, testing the image, and even deploying the image and updating the service running it. I use a Makefile for my personal website to do all these tasks in an easy, automated way. + +### Build, test, deploy + +I build my website using [Hugo][3], a static website generator that builds static HTML from YAML files. I use Hugo to build the HTML files for me, then build a container image with those files and [Caddy][4], a fast and simple web server, and run that image as a container. (Both Hugo and Caddy are open source, Apache-licensed projects.) I use a Makefile to make building and deploying that image to production much easier. + +The first target in the Makefile is appropriately the `image_build` command: + + +``` +image_build: +  podman build --format docker -f Containerfile -t $(IMAGE_REF):$(HASH) . +``` + +This target invokes [Podman][5] to build an image from the Containerfile included in the project. There are some variables in the command above—what are they? Variables can be specified in the Makefile, similarly to Bash or a programming language. I use them for a variety of things within the Makefile, but the most useful is building the image reference to be pushed to remote container image registries: + + +``` +# Image values +REGISTRY := "us.gcr.io" +PROJECT := "my-project-name" +IMAGE := "some-image-name" +IMAGE_REF := $(REGISTRY)/$(PROJECT)/$(IMAGE) + +# Git commit hash +HASH := $(shell git rev-parse --short HEAD) +``` + +Using these variables, the `image_build` target builds an image reference like `us.gcr.io/my-project-name/my-image-name:abc1234` using the short Git revision hash as the image tag so that it can be tied to the code that built it easily. + +The Makefile then tags that image as `:latest`. I don't generally use `:latest` for anything in production, but further down in this Makefile, it will come in useful for cleanup: + + +``` +image_tag: +  podman tag $(IMAGE_REF):$(HASH) $(IMAGE_REF):latest +``` + +So, now the image has been built and needs to be validated to make sure it meets some minimum requirements. For my personal website, this is honestly just, "does the webserver start and return something?" This could be accomplished with shell commands in the Makefile, but it was easier for me to write a Python script that starts a container with Podman, issues an HTTP request to the container, verifies it receives a reply, and then cleans up the container. Python's "try, except, finally" exception handling is perfect for this and considerably easier than replicating the same logic from shell commands in a Makefile: + + +``` +#!/usr/bin/env python3 + +import time +import argparse +from subprocess import check_call, CalledProcessError +from urllib.request import urlopen, Request + +parser = argparse.ArgumentParser() +parser.add_argument('-i', '--image', action='store', required=True, help='image name') +args = parser.parse_args() + +print(args.image) + +try: +    check_call("podman rm smk".split()) +except CalledProcessError as err: +    pass + +check_call( +    "podman run --rm --name=smk -p 8080:8080 -d {}".format(args.image).split() +) + +time.sleep(5) + +r = Request("", headers={'Host': 'chris.collins.is'}) +try: +    print(str(urlopen(r).read())) +finally: +    check_call("podman kill smk".split()) +``` + +This could be a more thorough test. For example, during the build process, the Git revision hash could be built into the response, and the test could check that the response included the expected hash. This would have the benefit of verifying that at least some of the expected content is there. + +If all goes well with the tests, then the image is ready to be deployed. I use Google's Cloud Run service to host my website, and like any of the major cloud services, there is an excellent command-line interface (CLI) tool that I can use to interact with the service. Since Cloud Run is a container service, deployment consists of pushing the images built locally to a remote container registry, and then kicking off a rollout of the service using the `gcloud` CLI tool. + +You can do the push using Podman or Skopeo (or Docker, if you're using it). My push target pushes the `$(IMAGE_REF):$(HASH)` image and also the `:latest` tag: + + +``` +push: +  podman push --remove-signatures $(IMAGE_REF):$(HASH) +  podman push --remove-signatures $(IMAGE_REF):latest +``` + +After the image has been pushed, use the `gcloud run deploy` command to roll out the newest image to the project and make the new image live. Once again, the Makefile comes in handy here. I can specify the `--platform` and `--region` arguments as variables in the Makefile so that I don't have to remember them each time. Let's be honest: I write so infrequently for my personal blog, there is zero chance I would remember these variables if I had to type them from memory each time I deployed a new image: + + +``` +rollout: +  gcloud run deploy $(PROJECT) --image $(IMAGE_REF):$(HASH) --platform $(PLATFORM) --region $(REGION) +``` + +### More targets + +There are additional helpful `make` targets. When writing new stuff or testing CSS or code changes, I like to see what I'm working on locally without deploying it to a remote server. For this, my Makefile has a `run_local` command, which spins up a container with the contents of my current commit and opens my browser to the URL of the page hosted by the locally running webserver: + + +``` +.PHONY: run_local +run_local: +  podman stop mansmk ; podman rm mansmk ; podman run --name=mansmk --rm -p $(HOST_ADDR):$(HOST_PORT):$(TARGET_PORT) -d $(IMAGE_REF):$(HASH) && $(BROWSER) $(HOST_URL):$(HOST_PORT) +``` + +I also use a variable for the browser name, so I can test with several if I want to. By default, it will open in Firefox when I run `make run_local`. If I want to test the same thing in Google, I run `make run_local BROWSER="google-chrome"`. + +When working with containers and container images, cleaning up old containers and images is an annoying chore, especially when you iterate frequently. I include targets in my Makefile for handling these tasks, too. When cleaning up a container, if the container doesn't exist, Podman or Docker will return with an exit code of 125. Unfortunately, `make` expects each command to return 0 or it will stop processing, so I use a wrapper script to handle that case: + + +``` +#!/usr/bin/env bash + +ID="${@}" + +podman stop ${ID} 2>/dev/null + +if [[ $?  == 125 ]] +then +  # No such container +  exit 0 +elif [[ $? == 0 ]] +then +  podman rm ${ID} 2>/dev/null +else +  exit $? +fi +``` + +Cleaning images requires a bit more logic, but it can all be done within the Makefile. To do this easily, I add a label (via the Containerfile) to the image when it's being built. This makes it easy to find all the images with these labels. The most recent of these images can be identified by looking for the `:latest` tag. Finally, all of the images, except those pointing to the image tagged with `:latest`, can be deleted: + + +``` +clean_images: +  $(eval LATEST_IMAGES := $(shell podman images --filter "label=my-project.purpose=app-image" --no-trunc | awk '/latest/ {print $$3}')) +  podman images --filter "label=my-project.purpose=app-image" --no-trunc --quiet | grep -v $(LATEST_IMAGES) | xargs --no-run-if-empty --max-lines=1 podman image rm +``` + +This is the point where using a Makefile for managing container projects really comes together into something cool. To this point, the Makefile includes commands for building and tagging images, testing, pushing images, rolling out a new version, cleaning up a container, cleaning up images, and running a local version. Running each of these with `make image_build && make image_tag && make test`… etc. is considerably easier than running each of the original commands, but it can be simplified even further. + +A Makefile can group commands into a target, allowing multiple targets to run with a single command. For example, my Makefile groups the `image_build` and `image_tag` targets under the `build` target, so I can run both by simply using `make build`. Even better, these targets can be further grouped into the default `make` target, `all`, allowing me to run all of them in order by executing `make all` or more simply, `make`. + +For my project, I want the default `make` action to include everything from building the image to testing, deploying, and cleaning up, so I include the following targets: + + +``` +.PHONY: all +all: build test deploy clean + +.PHONY: build image_build image_tag +build: image_build image_tag + +.PHONY: deploy push rollout +deploy: push rollout + +.PHONY: clean clean_containers clean_images +clean: clean_containers clean_images +``` + +This does everything I've talked about in this article, except the `make run_local` target, in a single command: `make`. + +### Conclusion + +A Makefile is an excellent way to manage a container-based project. By combining all the commands necessary to build, test, and deploy a project into `make` targets within the Makefile, all the "meta" work—everything aside from writing the code—can be simplified and automated. The Makefile can even be used for code-related tasks: running unit tests, maintaining modules, compiling binaries and checksums. While it can't yet write code for you, using a Makefile combined with the benefits of a containerized, cloud-based service can `make` (wink, wink) managing many aspects of a project much easier. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/manage-containers-makefile + +作者:[Chris Collins][a] +选题:[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/clcollins +[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://opensource.com/article/18/8/what-how-makefile +[3]: https://gohugo.io/ +[4]: https://caddyserver.com/ +[5]: https://podman.io From d4b7cbf45a85a611f26c2b952534c97257744586 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 2 Jul 2021 05:03:58 +0800 Subject: [PATCH 274/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210701=20?= =?UTF-8?q?Try=20Dolibarr,=20an=20open=20source=20customer=20relationship?= =?UTF-8?q?=20management=20platform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210701 Try Dolibarr, an open source customer relationship management platform.md --- ...stomer relationship management platform.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20210701 Try Dolibarr, an open source customer relationship management platform.md diff --git a/sources/tech/20210701 Try Dolibarr, an open source customer relationship management platform.md b/sources/tech/20210701 Try Dolibarr, an open source customer relationship management platform.md new file mode 100644 index 0000000000..7549782409 --- /dev/null +++ b/sources/tech/20210701 Try Dolibarr, an open source customer relationship management platform.md @@ -0,0 +1,98 @@ +[#]: subject: (Try Dolibarr, an open source customer relationship management platform) +[#]: via: (https://opensource.com/article/21/7/open-source-dolibarr) +[#]: author: (Pradeep Vijayakumar https://opensource.com/users/deepschennai) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Try Dolibarr, an open source customer relationship management platform +====== +Maintain a customer database and send promotions and offers with +Dolibarr's CRM features. +![a handshake ][1] + +No matter what industry you work in, a key aspect of sustaining your business is keeping your customers. In the customer-relations domain, we call this _customer retention_. + +Whether you run a retail store, restaurant, pub, supermarket, gym, or any other business, you need a reliable way to keep in touch with your customers. After all, they're customers because they like what you do, and, if they've shared their contact information with you, they want to hear more about what you have to offer. Sending them discount coupons, promotions, and special offers benefits your customers and helps ensure they remember your brand and come back to do business with you again. + +So, how can you achieve this? + +I work with [many other people][2] on the [Dolibarr][3] project. It's an open source enterprise resource planning (ERP) and customer relationship management (CRM) software. Dolibarr provides a whole range of ERP features, including point-of-sale (POS), invoicing, stock and inventory management, sales orders, purchase orders, and human resources management. This article focuses on Dolibarr's CRM features, which help you maintain a database of your customers and connect with them to send promotions and offers. + +Even if you've never used a CRM system before, Dolibarr makes it easy to manage your customers and, as long as you put in the effort, enhance customer loyalty. + +### Install Dolibarr CRM + +Dolibarr is open source, so you can [download][4] it and run it locally. If your store's staff includes more than a few people, you probably need a few networked Dolibarr instances. Your systems administrator can set that up for you or, if you're on your own, many hosting service providers offer one-click installers, such as Installatron and Softaculous. + +In the interim, you can try Dolibarr's [online demo][5]. + +### Add customer data + +The first step to getting to know your customers is getting your customers' information into your CRM system. You may not have this data yet, so you'll be starting fresh, or you might have a database or spreadsheet from a system that hasn't been working out for you. Dolibarr imports a wide variety of formats, so it's relatively painless to migrate. + +For the sake of simplicity, I'll assume you're entering new customers. To enter a new customer into your Dolibarr system, navigate to the **Third-parties** menu, and click on the **New Customer** menu item. + +![add a new customer to Dolibarr][6] + +(Pradeep Vijayakumar, [CC BY-SA 4.0][7]) + +All the fields are configurable, and you can add and remove fields if you want. Define a marketing strategy on how you want to connect with your customers. It could be email, SMS, Facebook, Twitter, or another way your customers prefer. Once you have defined the communication channel, you know what information you need to capture for each customer. + +For example, if you've chosen email as your communication method, you know to ask your customers for an email address so that you can put it into the system, along with their name, location, and any other information that may be important to you. + +### Set up an email campaign + +Imagine you're running a weekend promotion with a 20% discount on selected products. Here's how to run an email campaign to announce this offer to all your customers in just a few clicks. + +First, click on the **Tools** tab and the **New Emailing** link. You can use the editor's WYSIWYG capabilities to design attractive emails. + +![Drafting a marketing email with Dolibarr's WYSIWYG Editor][8] + +(Pradeep Vijayakumar, [CC BY-SA 4.0][7]) + +You can use substitution variables to individualize your customers' name, location, gender, etc., as long as you have captured this information in the system (use the **?** tool tip to get the list of substitution variables). Because this email will go out to all the people in your database, you must use the substitution variables to represent any customer-specific data, such as your customers' names. + +Once you've drafted your email, the next step is choosing your customer list. Navigate to the **Recipients** tab and choose **Third parties (by categories)**. + +![Add customers to an email campaign list][9] + +(Pradeep Vijayakumar, [CC BY-SA 4.0][7]) + +All your customers should be included in this email list; you can confirm this by looking at the count displayed next to the list and under **Number of distinct recipients**. + +You can now click on **Validate** and then **Send** to send your email to all of your customers. Dolibarr automatically substitutes the substitution variables with actual customer data. You can also view the delivery reports for the emails that were sent out. + +### Integrations + +Because the marketplace is ever-changing, CRM software needs to keep pace with what customers use for communication. Dolibarr is designed for integration. You can, for instance, manage SMS marketing the same way you manage email marketing. The same is true for WhatsApp and many other targets. + +### Learn more + +All things considered, I think Dolibarr is an indispensable tool for implementing a customer relationship and customer retention strategy for your business. You can learn more about Dolibarr's CRM features by watching [this video on YouTube][10]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-source-dolibarr + +作者:[Pradeep Vijayakumar][a] +选题:[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/deepschennai +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/handshake_business_contract_partner.png?itok=NrAWzIDM (a handshake ) +[2]: https://www.dolibarr.org/who-works-on-the-dolibarr-project-.php +[3]: http://dolibarr.org/ +[4]: https://www.dolibarr.org/downloads.php +[5]: https://www.dolibarr.org/onlinedemo.php +[6]: https://opensource.com/sites/default/files/uploads/dolibarr_add-customer.png (add a new customer to Dolibarr) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/dolibarr_create-email.png (Drafting a marketing email with Dolibarr's WYSIWYG Editor) +[9]: https://opensource.com/sites/default/files/uploads/dolibarr_select-recipients.png (Add customers to an email campaign list) +[10]: https://youtu.be/9ETxdpVsgU0 From ef83db3986366cc29c3c33131aefcba1dc16d8ef Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 2 Jul 2021 05:04:26 +0800 Subject: [PATCH 275/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210701=20?= =?UTF-8?q?KaOS=202021.06=20Brings=20in=20Plasma=205.22,=20JPEG=20XL=20Sup?= =?UTF-8?q?port,=20and=20More?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md --- ... Plasma 5.22, JPEG XL Support, and More.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md diff --git a/sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md b/sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md new file mode 100644 index 0000000000..2be59d622d --- /dev/null +++ b/sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md @@ -0,0 +1,90 @@ +[#]: subject: (KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More) +[#]: via: (https://news.itsfoss.com/kaos-2021-06-release/) +[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More +====== + +[KaOS][1] is an independent Linux/GNU distribution built from scratch. It is uses Qt and [KDE][2], comes baked in with [pacman][3] as its package manager. + +The latest version comes with useful upgrades. Let’s discover what this version has to offer. + +### What’s New? + +![][4] + +KaOS 2021.06 comes with [Plasma 5.22][5], which is the latest and the most stable release currently. Not just limited to stability, it also provides better flexibility and usability. To know more about the desktop environment, you can refer to our article on [Plasma 5.22][6]. + +To give you a quick overview, the most remarkable new feature Plasma 5.22 presents is **Adaptive Transparency. **It means the panel and panel widgets will be pleasantly translucent. However, if there are any maximized windows, they will become entirely opaque. + +Also, **Plasma Wayland** session now supports **Activities. **Thus, you can keep your work separate from other tasks. In other words, you will get the most out of your activity by staying focused on it. + +Along with the desktop environment upgrade, some of the key changes include: + + * Plasma System Monitor now replaces KSysguard. + * No need to adjust a mirror list to install/update KaOS anymore. KaOS will be using Fosshost as the default mirror, which utilizes Fastly CDN to deliver the content from a nearby location without you needing to select a mirror explicitly. + * KWin Wayland now includes the Present Windows effect. + * New applications added include [Maliit][7] virtual keyboard packages. + * Support for [JPEG XL][8], a modern option for the JPEG format. + + + +![][9] + +### Other Improvements + + * The Calamares installer has two new QML modules to provide consistent layout and the interactive map that you notice in the installer should work fine without an active internet connection. + * All of the latest Plasma Desktop packages are built on **Qt 5.15.2+**. These include Frameworks 5.83.0, Plasma 5.22.2, and KDE applications 21.04.2. + * LibreOffice has replaced Calligra as the default office suite. + * Installing on RAID is currently unavailable. + + + +![][10] + +For more details you can refer to the [official announcement][11]. + +### Summing Up + +KaOS is making progress towards providing a complete and focused open-source operating system. They are working on presenting constant enhancements within the scope of KDE. + +[Download KaOS 2021.06][12] + +_What do you think about KaOS with Plasma 5.22? Would you be willing to try it out?_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kaos-2021-06-release/ + +作者:[Omar Maarof][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/omar/ +[b]: https://github.com/lujun9972 +[1]: https://kaosx.us/ +[2]: https://kde.org/ +[3]: https://itsfoss.com/pacman-command/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://kde.org/announcements/plasma/5/5.22.0/ +[6]: https://news.itsfoss.com/kde-plasma-5-22-release/ +[7]: https://maliit.github.io/ +[8]: https://jpeg.org/jpegxl/ +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU3NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[11]: https://kaosx.us/news/2021/kaos06/ +[12]: https://kaosx.us/pages/download/ From 6690f6b00e4efff1729311fff5fffab319ec94a1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 2 Jul 2021 08:45:42 +0800 Subject: [PATCH 276/870] translated --- ...ging and Editing Large Photo Collection.md | 91 ------------------- ...ging and Editing Large Photo Collection.md | 88 ++++++++++++++++++ 2 files changed, 88 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md create mode 100644 translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md diff --git a/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md b/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md deleted file mode 100644 index 8abc8ba509..0000000000 --- a/sources/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: subject: (Fotoxx: An Open Source App for Managing and Editing Large Photo Collection) -[#]: via: (https://itsfoss.com/fotoxx/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Fotoxx: An Open Source App for Managing and Editing Large Photo Collection -====== - -When it comes to [photo management software in Linux][1], Shotwell is perhaps the most famous of them all. No wonder it comes preinstalled in many distributions. - -But if you are looking for a Shotwell like application which is a bit faster, Fotoxx could be a good choice. - -It may not have a modern user interface, but it is fast in handling a large collection of photos. And it matters because indexing and showing thumbnails for thousands of photos could take considerable time and computing resources. - -### Manage photos and edit them in Linux with Fotoxx - -![Fotoxx interface][2] - -As you can see in the screenshot above, it is not the nicest interface. Looks more like an application from around 2010. What it lacks in the visual department, it makes up with features and performance. - -You can import a huge collection of photos, including RAW images. The images stay where they are. They are not copied or moved. They just get indexed in the application. - -You can edit image metadata like tags, geotags, dates, ratings, captions etc. You can search images based on these matadata. - -It also has a map feature that groups and displays images belonging to a certain location (based on geotag data on the images). - -![Map view][3] - -Since it focuses on managing large collection of photos, it has several batch functions to rename, resize, copy/move, convert image format and edit metadata. - -You can select images to create albums and slideshows and all this happens without duplicating the images. Photos can be combined to create 360-degree panoramas. - -Fotoxx also has several editing functions that can be used to retouch the images, add effect (like sketching, painting), trim, rotate and more. - -There is also options for removing red eyes and dust spots from the old, scanned photo prints. - -I can go on with the features list but it won’t end. Its website describes its full capabilities and you should check it out. - -[Fotoxx Feature Overview][4] - -If it interests you, you can watch this video that demonstrates the features of Fotoxx: - -[Subscribe to It’s FOSS YouTube channel][5] - -### Installing Fotoxx on Linux - -Please keep in mind that **Fotoxx developer recommends a strong computer** with 4+ CPU cores, 16+ GB memory for proper functioning. Lesser computers may be slow or may fail to edit large images. - -Fotoxx is available in the repositories of most Linux distributions like Debian, Ubuntu, Fedora and Arch Linux. Just use your distribution’s package manager or software center to search for Fotoxx and install it. - -On Ubuntu and Debian based distributions, you can use the apt command to install it like this: - -``` -sudo apt install fotoxx -``` - -When you first run it, it will ask to search the home directory for images. You may continue with it or limit the search location to selected folders. - -![][6] - -I noticed that despite indexing over 4,700 in a minute or so, it didn’t start displaying the images immediately. I had to **click on Gallery->All Folders and the select the folder(s) and then it showed the images**. So, this is something to keep in mind. - -Fotoxx is an extensive tool and it will take some time in getting used to it and explore all its features. Its webapge lists several examples that you should have a look at. - -[Fotoxx Feature Examples][4] - -As I said earlier, it is not the prettiest application, but it gets the job done with a huge list of features. If you are a photographer or have a large collection of images, you may give Fotoxx a try and see if it fits your need. And when you do that, please do share your experience with it in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/fotoxx/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linux-photo-management-software/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-interface.jpg?resize=800%2C561&ssl=1 -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-geotag-map-view.jpg?resize=800%2C466&ssl=1 -[4]: https://kornelix.net/fotoxx/fotoxx.html -[5]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-indexing.png?resize=800%2C617&ssl=1 diff --git a/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md b/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md new file mode 100644 index 0000000000..c09bc3261b --- /dev/null +++ b/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md @@ -0,0 +1,88 @@ +[#]: subject: (Fotoxx: An Open Source App for Managing and Editing Large Photo Collection) +[#]: via: (https://itsfoss.com/fotoxx/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fotoxx:用于管理和编辑大型照片收藏的开源应用 +====== + +说到 [Linux 中的照片管理软件][1],Shotwell 可能是其中最有名的。难怪它在许多发行版中都预装了。 + +但是,如果你正在寻找一个类似 Shotwell 的应用,而且速度更快,Fotoxx 可能是一个不错的选择。 + +它可能没有一个现代的用户界面,但它在处理大量照片收藏时速度很快。这一点很重要,因为索引和显示成千上万张照片的缩略图可能需要相当多的时间和计算资源。 + +### 用 Fotoxx 在 Linux 中管理照片并编辑它们 + +![Fotoxx interface][2] + +正如你在上面的截图中看到的,它没有漂亮的界面。看起来更像是一个 2010 年左右的应用。它在视觉上的不足,在功能和性能上得到了弥补。 + +你可以导入大量的照片,包括 RAW 图像。这些图片保持原样。它们不会被复制或移动。它们只是在应用中被索引。 + +你可以编辑图像元数据,如标签、地理标签、日期、评级、标题等。你可以根据这些元数据来搜索图片。 + +它还有一个地图功能,可以分组并显示属于某个地点的图片(基于图片上的地理标签数据)。 + +![Map view][3] + +由于它专注于管理大型照片集,它有几个批处理功能,可以重命名、调整大小、复制/移动、转换图像格式和编辑元数据。 + +你可以选择图片来创建相册和幻灯片,所有这些都是在去重图片的情况下进行的。照片可以组合成 360 度的全景图。 + +Fotoxx 还有几个编辑功能,可以用来修饰图片,添加效果(如素描,绘画)、修剪、旋转等。 + +还有一些选项可以去除旧的、扫描过的照片打印件上的红眼和尘斑。 + +我可以继续列举功能清单,但这没有结束。它的网站描述了它的全部功能,你应该去看看。 + +[Fotoxx Feature Overview][4] + +如果你感兴趣,你可以观看这个演示 Fotoxx 功能的视频。 + +### 在 Linux 上安装 Fotoxx + +请记住,**Fotoxx 的开发者建议使用一台强大的计算机**,有 4 个以上的 CPU 核心,16GB 以上的内存,以便正常运行。较小的计算机可能会很慢,或可能无法编辑大型图像。 + +Fotoxx 在大多数 Linux 发行版中都有,如 Debian、Ubuntu、Fedora 和 Arch Linux。只需使用你的发行版的包管理器或软件中心来搜索 Fotoxx 并安装它。 + +在基于 Ubuntu 和 Debian 的发行版上,你可以使用 apt 命令来安装它,像这样: + +``` +sudo apt install fotoxx +``` + +当你第一次运行它时,它会要求搜索主目录中的图像。你可以继续使用它,或者将搜索位置限制在选定的文件夹。 + +![][6] + +我注意到,尽管在一分钟左右的时间内索引了 4700 多张,但它并没有立即开始显示图片。我不得不**点击 Gallery->All Folders,然后选择文件夹,然后它就显示了图片**。所以,这一点要记住。 + +Fotoxx 是一个功能广泛的工具,你需要一些时间来适应它并探索它的所有功能。它的网站列出了几个例子,你应该看看。 + +[Fotoxx Feature Examples][4] + +正如我前面所说,它不是最漂亮的应用,但它大量的功能列表可以完成任务。如果你是一个摄影师或有大量的图片收藏,你可以试试 Fotoxx,看看它是否符合你的需要。当你试过后,请在评论区分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fotoxx/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-photo-management-software/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-interface.jpg?resize=800%2C561&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-geotag-map-view.jpg?resize=800%2C466&ssl=1 +[4]: https://kornelix.net/fotoxx/fotoxx.html +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/fotoxx-indexing.png?resize=800%2C617&ssl=1 From af659f8a206510e1ba44b9ddf83198d5de36a9d4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 2 Jul 2021 08:49:02 +0800 Subject: [PATCH 277/870] translating --- .../20210628 How to parse Bash program configuration files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210628 How to parse Bash program configuration files.md b/sources/tech/20210628 How to parse Bash program configuration files.md index 8051badb1b..b957badf30 100644 --- a/sources/tech/20210628 How to parse Bash program configuration files.md +++ b/sources/tech/20210628 How to parse Bash program configuration files.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/bash-config) [#]: author: (David Both https://opensource.com/users/dboth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 00df4f08e1c1c53ddbc2aa02b942324562d2bb70 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Jul 2021 11:00:52 +0800 Subject: [PATCH 278/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @baddate 感谢您,完成了第一篇翻译贡献(我校对发布晚了,抱歉) --- .../tech/20210614 What is a CI-CD pipeline.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210614 What is a CI-CD pipeline.md b/translated/tech/20210614 What is a CI-CD pipeline.md index 94148e3d1c..7cdcec29b4 100644 --- a/translated/tech/20210614 What is a CI-CD pipeline.md +++ b/translated/tech/20210614 What is a CI-CD pipeline.md @@ -3,37 +3,37 @@ [#]: author: (Will Kelly https://opensource.com/users/willkelly) [#]: collector: (lujun9972) [#]: translator: (baddate) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) CI/CD 管道是什么? ====== -你如何定义持续集成/持续部署管道取决于你组织的要求。 +> 你如何定义持续集成/持续部署管道取决于你组织的要求。 + ![Plumbing tubes in many directions][1] -持续集成/持续部署 (CI/CD) 管道是每个 DevOps 计划的基础。 CI/CD 管道打破了传统的开发孤岛,使开发和运营团队能够在整个软件开发生命周期中进行协作。 +持续集成continuous integration/持续部署continuous deployment(CI/CD)管道是每个 DevOps 计划的基础。 CI/CD 管道打破了传统的开发孤岛,使开发和运营团队能够在整个软件开发生命周期中进行协作。 -更好的是,转向 DevOps 和 CI/CD 管道可以帮助你的组织以更高的速度更安全地[交付软件][2]。 -### Breaking down the CI/CD pipeline +更好的是,转向 DevOps 和 CI/CD 管道可以帮助你的组织以更高的速度更安全地 [交付软件][2]。 + +### 拆解 CI/CD 管道 CI/CD 管道有很多定义,所以我总是建议组织定义自己的 CI/CD 管道版本和其他 DevOps 概念,而不是使用其他人的。开源 CI/CD 工具为你提供构建满足组织要求的 CI/CD 管道的自由和选择。 形成 CI/CD 管道的阶段是将不同的任务子集分组为 _管道阶段_。典型的管道阶段包括: * **构建**:开发人员编译应用程序代码。 - * **测试**:质量保证 (QA) 团队使用自动化测试工具和策略测试应用程序代码。 + * **测试**:质量保证(QA)团队使用自动化测试工具和策略测试应用程序代码。 * **发布**:开发团队将应用程序代码交付到代码库。 * **部署**:DevOps 团队将应用程序代码分阶段投入生产。 - * **安全性和合规性**:QA 团队根据项目要求验证构建。这是组织部署容器扫描工具的阶段,这些工具根据常见漏洞和暴露 (CVE) 检查图像的质量。 + * **安全性和合规性**:QA 团队根据项目要求验证构建。这是组织部署容器扫描工具的阶段,这些工具根据常见漏洞和暴露Common Vulnerabilities and Exposures(CVE)检查容器镜像的质量。 +这些是 CI/CD 管道的标准阶段,但一些组织调整 CI/CD 管道模型以满足他们的要求。例如,为医疗保健市场构建应用程序的组织,具有严格的合规性标准,可以在整个工具链中分发测试、验证和合规性门槛。 +其他示例可能是依赖于具有开源软件(OSS)的复杂软件供应链的组织。商业组件可能会设立一个门槛,开发团队成员可以在其中为 OSS 包生成 [软件物料清单][3]software bill of materials(SBOM),或者外部商业软件供应商必须将 SBOM 作为其合同可交付成果的一部分进行交付。 - -这些是 CI/CD 管道的标准阶段,但一些组织调整 CI/CD 管道模型以满足他们的要求。例如,为医疗保健市场构建应用程序的组织,具有严格的合规性标准,可以在整个工具链中分发测试、验证和合规性门。 - -其他示例可能是依赖于具有开源软件 (OSS) 的复杂软件供应链的组织。商业组件可能会设立一个门槛,开发团队成员可以在其中为 OSS 包生成[软件物料清单][3] (SBOM),或者外部商业软件供应商必须将 SBOM 作为其合同可交付成果的一部分进行交付。 ### CI/CD 管道的障碍 实施 CI/CD 管道会改变团队的流程和文化。尽管许多开发人员愿意接受某些任务和测试的自动化,但人员可能成为采用 CI/CD 的障碍。 @@ -44,15 +44,15 @@ CI/CD 管道有很多定义,所以我总是建议组织定义自己的 CI/CD 随着你在文化、流程和工具中达到更高的 DevOps 成熟度水平,包含 CI/CD 工具链的工具的开源根源为一些激动人心的集成创造了机会。 -分析公司 Forrester 在 2020 年预测,即时学习将加入 CI/CD 管道。如果你考虑一下,会发现这是有道理的。在当前远程工作的时代,甚至对于新员工的远程入职,这更有意义。例如,组织可以将文档 wiki 与内部流程文档集成到其管道中。 +分析公司 Forrester 在 2020 年预测,即时学习just-in-time learning将加入 CI/CD 管道。如果你考虑一下,会发现这是有道理的。在当前远程工作的时代,甚至对于新员工的远程入职,这更有意义。例如,组织可以将文档 wiki 与内部流程文档集成到其管道中。 -更雄心勃勃的组织可以将学习管理系统 (LMS)(例如 [Moodle][4])集成到其 CI/CD 管道中。它可以使用 LMS 发布有关新 DevOps 工具链功能的简短视频,开发人员在加入时或在整个管道中更新工具时需要学习这些功能。 +更雄心勃勃的组织可以将学习管理系统(LMS)(例如 [Moodle][4])集成到其 CI/CD 管道中。它可以使用 LMS 发布有关新 DevOps 工具链功能的简短视频,开发人员在加入时或在整个管道中更新工具时需要学习这些功能。 -一些组织正在将群聊和其他协作工具直接集成到他们的 CI/CD 管道中。聊天平台提供警报并支持团队之间的协作和沟通。将 Mattermost、Rocket.Chat 或其他[企业聊天][5]平台集成到你的 CI/CD 管道中需要预先规划和分析,以确保管道用户不会被警报淹没。 +一些组织正在将群聊和其他协作工具直接集成到他们的 CI/CD 管道中。聊天平台提供警报并支持团队之间的协作和沟通。将 Mattermost、Rocket.Chat 或其他 [企业聊天][5] 平台集成到你的 CI/CD 管道中需要预先规划和分析,以确保管道用户不会被警报淹没。 另一个需要探索的集成机会是将分析和高级报告构建到你的 CI/CD 管道中。这有助于你利用通过管道传输的数据。 -### 最后的想法 +### 总结 CI/CD 管道是 DevOps 的基础。开源使其能够适应并灵活地满足你在 DevOps 之旅中实施的运营变更所产生的新需求。 @@ -68,8 +68,8 @@ via: https://opensource.com/article/21/6/what-cicd-pipeline 作者:[Will Kelly][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/baddate) -校对:[校对者ID](https://github.com/校对者ID) +译者:[baddate](https://github.com/baddate) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8929ee9a10afdd40264f7ab5af6f483b20c358aa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Jul 2021 11:01:44 +0800 Subject: [PATCH 279/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @baddate 本文首发地址:https://linux.cn/article-13541-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/baddate --- .../tech => published}/20210614 What is a CI-CD pipeline.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210614 What is a CI-CD pipeline.md (98%) diff --git a/translated/tech/20210614 What is a CI-CD pipeline.md b/published/20210614 What is a CI-CD pipeline.md similarity index 98% rename from translated/tech/20210614 What is a CI-CD pipeline.md rename to published/20210614 What is a CI-CD pipeline.md index 7cdcec29b4..cb9baa3fb8 100644 --- a/translated/tech/20210614 What is a CI-CD pipeline.md +++ b/published/20210614 What is a CI-CD pipeline.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (baddate) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13541-1.html) CI/CD 管道是什么? ====== From 7a199cff86af0ef08e0b114a3d25aa34b1494414 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Jul 2021 12:43:08 +0800 Subject: [PATCH 280/870] PRF @zepoch --- ...n to solve a charity-s business problem.md | 107 +++++++----------- 1 file changed, 41 insertions(+), 66 deletions(-) diff --git a/translated/tech/20200914 Use Python to solve a charity-s business problem.md b/translated/tech/20200914 Use Python to solve a charity-s business problem.md index f30612f329..b1605927ed 100644 --- a/translated/tech/20200914 Use Python to solve a charity-s business problem.md +++ b/translated/tech/20200914 Use Python to solve a charity-s business problem.md @@ -1,6 +1,6 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Use Python to solve a charity's business problem" @@ -10,19 +10,19 @@ 使用 Python 来解决慈善机构的业务问题 ====== -比较不同的编程语言如何解决同一个问题是一个很有趣的事情,也很有指导意义。接下来,我们就来讲一讲 Python。 -![Python programming language logo with question marks][1] +> 比较不同的编程语言如何解决同一个问题是一个很有趣的事情,也很有指导意义。接下来,我们就来讲一讲如何用 Python 来解决。 -在我这一系列的[第一篇文章][2]里,我描述了这样子的一个问题,如何将一大批的救助物资分为具有相同价值的物品,并将其分发给社区中的困难住户。我也曾写过用不同的编程语言写一些小程序来解决这样子的小问题以及比较这些程序时如何工作的。 +![](https://img.linux.net.cn/data/attachment/album/202107/02/124241fzuzo7kflrf7g77v.jpg) + +在我这一系列的 [第一篇文章][2] 里,我描述了这样子的一个问题,如何将一大批的救助物资分为具有相同价值的物品,并将其分发给社区中的困难住户。我也曾写过用不同的编程语言写一些小程序来解决这样子的小问题以及比较这些程序时如何工作的。 在第一篇文章中,我是使用了 [Groovy][3] 语言来解决问题的。Groovy 在很多方面都与 [Python][4] 很相似,但是在语法上她更像 C 语言和 Java。因此,使用 Python 来创造一个相同的解决方案应该会很有趣且更有意义。 ### 使用 Python 的解决方案 -使用 Java 时,我会声明一个 utility 类来保存元组数据(新的特征记录器将会很好地解决这个问题)。使用 Groovy 时,我就是用了 maps 中的映射,我也将在 Python 使用相同的映射 - -使用一个字典来保存从批发商处批发来的货物: +使用 Java 时,我会声明一个工具类来保存元组数据(新的记录功能将会很好地用于这个需求)。使用 Groovy 时,我就是用了该语言的映射功能,我也将在 Python 使用相同的机制。 +使用一个字典列表来保存从批发商处批发来的货物: ``` packs = [ @@ -43,18 +43,15 @@ packs = [ {'item':'Soap','brand':'Sunny Day','units':6,'price':1794,'quantity':2}] ``` -大米有一包,每包中有 10 袋大米,意大利面条有十包,每包中有一袋意大利面条。上述代码中,变量 `packs` 被设置为 Python 字典列表。这与Groovy的方法非常相似。关于 Groovy 和 Python 之间的区别,有几点需要注意: - - 1. 在 Python 中,无需关键字来定义变量 `packs`,Python 变量初始化时需要设置一个值。 - 2. Python 字典中的词键(例如,`item`, `brand`, `units`, `price`, `quantity`)需要引号来表明它们是字符串;Groovy 假定这些是字符串,但也接受引号。 - 3. 在 Python 中,符号 `{ ... }` 表明一个字典声明; Groovy 使用与列表相同的方括号,但两种情况下的结构都必须具有键值对。 - +大米有一包,每包中有 10 袋大米,意大利面条有十包,每包中有一袋意大利面条。上述代码中,变量 `packs` 被设置为 Python 字典列表。这与 Groovy 的方法非常相似。关于 Groovy 和 Python 之间的区别,有几点需要注意: + 1. 在 Python 中,无需关键字来定义变量 `packs`,Python 变量初始化时需要设置一个值。 + 2. Python 字典中的词键(例如,`item`、`brand`、`units`、`price`、 `quantity`)需要引号来表明它们是字符串;Groovy 假定这些是字符串,但也接受引号。 + 3. 在 Python 中,符号 `{ ... }` 表明一个字典声明; Groovy 使用与列表相同的方括号,但两种情况下的结构都必须具有键值对。 当然,表中的价格不是以美元计算的。 -接下来,打开散装包。 例如,打开大米的单个散装包装,将产出 10 单位大米; 也就是说,产出的单位总数是`单位 * 数量`。 Groovy 脚本使用一个名为 `collectMany` 的方便的函数,该函数可用于展平列表列表。 据我所知,Python 没有类似的东西,所以使用两个列表推导式来产生相同的结果: - +接下来,打开散装包。例如,打开大米的单个散装包装,将产出 10 单元大米; 也就是说,产出的单元总数是 `units * quantity`。 Groovy 脚本使用一个名为 `collectMany` 的方便的函数,该函数可用于展平列表列表。 据我所知,Python 没有类似的东西,所以使用两个列表推导式来产生相同的结果: ``` units = [[{'item':pack['item'],'brand':pack['brand'], @@ -65,74 +62,52 @@ units = [x for sublist in units for x in sublist] 第一个列表可理解为(分配给单元)构建字典列表列表。 第二个将其“扁平化”为字典列表。 请注意,Python 和 Groovy 都提供了一个 `*` 运算符,它接受左侧的列表和右侧的数字 `N`,并复制列表 `N` 次。 -后一步是将这些单位的大米之类的重新包装到 hamper 中以进行分发。 就像在 Groovy 版本中一样,您需要更具体地了解理想的 hamper 值,当您只剩下几个单位时,您最好不要过度限制,即可以做一些随机分配: +最后一步是将这些单元的大米之类的重新包装到篮子(`hamper`)中以进行分发。 就像在 Groovy 版本中一样,你需要更具体地了解理想的篮子数,当你只剩下几个单元时,你最好不要过度限制,即可以做一些随机分配: - -```python +``` valueIdeal = 5000 valueMax = valueIdeal * 1.1 ``` -很好! 重新包装包裹。 +很好! 重新打包篮子。 - -```python +``` import random -hamperNumber = 0 # [1] -while len(units) > 0: # [2] +hamperNumber = 0 # 导入 Python 的随机数生成器工具并初始化篮子数 +while len(units) > 0: # 只要有更多可用的单元,这个 `while` 循环就会将单元重新分配到篮子中: hamperNumber += 1 hamper = [] value = 0 - canAdd = True # [2.1] - while canAdd: # [2.2] - u = random.randint(0,len(units)-1) # [2.2.1] - canAdd = False # [2.2.2] - o = 0 # [2.2.3] - while o < len(units): # [2.2.4] + canAdd = True # 增加篮子编号,得到一个新的空篮子(单元的列表),并将其值设为 0; 开始假设你可以向篮子中添加更多物品。 + while canAdd: # 这个 `while` 循环将尽可能多地向篮子添加单元(Groovy 代码使用了 `for` 循环,但 Python 的 `for` 循环期望迭代某些东西,而 Groovy 则是为更传统的 C 形式的 `for` 循环形式): + u = random.randint(0,len(units)-1) # 获取一个介于 0 和剩余单元数减 1 之间的随机数。 + canAdd = False # 假设你找不到更多要添加的单元。 + o = 0 # 创建一个变量,用于从你正在寻找要放入篮子中的物品的起点的偏移量。 + while o < len(units): # 从随机选择的索引开始,这个 `while` 循环将尝试找到一个可以添加到篮子的单元(再次注意,Python `for` 循环可能不适合这里,因为列表的长度将在迭代中中发生变化)。 uo = (u + o) % len(units) unit = units[uo] - unitPrice = unit['price'] # [2.2.4.1] - if len(units) < 3 or not (unit in hamper) and (value + unitPrice) < valueMax: - # [2.2.4.2] + unitPrice = unit['price'] # 找出要查看的单元(随机起点+偏移量)并获得其价格。 + if len(units) < 3 or not (unit in hamper) and (value + unitPrice) < valueMax: + # 如果只剩下几个,或者添加单元后篮子的价值不太高,你可以将此单元添加到篮子中。 hamper.append(unit) value += unitPrice - units.pop(u) # [2.2.4.3] - canAdd = len(units) > 0 - break # [2.2.4.4] - o += 1 # [2.2.4.5] - # [2.2.5] + units.pop(u) # 将单元添加到篮子中,按单价增加 篮子数,从可用单元列表中删除该单元。 + canAdd = len(units) > 0 + break # 只要还有剩余单元,你就可以添加更多单元,因此可以跳出此循环继续寻找。 + o += 1 # 增加偏移量。 + # 在退出这个 `while` 循环时,如果你检查了所有剩余的单元并且找不到单元可以添加到篮子中,那么篮子就完成了搜索; 否则,你找到了一个,可以继续寻找更多。 print('') print('Hamper',hamperNumber,'value',value) for item in hamper: - print('%-25s%-25s%7.2f' % (item['item'],item['brand'],item['price'])) # [2.3] - print('Remaining units',len(units)) # [2.4] + print('%-25s%-25s%7.2f' % (item['item'],item['brand'],item['price'])) # 打印出篮子的内容。 + print('Remaining units',len(units)) # 打印出剩余的单元信息。 ``` -一些澄清,上面注释中括号中的数字(例如,_[1]_)对应于以下澄清: - - * 1\. 导入 Python 的随机数生成器工具并初始化 hampers 数。 - * 2\. 只要有更多可用的单元,这个`while` 循环就会将单元重新分配到 hampers 中: - * 2.1 增加 hamper 编号,得到一个新的空hamper(单位列表),并将其值设为0; 开始假设您可以向 hamper 中添加更多物品。 - * 2.2 这个 `while` 循环将尽可能多地向 Hamper 添加单元(Groovy 代码使用了 `for` 循环,但 Python 的 `for` 循环期望迭代某些东西,而 Groovy 则是为更传统的 C 形式的 `for` 循环形式): - * 2.2.1 获取一个介于 0 和剩余单位数减 1 之间的随机数。 - * 2.2.2 假设您找不到更多要添加的单位。 - * 2.2.3 创建一个变量,用于从您正在寻找要放入 hamper 中的物品的起点的偏移量。 - * 2.2.4 从随机选择的索引开始,这个 `while` 循环将尝试找到一个可以添加到 hamper 的单元(再次注意,Python `for` 循环可能不适合这里,因为列表的长度将在迭代中中发生变化)。 - * 2.2.4.1 找出要查看的单位(随机起点+偏移量)并获得其价格。 - * 2.2.4.2 如果只剩下几个,或者添加单位后篮子的价值不太高,您可以将此单位添加到 Hamper 中。 - * 2.2.4.3 将单位添加到 Hamper 中,按单价增加 Hamper 价值,从可用单位列表中删除该单位。 - * 2.2.4.4 只要还有剩余单位,您就可以添加更多单位,因此可以跳出此循环继续寻找。 - * 2.2.4.5 增加偏移量,。 - * 2.2.5 在退出这个 `while` 循环时,如果你检查了所有剩余的单元并且找不到单元可以添加到 hamper 中,那么 hamper 就完成了搜索; 否则,您找到了一个,可以继续寻找更多。 - * 2.3 打印出 hamper 的内容。 - * 2.4 打印出剩余的单位信息。 - - +一些澄清如上面的注释。 运行此代码时,输出看起来与 Groovy 程序的输出非常相似: - -```python +``` Hamper 1 value 5304.0 UHT milk Atlantic 760.00 Tomato sauce Best Family 190.00 @@ -162,7 +137,7 @@ Spaghetti Best Family 327.00 Lentils Southern Style 1189.00 Remaining units 135 -… +... Hamper 21 value 5145.0 Tomato sauce Best Family 190.00 @@ -182,17 +157,17 @@ Rice Best Family 565.00 Remaining units 0 ``` -最后一个 hamper 在内容和价值上有所简化。 +最后一个篮子在内容和价值上有所简化。 ### 结论 乍一看,这个程序的 Python 和 Groovy 版本之间没有太大区别。 两者都有一组相似的结构,这使得处理列表和字典非常简单。 两者都不需要很多“样板代码”或其他“繁杂”操作。 -此外,使用 Groovy 时,向 Hamper 中添加单元还是一件比较繁琐的事情。 您需要在单位列表中随机选择一个位置,然后从该位置开始,遍历列表,直到找到一个价格允许的且包含它的单位,或者直到您用完列表为止。 当只剩下几件物品时,您需要将它们扔到最后一个 Hamper 里。 +此外,使用 Groovy 时,向篮子中添加单元还是一件比较繁琐的事情。 你需要在单元列表中随机选择一个位置,然后从该位置开始,遍历列表,直到找到一个价格允许的且包含它的单元,或者直到你用完列表为止。 当只剩下几件物品时,你需要将它们扔到最后一个篮子里。 另一个值得一提的问题是:这不是一种特别有效的方法。 从列表中删除元素、极其多的重复表达式还有一些其它的问题使得这不太适合解决这种大数据重新分配问题。 尽管如此,它仍然在我的老机器上运行。 -如果你觉得我在这段代码中使用 `while` 循环并改变其中的数据感到不舒服,您可能希望我让它更有用一些。 我想不出一种方法不使用 Python 中的 map 和 reduce 函数,并结合随机选择的单元进行重新打包。 你可以吗? +如果你觉得我在这段代码中使用 `while` 循环并改变其中的数据感到不舒服,你可能希望我让它更有用一些。 我想不出一种方法不使用 Python 中的 map 和 reduce 函数,并结合随机选择的单元进行重新打包。 你可以吗? 在下一篇文章中,我将使用 Java 重新执行此操作,以了解 Groovy 和 Python 的工作量减少了多少,未来的文章将介绍 Julia 和 Go。 @@ -203,7 +178,7 @@ via: https://opensource.com/article/20/9/solve-problem-python 作者:[Chris Hermansen][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 38ecc66778bdd34de381781f81dbbdbd8f278d20 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Jul 2021 12:44:11 +0800 Subject: [PATCH 281/870] PUB @zepoch https://linux.cn/article-13542-1.html --- ...200914 Use Python to solve a charity-s business problem.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200914 Use Python to solve a charity-s business problem.md (99%) diff --git a/translated/tech/20200914 Use Python to solve a charity-s business problem.md b/published/20200914 Use Python to solve a charity-s business problem.md similarity index 99% rename from translated/tech/20200914 Use Python to solve a charity-s business problem.md rename to published/20200914 Use Python to solve a charity-s business problem.md index b1605927ed..b2a6f4379c 100644 --- a/translated/tech/20200914 Use Python to solve a charity-s business problem.md +++ b/published/20200914 Use Python to solve a charity-s business problem.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13542-1.html" [#]: subject: "Use Python to solve a charity's business problem" [#]: via: "https://opensource.com/article/20/9/solve-problem-python" [#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" From 46d1cd7c93075e0e8cc8592bd1b4184a027426af Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Jul 2021 12:47:36 +0800 Subject: [PATCH 282/870] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202106?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...6 requirements of cloud-native software.md | 0 ... How key Python projects are maintained.md | 0 ...gists on careers in tech for minorities.md | 0 ...using systemd as a troubleshooting tool.md | 0 ...Why we open sourced our Python platform.md | 0 ...e a long-term boost for 5G availability.md | 0 ...01026 7 Git tricks that changed my life.md | 0 ...de to the syntax of C-- method pointers.md | 0 ...nce bottlenecks using open source tools.md | 0 ...nux PC hardware-using open source tools.md | 0 ...ther improvements Python 3.5 brought us.md | 0 ...en source tools to set up a private VPN.md | 0 ...tial characteristics of successful APIs.md | 0 ... method for filesystems from Python 3.6.md | 0 ...8 Manage your Raspberry Pi with Cockpit.md | 0 ...generators with this Python 3.7 feature.md | 0 ...h this positional trick from Python 3.8.md | 0 ...ed decorators and improved dictionaries.md | 0 ...0210523 3 reasons to learn Java in 2021.md | 0 ...on Ubuntu for Remote Desktop Connection.md | 0 ...ith CircuitPython and open source tools.md | 0 ...Command Not Found- Here-s How to Fix it.md | 0 ... you need to know about Quarkus in 2021.md | 0 .../20210601 Get started with FreeDOS.md | 0 ...d Web Browser Inspired by Emacs and Vim.md | 0 ...ux Terminal With This Nifty Little Tool.md | 0 ...oses the Gap With SUSE Linux Enterprise.md | 0 ...xplore the Kubernetes ecosystem in 2021.md | 0 ...Install Code Blocks IDE on Ubuntu Linux.md | 0 ...oard Shortcuts to Increase Productivity.md | 0 .../20210608 How FreeDOS boots.md | 0 ...ss-Platform Open-Source Subtitle Editor.md | 0 ...Based Text Editor for Power Linux Users.md | 0 ...210610 Use cpulimit to free up your CPU.md | 0 ...source for your home automation project.md | 0 ...stand) the Fantastic Man Pages in Linux.md | 0 ...Source Software Can Save Online Privacy.md | 0 ...15 Build a static website with Eleventy.md | 0 ...new open source tool for data analytics.md | 0 ...our Linux Computer Screen to Any Device.md | 0 ...chines to Kubernetes with this new tool.md | 0 ...ghting Effects and Other Configurations.md | 0 ...618 Systemd Timers for Scheduling Tasks.md | 0 ... Switching to Linux Makes Sense in 2021.md | 0 ...ly Useful BitTorrent Application by KDE.md | 0 .../20210622 Replace du with dust on Linux.md | 0 ...210623 Python 3.10 beta in Fedora Linux.md | 0 .../20210623 Replace find with fd on Linux.md | 0 .../20210614 What is a CI-CD pipeline.md | 82 ------------------- 49 files changed, 82 deletions(-) rename published/{ => 202106}/20200108 6 requirements of cloud-native software.md (100%) rename published/{ => 202106}/20200206 How key Python projects are maintained.md (100%) rename published/{ => 202106}/20200228 4 technologists on careers in tech for minorities.md (100%) rename published/{ => 202106}/20200511 Start using systemd as a troubleshooting tool.md (100%) rename published/{ => 202106}/20200731 Why we open sourced our Python platform.md (100%) rename published/{ => 202106}/20200930 FCC auctions should be a long-term boost for 5G availability.md (100%) rename published/{ => 202106}/20201026 7 Git tricks that changed my life.md (100%) rename published/{ => 202106}/20210222 A friendly guide to the syntax of C-- method pointers.md (100%) rename published/{ => 202106}/20210325 Identify Linux performance bottlenecks using open source tools.md (100%) rename published/{ => 202106}/20210427 Upgrade your Linux PC hardware-using open source tools.md (100%) rename published/{ => 202106}/20210517 Convenient matrices and other improvements Python 3.5 brought us.md (100%) rename published/{ => 202106}/20210517 Use open source tools to set up a private VPN.md (100%) rename published/{ => 202106}/20210518 4 essential characteristics of successful APIs.md (100%) rename published/{ => 202106}/20210518 Are you using this magic method for filesystems from Python 3.6.md (100%) rename published/{ => 202106}/20210518 Manage your Raspberry Pi with Cockpit.md (100%) rename published/{ => 202106}/20210519 Slice infinite generators with this Python 3.7 feature.md (100%) rename published/{ => 202106}/20210520 Make your API better with this positional trick from Python 3.8.md (100%) rename published/{ => 202106}/20210521 How Python 3.9 fixed decorators and improved dictionaries.md (100%) rename published/{ => 202106}/20210523 3 reasons to learn Java in 2021.md (100%) rename published/{ => 202106}/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md (100%) rename published/{ => 202106}/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md (100%) rename published/{ => 202106}/20210526 Make Command Not Found- Here-s How to Fix it.md (100%) rename published/{ => 202106}/20210528 What you need to know about Quarkus in 2021.md (100%) rename published/{ => 202106}/20210601 Get started with FreeDOS.md (100%) rename published/{ => 202106}/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md (100%) rename published/{ => 202106}/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md (100%) rename published/{ => 202106}/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md (100%) rename published/{ => 202106}/20210603 Explore the Kubernetes ecosystem in 2021.md (100%) rename published/{ => 202106}/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md (100%) rename published/{ => 202106}/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md (100%) rename published/{ => 202106}/20210608 How FreeDOS boots.md (100%) rename published/{ => 202106}/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md (100%) rename published/{ => 202106}/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md (100%) rename published/{ => 202106}/20210610 Use cpulimit to free up your CPU.md (100%) rename published/{ => 202106}/20210610 Why choose open source for your home automation project.md (100%) rename published/{ => 202106}/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md (100%) rename published/{ => 202106}/20210613 How Free - Open Source Software Can Save Online Privacy.md (100%) rename published/{ => 202106}/20210615 Build a static website with Eleventy.md (100%) rename published/{ => 202106}/20210615 Try this new open source tool for data analytics.md (100%) rename published/{ => 202106}/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md (100%) rename published/{ => 202106}/20210616 Migrate virtual machines to Kubernetes with this new tool.md (100%) rename published/{ => 202106}/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md (100%) rename published/{ => 202106}/20210618 Systemd Timers for Scheduling Tasks.md (100%) rename published/{ => 202106}/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md (100%) rename published/{ => 202106}/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md (100%) rename published/{ => 202106}/20210622 Replace du with dust on Linux.md (100%) rename published/{ => 202106}/20210623 Python 3.10 beta in Fedora Linux.md (100%) rename published/{ => 202106}/20210623 Replace find with fd on Linux.md (100%) delete mode 100644 published/20210614 What is a CI-CD pipeline.md diff --git a/published/20200108 6 requirements of cloud-native software.md b/published/202106/20200108 6 requirements of cloud-native software.md similarity index 100% rename from published/20200108 6 requirements of cloud-native software.md rename to published/202106/20200108 6 requirements of cloud-native software.md diff --git a/published/20200206 How key Python projects are maintained.md b/published/202106/20200206 How key Python projects are maintained.md similarity index 100% rename from published/20200206 How key Python projects are maintained.md rename to published/202106/20200206 How key Python projects are maintained.md diff --git a/published/20200228 4 technologists on careers in tech for minorities.md b/published/202106/20200228 4 technologists on careers in tech for minorities.md similarity index 100% rename from published/20200228 4 technologists on careers in tech for minorities.md rename to published/202106/20200228 4 technologists on careers in tech for minorities.md diff --git a/published/20200511 Start using systemd as a troubleshooting tool.md b/published/202106/20200511 Start using systemd as a troubleshooting tool.md similarity index 100% rename from published/20200511 Start using systemd as a troubleshooting tool.md rename to published/202106/20200511 Start using systemd as a troubleshooting tool.md diff --git a/published/20200731 Why we open sourced our Python platform.md b/published/202106/20200731 Why we open sourced our Python platform.md similarity index 100% rename from published/20200731 Why we open sourced our Python platform.md rename to published/202106/20200731 Why we open sourced our Python platform.md diff --git a/published/20200930 FCC auctions should be a long-term boost for 5G availability.md b/published/202106/20200930 FCC auctions should be a long-term boost for 5G availability.md similarity index 100% rename from published/20200930 FCC auctions should be a long-term boost for 5G availability.md rename to published/202106/20200930 FCC auctions should be a long-term boost for 5G availability.md diff --git a/published/20201026 7 Git tricks that changed my life.md b/published/202106/20201026 7 Git tricks that changed my life.md similarity index 100% rename from published/20201026 7 Git tricks that changed my life.md rename to published/202106/20201026 7 Git tricks that changed my life.md diff --git a/published/20210222 A friendly guide to the syntax of C-- method pointers.md b/published/202106/20210222 A friendly guide to the syntax of C-- method pointers.md similarity index 100% rename from published/20210222 A friendly guide to the syntax of C-- method pointers.md rename to published/202106/20210222 A friendly guide to the syntax of C-- method pointers.md diff --git a/published/20210325 Identify Linux performance bottlenecks using open source tools.md b/published/202106/20210325 Identify Linux performance bottlenecks using open source tools.md similarity index 100% rename from published/20210325 Identify Linux performance bottlenecks using open source tools.md rename to published/202106/20210325 Identify Linux performance bottlenecks using open source tools.md diff --git a/published/20210427 Upgrade your Linux PC hardware-using open source tools.md b/published/202106/20210427 Upgrade your Linux PC hardware-using open source tools.md similarity index 100% rename from published/20210427 Upgrade your Linux PC hardware-using open source tools.md rename to published/202106/20210427 Upgrade your Linux PC hardware-using open source tools.md diff --git a/published/20210517 Convenient matrices and other improvements Python 3.5 brought us.md b/published/202106/20210517 Convenient matrices and other improvements Python 3.5 brought us.md similarity index 100% rename from published/20210517 Convenient matrices and other improvements Python 3.5 brought us.md rename to published/202106/20210517 Convenient matrices and other improvements Python 3.5 brought us.md diff --git a/published/20210517 Use open source tools to set up a private VPN.md b/published/202106/20210517 Use open source tools to set up a private VPN.md similarity index 100% rename from published/20210517 Use open source tools to set up a private VPN.md rename to published/202106/20210517 Use open source tools to set up a private VPN.md diff --git a/published/20210518 4 essential characteristics of successful APIs.md b/published/202106/20210518 4 essential characteristics of successful APIs.md similarity index 100% rename from published/20210518 4 essential characteristics of successful APIs.md rename to published/202106/20210518 4 essential characteristics of successful APIs.md diff --git a/published/20210518 Are you using this magic method for filesystems from Python 3.6.md b/published/202106/20210518 Are you using this magic method for filesystems from Python 3.6.md similarity index 100% rename from published/20210518 Are you using this magic method for filesystems from Python 3.6.md rename to published/202106/20210518 Are you using this magic method for filesystems from Python 3.6.md diff --git a/published/20210518 Manage your Raspberry Pi with Cockpit.md b/published/202106/20210518 Manage your Raspberry Pi with Cockpit.md similarity index 100% rename from published/20210518 Manage your Raspberry Pi with Cockpit.md rename to published/202106/20210518 Manage your Raspberry Pi with Cockpit.md diff --git a/published/20210519 Slice infinite generators with this Python 3.7 feature.md b/published/202106/20210519 Slice infinite generators with this Python 3.7 feature.md similarity index 100% rename from published/20210519 Slice infinite generators with this Python 3.7 feature.md rename to published/202106/20210519 Slice infinite generators with this Python 3.7 feature.md diff --git a/published/20210520 Make your API better with this positional trick from Python 3.8.md b/published/202106/20210520 Make your API better with this positional trick from Python 3.8.md similarity index 100% rename from published/20210520 Make your API better with this positional trick from Python 3.8.md rename to published/202106/20210520 Make your API better with this positional trick from Python 3.8.md diff --git a/published/20210521 How Python 3.9 fixed decorators and improved dictionaries.md b/published/202106/20210521 How Python 3.9 fixed decorators and improved dictionaries.md similarity index 100% rename from published/20210521 How Python 3.9 fixed decorators and improved dictionaries.md rename to published/202106/20210521 How Python 3.9 fixed decorators and improved dictionaries.md diff --git a/published/20210523 3 reasons to learn Java in 2021.md b/published/202106/20210523 3 reasons to learn Java in 2021.md similarity index 100% rename from published/20210523 3 reasons to learn Java in 2021.md rename to published/202106/20210523 3 reasons to learn Java in 2021.md diff --git a/published/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md b/published/202106/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md similarity index 100% rename from published/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md rename to published/202106/20210524 How to Install and Use XRDP on Ubuntu for Remote Desktop Connection.md diff --git a/published/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md b/published/202106/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md similarity index 100% rename from published/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md rename to published/202106/20210526 How I monitor my greenhouse with CircuitPython and open source tools.md diff --git a/published/20210526 Make Command Not Found- Here-s How to Fix it.md b/published/202106/20210526 Make Command Not Found- Here-s How to Fix it.md similarity index 100% rename from published/20210526 Make Command Not Found- Here-s How to Fix it.md rename to published/202106/20210526 Make Command Not Found- Here-s How to Fix it.md diff --git a/published/20210528 What you need to know about Quarkus in 2021.md b/published/202106/20210528 What you need to know about Quarkus in 2021.md similarity index 100% rename from published/20210528 What you need to know about Quarkus in 2021.md rename to published/202106/20210528 What you need to know about Quarkus in 2021.md diff --git a/published/20210601 Get started with FreeDOS.md b/published/202106/20210601 Get started with FreeDOS.md similarity index 100% rename from published/20210601 Get started with FreeDOS.md rename to published/202106/20210601 Get started with FreeDOS.md diff --git a/published/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md b/published/202106/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md similarity index 100% rename from published/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md rename to published/202106/20210601 Nyxt Browser is a Keyboard-oriented Web Browser Inspired by Emacs and Vim.md diff --git a/published/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md b/published/202106/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md similarity index 100% rename from published/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md rename to published/202106/20210602 Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool.md diff --git a/published/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md b/published/202106/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md similarity index 100% rename from published/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md rename to published/202106/20210602 openSUSE Leap 15.3 Release Finally Closes the Gap With SUSE Linux Enterprise.md diff --git a/published/20210603 Explore the Kubernetes ecosystem in 2021.md b/published/202106/20210603 Explore the Kubernetes ecosystem in 2021.md similarity index 100% rename from published/20210603 Explore the Kubernetes ecosystem in 2021.md rename to published/202106/20210603 Explore the Kubernetes ecosystem in 2021.md diff --git a/published/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md b/published/202106/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md similarity index 100% rename from published/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md rename to published/202106/20210603 How to Install Code Blocks IDE on Ubuntu Linux.md diff --git a/published/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md b/published/202106/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md similarity index 100% rename from published/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md rename to published/202106/20210605 15 Useful Visual Studio Code Keyboard Shortcuts to Increase Productivity.md diff --git a/published/20210608 How FreeDOS boots.md b/published/202106/20210608 How FreeDOS boots.md similarity index 100% rename from published/20210608 How FreeDOS boots.md rename to published/202106/20210608 How FreeDOS boots.md diff --git a/published/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md b/published/202106/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md similarity index 100% rename from published/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md rename to published/202106/20210608 Subtitld- A Cross-Platform Open-Source Subtitle Editor.md diff --git a/published/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md b/published/202106/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md similarity index 100% rename from published/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md rename to published/202106/20210609 Helix- A Terminal Based Text Editor for Power Linux Users.md diff --git a/published/20210610 Use cpulimit to free up your CPU.md b/published/202106/20210610 Use cpulimit to free up your CPU.md similarity index 100% rename from published/20210610 Use cpulimit to free up your CPU.md rename to published/202106/20210610 Use cpulimit to free up your CPU.md diff --git a/published/20210610 Why choose open source for your home automation project.md b/published/202106/20210610 Why choose open source for your home automation project.md similarity index 100% rename from published/20210610 Why choose open source for your home automation project.md rename to published/202106/20210610 Why choose open source for your home automation project.md diff --git a/published/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md b/published/202106/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md similarity index 100% rename from published/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md rename to published/202106/20210611 RTFM- How to Read (and Understand) the Fantastic Man Pages in Linux.md diff --git a/published/20210613 How Free - Open Source Software Can Save Online Privacy.md b/published/202106/20210613 How Free - Open Source Software Can Save Online Privacy.md similarity index 100% rename from published/20210613 How Free - Open Source Software Can Save Online Privacy.md rename to published/202106/20210613 How Free - Open Source Software Can Save Online Privacy.md diff --git a/published/20210615 Build a static website with Eleventy.md b/published/202106/20210615 Build a static website with Eleventy.md similarity index 100% rename from published/20210615 Build a static website with Eleventy.md rename to published/202106/20210615 Build a static website with Eleventy.md diff --git a/published/20210615 Try this new open source tool for data analytics.md b/published/202106/20210615 Try this new open source tool for data analytics.md similarity index 100% rename from published/20210615 Try this new open source tool for data analytics.md rename to published/202106/20210615 Try this new open source tool for data analytics.md diff --git a/published/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md b/published/202106/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md similarity index 100% rename from published/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md rename to published/202106/20210615 With Deskreen, You Can Mirror or Stream Your Linux Computer Screen to Any Device.md diff --git a/published/20210616 Migrate virtual machines to Kubernetes with this new tool.md b/published/202106/20210616 Migrate virtual machines to Kubernetes with this new tool.md similarity index 100% rename from published/20210616 Migrate virtual machines to Kubernetes with this new tool.md rename to published/202106/20210616 Migrate virtual machines to Kubernetes with this new tool.md diff --git a/published/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md b/published/202106/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md similarity index 100% rename from published/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md rename to published/202106/20210618 How to Set Up Razer Devices on Linux for Lighting Effects and Other Configurations.md diff --git a/published/20210618 Systemd Timers for Scheduling Tasks.md b/published/202106/20210618 Systemd Timers for Scheduling Tasks.md similarity index 100% rename from published/20210618 Systemd Timers for Scheduling Tasks.md rename to published/202106/20210618 Systemd Timers for Scheduling Tasks.md diff --git a/published/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md b/published/202106/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md similarity index 100% rename from published/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md rename to published/202106/20210619 Here-s Why Switching to Linux Makes Sense in 2021.md diff --git a/published/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md b/published/202106/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md similarity index 100% rename from published/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md rename to published/202106/20210622 KTorrent- An Incredibly Useful BitTorrent Application by KDE.md diff --git a/published/20210622 Replace du with dust on Linux.md b/published/202106/20210622 Replace du with dust on Linux.md similarity index 100% rename from published/20210622 Replace du with dust on Linux.md rename to published/202106/20210622 Replace du with dust on Linux.md diff --git a/published/20210623 Python 3.10 beta in Fedora Linux.md b/published/202106/20210623 Python 3.10 beta in Fedora Linux.md similarity index 100% rename from published/20210623 Python 3.10 beta in Fedora Linux.md rename to published/202106/20210623 Python 3.10 beta in Fedora Linux.md diff --git a/published/20210623 Replace find with fd on Linux.md b/published/202106/20210623 Replace find with fd on Linux.md similarity index 100% rename from published/20210623 Replace find with fd on Linux.md rename to published/202106/20210623 Replace find with fd on Linux.md diff --git a/published/20210614 What is a CI-CD pipeline.md b/published/20210614 What is a CI-CD pipeline.md deleted file mode 100644 index cb9baa3fb8..0000000000 --- a/published/20210614 What is a CI-CD pipeline.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: subject: (What is a CI/CD pipeline?) -[#]: via: (https://opensource.com/article/21/6/what-cicd-pipeline) -[#]: author: (Will Kelly https://opensource.com/users/willkelly) -[#]: collector: (lujun9972) -[#]: translator: (baddate) -[#]: reviewer: (wxy) -[#]: publisher: (wxy) -[#]: url: (https://linux.cn/article-13541-1.html) - -CI/CD 管道是什么? -====== - -> 你如何定义持续集成/持续部署管道取决于你组织的要求。 - -![Plumbing tubes in many directions][1] - -持续集成continuous integration/持续部署continuous deployment(CI/CD)管道是每个 DevOps 计划的基础。 CI/CD 管道打破了传统的开发孤岛,使开发和运营团队能够在整个软件开发生命周期中进行协作。 - -更好的是,转向 DevOps 和 CI/CD 管道可以帮助你的组织以更高的速度更安全地 [交付软件][2]。 - -### 拆解 CI/CD 管道 - -CI/CD 管道有很多定义,所以我总是建议组织定义自己的 CI/CD 管道版本和其他 DevOps 概念,而不是使用其他人的。开源 CI/CD 工具为你提供构建满足组织要求的 CI/CD 管道的自由和选择。 - -形成 CI/CD 管道的阶段是将不同的任务子集分组为 _管道阶段_。典型的管道阶段包括: - - * **构建**:开发人员编译应用程序代码。 - * **测试**:质量保证(QA)团队使用自动化测试工具和策略测试应用程序代码。 - * **发布**:开发团队将应用程序代码交付到代码库。 - * **部署**:DevOps 团队将应用程序代码分阶段投入生产。 - * **安全性和合规性**:QA 团队根据项目要求验证构建。这是组织部署容器扫描工具的阶段,这些工具根据常见漏洞和暴露Common Vulnerabilities and Exposures(CVE)检查容器镜像的质量。 - -这些是 CI/CD 管道的标准阶段,但一些组织调整 CI/CD 管道模型以满足他们的要求。例如,为医疗保健市场构建应用程序的组织,具有严格的合规性标准,可以在整个工具链中分发测试、验证和合规性门槛。 - -其他示例可能是依赖于具有开源软件(OSS)的复杂软件供应链的组织。商业组件可能会设立一个门槛,开发团队成员可以在其中为 OSS 包生成 [软件物料清单][3]software bill of materials(SBOM),或者外部商业软件供应商必须将 SBOM 作为其合同可交付成果的一部分进行交付。 - -### CI/CD 管道的障碍 - -实施 CI/CD 管道会改变团队的流程和文化。尽管许多开发人员愿意接受某些任务和测试的自动化,但人员可能成为采用 CI/CD 的障碍。 - -从瀑布式流程转向 CI/CD 可能会动摇某些组织中基本的和隐含的权力结构。由于 CI/CD 管道提高了软件交付速度,旧手动流程的“守门人”可能会受到这种变化的威胁。 - -### 整合机会 - -随着你在文化、流程和工具中达到更高的 DevOps 成熟度水平,包含 CI/CD 工具链的工具的开源根源为一些激动人心的集成创造了机会。 - -分析公司 Forrester 在 2020 年预测,即时学习just-in-time learning将加入 CI/CD 管道。如果你考虑一下,会发现这是有道理的。在当前远程工作的时代,甚至对于新员工的远程入职,这更有意义。例如,组织可以将文档 wiki 与内部流程文档集成到其管道中。 - -更雄心勃勃的组织可以将学习管理系统(LMS)(例如 [Moodle][4])集成到其 CI/CD 管道中。它可以使用 LMS 发布有关新 DevOps 工具链功能的简短视频,开发人员在加入时或在整个管道中更新工具时需要学习这些功能。 - -一些组织正在将群聊和其他协作工具直接集成到他们的 CI/CD 管道中。聊天平台提供警报并支持团队之间的协作和沟通。将 Mattermost、Rocket.Chat 或其他 [企业聊天][5] 平台集成到你的 CI/CD 管道中需要预先规划和分析,以确保管道用户不会被警报淹没。 - -另一个需要探索的集成机会是将分析和高级报告构建到你的 CI/CD 管道中。这有助于你利用通过管道传输的数据。 - -### 总结 - -CI/CD 管道是 DevOps 的基础。开源使其能够适应并灵活地满足你在 DevOps 之旅中实施的运营变更所产生的新需求。 - -我希望看到对统一 DevOps 平台趋势的开源响应,在这种趋势中,组织寻求端到端的 CI/CD 解决方案。这种解决方案的要素就在那里。毕竟,GitLab 和 GitHub 将他们的平台追溯到开源根源。 - -最后,不要忘记每一个成功的 CI/CD 工具链背后的教育和外展。记录你的工具链和相关流程将改善开发人员入职和持续的 DevOps 团队培训。 - -你和你的组织如何定义你的 CI/CD 工具链?请在评论中分享你的反馈。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/what-cicd-pipeline - -作者:[Will Kelly][a] -选题:[lujun9972][b] -译者:[baddate](https://github.com/baddate) -校对:[wxy](https://github.com/wxy) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/willkelly -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) -[2]: https://techbeacon.com/devops/5-reasons-why-cicd-vital-your-organizations-value-stream -[3]: https://www.ntia.gov/SBOM -[4]: https://moodle.org/ -[5]: https://opensource.com/alternatives/slack From 6bb116f4e6f4622851f6633d8a39511a0faf475b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 2 Jul 2021 12:59:32 +0800 Subject: [PATCH 283/870] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=AF=AF=E5=88=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210614 What is a CI-CD pipeline.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 published/20210614 What is a CI-CD pipeline.md diff --git a/published/20210614 What is a CI-CD pipeline.md b/published/20210614 What is a CI-CD pipeline.md new file mode 100644 index 0000000000..e6bd3657fa --- /dev/null +++ b/published/20210614 What is a CI-CD pipeline.md @@ -0,0 +1,82 @@ +[#]: subject: (What is a CI/CD pipeline?) +[#]: via: (https://opensource.com/article/21/6/what-cicd-pipeline) +[#]: author: (Will Kelly https://opensource.com/users/willkelly) +[#]: collector: (lujun9972) +[#]: translator: (baddate) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13541-1.html) + +CI/CD 管道是什么? +====== + +> 你如何定义持续集成/持续部署管道取决于你组织的要求。 + +![Plumbing tubes in many directions][1] + +持续集成continuous integration/持续部署continuous deployment(CI/CD)管道是每个 DevOps 计划的基础。 CI/CD 管道打破了传统的开发孤岛,使开发和运营团队能够在整个软件开发生命周期中进行协作。 + +更好的是,转向 DevOps 和 CI/CD 管道可以帮助你的组织以更高的速度更安全地 [交付软件][2]。 + +### 拆解 CI/CD 管道 + +CI/CD 管道有很多定义,所以我总是建议组织定义自己的 CI/CD 管道版本和其他 DevOps 概念,而不是使用其他人的。开源 CI/CD 工具为你提供构建满足组织要求的 CI/CD 管道的自由和选择。 + +形成 CI/CD 管道的阶段是将不同的任务子集分组为 _管道阶段_。典型的管道阶段包括: + + * **构建**:开发人员编译应用程序代码。 + * **测试**:质量保证(QA)团队使用自动化测试工具和策略测试应用程序代码。 + * **发布**:开发团队将应用程序代码交付到代码库。 + * **部署**:DevOps 团队将应用程序代码分阶段投入生产。 + * **安全性和合规性**:QA 团队根据项目要求验证构建。这是组织部署容器扫描工具的阶段,这些工具根据常见漏洞和暴露Common Vulnerabilities and Exposures(CVE)检查容器镜像的质量。 + +这些是 CI/CD 管道的标准阶段,但一些组织调整 CI/CD 管道模型以满足他们的要求。例如,为医疗保健市场构建应用程序的组织,具有严格的合规性标准,可以在整个工具链中分发测试、验证和合规性门槛。 + +其他示例可能是依赖于具有开源软件(OSS)的复杂软件供应链的组织。商业组件可能会设立一个门槛,开发团队成员可以在其中为 OSS 包生成 [软件物料清单][3]software bill of materials(SBOM),或者外部商业软件供应商必须将 SBOM 作为其合同可交付成果的一部分进行交付。 + +### CI/CD 管道的障碍 + +实施 CI/CD 管道会改变团队的流程和文化。尽管许多开发人员愿意接受某些任务和测试的自动化,但人员可能成为采用 CI/CD 的障碍。 + +从瀑布式流程转向 CI/CD 可能会动摇某些组织中基本的和隐含的权力结构。由于 CI/CD 管道提高了软件交付速度,旧手动流程的“守门人”可能会受到这种变化的威胁。 + +### 整合机会 + +随着你在文化、流程和工具中达到更高的 DevOps 成熟度水平,包含 CI/CD 工具链的工具的开源根源为一些激动人心的集成创造了机会。 + +分析公司 Forrester 在 2020 年预测,即时学习just-in-time learning将加入 CI/CD 管道。如果你考虑一下,会发现这是有道理的。在当前远程工作的时代,甚至对于新员工的远程入职,这更有意义。例如,组织可以将文档 wiki 与内部流程文档集成到其管道中。 + +更雄心勃勃的组织可以将学习管理系统(LMS)(例如 [Moodle][4])集成到其 CI/CD 管道中。它可以使用 LMS 发布有关新 DevOps 工具链功能的简短视频,开发人员在加入时或在整个管道中更新工具时需要学习这些功能。 + +一些组织正在将群聊和其他协作工具直接集成到他们的 CI/CD 管道中。聊天平台提供警报并支持团队之间的协作和沟通。将 Mattermost、Rocket.Chat 或其他 [企业聊天][5] 平台集成到你的 CI/CD 管道中需要预先规划和分析,以确保管道用户不会被警报淹没。 + +另一个需要探索的集成机会是将分析和高级报告构建到你的 CI/CD 管道中。这有助于你利用通过管道传输的数据。 + +### 总结 + +CI/CD 管道是 DevOps 的基础。开源使其能够适应并灵活地满足你在 DevOps 之旅中实施的运营变更所产生的新需求。 + +我希望看到对统一 DevOps 平台趋势的开源响应,在这种趋势中,组织寻求端到端的 CI/CD 解决方案。这种解决方案的要素就在那里。毕竟,GitLab 和 GitHub 将他们的平台追溯到开源根源。 + +最后,不要忘记每一个成功的 CI/CD 工具链背后的教育和外展。记录你的工具链和相关流程将改善开发人员入职和持续的 DevOps 团队培训。 + +你和你的组织如何定义你的 CI/CD 工具链?请在评论中分享你的反馈。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/what-cicd-pipeline + +作者:[Will Kelly][a] +选题:[lujun9972][b] +译者:[baddate](https://github.com/baddate) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) +[2]: https://techbeacon.com/devops/5-reasons-why-cicd-vital-your-organizations-value-stream +[3]: https://www.ntia.gov/SBOM +[4]: https://moodle.org/ +[5]: https://opensource.com/alternatives/slack \ No newline at end of file From 7da06573954bf3298e52457dcd6570b683736277 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Fri, 2 Jul 2021 19:08:04 +0800 Subject: [PATCH 284/870] Update 20210624 View statistics about your code with Tokei.md --- .../tech/20210624 View statistics about your code with Tokei.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210624 View statistics about your code with Tokei.md b/sources/tech/20210624 View statistics about your code with Tokei.md index 539c97920d..67549bebda 100644 --- a/sources/tech/20210624 View statistics about your code with Tokei.md +++ b/sources/tech/20210624 View statistics about your code with Tokei.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/tokei) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c2153e3bdf25a81c59fd4b63b6be5cc2ced5f2a1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 3 Jul 2021 05:03:11 +0800 Subject: [PATCH 285/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210702=20?= =?UTF-8?q?Run=20Prometheus=20at=20home=20in=20a=20container?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210702 Run Prometheus at home in a container.md --- ...2 Run Prometheus at home in a container.md | 330 ++++++++++++++++++ 1 file changed, 330 insertions(+) create mode 100644 sources/tech/20210702 Run Prometheus at home in a container.md diff --git a/sources/tech/20210702 Run Prometheus at home in a container.md b/sources/tech/20210702 Run Prometheus at home in a container.md new file mode 100644 index 0000000000..13b19b7d5e --- /dev/null +++ b/sources/tech/20210702 Run Prometheus at home in a container.md @@ -0,0 +1,330 @@ +[#]: subject: (Run Prometheus at home in a container) +[#]: via: (https://opensource.com/article/21/7/run-prometheus-home-container) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Run Prometheus at home in a container +====== +Keep tabs on your home network by setting up a Prometheus container +image. +![A graph of a wave.][1] + +[Prometheus][2] is an open source monitoring and alerting system that provides insight into the state and history of a computer, application, or cluster by storing defined metrics in a time-series database. It provides a powerful query language, PromQL, to help you explore and understand the data it stores. Prometheus also includes an Alertmanager that makes it easy to trigger notifications when the metrics you collect cross certain thresholds. Most importantly, Prometheus is flexible and easy to set up to monitor all kinds of metrics from whatever system you need to track. + +As site reliability engineers (SREs) on Red Hat's OpenShift Dedicated team, we use Prometheus as a central component of our monitoring and alerting for clusters and other aspects of our infrastructure. Using Prometheus, we can predict when problems may occur by following trends in the data we collect from nodes in the cluster and services we run. We can trigger alerts when certain thresholds are crossed or events occur. As a data source for [Grafana][3], Prometheus enables us to produce graphs of data over time to see how a cluster or service is behaving. + +Prometheus is a strategic piece of infrastructure for us at work, but it is also useful to me at home. Luckily, it's not only powerful and useful but also easy to set up in a home environment, with or without Kubernetes, OpenShift, containers, etc. This article shows you how to build a Prometheus container image and set up the Prometheus Node Exporter to collect data from home computers. It also explains some basic PromQL, the query language Prometheus uses to return data and create graphs. + +### Build a Prometheus container image + +The Prometheus project publishes its own container image, `quay.io/prometheus/prometheus`. However, I enjoy building my own for home projects and prefer to use the [Red Hat Universal Base Image][4] family for my projects. These images are freely available for anyone to use. I prefer the [Universal Base Image 8 Minimal][5] (ubi8-minimal) image based on Red Hat Enterprise Linux 8. The ubi8-minimal image is a smaller version of the normal ubi8 images. It is larger than the official Prometheus container image's ultra-sparse Busybox image, but since I use the Universal Base Image for other projects, that layer is a wash in terms of disk space for me. (If two images use the same layer, that layer is shared between them and doesn't use any additional disk space after the first image.) + +My Containerfile for this project is split into a [multi-stage build][6]. The first, `builder`, installs a few tools via DNF packages to make it easier to download and extract a Prometheus release from GitHub, then downloads a specific release for whatever architecture I need (either ARM64 for my [Raspberry Pi Kubernetes cluster][7] or AMD64 for running locally on my laptop), and extracts it: + + +``` +# The first stage build, downloading Prometheus from Github and extracting it + +FROM registry.access.redhat.com/ubi8/ubi-minimal as builder +LABEL maintainer "Chris Collins <[collins.christopher@gmail.com][8]>" + +# Install packages needed to download and extract the Prometheus release +RUN microdnf install -y gzip jq tar + +# Replace the ARCH for different architecture versions, eg: "linux-arm64.tar.tz" +ENV PROMETHEUS_ARCH="linux-amd64.tar.gz" + +# Replace "tag/<tag_name>" with "latest" to build whatever the latest tag is at the time +ENV PROMETHEUS_VERSION="tags/v2.27.0" +ENV PROMETHEUS="" + +# The checksum file for the Prometheus project is "sha256sums.txt" +ENV SUMFILE="sha256sums.txt" + +RUN mkdir /prometheus +WORKDIR /prometheus + +# Download the checksum +RUN /bin/sh -c "curl -sSLf $(curl -sSLf ${PROMETHEUS} -o - | jq -r '.assets[] | select(.name|test(env.SUMFILE)) | .browser_download_url') -o ${SUMFILE}" + +# Download the binary tarball +RUN /bin/sh -c "curl -sSLf -O $(curl -sSLf ${PROMETHEUS} -o - | jq -r '.assets[] | select(.name|test(env.PROMETHEUS_ARCH)) |.browser_download_url')" + +# Check the binary and checksum match +RUN sha256sum --check --ignore-missing ${SUMFILE} + +# Extract the tarball +RUN tar --extract --gunzip --no-same-owner --strip-components=1 --directory /prometheus --file *.tar.gz +``` + +The second stage of the multi-stage build copies the extracted Prometheus files to a pristine ubi8-minimal image (there's no need for the extra tools from the first image to take up space in the final image) and links the binaries into the `$PATH`: + + +``` +# The second build stage, creating the final image +FROM registry.access.redhat.com/ubi8/ubi-minimal +LABEL maintainer "Chris Collins <[collins.christopher@gmail.com][8]>" + +# Get the binary from the builder image +COPY --from=builder /prometheus /prometheus + +WORKDIR /prometheus + +# Link the binary files into the $PATH +RUN ln prometheus /bin/ +RUN ln promtool /bin/ + +# Validate prometheus binary +RUN prometheus --version + +# Add dynamic target (file_sd_config) support to the prometheus config +# +RUN echo -e "\n\ +  - job_name: 'dynamic'\n\ +    file_sd_configs:\n\ +    - files:\n\ +      - data/sd_config*.yaml\n\ +      - data/sd_config*.json\n\ +      refresh_interval: 30s\ +" >> prometheus.yml + +EXPOSE 9090 +VOLUME ["/prometheus/data"] + +ENTRYPOINT ["prometheus"] +CMD ["--config.file=prometheus.yml"] +``` + +Build the image: + + +``` +# Build the Prometheus image from the Containerfile +podman build --format docker -f Containerfile -t prometheus +``` + +I'm using [Podman][9] as my container engine at home, but you can use Docker if you prefer. Just replace the `podman` command with `docker` above. + +After building this image, you're ready to run Prometheus locally and start collecting some metrics. + +### Running Prometheus + + +``` +# This only needs to be done once +# This directory will store the metrics Prometheus collects so they persist between container restarts +mkdir data + +# Run Prometheus locally, using the ./data directory for persistent data storage +# Note that the image name, prometheus:latest, will be whatever image you are using +podman run --mount=type=bind,src=$(pwd)/data,dst=/prometheus/data,relabel=shared --publish=127.0.0.1:9090:9090 --detach prometheus:latest +``` + +The Podman command above runs Prometheus in a container, mounting the Data directory into the container and allowing you to access the Prometheus web interface with a browser only from the machine running the container. If you want to access Prometheus from other hosts, replace `--publish=127.0.0.1:9090:9090` in the command with `--publish=9090:9090`. + +Once the container is running, you should be able to access Prometheus at `http://127.0.0.1:9000/graph`. There is not much to look at yet, though. By default, Prometheus knows only to check itself (the Prometheus service) for metrics related to itself. For example, navigating to the link above and entering a query for `prometheus_http_requests_total` will show how many HTTP requests Prometheus has received (most likely, just those you have made so far). + +![number of HTTP requests Prometheus received][10] + +(Chris Collins, [CC BY-SA 4.0][11]) + +This query can also be referenced as a URL: + + +``` +`http://127.0.0.1:9090/graph?g0.expr=prometheus_http_requests_total&g0.tab=1&g0.stacked=0&g0.range_input=1h` +``` + +Clicking it should take you to the same results. By default, Prometheus scrapes for metrics every 15 seconds, so these metrics will update over time (assuming they have changed since the last scrape). + +You can also graph the data over time by entering a query (as above) and clicking the **Graph** tab. + +![Graphing data over time][12] + +(Chris Collins, [CC BY-SA 4.0][11]) + +Graphs can also be referenced as a URL: + + +``` +`http://127.0.0.1:9090/graph?g0.expr=prometheus_http_requests_total&g0.tab=0&g0.stacked=0&g0.range_input=1h` +``` + +This internal data is not helpful by itself, though. So let's add some useful metrics. + +### Add some data + +Prometheus—the project—publishes a program called [Node Exporter][13] for exporting useful metrics about the computer or node it is running on. You can use Node Exporter to quickly create a metrics target for your local machine, exporting data such as memory utilization and CPU consumption for Prometheus to track. + +In the interest of brevity, just run the `quay.io/prometheus/node-exporter:latest` container image published by the Projetheus project to get started. + +Run the following with Podman or your container engine of choice: + + +``` +`podman run --net="host" --pid="host" --mount=type=bind,src=/,dst=/host,ro=true,bind-propagation=rslave --detach quay.io/prometheus/node-exporter:latest --path.rootfs=/host` +``` + +This will start a Node Exporter on your local machine and begin publishing metrics on port 9100. You can see which metrics are being generated by opening `http://127.0.0.1:9100/metrics` in your browser. It will look similar to this: + + +``` +# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles. +# TYPE go_gc_duration_seconds summary +go_gc_duration_seconds{quantile="0"} 0.000176569 +go_gc_duration_seconds{quantile="0.25"} 0.000176569 +go_gc_duration_seconds{quantile="0.5"} 0.000220407 +go_gc_duration_seconds{quantile="0.75"} 0.000220407 +go_gc_duration_seconds{quantile="1"} 0.000220407 +go_gc_duration_seconds_sum 0.000396976 +go_gc_duration_seconds_count 2 +``` + +Now you just need to tell Prometheus that the data is there. Prometheus uses a set of rules called [scrape_configs][14] that are defined in its configuration file, `prometheus.yml`, to decide what hosts to check for metrics and how often to check them. The scrape_configs can be set statically in the Prometheus config file, but that doesn't make Prometheus very flexible. Every time you add a new target, you would have to update the config file, stop Prometheus manually, and restart it. Prometheus has a better way, called [file-based service discovery][15]. + +In the Containerfile above, there's a stanza adding a dynamic file-based service discovery configuration to the Prometheus config file: + + +``` +RUN echo -e "\n\ +  - job_name: 'dynamic'\n\ +    file_sd_configs:\n\ +    - files:\n\ +      - data/sd_config*.yaml\n\ +      - data/sd_config*.json\n\ +      refresh_interval: 30s\ +" >> prometheus.ym +``` + +This tells Prometheus to look for files named `sd_config*.yaml` or `sd_config*.json` in the Data directory that are mounted into the running container and to check every 30 seconds to see if there are more config files or if they have changed at all. Using files with that naming convention, you can tell Prometheus to start looking for other targets, such as the Node Exporter you started earlier. + +Create a file named `sd_config_01.json` in the Data directory with the following contents, replacing `your_hosts_ip_address` with the IP address of the host running the Node Exporter: + + +``` +`[{"labels": {"job": "node"}, "targets": ["your_hosts_ip_address:9100"]}` +``` + +Check `http://127.0.0.1:9090/targets` in Prometheus; you should see Prometheus monitoring itself (inside the container) and the target you added for the host with the Node Exporter. Click on the link for this new target to see the raw data Prometheus has scraped. It should look familiar: + + +``` +# NOTE: Truncated for brevity +# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles. +# TYPE go_gc_duration_seconds summary +go_gc_duration_seconds{quantile="0"} 3.6547e-05 +go_gc_duration_seconds{quantile="0.25"} 0.000107517 +go_gc_duration_seconds{quantile="0.5"} 0.00017582 +go_gc_duration_seconds{quantile="0.75"} 0.000503352 +go_gc_duration_seconds{quantile="1"} 0.008072206 +go_gc_duration_seconds_sum 0.029700021 +go_gc_duration_seconds_count 55 +``` + +This is the same data the Node Exporter is exporting: + + +``` +`http://127.0.0.1:9090/graph?g0.expr=rate(node_network_receive_bytes_total%7B%7D%5B5m%5D)&g0.tab=0&g0.stacked=0&g0.range_input=15m` +``` + +With this information, you can create your own rules and instrument your own applications to provide metrics for Prometheus to consume. + +### A light introduction to PromQL + +PromQL is Prometheus' query language and a powerful way to aggregate the time-series data stored in Prometheus. Prometheus shows you the output of a query as the raw result, or it can be displayed as a graph showing the trend of the data over time, like the `node_network_receive_bytes_total` example above. PromQL can be daunting to get into, and this article will not dive into a full tutorial on how to use it, but I will cover some basics. + +To get started, pull up the query interface for Prometheus: + + +``` +`http://127.0.0.1:9090/graph` +``` + +Look at the `node_network_receive_bytes_total` metrics in this example. Enter that string into the query field, and press Enter to display all the collected network metrics from the computer on which the Node Exporter is running. (Note that Prometheus provides an autocomplete feature, making it easy to explore the metrics it collects.) You may see several results, each with labels that have been applied to the data sent by the Node Exporter: + +![Network data received][16] + +(Chris Collins, [CC BY-SA 4.0][11]) + +Looking at the image above, you can see eight interfaces, each labeled by the device name (e.g., `{device="ensp12s0u1"}`), the instance they were collected from (in this case, all the same node), and the job node that was assigned in the `sd_config_01.json`. To the right of these is the latest raw metric data for this device. In the case of the `ensp12s0u1` device, it's received `4007938272` bytes of data over the interface since Prometheus started tracking the data. + +Note: The "job" label is useful in defining what kind of data is being collected. For example, "node" for metrics sent by the Node Exporter, or "cluster" for Kubernetes cluster data, or perhaps an application name for a specific service you may be monitoring. + +Click on the **Graph** tab, and you can see the metrics for these devices graphed over time (one hour by default). The time period can be adjusted using the `- +` toggle on the left. Historical data is displayed and graphed along with the current value. This provides valuable insight into how the data changes over time: + +![Graph of data changing over time][17] + +(Chris Collins, [CC BY-SA 4.0][11]) + +You can further refine the displayed data using the labels. This graph displays all the interfaces reported by the Node Exporter, but what if you are interested just in the wireless device? By changing the query to include the label `node_network_receive_bytes_total{device="wlp2s0"}`, you can evaluate just the data matching that label. Prometheus automatically adjusts the scale to a more human-readable one after the other devices' data is removed: + +![Graph of network data for one label][18] + +(Chris Collins, [CC BY-SA 4.0][11]) + +This data is helpful in itself, but Prometheus' PromQL also has several query functions that can be applied to the data to provide more information. For example, look again at the `rate()` function. The `rate()` function "calculates the per-second average rate of increase of the time series in the range vector." That's a fancy way of saying "shows how quickly the data grew." + +Looking at the graph for the wireless device above, you can see a slight curve—a slightly more vertical increase—in the line graph right around 19:00 hours. It doesn't look like much on its own but, using the `rate()` function, it is possible to calculate just how much larger the growth spike was around that timeframe. Using the query `rate(node_network_receive_bytes_total{device="wlp2s0"}[15m])` shows the rate that the received bytes increased for the wireless device, averaged per second over a 15-minute period: + +![Graph showing rate data increased][19] + +(Chris Collins, [CC BY-SA 4.0][11]) + +It is much more evident that around 19:00 hours, the wireless device received almost three times as much traffic for a brief period. + +PromQL can do much more than this. Using the `predict_linear()` function, Prometheus can make an educated guess about when a certain threshold will be crossed. Using the same wireless `network_receive_bytes` data, you can predict where the value will be over the next four hours based on the data from the previous four hours (or any combination you might be interested in). Try querying `predict_linear(node_network_receive_bytes_total{device="wlp2s0"}[4h], 4 * 3600)`. + +The important bit of the `predict_linear()` function above is `[4h], 4 * 3600`. The `[4h]` tells Prometheus to use the past four hours as a dataset and then to predict where the value will be over the next four hours (or `4 * 3600` since there are 3,600 seconds in an hour). Using the example above, Prometheus predicts that the wireless device will have received almost 95MB of data about an hour from now (your data will vary): + +![Graph showing predicted data that will be received][20] + +(Chris Collins, [CC BY-SA 4.0][11]) + +You can start to see how this might be useful, especially in an operations capacity. Kubernetes exports node disk usage metrics and includes a built-in alert using `predict_linear()` to estimate when a disk might run out of space. You can use all of these queries in conjunction with Prometheus' Alertmanager to notify you when various conditions are met—from network utilization being too high to disk space _probably_ running out in the next four hours and more. Alertmanager is another useful topic that I'll cover in a future article. + +### Conclusion + +Prometheus consumes metrics by scraping endpoints for specially formatted data. Data is tracked and can be queried for point-in-time info or graphed to show changes over time. Even better, Prometheus supports, out of the box, alerting rules that can hook in with your infrastructure in a variety of ways. Prometheus can also be used as a data source for other projects, like Grafana, to provide more sophisticated graphing information. + +In the real world at work, we use Prometheus to track metrics and provide alert thresholds that page us when clusters are unhealthy, and we use Grafana to make dashboards of data we need to view regularly. We export node data to track our nodes and instrument our operators to track their performance and health. Prometheus is the backbone of all of it. + +If you have been interested in Prometheus, keep your eyes peeled for follow-up articles. You'll learn about alerting when certain conditions are met, using Prometheus' built-in Alertmanager and integrations with it, more complicated PromQL, and how to instrument your own application and integrate it with Prometheus. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/run-prometheus-home-container + +作者:[Chris Collins][a] +选题:[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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_wavegraph.png?itok=z4pXCf_c (A graph of a wave.) +[2]: https://prometheus.io/ +[3]: https://grafana.com/ +[4]: https://www.redhat.com/en/blog/introducing-red-hat-universal-base-image +[5]: https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8 +[6]: https://docs.docker.com/develop/develop-images/multistage-build/ +[7]: https://opensource.com/article/20/6/kubernetes-raspberry-pi +[8]: mailto:collins.christopher@gmail.com +[9]: https://docs.podman.io/en/latest/Introduction.html +[10]: https://opensource.com/sites/default/files/uploads/prometheus_http_requests_total_query.png (number of HTTP requests Prometheus received) +[11]: https://creativecommons.org/licenses/by-sa/4.0/ +[12]: https://opensource.com/sites/default/files/uploads/prometheus_http_requests_total.png (Graphing data over time) +[13]: https://prometheus.io/docs/guides/node-exporter/ +[14]: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config +[15]: https://prometheus.io/docs/guides/file-sd/ +[16]: https://opensource.com/sites/default/files/uploads/node_network_receive_bytes_total.png (Network data received) +[17]: https://opensource.com/sites/default/files/uploads/node_network_receive_bytes_total_graph_1.png (Graph of data changing over time) +[18]: https://opensource.com/sites/default/files/uploads/node_network_receive_bytes_total_wireless_graph.png (Graph of network data for one label) +[19]: https://opensource.com/sites/default/files/uploads/rate_network_receive_bytes_total_wireless_graph.png (Graph showing rate data increased) +[20]: https://opensource.com/sites/default/files/uploads/predict_linear_node_network_receive_bytes_total_wireless_graph.png (Graph showing predicted data that will be received) From 9b4e55897f95ccaddfc06b810dfaf3869ce136dc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 3 Jul 2021 05:03:30 +0800 Subject: [PATCH 286/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210702=20?= =?UTF-8?q?Bind=20a=20cloud=20event=20to=20Knative?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210702 Bind a cloud event to Knative.md --- .../20210702 Bind a cloud event to Knative.md | 333 ++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 sources/tech/20210702 Bind a cloud event to Knative.md diff --git a/sources/tech/20210702 Bind a cloud event to Knative.md b/sources/tech/20210702 Bind a cloud event to Knative.md new file mode 100644 index 0000000000..46f218a2e5 --- /dev/null +++ b/sources/tech/20210702 Bind a cloud event to Knative.md @@ -0,0 +1,333 @@ +[#]: subject: (Bind a cloud event to Knative) +[#]: via: (https://opensource.com/article/21/7/cloudevents-bind-java-knative) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Bind a cloud event to Knative +====== +CloudEvents provides a common format to describe events and increase +interoperability. +![woman on laptop sitting at the window][1] + +Events have become an essential piece of modern reactive systems. Indeed, events can be used to communicate from one service to another, trigger out-of-band processing, or send a payload to a service like Kafka. The problem is that event publishers may express event messages in any number of different ways, regardless of content. For example, some messages are payloads in JSON format to serialize and deserialize messages by application. Other applications use binary formats such as [Avro][2] and [Protobuf][3] to transport payloads with metadata. This is an issue when building an event-driven architecture that aims to easily integrate external systems and reduce the complexity of message transmission. + +[CloudEvents][4] is an open specification providing a common format to describe events and increase interoperability. Many cloud providers and middleware stacks, including [Knative][5], [Kogito][6], [Debezium][7], and [Quarkus][8] have adopted this format after the release of CloudEvents 1.0. Furthermore, developers need to decouple relationships between event producers and consumers in serverless architectures. [Knative Eventing][9] is consistent with the CloudEvents specification, providing common formats for creating, parsing, sending, and receiving events in any programming language. Knative Eventing also enables developers to late-bind event sources and event consumers. For example, a cloud event using JSON might look like this: + + +``` +{ +    "specversion" : "1.0", (1) +    "id" : "11111", (2) +    "source" : "", (3) +    "type" : "knative-events-binding", (4) +    "subject" : "cloudevents", (5) +    "time" : "2021-06-04T16:00:00Z", (6) +    "datacontenttype" : "application/json", (7) +    "data" : "{\"message\": \"Knative Events\"}", (8) +} +``` + +In the above code: +(1) Which version of the CloudEvents specification to use +(2) The ID field for a specific event; combining the `id` and the `source` provides a unique identifier +(3) The Uniform Resource Identifier (URI) identifies the event source in terms of the context where it happened or the application that emitted it +(4) The type of event with any random words +(5) Additional details about the event (optional) +(6) The event creation time (optional) +(7) The content type of the data attribute (optional) +(8) The business data for the specific event + +Here is a quick example of how developers can enable a CloudEvents bind with Knative and the [Quarkus Funqy extension][10]. + +### 1\. Create a Quarkus Knative event Maven project + +Generate a Quarkus project (e.g., `quarkus-serverless-cloudevent`) to create a simple function with Funqy Knative events binding extensions: + + +``` +$ mvn io.quarkus:quarkus-maven-plugin:2.0.0.CR3:create \ +       -DprojectGroupId=org.acme \ +       -DprojectArtifactId=quarkus-serverless-cloudevent \ +       -Dextensions="funqy-knative-events" \ +       -DclassName="org.acme.getting.started.GreetingResource" +``` + +### 2\. Run the serverless event function locally + +Open the `CloudEventGreeting.java` file in the `src/main/java/org/acme/getting/started/funqy/cloudevent` directory. The `@funq` annotation enables the `myCloudEventGreeting` method to map the input data to the cloud event message automatically: + + +``` +private static final Logger log = Logger.getLogger(CloudEventGreeting.class); + +    @Funq +    public void myCloudEventGreeting(Person input) { +        log.info("Hello " + input.getName()); +    } +} +``` + +Run the function via Quarkus Dev Mode: + + +``` +`$ ./mvnw quarkus:dev` +``` + +The output should look like this: + + +``` +__  ____  __  _____   ___  __ ____  ______ + --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ + -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   +\--\\___\\_\\____/_/ |_/_/|_/_/|_|\\____/___/   +INFO  [io.quarkus] (Quarkus Main Thread) quarkus-serverless-cloudevent 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.0.0.CR3) started in 1.546s. Listening on: +INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated. +INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, funqy-knative-events, smallrye-context-propagation] + +\-- +Tests paused, press [r] to resume +``` + +**Note**: Quarkus 2.x provides a continuous testing feature so that you can keep testing your code when you add or update code by pressing `r` in the terminal. + +Now the CloudEvents function is running in your local development environment. So, send a cloud event to the function over the HTTP protocol: + + +``` +curl -v \ +  -H "Content-Type:application/json" \ +  -H "Ce-Id:1" \ +  -H "Ce-Source:cloud-event-example" \ +  -H "Ce-Type:myCloudEventGreeting" \ +  -H "Ce-Specversion:1.0" \ +  -d "{\"name\": \"Daniel\"}" +``` + +The output should end with: + + +``` +`HTTP/1.1 204 No Content` +``` + +Go back to the terminal, and the log should look like this: + + +``` +`INFO [org.acm.get.sta.fun.clo.CloudEventGreeting] (executor-thread-0) Hello Daniel` +``` + +### 3\. Deploy the serverless event function to Knative + +Add a `container-image-docker` extension to the Quarkus Funqy project. The extension enables you to build a container image based on the serverless event function and then push it to an external container registry (e.g., [Docker Hub][11], [Quay.io][12]): + + +``` +`$ ./mvnw quarkus:add-extension -Dextensions="container-image-docker"` +``` + +Open the `application.properties` file in the `src/main/resources/` directory. Then add the following variables to configure Knative and Kubernetes resources (make sure to replace `yourAccountName` with your container registry's account name, e.g., your username in Docker Hub): + + +``` +quarkus.container-image.build=true +quarkus.container-image.push=true +quarkus.container-image.builder=docker +quarkus.container-image.image=docker.io/yourAccountName/funqy-knative-events-codestart +``` + +Run the following command to containerize the function and then push it to the Docker Hub container registry automatically: + + +``` +`$ ./mvnw clean package` +``` + +The output should end with `BUILD SUCCESS`. + +Open the `funqy-service.yaml` file in the `src/main/k8s` directory. Then replace `yourAccountName` with your account information in the Docker Hub registry: + + +``` +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: +  name: funqy-knative-events-codestart +spec: +  template: +    metadata: +      name: funqy-knative-events-codestart-v1 +      annotations: +        autoscaling.knative.dev/target: "1" +    spec: +      containers: +        - image: docker.io/yourAccountName/funqy-knative-events-codestart +``` + +Assuming the container image pushed successfully, create the Knative service based on the event function using the following `kubectl` command-line tool (be sure to log into the Kubernetes cluster and change the namespace where you want to create the Knative service): + + +``` +`$ kubectl create -f src/main/k8s/funqy-service.yaml` +``` + +The output should look like this: + + +``` +`service.serving.knative.dev/funqy-knative-events-codestart created` +``` + +Create a default broker to subscribe to the event function. Use the [kn][13] Knative Serving command-line tool: + + +``` +`$ kn broker create default` +``` + +Open the `funqy-trigger.yaml` file in the `src/main/k8s` directory and replace it with: + + +``` +apiVersion: eventing.knative.dev/v1 +kind: Trigger +metadata: +  name: my-cloudevent-greeting +spec: +  broker: default +  subscriber: +    ref: +      apiVersion: serving.knative.dev/v1 +      kind: Service +      name: funqy-knative-events-codestart +``` + +Create a trigger using the `kubectl` command-line tool: + + +``` +`$ kubectl create -f src/main/k8s/funqy-trigger.yaml` +``` + +The output should look like this: + + +``` +`trigger.eventing.knative.dev/my-cloudevent-greeting created` +``` + +### 4\. Send a cloud event to the serverless event function in Kubernetes + +Find out the function's route URL and check that the output looks like this: + + +``` +$ kubectl get rt +NAME URL READY REASON +funqy-knative-events-codestart     True +``` + +Send a cloud event to the function over the HTTP protocol: + + +``` +curl -v \ +  -H "Content-Type:application/json" \ +  -H "Ce-Id:1" \ +  -H "Ce-Source:cloud-event-example" \ +  -H "Ce-Type:myCloudEventGreeting" \ +  -H "Ce-Specversion:1.0" \ +  -d "{\"name\": \"Daniel\"}" +``` + +The output should end with: + + +``` +`HTTP/1.1 204 No Content` +``` + +Once the function pod scales up, take a look at the pod logs. Use the following `kubectl` command to retrieve the pod's name: + + +``` +`$ kubectl get pod` +``` + +The output will look like this: + + +``` +NAME                                                           READY   STATUS    RESTARTS   AGE +funqy-knative-events-codestart-v1-deployment-6569f6dfc-zxsqs   2/2     Running   0          11s +``` + +Run the following `kubectl` command to verify that the pod's logs match the local testing's result:  + + +``` +`$ kubectl logs funqy-knative-events-codestart-v1-deployment-6569f6dfc-zxsqs -c user-container | grep CloudEventGreeting` +``` + +The output looks like this: + + +``` +`INFO  [org.acm.get.sta.fun.clo.CloudEventGreeting] (executor-thread-0) Hello Daniel` +``` + +If you deploy the event function to an [OpenShift Kubernetes Distribution][14] (OKD) cluster, you will find the deployment status in the topology view: + +![Deployment status][15] + +(Daniel Oh, [CC BY-SA 4.0][16]) + +You can also find the pod's logs in the **Pod details** tab: + +![Pod details][17] + +(Daniel Oh, [CC BY-SA 4.0][16]) + +### What's next? + +Developers can bind a cloud event to Knative using Quarkus functions. Quarkus also scaffolds Kubernetes manifests, such as Knative services and triggers, to process cloud events over a channel or HTTP request. + +Learn more serverless and Quarkus topics through OpenShift's [interactive self-service learning portal][18]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/cloudevents-bind-java-knative + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://avro.apache.org/ +[3]: https://developers.google.com/protocol-buffers +[4]: https://cloudevents.io/ +[5]: https://knative.dev/ +[6]: https://kogito.kie.org/ +[7]: https://debezium.io/ +[8]: https://quarkus.io/ +[9]: https://knative.dev/docs/eventing/ +[10]: https://opensource.com/article/21/6/quarkus-funqy +[11]: https://hub.docker.com/ +[12]: https://quay.io/ +[13]: https://knative.dev/docs/client/install-kn/ +[14]: https://www.okd.io/ +[15]: https://opensource.com/sites/default/files/uploads/5_deployment-status.png (Deployment status) +[16]: https://creativecommons.org/licenses/by-sa/4.0/ +[17]: https://opensource.com/sites/default/files/uploads/5_pod-details.png (Pod details) +[18]: https://learn.openshift.com/serverless/ From bc2e4440dbda6efeacde3b0734a5ddb246d62486 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 3 Jul 2021 15:42:08 +0800 Subject: [PATCH 287/870] PRF @baddate --- ...28 Learn Bash with this book of puzzles.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/translated/tech/20200428 Learn Bash with this book of puzzles.md b/translated/tech/20200428 Learn Bash with this book of puzzles.md index b35b78e7cf..2896bbe2ab 100644 --- a/translated/tech/20200428 Learn Bash with this book of puzzles.md +++ b/translated/tech/20200428 Learn Bash with this book of puzzles.md @@ -1,23 +1,25 @@ [#]: collector: (lujun9972) [#]: translator: (baddate) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Learn Bash with this book of puzzles) [#]: via: (https://opensource.com/article/20/4/bash-it-out-book) [#]: author: (Carlos Aguayo https://opensource.com/users/hwmaster1) -用这本谜题书学习 Bash +《Bash it out》书评:用这本谜题书学习 Bash ====== ->“Bash it out”使用 16 个谜题,涵盖了基本、中级和高级 Bash 脚本。 -![Puzzle pieces coming together to form a computer screen][1] +> 《Bash it out》使用 16 个谜题,涵盖了基本、中级和高级 Bash 脚本。 -计算机既是我的爱好,也是我的职业。我的公寓里散布着大约 10 个,它们都运行 Linux(包括我的 Mac)。由于我喜欢升级我的电脑和提升我的电脑技能,当我遇到 Sylvain Leroux 的[_Bash it out_][2]时,我抓住了购买它的机会。我在 Debian Linux 上经常使用命令行,这似乎是扩展我的 Bash 知识的好机会。当作者在前言中解释他使用 Debian Linux 时,我笑了,这是我最喜欢的两个发行版之一。 +![](https://img.linux.net.cn/data/attachment/album/202107/03/154134jgm2m82o76mrm2o7.jpg) -Bash 可让你自动执行任务,因此它是一种省力、有趣且有用的工具。在阅读本书之前,我已经有相当多的 Unix 和 Linux 上的 Bash 经验。我不是专家,部分原因是脚本语言非常广泛和强大。当我在基于 Arch 的 Linux 发行版[EndeavourOS][3]的欢迎屏幕上看到 Bash 时,我第一次对 Bash 产生了兴趣。 +计算机既是我的爱好,也是我的职业。我的公寓里散布着大约 10 台计算机,它们都运行 Linux(包括我的 Mac)。由于我喜欢升级我的电脑和提升我的电脑技能,当我遇到 Sylvain Leroux 的《[Bash it out][2]》时,我抓住了购买它的机会。我在 Debian Linux 上经常使用命令行,这似乎是扩展我的 Bash 知识的好机会。当作者在前言中解释他使用 Debian Linux 时,我笑了,这是我最喜欢的两个发行版之一。 + +Bash 可让你自动执行任务,因此它是一种省力、有趣且有用的工具。在阅读本书之前,我已经有相当多的 Unix 和 Linux 上的 Bash 经验。我不是专家,部分原因是脚本语言非常广泛和强大。当我在基于 Arch 的 Linux 发行版 [EndeavourOS][3] 的欢迎屏幕上看到 Bash 时,我第一次对 Bash 产生了兴趣。 + +以下屏幕截图显示了 EndeavourOS 的一些选项。你可能不相信,这些面板只指向 Bash 脚本,每个脚本都完成一些相对复杂的任务。而且因为它都是开源的,所以我可以根据需要修改这些脚本中的任何一个。 -以下屏幕截图显示了 EndeavourOS 的一些选项。不管你信不信,这些面板只指向 Bash 脚本,每个脚本都完成一些相对复杂的任务。而且因为它都是开源的,所以我可以根据需要修改这些脚本中的任何一个。 ![EndeavourOS after install][4] ![EndeavourOS install apps][5] @@ -26,11 +28,11 @@ Bash 可让你自动执行任务,因此它是一种省力、有趣且有用的 我对这本书的印象非常好。虽然不长,但经过了深思熟虑。作者对 Bash 有非常广泛的了解,并且具有解释如何使用它的不可思议的能力。这本书使用 16 个谜题涵盖了基本、中级和高级 Bash 脚本,他称之为“挑战”。这教会了我将 Bash 脚本视为需要解决的编程难题,这让我玩起来更有趣。 -Bash 一个令人兴奋的方面是它与 Linux 系统深度集成。虽然它的部分能力在于它的语法,但它也很强大,因为它可以访问很多系统资源。你可以编写重复性任务或简单但厌倦了手动执行的任务的脚本。没有什么太大或太小的事,*Bash it out*可以帮助你了解可以做什么以及如何实现它。 +Bash 的一个令人兴奋的方面是它与 Linux 系统深度集成。虽然它的部分能力在于它的语法,但它也很强大,因为它可以访问很多系统资源。你可以编写重复性任务或简单但厌倦了手动执行的任务的脚本。不管是大事还是小事,《Bash it out》可以帮助你了解可以做什么以及如何实现它。 -如果我不提及 David Both 的免费资源[_A sysadmin's guide to Bash scripting_][6]on Opensource.com,这篇评论就不会完整。这个 17 页的 PDF 指南与Bash it out不同,但它们共同构成了任何想要了解它的人的成功组合。 +如果我不提及 David Both 的发布在 Opensource.com 的免费资源《[A sysadmin's guide to Bash scripting_][6]》,这篇书评就不会完整。这个 17 页的 PDF 指南与《Bash it out》不同,但它们共同构成了任何想要了解它的人的成功组合。 -我不是计算机程序员,但*Bash it out*增加了我进入更高级 Bash 脚本水平的欲望——虽然没有这个打算,但我可能最终无意中成为一名计算机程序员。 +我不是计算机程序员,但《Bash it out》增加了我进入更高级 Bash 脚本水平的欲望——虽然没有这个打算,但我可能最终无意中成为一名计算机程序员。 我喜欢 Linux 的原因之一是因为它的操作系统功能强大且用途广泛。无论我对 Linux 了解多少,总有一些新东西需要学习,这让我更加欣赏 Linux。 @@ -44,8 +46,8 @@ via: https://opensource.com/article/20/4/bash-it-out-book 作者:[Carlos Aguayo][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/baddates) -校对:[校对者ID](https://github.com/校对者ID) +译者:[baddates](https://github.com/baddates) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 490e7fa7a87b86fcae01066c88868e9d94cf89fe Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 3 Jul 2021 15:42:48 +0800 Subject: [PATCH 288/870] PUB @baddate https://linux.cn/article-13544-1.html --- .../20200428 Learn Bash with this book of puzzles.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200428 Learn Bash with this book of puzzles.md (98%) diff --git a/translated/tech/20200428 Learn Bash with this book of puzzles.md b/published/20200428 Learn Bash with this book of puzzles.md similarity index 98% rename from translated/tech/20200428 Learn Bash with this book of puzzles.md rename to published/20200428 Learn Bash with this book of puzzles.md index 2896bbe2ab..532a58dc4a 100644 --- a/translated/tech/20200428 Learn Bash with this book of puzzles.md +++ b/published/20200428 Learn Bash with this book of puzzles.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (baddate) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13544-1.html) [#]: subject: (Learn Bash with this book of puzzles) [#]: via: (https://opensource.com/article/20/4/bash-it-out-book) [#]: author: (Carlos Aguayo https://opensource.com/users/hwmaster1) From 3e2b25ea3886059de3adc1fc72f946718df4893a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 3 Jul 2021 15:59:00 +0800 Subject: [PATCH 289/870] PRF @geekpi --- ...d on WSL- Here-s How to Reset it Easily.md | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md b/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md index b89dfb5aca..743edff750 100644 --- a/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md +++ b/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md @@ -3,7 +3,7 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -12,9 +12,9 @@ 对于那些想从舒适的 Windows 中享受 Linux 命令行的人来说,WSL(Windows Subsystem for Linux) 是一个方便的工具。 -当你[在 Windows 上使用 WSL 安装 Linux][1]时,会要求你创建一个用户名和密码。当你在 WSL 上启动 Linux 时,这个用户会自动登录。 +当你 [在 Windows 上使用 WSL 安装 Linux][1] 时,会要求你创建一个用户名和密码。当你在 WSL 上启动 Linux 时,这个用户会自动登录。 -现在的问题是,如果你有一段时间没有使用它,你可能会忘记 WSL 的账户密码。而如果你要使用 sudo 的命令,这将成为一个问题,因为这里你需要输入密码。 +现在的问题是,如果你有一段时间没有使用它,你可能会忘记 WSL 的账户密码。而如果你要使用 `sudo` 的命令,这将成为一个问题,因为这里你需要输入密码。 ![][2] @@ -24,27 +24,25 @@ 要在 WSL 中重设 Linux 密码,你需要: - * 将默认用户切换为 root + * 将默认用户切换为 `root` * 重置普通用户的密码 - * 将默认用户切换回正常用户 - - + * 将默认用户切换回普通用户 让我向你展示详细的步骤和截图。 #### 步骤 1:将默认用户切换为 root -记下你的普通/常规用户名将是明智之举。如你所见,我的普通帐户的用户名是 abhishek。 +记下你的普通/常规用户名将是明智之举。如你所见,我的普通帐户的用户名是 `abhishek`。 ![Note down the account username][3] -WSL 中的 root 用户是解锁的,没有设置密码。这意味着你可以切换到 root 用户,然后利用 root 的能力来重置密码。 +WSL 中的 `root` 用户是无锁的,没有设置密码。这意味着你可以切换到 `root` 用户,然后利用 `root` 的能力来重置密码。 -由于你不记得帐户密码,切换到根用户是通过改变你的 Linux WSL 应用的配置,使其默认使用 root 用户来完成。 +由于你不记得帐户密码,切换到 `root` 用户是通过改变你的 Linux WSL 应用的配置,使其默认使用 `root` 用户来完成。 这是通过 Windows 命令提示符完成的,你需要知道你的 Linux 发行版需要运行哪个命令。 -这个信息通常在 [Windows Store][4] 中的发行版应用的描述中提供。这是你首次下载发行版的地方。 +这个信息通常在 [Windows 商店][4] 中的发行版应用的描述中提供。这是你首次下载发行版的地方。 ![Know the command to run for your distribution app][5] @@ -66,17 +64,17 @@ ubuntu config --default-user root 发行版应用 | Windows 命令 ---|--- -Ubuntu | ubuntu config –default-user root -Ubuntu 20.04 | ubuntu2004 config –default-user root -Ubuntu 18.04 | ubuntu1804 config –default-user root -Debian | debian config –default-user root -Kali Linux | kali config –default-user root +Ubuntu | `ubuntu config –default-user root` +Ubuntu 20.04 | `ubuntu2004 config –default-user root` +Ubuntu 18.04 | `ubuntu1804 config –default-user root` +Debian | `debian config –default-user root` +Kali Linux | `kali config –default-user root` #### 步骤 2:重设帐户密码 -现在,如果你启动 Linux 发行程序,你应该以 root 身份登录。你可以重新设置普通用户帐户的密码。 +现在,如果你启动 Linux 发行程序,你应该以 `root` 身份登录。你可以重新设置普通用户帐户的密码。 -你还记得 WSL 中的用户名吗?如果没有,你可以随时检查 /home 目录的内容。当你有了用户名后,使用这个命令: +你还记得 WSL 中的用户名吗?(LCTT 译注:请使用你的“用户名”替换下列命令中的 `username`)如果没有,你可以随时检查 `/home` 目录的内容。当你有了用户名后,使用这个命令: ``` passwd username @@ -86,13 +84,13 @@ passwd username ![Reset the password for the regular user][8] -恭喜你。用户账户的密码已经被重置。但你还没有完成。默认用户仍然是 root。你应该把它改回你的普通用户帐户,否则它将一直以 root 用户的身份登录。 +恭喜你。用户账户的密码已经被重置。但你还没有完成。默认用户仍然是 `root`。你应该把它改回你的普通用户帐户,否则它将一直以 `root` 用户的身份登录。 #### 步骤 3:再次将普通用户设置为默认用户 -你需要你在上一步中用 [passwd 命令][9]使用的普通帐户用户名。 +你需要你在上一步中用 [passwd 命令][9] 使用的普通帐户用户名。 -再次启动 Windows 命令提示符。**使用你的发行版命令**,方式与第 1 步中类似。然而,这一次,用普通用户代替 root。 +再次启动 Windows 命令提示符。**使用你的发行版命令**,方式与第 1 步中类似。然而,这一次,用普通用户代替 `root`。 ``` ubuntu config --default-user username @@ -100,7 +98,7 @@ ubuntu config --default-user username ![Set regular user as default user][10] -现在,当你在 WSL 中启动你的 Linux 发行版时,你将以普通用户的身份登录。你已经重新设置了密码,可以用它来运行 sudo 的命令。 +现在,当你在 WSL 中启动你的 Linux 发行版时,你将以普通用户的身份登录。你已经重新设置了密码,可以用它来运行 `sudo` 命令。 如果你将来再次忘记了密码,你知道重置密码的步骤。 @@ -121,7 +119,7 @@ via: https://itsfoss.com/reset-linux-password-wsl/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 14b1d277f88360d78ba77133d345338ec5400b66 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 3 Jul 2021 15:59:26 +0800 Subject: [PATCH 290/870] PUB @geekpi https://linux.cn/article-13545-1.html --- ...ot Linux Password on WSL- Here-s How to Reset it Easily.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md (98%) diff --git a/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md b/published/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md similarity index 98% rename from translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md rename to published/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md index 743edff750..b92b147787 100644 --- a/translated/tech/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md +++ b/published/20210628 Forgot Linux Password on WSL- Here-s How to Reset it Easily.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13545-1.html) 在 WSL 上忘记了 Linux 密码?下面是如何轻松重设的方法 ====== From 75edd88d7e149e0dc2ce5bddf41ab544364f1db4 Mon Sep 17 00:00:00 2001 From: Zioyi Date: Sat, 3 Jul 2021 22:29:59 +0800 Subject: [PATCH 291/870] =?UTF-8?q?=E8=AE=A4=E9=A2=86=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20180416 Cgo and Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180416 Cgo and Python.md b/sources/tech/20180416 Cgo and Python.md index e5688d43c8..3e70df6334 100644 --- a/sources/tech/20180416 Cgo and Python.md +++ b/sources/tech/20180416 Cgo and Python.md @@ -326,7 +326,7 @@ Are you a polyglot who loves mixing different programming languages? Do you love via: https://www.datadoghq.com/blog/engineering/cgo-and-python/ 作者:[ Massimiliano Pippi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Zioyi](https://github.com/Zioyi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4247e1dc8dd68bcfe94395ca7fd535b3a615cec2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 4 Jul 2021 05:03:33 +0800 Subject: [PATCH 292/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210703=20?= =?UTF-8?q?Identify=20flowers=20and=20trees=20with=20this=20open=20source?= =?UTF-8?q?=20mobile=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210703 Identify flowers and trees with this open source mobile app.md --- ... trees with this open source mobile app.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210703 Identify flowers and trees with this open source mobile app.md diff --git a/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md b/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md new file mode 100644 index 0000000000..9d83d17888 --- /dev/null +++ b/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md @@ -0,0 +1,99 @@ +[#]: subject: (Identify flowers and trees with this open source mobile app) +[#]: via: (https://opensource.com/article/21/7/open-source-plantnet) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Identify flowers and trees with this open source mobile app +====== +PlantNet combines open source technology with crowdsourced knowledge to +help you become an amateur botanist. +![Fire pink flower in Maggie Valley, NC][1] + +Where I live, there are lots of trails and roads lined with flowers and trees. My community is famous for its annual maple festival, and maple trees are easy for me to identify. However, there are many other trees I cannot identify by name. Flowers are the same: dandelions are easy to spot, but I don't know the names of the wildflowers that line my walking path. + +Recently my wife told me about PlantNet, a mobile application that can identify these flowers and trees. It's available on iOS and Android, and it's free, so I decided to try it out. + +### Identifying plants the open source way + +I downloaded the app on my phone and began using it to identify some of the flowers and trees on my walks around the village. As I became familiar with the app, I noticed that the pictures I took (and those taken by other users) are shared with a Creative Commons Attribution-ShareAlike (CC-BY-SA) license. Further investigation revealed that PlantNet is [open source][2]. You can use the application anonymously if you like or become a registered member of the community. + +According to the [Cos4Cloud][3] citizen science project, "PlantNet is a participatory citizen science platform for collecting, sharing, and reviewing plant observations based on automated identification. Its objective is to monitor plant biodiversity and facilitate access to plant knowledge by the general public." It uses image-recognition techniques to inventory biodiversity. + +The project's development began in 2009 by botanists and computer scientists in France. It started out as a [web application][4], and the smartphone app launched in 2013. The project is part of the [Floris'Tic][5] initiative, another French project that aims to promote scientific, technical, and industrial culture in plant sciences. + +PlantNet allows users to utilize a smartphone's camera to collect visual specimens, which are identified by software and the community. These photos are then shared with millions of people worldwide who are part of the PlantNet network. + +The project says, "The PlantNet system works by comparing visual patterns transmitted by users via photos of plant organs (flowers, fruits, leaves …) that they seek to determine. These images are analyzed and compared to an image bank produced collaboratively and enriched daily. The system then offers a possible list of species with its illustrations." + +### Using PlantNet + +The mobile application is easy to use. Launch it from the app's icon on your smartphone. + +![PlantNet smartphone icon][6] + +(Don Watkins, [CC BY-SA 4.0][7]) + +When the application opens, you see the specimens you've already collected in your library. The Camera icon at the bottom of the display allows you to use your camera to add pictures to your photo library. + +![Pl@ntnet homescreen][8] + +(Don Watkins, [CC BY-SA 4.0][7]) + +Choose the Camera option, and point your phone's camera at a tree or flower you want to identify. After you take the picture, click on the option (leaf, flower, bark, fruit, and so on) that matches the specimen you want to identify. + +![Selecting plant type to identify][9] + +(Don Watkins, [CC BY-SA 4.0][7]) + +For example, if you're trying to identify a specimen by its leaf characteristics, choose **leaf**. PlantNet assigns a degree of certainty about its identification, ranging from a high to a low percentage. You can also use your smartphone's GPS function to add location information to your data collection automatically, and you can also add a note. + +![Identified plant][10] + +(Don Watkins, [CC BY-SA 4.0][7]) + +You can access all the observations you have uploaded and keep track of whether the community has approved them either on your smartphone or by logging into the website with your user ID (if you create an account). From the web interface, you can also download a record of your observations in CSV or spreadsheet formats. + +![Pl@ntnet provides user stats][11] + +(Don Watkins, [CC BY-SA 4.0][7]) + +### The great outdoors + +I particularly enjoy that PlantNet links to Wikipedia so that I can read more information about the plant data I collect. + +There are currently approximately 12 million PlantNet users worldwide, so the data set is growing all the time. The application is free to use for up to 500 requests per day. It also features an API that delivers data in JSON format, so you can even use Pl
antNet's visual identification engine as a web service. + +One very nice thing about PlantNet is that it combines crowdsourced knowledge and open source technology to connect users to each other and with the great outdoors. There's no better reason to support open source software than this. + +A complete description of the application and its developers is available on [YouTube][12] (in French with English subtitles). You can also learn more about the project on [PlantNet][13]'s website. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-source-plantnet + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fire-pink-flower-maggie-valley.jpg?itok=q6Ev7TSr (Fire pink flower in Maggie Valley, NC) +[2]: https://github.com/plantnet +[3]: https://cos4cloud-eosc.eu/citizen-science-innovation/cos4cloud-citizen-observatories/plntnet/ +[4]: https://identify.plantnet.org/ +[5]: http://floristic.org/ +[6]: https://opensource.com/sites/default/files/uploads/plantnet-icon.jpg (PlantNet smartphone icon) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/plantnet_camera.jpg (Pl@ntnet homescreen) +[9]: https://opensource.com/sites/default/files/uploads/plantnet_plant-type.jpg (Selecting plant type to identify) +[10]: https://opensource.com/sites/default/files/uploads/plantnet-identification.jpg (Identified plant) +[11]: https://opensource.com/sites/default/files/uploads/plantnet_user-stats.jpg (Pl@ntnet provides user stats) +[12]: https://www.youtube.com/watch?v=W_cBqaPfRFE +[13]: https://plantnet.org/ From 218d26ff458f9137842e4acccad429a1c4f49294 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 4 Jul 2021 05:03:59 +0800 Subject: [PATCH 293/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210703=20?= =?UTF-8?q?Can=20Windows=2011=20Influence=20Linux=20Distributions=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210703 Can Windows 11 Influence Linux Distributions.md --- ...indows 11 Influence Linux Distributions.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/news/20210703 Can Windows 11 Influence Linux Distributions.md diff --git a/sources/news/20210703 Can Windows 11 Influence Linux Distributions.md b/sources/news/20210703 Can Windows 11 Influence Linux Distributions.md new file mode 100644 index 0000000000..2dd1083400 --- /dev/null +++ b/sources/news/20210703 Can Windows 11 Influence Linux Distributions.md @@ -0,0 +1,117 @@ +[#]: subject: (Can Windows 11 Influence Linux Distributions?) +[#]: via: (https://news.itsfoss.com/can-windows-11-influence-linux/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Can Windows 11 Influence Linux Distributions? +====== + +Microsoft’s Windows 11 has been finally revealed. While some compare it to macOS, others compare the nitty-gritty details to find similarities with GNOME and KDE (which does not make much sense). + +But, among all the buzz, I am curious about something else — **Can Microsoft’s Windows 11 influence the future design decisions of desktop Linux distributions?** + +Here I shall mention some of my thoughts on why it might happen, if it has happened before, and what the future holds for Linux distributions. + +### Some Linux Distributions Already Focus on Windows-like Experience: But, why? + +Microsoft’s Windows is the most popular desktop operating system with **88% of the market share** for its ease of use, software support, and hardware compatibility. + +On the contrary, Linux has **about 2% of the market share,** even with all the added [benefits of Linux over Windows][1]. + +So what can Linux do to convince more users to try Linux as their desktop operating system? + +The main focus of every desktop operating system should be the user experience. While Microsoft and Apple have managed to provide a comfortable user experience for the masses, Linux distributions did not manage to get a big win on that front. + +However, you will find several [Linux distributions that aim to replace Windows 10][2]. These Linux distributions try to provide a familiar user interface that could encourage a Windows user to consider switching to Linux. + +And, due to the existence of such distributions, [switching to Linux in 2021][3] makes more sense than ever. + +Hence, to get more users to jump-ship to Linux, Microsoft Windows has influenced many distributions for years now. + +### Is Windows 11 Better than Linux in Some Way? + +The user interface is constantly evolving with Windows. Even if that’s subjective, it is what most desktop users seem to be going for. + +So I’d say Windows 11 has made some attractive improvements on that front. + +![][4] + +Not just limited to the UI/UX, things like integrating Microsoft Team’s chat features in the taskbar makes it convenient for users to instantly connect with anyone. + +**While Linux distributions do not have their own full-fledged services, more out-of-the-box integrations tailored like this should make the onboarding experience easier for new users.** + +And that brings me to another aspect of Windows 11—a personalized news and information feed. + +Sure, Microsoft collects data for that, and you may have to sign in using a Microsoft account. But this is yet something that reduces friction for the users to go and look for a separate app to keep track of weather, news, and other daily information. + +Linux does not force these choices for a user but features/integrations like this can be added as additional options which can be presented in the form of a choice to users. + +**In other words, making things more accessible while integrated with the OS should get rid of a steep learning curve.** + +And, the dreaded Microsoft Store has also got a serious upgrade with Windows 11. + +![][5] + +Unfortunately, for Linux distributions, I don’t see much meaningful upgrade to the app centers to make it visually appealing, and something interesting. + +elementaryOS is probably making a good effort to focus on the UX/UI, and the evolving the experience with app center but for the most other distros, no significant upgrade. + +![Software Manager in Linux Mint 20.1][6] + +While I appreciate what Deepin Linux does in this regard, but it isn’t the popular choice for many users who try Linux for the first time. + +### Windows 11 Introduces More Competition: Linux Has to Keep Up + +With the launch of Windows 11, Linux as a desktop choice will get more competition. + +While we do have some replacements for Windows 10 experience in the Linux world, there’s nothing that targets Windows 11, yet. + +But this brings us to the obvious counter-response from the Linux community – **a Linux distribution that takes a dab at Windows 11**. + +No matter whether you hate or love Microsoft’s latest design approach to Windows 11, the masses will adopt it over the next few years. + +And to keep Linux as a compelling desktop alternative, the design language with Linux distributions must evolve as well. + +Not just the desktop market—but laptop-exclusive design choices also need a significant improvement for Linux distributions. + +Some options like [Pop!_OS by System76][7] have been trying to offer that experience for Linux, which is a good start. + +I think Zorin OS can be one of the distributions to introduce a “**Windows 11**” layout as an option to get more users to try Linux. + +Not to forget—[Deepin Linux introduced Android app support][8] right after Windows 11 marketed it as a feature. + +So, you see when Microsoft’s Windows makes a move, it does have a ripple effect on Linux, too. And Deepin Linux’s Android app support is just the start…Let’s see what else comes up next. + +_What do you think about Windows 11 influencing the future of Linux desktop? Do we need to evolve as well? Or should we continue being different and not get influenced by what the masses choose?_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/can-windows-11-influence-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-better-than-windows/ +[2]: https://itsfoss.com/windows-like-linux-distributions/ +[3]: https://news.itsfoss.com/switch-to-linux-in-2021/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY0OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://pop.system76.com +[8]: https://news.itsfoss.com/deepin-linux-20-2-2-release/ From 9e6418dae20ecc6364665f51c662fa3f99078b86 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 4 Jul 2021 15:20:19 +0800 Subject: [PATCH 294/870] Rename sources/news/20210703 Can Windows 11 Influence Linux Distributions.md to sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md --- .../20210703 Can Windows 11 Influence Linux Distributions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210703 Can Windows 11 Influence Linux Distributions.md (100%) diff --git a/sources/news/20210703 Can Windows 11 Influence Linux Distributions.md b/sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md similarity index 100% rename from sources/news/20210703 Can Windows 11 Influence Linux Distributions.md rename to sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md From 77ccee95a37235ada24865856660257eeca40168 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sun, 4 Jul 2021 15:37:18 +0800 Subject: [PATCH 295/870] Zz air patch 1 (#22410) * Update 20210621 Jim Hall- How Do You Fedora.md * Update 20210621 Jim Hall- How Do You Fedora.md * Update 20210621 Jim Hall- How Do You Fedora.md * Update 20210621 Jim Hall- How Do You Fedora.md * Update 20210621 Jim Hall- How Do You Fedora.md * Update 20210621 Jim Hall- How Do You Fedora.md * Rename sources/talk/20210621 Jim Hall- How Do You Fedora.md to translated/talk/20210621 Jim Hall- How Do You Fedora.md --- .../20210621 Jim Hall- How Do You Fedora.md | 84 ------------------- .../20210621 Jim Hall- How Do You Fedora.md | 81 ++++++++++++++++++ 2 files changed, 81 insertions(+), 84 deletions(-) delete mode 100644 sources/talk/20210621 Jim Hall- How Do You Fedora.md create mode 100644 translated/talk/20210621 Jim Hall- How Do You Fedora.md diff --git a/sources/talk/20210621 Jim Hall- How Do You Fedora.md b/sources/talk/20210621 Jim Hall- How Do You Fedora.md deleted file mode 100644 index b70cbca599..0000000000 --- a/sources/talk/20210621 Jim Hall- How Do You Fedora.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: subject: (Jim Hall: How Do You Fedora?) -[#]: via: (https://fedoramagazine.org/jim-hall-how-do-you-fedora/) -[#]: author: (Karimi Hari Priya https://fedoramagazine.org/author/haripriya21/) -[#]: collector: (lujun9972) -[#]: translator: (zz-air) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Jim Hall: How Do You Fedora? -====== - -![][1] - -We recently interviewed Jim Hall on how he uses Fedora. This is part of a [series][2] on the Fedora Magazine. The series profiles Fedora users and how they use Fedora to get things done. Contact us on the [feedback form][3] if you are interested in being interviewed for a further installment of this series. - -## **Who is Jim Hall?** - -Jim Hall served as Chief Information Officer in higher education and government for over eight years and has recently started the consulting company [Hallmentum][4]. Most of his work includes training, workshops, and coaching to help new IT leaders develop leadership skills, also to help current IT leaders get better at leadership. Apart from consulting, Jim also serves as adjunct faculty at the university level, currently teaching courses in Management Information Systems (MIS) and Technical & Professional Writing. - -How did Jim grow up? Jim’s childhood heroes were from TV and movies, including Batman and Han Solo. Jim’s long-time favorite go-to movie is Star Wars: A New Hope. Jim says, “I am a big Star Wars nerd.” Jim’s favorite meals are Italian. “I love Italian food! Probably my favorite Italian dish is chicken cacciatore.” Jim’s opinion is that Honesty, Creativity, Imagination, Curiosity, and Openness are the five greatest qualities someone can possess. - -He loves writing, which is good because most of his day job is about writing. He spends a lot of time writing “how-to” articles for places like OpenSource.com, CloudSavvy IT, and Linux Magazine, and right now he is writing a book about C programming. Apart from writing, he also relaxes by playing video games. He owns a PlayStation 4 and can be found most Saturday afternoons in front of his TV playing a game. - -## **Fedora Community** - -Jim started using Linux in 1993. His first Linux distribution was Softlanding Linux System (SLS) 1.03, running Linux kernel 0.99 patch level 11. “I’ve been a full-time Linux user at home ever since”. Jim became more involved in Fedora after attending a Linux conference long ago in the Fedora Core days. Jim met Tom “Spot” Callaway there, and they got talking about Fedora. “Spot encouraged me to contribute another way: by finding bugs and reporting them. And that’s how I got involved in testing for all the Beta releases”. - -What would Jim like to change in Fedora? He would like to see a countdown on the getfedora.org website, that tells when the new Beta release or new full release is due out as a change in Fedora Project. And Jim wishes that other people know how easy it is to use Fedora. ”The most challenging thing in contributing to open source is to figure out how to make their first contribution.” Jim adds, “I don’t know that I’m a ‘Fedora Project member’ like other developers would be. I’m just a user. But as someone who’s been involved in developing open-source software since 1993 or 1994, I try to be a helpful member of the community. So I take every opportunity to experiment with new Fedora releases, even the Beta releases, and let people know if I find problems.” - -## **What hardware do you use?** - -Jim is currently running a ThinkCentre M720 Tiny. It’s configured with 8th Generation Intel Core i3-8100T (3.10GHz, 6MB Cache), 32GB (16GB + 16GB) DDR4 2666MHz, Intel graphics, 256GB Solid State Drive PCIe-NVME Opal M.2, Intel 8265 802.11AC, and Bluetooth 4.2. His monitor is an Asus VE248H. “It all works great with Fedora!” says Jim. - -He uses the Perixx Periboard-512 Ergonomic Classic Split Keyboard which replaced his original Microsoft Natural Keyboard Elite PS/2 keyboard from 1998. Jim says “I sometimes swap out the Perixx keyboard for my USB clone of the original IBM Model M keyboard, from Unicomp. I do love the clicky keyboard with the buckling spring action. And mine is in the ‘putty white’ color so it has that classic look and feel.” - -## **What software do you use?** - -Jim is currently running Fedora 33 and previously Fedora 33 Beta, and Fedora 32. “I use GNOME 3 as my desktop. I find the defaults suit most of my needs, so I don’t have any GNOME Extensions loaded, but I do adjust a few things using Settings and GNOME Tweaks. So I’m not making any big changes. For example, I changed my default user interface font to use Droid Sans Regular. And I used Settings to change the keyboard shortcut so Alt-Tab switches windows instead of switching applications. I grew up with the Alt-Tab workflow, so I’m used to that,” says Jim. He uses Firefox and Google Chrome as his web browsers. - -To run his consultancy business, Jim relies on a suite of applications: - - * [LibreOffice][5] to write his books. For example, he published [Coaching Buttons][6] last year. He wrote this book entirely using LibreOffice. More recently, he wrote a book about [Writing Free DOS Programs in C][7] and used LibreOffice for that too. - * [INKSCAPE][8] for creating his company logo in vector format. His logo scales up and down perfectly—from a small corner image on a document to a large-format poster or banner. And INKSCAPE lets him export to a variety of common formats. Jim says that his advertising partners appreciate that INKSCAPE can export to EPS (Encapsulated Postscript), which makes it a snap to print his logo on products. - * [GIMP][9] for other graphics, such as a splash image. “My splash image is my company logo placed over a background image, and I use that in place of a plain logo where I need extra pizzazz, such as on printed materials. I also use a version of the splash image on my website.” - * [QEMU][10] to run a virtual machine where he can boot [FreeDOS][11]. “I like using QEMU because I can set all the options I need at the command line, which gives me a lot of extra flexibility in configuring the virtual machine. To make this easier, I put all the options into a script, and use that to run QEMU with the same options every time.” - * [Scribus][12] to print products. Scribus is easy to use to create print-ready materials with _full bleed_, meaning any color backgrounds overlap the edge of the paper. Full bleed requires a special print-ready file that overlaps the print area . It even provides cut marks so that the printer knows exactly where to trim. - - - -![Scribus – Postcard][13] - -![QEMU – running as easy as in FreeDOS][14] - -![Libre Office Writer][15] - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/jim-hall-how-do-you-fedora/ - -作者:[Karimi Hari Priya][a] -选题:[lujun9972][b] -译者:[zz-air](https://github.com/zz-air) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/haripriya21/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/12/PXL_20200929_205044670.PORTRAIT-01.COVER_-816x345.jpg -[2]: https://fedoramagazine.org/tag/how-do-you-fedora -[3]: https://fedoramagazine.org/submit-an-idea-or-tip -[4]: https://hallmentum.com/ -[5]: https://www.libreoffice.org/ -[6]: https://www.amazon.com/Coaching-Buttons-Jim-Hall/dp/0359834930 -[7]: https://www.freedos.org/books/ -[8]: https://inkscape.org/ -[9]: https://www.gimp.org/ -[10]: https://www.qemu.org/ -[11]: https://www.freedos.org/ -[12]: https://www.scribus.net/ -[13]: https://fedoramagazine.org/wp-content/uploads/2021/03/Scribus-postcard-1024x576.png -[14]: https://fedoramagazine.org/wp-content/uploads/2021/03/QEMU-running-AsEasyAs-in-FreeDOS.png -[15]: https://fedoramagazine.org/wp-content/uploads/2021/03/LibreOffice-Writer-book-1-1024x576.png diff --git a/translated/talk/20210621 Jim Hall- How Do You Fedora.md b/translated/talk/20210621 Jim Hall- How Do You Fedora.md new file mode 100644 index 0000000000..cc4a0f7085 --- /dev/null +++ b/translated/talk/20210621 Jim Hall- How Do You Fedora.md @@ -0,0 +1,81 @@ +[#]: subject: (Jim Hall: How Do You Fedora?) +[#]: via: (https://fedoramagazine.org/jim-hall-how-do-you-fedora/) +[#]: author: (Karimi Hari Priya https://fedoramagazine.org/author/haripriya21/) +[#]: collector: (lujun9972) +[#]: translator: (zz-air) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Jim Hall: 你觉得 Fedora 怎么样? +====== + +![][1] + +我们最近采访了 Jim Hall 关于他如何使用 Fedora. 这个部分是在一个 Fedora 杂志 [系列][2] 上。 该系列介绍了Fedora用户以及他们如何使用Fedora来完成任务。 如果您对本系列的下一期采访感兴趣,请通过 [反馈表][3] 与我们联系。 + +## **Jim Hall 是谁?** + +Jim Hall 曾担任高等教育和政府部门的首席信息管超过8年,最近创办了咨询公司 [Hallmentum][4]。 他的大部分工作包括培训、研讨会和指导帮助新的IT领导者发展领导技能,也帮助当前的IT领导者更好地发挥领导能力。除了咨询 Jim 还担任大学水平的兼职教师, 目前教授管理信息系统(MIS)和技术与专业写作课程。 + +Jim 是怎么长大的? Jim 童年时代的英雄来自电视和电影,包括蝙蝠侠和汉索罗。 Jim 长期以来最喜欢看的电影是《星球打字:新希望》。 Jim 说:“我是一个星球大战迷” Jim 最喜欢吃意大利菜。 “我喜欢的意大利菜可能是炖鸡”。 Jim 的观点是诚实、创造力、想象力、好奇心和开放性是一个人所能拥有的五大品质。 + +他喜欢写作,这很好,因为他的日常工作主要是写作。 他花了很多时间为像OpenSource.com、CloudSavvy IT 和 Linux Magazine等网站撰写“如何”文章。现在他正在写一本关于C编程的书。除了写作,他还玩电子游戏来放松。他有一台 PlayStation 4游戏机,大多数周六下午他都会坐在电视机前玩游戏。 + +## **Fedora 社区** + +Jim 从1993年开始使用 Linux 。 他的第一个 Linux 发行版本是软著陆 Linux 系统 (SLS) 1.03, 运行 Linux 内核 0.99 补丁级别 11。 “从那以后,我一直是家里全职 Linux 用户”。 Jim在很久以前参加了Fedora核心时代的一个Linux会议之后,对Fedora的参与度更高了。 Jim 和 Tom 在这遇见了“斑点” 卡拉威, 他们开始谈论 Fedora. “ 斑点鼓励我用另一种方式来做贡献:找到bug并报告它们。这就是我参与测试所有Beta版本的原因”. + +Jim 想在 Fedora 改变什么? 他想看到 getfedora 的倒计时。非盈利的组织网站,他告诉新的Beta版本或新的完整版本合适发布是取决于Fedora项目的改变。 并且 Jim 想让人们都知道,使用 Fedora 是多容易。 “对开源做出贡献最具挑战性的事情是找出如何做出他们的第一个贡献。”Jim补充道,“我不知道我和其他开发人员一样是‘Fedora项目成员’。我只是个用户。但是作为一个从1993年或1994年就开始参与开发开源软件的人,我试图成为社区中一个有帮助的成员。因此,我利用一切机会尝试新的 Fedora 版本,甚至是 Beta 版,如果我发现问题,就让人们知道。” +## **你用什么硬件 ?** + +Jim 目前正在运行 ThinkCentre M720 Tiny。 它配置了第8代酷睿 i3-8100T (3.10GHz, 6MB 内存), 32GB (16GB + 16GB) DDR4 2666MHz, 因特尔显卡, 256GB 固态硬盘 PCIe-NVME Opal M.2, 英特尔 8265 802.11AC, 和 蓝牙 4.2。 他的显卡是华硕 VE248H。 Jim说:“这一切都很适合 Fedora!”。 + +他使用 Perixx Periboard-512 人体工程学经典拆分键盘,它从1998年开始取代了他最初的微软天然键盘精英 PS/2 键盘。Jim 说: “我有时候会把我的 Perixx 键盘换成 Unicomp 的 IBM Model M USB克隆键盘。 我很喜欢带有弯曲弹簧动作的点击键盘。 我的是“灰白色”,所以它有种经典的外观和感觉” + +Jim 目前运行的是 Fedora 33 、之前的 Fedora 33 Beta 和 Fedora 32。 Jim说:“我使用 GNOME 3 作为我的桌面。 我发现默认值适合我的大多数需求,所以我没有加载任何GNOME 扩展, 但我确实使用设置和 GNOME 调整了一些东西。 所以我不会做什么大的改变。 例如,我将默认用户界面字体改为使用 Droid Sans Regular 字体。并且我用“设置”来改变键盘快捷键,用Alt-Tab键来切换窗口,而不是切换应用程序。我是在Alt-Tab工作流程中长大的,所以我已经习惯了。”。 他使用火狐和谷歌浏览器来作为他的网络浏览器。 + +为了经营他的咨询业务,Jim依赖于一套应用程序: + + * 使用 [LibreOffice][5] 去写他的书例如,他去年出版了 [《指导按钮》][6],他完全是用 来写这本书的。最近他写了一本关于 [用C语言编写自由DOS程序的书][7] 也用了 LibreOffice 。 + * [INKSCAPE][8] 在矢量格式上用于创造他公司的标志。他的标志从文件上的小角落图像到大幅面的海报或横幅,完美地上下伸缩。并且INKSCAPE允许他导出各种通用格式。Jim说他的广告合作伙伴很欣赏INKSCAPE可以输出到EPS(封装的附言),这使得在产品上打印他的徽标变得很容易。 + * [GIMP][9] 用于其他图形,例如飞溅图片 “我的飞溅图片是我们公司的标准被放在了背景照片上,并且我用它来代替我需要额外装饰的普通标志,比如印刷材料。我也在我的网站上使用了splash图像的一个版本”。 + * [QEMU][10] 运行一个虚拟机,在他那里可以启动 [FreeDOS][11]. “我喜欢使用QEMU,因为我可以在命令行中设置所有需要的选项,这使我在配置虚拟机时有了很大的灵活性。为了使这更容易,我将所有选项放入一个脚本中,并使用该脚本每次使用相同的选项运行QEMU。” + * [Scribus][12] 是用来打印产品的。 Scribus使用起来很容易,它可以创建打印就绪的材料,并带有“全出血”,这意味着任何颜色的背景都会重叠在纸张的边缘。 完全出血需要一个特殊的打印准备文件重叠的打印区域。它甚至还提供切割标记,以便打印机准确地知道要修剪的位置。 + + + +![Scribus – Postcard][13] + +![QEMU – running as easy as in FreeDOS][14] + +![Libre Office Writer][15] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/jim-hall-how-do-you-fedora/ + +作者:[Karimi Hari Priya][a] +选题:[lujun9972][b] +译者:[zz-air](https://github.com/zz-air) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/haripriya21/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/12/PXL_20200929_205044670.PORTRAIT-01.COVER_-816x345.jpg +[2]: https://fedoramagazine.org/tag/how-do-you-fedora +[3]: https://fedoramagazine.org/submit-an-idea-or-tip +[4]: https://hallmentum.com/ +[5]: https://www.libreoffice.org/ +[6]: https://www.amazon.com/Coaching-Buttons-Jim-Hall/dp/0359834930 +[7]: https://www.freedos.org/books/ +[8]: https://inkscape.org/ +[9]: https://www.gimp.org/ +[10]: https://www.qemu.org/ +[11]: https://www.freedos.org/ +[12]: https://www.scribus.net/ +[13]: https://fedoramagazine.org/wp-content/uploads/2021/03/Scribus-postcard-1024x576.png +[14]: https://fedoramagazine.org/wp-content/uploads/2021/03/QEMU-running-AsEasyAs-in-FreeDOS.png +[15]: https://fedoramagazine.org/wp-content/uploads/2021/03/LibreOffice-Writer-book-1-1024x576.png From d998799a3e9e10d4d925fe4883a1bb477c68e88b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 4 Jul 2021 17:49:06 +0800 Subject: [PATCH 296/870] PRF @stevenzdg988 --- ...Music composition with Python and Linux.md | 79 +++++++++---------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/translated/tech/20200210 Music composition with Python and Linux.md b/translated/tech/20200210 Music composition with Python and Linux.md index 3813bda801..cef42d77c8 100644 --- a/translated/tech/20200210 Music composition with Python and Linux.md +++ b/translated/tech/20200210 Music composition with Python and Linux.md @@ -1,85 +1,82 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Music composition with Python and Linux) [#]: via: (https://opensource.com/article/20/2/linux-open-source-music) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) -Music composition with Python and Linux -用 Python 和 Linux 进行音乐创作 +“MAGFest 先生”专访:用 Python 和 Linux 进行音乐创作 ====== -与 MAGFest 先生的聊天——Brendan Becker。 -![接入网络交换机的网络线缆][1] -1999 年,我遇到了在一家计算机商店工作的 Brendan Becker。我们都喜欢构建定制计算机并在其上安装 Linux。 Brendan 总是同时参与多个技术项目,从游戏编程到音乐创作。从电脑商店的日子快进几年,他继续编写[pyDance][2],一个多跳舞游戏的开源实现,然后成为音乐和游戏项目[MAGFest][3]的 CEO。有时被称为 “Mr. MAGFest”,因为他是项目的负责人,Brendan 现在使用音乐笔名 “[Inverse Phase][4]” 作为 `chiptunes`(电子和音)的作曲家——主要在8位计算机和游戏控制台上制作音乐。 +> 与 “MAGFest 先生” Brendan Becker 的对话。 -我认为采访他并询问他在整个职业生涯中如何从 Linux 和开源软件中受益的一些细节会很有趣。 +![](https://img.linux.net.cn/data/attachment/album/202107/04/174833k7uvo4l5vov7umv4.jpg) + +1999 年,我在一家计算机商店工作时遇到了 Brendan Becker。我们都喜欢构建定制计算机并在其上安装 Linux。Brendan 一直在同时参与着从游戏编程到音乐创作的多个技术项目。从那之后快进几年,他继续编写 [pyDance][2],这是一个多舞种游戏的开源实现,然后成为了音乐和游戏项目 [MAGFest][3] 的 CEO。他有时被称为 “MAGFest 先生”,因为他是该项目的负责人,Brendan 现在使用的音乐笔名是 “[Inverse Phase][4]”,是一位电子合音chiptune(主要在 8 位计算机和游戏机上创作的音乐)作曲家。 + +我认为采访并询问他在整个职业生涯中如何从 Linux 和开源软件中受益的一些细节会很有趣。 ![Inverse Phase 表演照片][5] -版权所有 Nickeledge, CC BY-SA 2.0. +### 你是如何开始接触计算机和软件的? -### Alan Formy-Duval: 您是如何开始使用计算机和软件的? +Brendan Becker:从我记事起,我家就有一台电脑。我父亲热衷于技术;在康柏便携式电脑刚刚上市时,他就带了一台回家,当他不在上面工作时,我就可以使用它。由于我两岁时就开始阅读,使用电脑就成了我的第二天性——只要阅读磁盘上的内容,按照说明进行操作,我就可以玩游戏了!有时我会玩一些学习和教育软件,我们有几张装满游戏的磁盘,我可以在其他时间玩。我记得有一张磁盘,里面有一些流行游戏的免费副本。后来,我父亲向我展示了我们可以呼叫其他计算机(我 5 岁时就上了 BBS!),我看到了一些游戏来自那儿。我喜欢玩的一款游戏是用 BASIC 编写的,当我意识到我可以简单地修改游戏,只需阅读一些内容并重新输入它们游戏就会更轻松,玩游戏就没意思了。 -Brendan Becker:从我记事起,我家就有一台电脑。我父亲热衷于技术;当 Compaq Portable 第一次大量上市时,他带了一台回家,当他不用它工作时,我可以使用它。自从我两岁开始阅读来,使用电脑就成了我的第二天性——只要阅读磁盘上的内容,按照说明进行操作,我就可以玩游戏了!有时我会玩学习和教育软件,我们有几张装满游戏的磁盘,我可以在其他时间玩。我记得有一个磁盘,里面有一些流行主题的免费克隆。最终,我父亲向我展示了我们可以调用其他计算机(5 岁时在 BBS 上!),我看到了一些游戏的来源。我喜欢玩的一款游戏是用 BASIC 编写的,当我意识到我可以简单地修改游戏时,只需阅读一些内容并重新输入它们以使我的游戏更容易,所有的赌注都被取消了。 +### 这是上世纪 80 年代? -### Formy-Duval: 这是 80 年代? +Becker:康柏便携式电脑于 1983 年推出,这可以给你一些参考。我爸爸有一个那个型号的初代产品。 -Becker: Compaq Portable 康柏便携式电脑于 1983 年推出,为您提供了一个参考框架。我爸爸有第一个那个模型。 +### 你是如何进入 Linux 和开源软件的? -### Formy-Duval: 您是如何进入 Linux 和开源软件的? +Becker:在上世纪 90 年代初,我酷爱 MOD 和演示场景demoscene之类的东西,我注意到 Walnut Creek(即 [cdrom.com][6];现已解散)在 FreeBSD 上开设了商店。总的来说,我对 Unix 和其他操作系统非常好奇,但没有太多的第一手资料,我认为是时候尝试一些东西了。当时 DOOM 刚刚发布,有人告诉我,我可以试着在计算机上运行它。在这与能够运行很酷的互联网服务器之间,我开始陷入两难取舍。有人看到我在阅读有关 FreeBSD 的文章,并建议我了解一下 Linux,这是一个为 x86 重新编写的新操作系统,与 BSD 不同,(他们说)后者存在一些兼容性问题。因此,我加入了 undernet IRC 上的 #linuxhelp 频道,询问如何开始使用 Linux,并表明我已经做了一些研究(我已经能问出 “Red Hat 和 Slackware 之间有什么区别?”这样的问题),想知道什么是最容易使用的。频道里唯一说话的人说他已经 13 岁了,他都能弄明白 Slackware,所以我应该不会有问题。学校的一个数学老师给了我一个硬盘,我下载了 “A” 盘组和一个启动盘,写入到软盘,安装了它,回头看也并没有花太多时间。 -Becker:在 90 年代初我酷爱 MOD 和演示场景的东西,我注意到 Walnut Creek([cdrom.com][6];现已解散)在 FreeBSD 上运行商店。总的来说,我对 Unix 和其他操作系统非常好奇,但没有太多的第一手资料,认为是时候尝试一些东西了。DOOM 刚刚发布,有人告诉我甚至可以让它运行。在这与能够运行很酷的互联网服务器之间,我开始陷入困境。有人看到我在阅读有关 FreeBSD 的文章,并建议我检查 Linux,这是一个重新为 x86 编写的新操作系统,与 BSD 不同,后者(他们说)存在一些兼容性问题。因此,我加入了在线交谈网络 IRC 上的 `#linuxhelp` 并询问如何开始使用 Linux,指出我已经做了一些研究(询问 “Red Hat 和 Slackware 之间有什么区别?”)并主要探讨什么是最简单的使用。频道里唯一说话的人说他已经 13 岁了,他可以弄清楚 Slackware,所以我应该没有问题。学校的一个数学老师给了我一个硬盘,我下载了 “A” 盘组和一个启动盘,写了出来,安装了它,回头看并没有花太多时间。 +### 你是如何被称为 “MAGFest 先生”的? -### Formy-Duval: 你是如何被称为 MAGFest 先生的? +Becker:嗯,这个很简单。在第一个活动后,我几乎立即成为了 MAGFest 的代理负责人。前任主席都各奔东西,我向负责人要求不要取消活动。解决方案就是自己运营它,当我慢慢地将项目塑造成我自己的时,这个昵称就成了我的。 -Becker:嗯,这个很简单。在第一个项目后,我几乎立即成为了 MAGFest 的代理负责人。前任主席都各奔东西,我向负责人要求不要取消项目。解决方案是自己运行它,当我慢慢地将项目塑造成我自己的时,这个昵称就成了我的。 +### 我记得我在早期参加过,MAGFest 最终变得有多大? -### Formy-Duval: 我记得在那些早期参加过。 MAGFest 到底有多大? +Becker:第一届 MAGFest 是 265 人。现在它超大,有两万多名不同的参与者。 -Becker:第一届 MAGFest 是 265 人。现在是一个可怕的庞大的罕见的 20,000+ 出席者。 +### 太棒了!你能简要描述一下 MAGFest 大会吗? -### Formy-Duval: 太棒了!您能简要描述一下 MAGFest 大会吗? +Becker:我的一个朋友 Hex 描述得非常好。他说:“就像是和你所有的朋友一起举办这个以电子游戏为主题的生日派对,那里恰好有几千人,如果你愿意,他们都可以成为你的朋友,然后还有摇滚音乐会。” 这很快被采用并缩短为 “这是一个为期四天的电子游戏派对,有多场电子游戏摇滚音乐会”。通常 “音乐和游戏节” 这句话就能让人们明白这个意思。 -Becker:我的一个朋友 Hex 描述得非常好。他说:“就像是和你所有的朋友一起举办这个以电子游戏为主题的生日派对,但那里恰好有几千人,如果你愿意,他们都可以成为你的朋友,然后还有摇滚音乐会。” 这很快被采用并缩短为 “这是一个为期四天的视频游戏派对,有多个视频游戏摇滚音乐会”。通常 “音乐和游戏节” 这个措词是人们所需要的。 +### 你是如何利用开源软件来运行 MAGFest 的? -### Formy-Duval: 您是如何利用开源软件来运行 MAGFest 的? +Becker:当我成为 MAGFest 的负责人时,我已经用 Python 编写了一个游戏,所以我觉得用 Python 编写我们的注册系统最舒服。这是一个非常轻松的决定,因为不涉及任何费用,而且我已经有了经验。后来,我们的在线注册系统和拼车界面都是用 PHP/MySQL 编写的,我们的论坛使用了 Kboard。最终,这发展到我们用 Python 从头开始编写了自己的注册系统,我们也在活动中使用它,并在主网站上运行 Drupal。有一次,我还用 Python 编写了一个系统来管理视频室和邀请比赛站。哦,我们有一些游戏音乐收听站,你可以翻阅标志性的游戏 OST(原始音轨)的曲目和简介,和演奏 MAGFest 的乐队。 -Becker:当我成为 MAGFest 的负责人时,我已经用 Python 编写了一个游戏,所以我觉得用 Python 编写我们的注册系统最舒服。这是一个非常容易的决定,因为不涉及任何成本,而且我已经有了经验。后来,我们的在线注册系统和拼车界面都是用 PHP/MySQL 编写的,我们的论坛使用了 Kboard。最终,从无到有逐渐形成在 Python 中滚动我们自己的注册系统,我们也在项目中使用它,并在主网站上运行 Drupal。有一次,我还用 Python 编写了一个系统来管理视频室和邀请比赛站。哦,我们有一些游戏音乐收听站,你可以翻阅曲目,标志性游戏的班轮笔记 OST(原始音轨)和演奏 MAGFest 的乐队。 +### 我知道几年前你减少了你在 MAGFest 的职责,去追求新的项目。你接下来的努力是什么? -### Formy-Duval: 我知道几年前你减少了你在 MAGFest 的职责,去追求新的项目。你接下来的努力是什么? +Becker:我一直非常投入游戏音乐领域,并试图将尽可能多的音乐带到 MAGFest 中。随着我越来越多地成为这些社区的一部分,我想参与其中。我使用以前用过的自由开源版本的 DOS 和 Windows 演示场景工具编写了一些视频游戏曲调的混合曲、封面和编曲,我以前使用过的这种工具也是免费的,但不一定是开源的。我在运行 MAGFest 的最初几年发布了一些曲目,然后在 Jake Kaufman(也被称为 `virt`;在他的简历之外也叫 Shovel Knight 和 Shantae)的一些严厉的关爱和建议之后,我改变主题到我更擅长的电子和音。尽管我小时候就用我的康柏便携式电脑编写了 PC 扬声器发出的哔哔啵啵声,并在 90 年代的演示场景中写过 MOD 文件,但我在 2006 年发布了第一首 NES 规格的曲目,我真的能很自豪地称之为我自己的作品。随后还有几张流行音乐的作品和专辑。 -Becker:我一直非常投入游戏音乐领域,并试图将尽可能多的音乐带到 MAGFest 中。随着我越来越多地成为这些社区的一部分,我想参与其中。我使用我以前使用过的免费开源版本的 DOS 和 Windows 演示场景工具编写了一些视频游戏曲调的混合曲、封面和编曲,这些工具也是免费的,但不一定是开源的。我在运行 MAGFest 的最初几年发布了一些曲目,然后在 Jake Kaufman(也被称为 `virt`;其中包括 Shovel Knight 和 Shantae 等人在他的简历上)的一些严厉的爱和建议之后,我改变主题到我更擅长的—— `chiptunes`(电子和音)。尽管我在 90 年代的演示场景中用我的 Compaq Portable 和 MOD 文件编写了 PC 扬声器的哔哔声和嘘声,但我还是在 2006 年发布了第一首 NES-spec 曲目,我真的很自豪地称之为我自己的曲目。专辑紧随其后。 +2010 年,有很多人找我做游戏配乐工作。尽管配乐工作对它没有太大影响,但我开始更认真地缩减我在 MAGFest 的一些职责,并且在 2011 年,我决定更多地进入幕后。我会留在董事会担任顾问,帮助人们了解他们需要什么来管理他们的部门,但我不再掌舵了。与此同时,我的兼职工作,即给我支付账单的工作,解雇了他们所有的工人,我突然发现自己有了很多空闲时间。我开始写《 Pretty Eight Machine》,这是一首向《Nine Inch Nails》致敬的作品,我在这个事情和游戏配乐工作之间花了一年多,我向自己证明了我可以用音乐来(即便只是勉强)维持生计,这就是我接下来想做的。 -2010 年,有很多人找我做游戏配乐工作。尽管配乐工作对它没有太大影响,但我开始更认真地缩减我在 MAGFest 的一些职责,并且在 2011 年,我决定在后台采取更大的步骤。我会留在董事会担任顾问,帮助人们了解他们需要什么来管理他们的部门,但我不再掌舵了。与此同时,我的兼职工作,即支付账单,解雇了他们所有的工人,我突然发现自己有很多空闲时间。我开始写 Pretty Eight Machine, Nine Inch Nails 致敬,我花了一年多,在那和游戏配乐工作之间,我向自己证明了我可以用音乐把食物放在桌子上(如果只是勉强),这就是我接下来想做的。 +![Inverse Phase CTM Tracker][7] -### +*版权所有 Inverse Phase,经许可使用。* -![Inverse Phase CTM 跟踪器][7] +### 就硬件和软件而言,你的工作空间是什么样的? -版权所有 Inverse Phase,经许可使用。 +Becker:在我的 DOS/Windows 时代,我主要使用 FastTracker 2。在 Linux 中,我将其替换为 SoundTracker(不是 Karsten Obarski 的原始版本,而是 GTK 重写版本;参见 [soundtracker.org][8])。近来,SoundTracker 处于不断变化的状态——虽然我仍然需要尝试新的 GTK3 版本——但是当我无法使用 SoundTracker 时,[MilkyTracker][9] 是一个很好的替代品。如果我真的需要原版 FastTracker 2,虽然老旧但它也可以在 DOSBox 中运行起来。然而,那是我开始使用 Linux 的时候,所以这是我在 20-25 年前发现的东西。 -### Formy-Duval: 就硬件和软件而言,您的工作空间是什么样的? +在过去的十年里,我已经从基于采样的音乐转向了电子和音,这是由来自 8 位和 16 位游戏系统和计算机的旧声音芯片合成的音乐。有一个非常好的跨平台工具叫 [Deflemask][10],可以为许多这些系统编写音乐。不过,我想为其创作音乐的一些系统不受支持,而且 Deflemask 是闭源的,因此我已经开始使用 Python 和 [Pygame][11] 从头开始构建自己的音乐创作环境。我使用 Git 维护我的代码树,并将使用开源的 [KiCad][12] 控制硬件合成器板。 -Becker:在我的 DOS/Windows 时代,我主要使用 FastTracker 2。在 Linux 中,我将其替换为 SoundTracker(不是 Karsten Obarski 的原始版本,而是 GTK 重写;参见 [soundtracker.org][8])。这些天,SoundTracker 处于不断变化的状态——虽然我仍然需要尝试新的 GTK3 版本——但是当我无法使用 SoundTracker 时,[MilkyTracker][9] 是一个很好的替代品。如果我真的需要原版,那么好老的 FastTracker 2 也可以在 DOSBox 中运行。然而,那是我开始使用 Linux 的时候,所以这是我在 20-25 年前发现的东西。 +### 你目前专注于哪些项目? -在过去的十年里,我已经从基于样本的音乐转向了`chiptunes`(电子和音)——由来自 8 位和 16 位游戏系统和计算机的旧声音芯片合成的音乐。有一个非常好的跨平台工具 [Deflemask][10] 可以为许多这些系统编写音乐。不过,我想为其创作音乐的一些系统不受支持,而且 Deflemask 是闭源的,因此我已经开始使用 Python 和 [Pygame][11] 从头开始构建自己的音乐创作环境。我使用 Git 维护我的代码树,并将使用开源 [KiCad][12] 控制硬件合成器板。 +Becker:我断断续续地从事于游戏配乐和音乐委托工作。在此期间,我还一直致力于创办一个名为 [Bloop][13] 的电子娱乐博物馆。我们在档案和库存方面做了很多很酷的事情,但也许最令人兴奋的是我们一直在用树莓派构建展览。它们的用途非常广泛,而且我觉得很奇怪,如果我在十年前尝试这样做,我就不会有可以驱动我的展品的小型单板计算机;我可能会用把一个平板固定在笔记本电脑的背面! -### Formy-Duval: 您目前专注于哪些项目? +### 现在有更多游戏平台进入 Linux,例如 Steam、Lutris 和 Play-on-Linux。你认为这种趋势会持续下去吗?这些会一直存在吗? -Becker:我断断续续地制作游戏配乐和音乐委员会。在此期间,我还一直致力于创办一个名为 [Bloop][13] 的电子娱乐博物馆。我们在档案和详细目录方面做了很多很酷的事情,但也许最令人兴奋的是我们一直在用 Raspberry Pi 构建展览。它们是如此多才多艺,而且很奇怪,如果我在十年前尝试这样做,我就不会拥有小型单板计算机来驱动我的展品;我可能会用螺栓将笔记本电脑固定在平板的背面! +Becker:作为一个在 Linux 上玩了 25 年游戏的人——事实上,我 _是因为_ 游戏才接触 Linux 的——我想我认为这个问题比大多数人认为的更艰难。我已经玩了 Linux 原生游戏几十年了,我甚至不得不对收回我当年说的“要么存在 Linux 解决方案,要么编写出来”这样的话,但最终,我做到了,我编写了一个 Linux 游戏。 -### Formy-Duval: 现在有更多游戏平台进入 Linux,例如 Steam、Lutris 和 Play-on-Linux。您认为这种趋势会持续下去吗?这些会一直存在吗? +说实话:Android 问世于 2008 年。如果你在 Android 上玩过游戏,那么你就在 Linux 上玩过游戏。Steam 在 Linux 已经八年了。Steambox/SteamOS 发布在 Steam 发布一年后。我没有听到太多 Lutris 或 Play-on-Linux 的消息,但我知道它们并希望它们成功。我确实看到 GOG 的追随者非常多,我认为这非常好。我看到很多来自 Ryan Gordon(icculus)和 Ethan Lee(flibitijibibo)等人的高质量游戏移植,甚至有些公司在内部移植。Unity 和 Unreal 等游戏引擎已经支持 Linux。Valve 已经将 Proton 纳入 Linux 版本的 Steam 已有两年左右的时间了,所以现在 Linux 用户甚至不必搜索他们游戏的 Linux 原生版本。 -Becker:作为一个在 Linux 上玩了 25 年游戏的人——事实上,我被带到 Linux _是因为_ 游戏——我想我认为这个问题比大多数人更难。几十年来,我一直在运行 Linux 原生游戏,我甚至不得不对“存在 Linux 解决方案或可以编写”的话表示食言,但最终,我做到了,编写了一个 Linux 游戏。 +我可以说,我认为大多数游戏玩家期待并将继续期待他们已经从零售游戏市场获得的支持水平。就我个人而言,我希望这个水平是增长而不是下降! -真心话:Android 于 2008 年问世。如果您在 Android 上玩过游戏,那么您就在 Linux 上玩过游戏。Steam 已可用于 Linux 八年。Steambox/SteamOS 仅在 Steam 发布一年后发布。我没有听到很多关于 Lutris 或 Play-on-Linux 的消息,但我知道它们存在并希望它们成功。我确实看到 GOG 的追随者非常多,我认为这非常好。我看到很多高质量的游戏端口来自 Ryan Gordon (icculus) 和 Ethan Lee (flibitijibibo) 等人,甚至有些公司在内部移植。Unity 和 Unreal 等游戏引擎已经支持 Linux。Valve 已经将 Proton 纳入 Linux 版本的 Steam 已有两年左右的时间了,所以现在 Linux 用户甚至不必搜索他们游戏的 Linux 原生版本。 - -我可以说,我认为大多数游戏玩家期待并将继续期待他们已经从零售游戏市场获得的支持水平。就我个人而言,我希望这个水平增长而不是下降! - -_详细了解 Brendan 担任 [Inverse Phase][14] 的工作。_ +_详细了解 Brendan 的 [Inverse Phase][14] 工作。_ -------------------------------------------------------------------------------- @@ -88,7 +85,7 @@ via: https://opensource.com/article/20/2/linux-open-source-music 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b277b03584983d03126e4391a8e47805db6dd2f2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 4 Jul 2021 17:49:53 +0800 Subject: [PATCH 297/870] PUB @stevenzdg988 https://linux.cn/article-13547-1.html --- .../20200210 Music composition with Python and Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200210 Music composition with Python and Linux.md (99%) diff --git a/translated/tech/20200210 Music composition with Python and Linux.md b/published/20200210 Music composition with Python and Linux.md similarity index 99% rename from translated/tech/20200210 Music composition with Python and Linux.md rename to published/20200210 Music composition with Python and Linux.md index cef42d77c8..ca457a139a 100644 --- a/translated/tech/20200210 Music composition with Python and Linux.md +++ b/published/20200210 Music composition with Python and Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13547-1.html) [#]: subject: (Music composition with Python and Linux) [#]: via: (https://opensource.com/article/20/2/linux-open-source-music) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From 0b54ee3488f93f86fa4cc41a65429d502b446e93 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 4 Jul 2021 18:14:11 +0800 Subject: [PATCH 298/870] PUB @geekpi https://linux.cn/article-13548-1.html --- ...24 Copy files between Linux and FreeDOS.md | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) rename {translated/tech => published}/20210624 Copy files between Linux and FreeDOS.md (80%) diff --git a/translated/tech/20210624 Copy files between Linux and FreeDOS.md b/published/20210624 Copy files between Linux and FreeDOS.md similarity index 80% rename from translated/tech/20210624 Copy files between Linux and FreeDOS.md rename to published/20210624 Copy files between Linux and FreeDOS.md index d8a383e4c9..55fe83b30b 100644 --- a/translated/tech/20210624 Copy files between Linux and FreeDOS.md +++ b/published/20210624 Copy files between Linux and FreeDOS.md @@ -3,46 +3,45 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13548-1.html) 在 Linux 和 FreeDOS 之间复制文件 ====== -下面是我如何在我的 FreeDOS 虚拟机和 Linux 桌面系统之间传输文件。 -![Files in a folder][1] + +> 下面是我如何在我的 FreeDOS 虚拟机和 Linux 桌面系统之间传输文件。 + +![](https://img.linux.net.cn/data/attachment/album/202107/04/181327bfvv3mmzby9z2dpr.jpg) 我运行 Linux 作为我的主要操作系统,我在一个虚拟机中启动 FreeDOS。大多数时候,我使用 QEMU 作为我的 PC 模拟器,但有时我会用 GNOME Boxes(它使用 QEMU 作为后端虚拟机)或用 VirtualBox 运行其他实验。 -我喜欢玩经典的 DOS 游戏,有时我也会调出一个最喜欢的 DOS 应用。我在管理信息系统 (MIS) 课上讲计算机的历史,有时我会用 FreeDOS 和一个传统的 DOS 应用录制一个演示,比如 As-Easy-As(我最喜欢的 DOS 电子表格,曾经作为“共享软件”发布,但现在可以[从 TRIUS 公司免费获得)][2])。 +我喜欢玩经典的 DOS 游戏,有时我也会调出一个最喜欢的 DOS 应用。我在管理信息系统(MIS)课上讲计算机的历史,有时我会用 FreeDOS 和一个传统的 DOS 应用录制一个演示,比如 As-Easy-As(我最喜欢的 DOS 电子表格,曾经作为“共享软件”发布,但现在可以 [从 TRIUS 公司免费获得][2])。 但是以这种方式使用 FreeDOS 意味着我需要在我的 FreeDOS 虚拟机和我的 Linux桌 面系统之间传输文件。让我来展示是如何做到这一点的。 ### 用 guestmount 访问镜像 -我曾经通过计算第一个 DOS 分区的偏移量来访问我的虚拟磁盘镜像,然后用正确的选项组合来调用 Linux 的 `mount` 命令来匹配这个偏移量。这总是很容易出错,而且不是很灵活。幸运的是,有一个更简单的方法可以做到这一点。来自 [libguestfs-tools][3] 包的 `guestmount` 程序可以让你从 Linux 中访问或_挂载_虚拟磁盘镜像。你可以在 Fedora 上用这个命令安装 `libguestfs-tools`: - +我曾经通过计算第一个 DOS 分区的偏移量来访问我的虚拟磁盘镜像,然后用正确的选项组合来调用 Linux 的 `mount` 命令来匹配这个偏移量。这总是很容易出错,而且不是很灵活。幸运的是,有一个更简单的方法可以做到这一点。来自 [libguestfs-tools][3] 包的 `guestmount` 程序可以让你从 Linux 中访问或 _挂载_ 虚拟磁盘镜像。你可以在 Fedora 上用这个命令安装 `libguestfs-tools`: ``` -`$ yum install libguestfs-tools libguestfs` +$ yum install libguestfs-tools libguestfs ``` 使用 `guestmount` 并不像从 GNOME 文件管理器中双击文件那么简单,但命令行的使用并不难。`guestmount` 的基本用法是: - ``` -`$ guestmount -a image -m device mountpoint` +$ guestmount -a image -m device mountpoint ``` -在这个用法中,_image_ 是要使用的虚拟磁盘镜像。在我的系统中,我用 `qemu-img` 命令创建了 QEMU 虚拟磁盘镜像。`guestmount` 程序可以读取这种磁盘镜像格式,以及 GNOME Boxes 使用的 QCOW2 镜像格式,或者 VirtualBox 使用的 VDI 镜像格式。 +在这个用法中,`image` 是要使用的虚拟磁盘镜像。在我的系统中,我用 `qemu-img` 命令创建了 QEMU 虚拟磁盘镜像。`guestmount` 程序可以读取这种磁盘镜像格式,以及 GNOME Boxes 使用的 QCOW2 镜像格式,或者 VirtualBox 使用的 VDI 镜像格式。 -_device_ 选项表示虚拟磁盘上的分区。想象一下,把这个虚拟磁盘当作一个真正的硬盘使用。你可以用 `/dev/sda1` 访问第一个分区,用 `/dev/sda2` 访问第二个分区,以此类推。这就是 `guestmount` 的语法。默认情况下,FreeDOS 1.3 RC4 在一个空的驱动器上创建了一个分区,所以访问这个分区的时候要用 `/dev/sda1`。 +`device` 选项表示虚拟磁盘上的分区。想象一下,把这个虚拟磁盘当作一个真正的硬盘使用。你可以用 `/dev/sda1` 访问第一个分区,用 `/dev/sda2` 访问第二个分区,以此类推。这就是 `guestmount` 的语法。默认情况下,FreeDOS 1.3 RC4 在一个空的驱动器上创建了一个分区,所以访问这个分区的时候要用 `/dev/sda1`。 -而 _mountpoint_ 是在你的本地 Linux 系统上“挂载” DOS 文件系统的位置。我通常会创建一个临时目录来工作。你只在访问虚拟磁盘时需要挂载点。 +而 `mountpoint` 是在你的本地 Linux 系统上“挂载” DOS 文件系统的位置。我通常会创建一个临时目录来工作。你只在访问虚拟磁盘时需要挂载点。 综上所述,我使用这组命令从 Linux 访问我的 FreeDOS 虚拟磁盘镜像: - ``` $ mkdir /tmp/freedos $ guestmount -a freedos.img -m /dev/sda1 /tmp/freedos @@ -50,7 +49,6 @@ $ guestmount -a freedos.img -m /dev/sda1 /tmp/freedos 之后,我可以通过 `/tmp/freedos` 目录访问我的 FreeDOS 文件,使用 Linux 上的普通工具。我可以在命令行中使用 `ls /tmp/freedos`,或者使用桌面文件管理器打开 `/tmp/freedos` 挂载点。 - ``` $ ls -l /tmp/freedos total 216 @@ -70,19 +68,16 @@ drwxr-xr-x. 3 root root 8192 May 11 18:33 TEMP ![GNOME file manager][4] -使用 GNOME 文件管理器来访问虚拟磁盘 -(Jim Hall, [CC-BY SA 4.0][5]) +*使用 GNOME 文件管理器来访问虚拟磁盘* 例如,要从我的 Linux `projects` 目录中复制几个 C 源文件到虚拟磁盘镜像上的 `C:\SRC`,以便我以后能在 FreeDOS 下使用这些文件,我可以使用 Linux `cp` 命令: - ``` -`$ cp /home/jhall/projects/*.c /tmp/freedos/SRC` +$ cp /home/jhall/projects/*.c /tmp/freedos/SRC ``` 虚拟驱动器上的文件和目录在技术上是不分大小写的,所以你可以用大写或小写字母来引用它们。然而,我发现使用所有大写字母来输入 DOS 文件和目录更为自然。 - ``` $ ls /tmp/freedos APPS CONFIG.SYS EDLIN FDCONFIG.SYS KERNEL.SYS SRC.ZIP @@ -97,12 +92,12 @@ EDLIN.EXE MAKEFILE.OW ### 用 guestmount 卸载 -在你再次在虚拟机中使用虚拟磁盘镜像之前,你应该总是先_卸载_。如果你在运行 QEMU 或 VirtualBox 时让镜像挂载,你有可能弄乱你的文件。 +在你再次在虚拟机中使用虚拟磁盘镜像之前,你应该总是先 _卸载_。如果你在运行 QEMU 或 VirtualBox 时让镜像挂载,你有可能弄乱你的文件。 与 `guestmount` 配套的命令是 `guestunmount`,用来卸载磁盘镜像。只要给出你想卸载的挂载点就可以了: ``` -`$ guestunmount /tmp/freedos` +$ guestunmount /tmp/freedos ``` 请注意命令拼写与 Linux 的 `umount` 稍有不同。 @@ -114,7 +109,7 @@ via: https://opensource.com/article/21/6/copy-files-linux-freedos 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2a522942f7016532db283da07a1cbab27df2eb95 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 5 Jul 2021 05:03:08 +0800 Subject: [PATCH 299/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210704=20?= =?UTF-8?q?7=20guides=20about=20open=20source=20to=20keep=20your=20brain?= =?UTF-8?q?=20busy=20this=20summer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md --- ...rce to keep your brain busy this summer.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md diff --git a/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md b/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md new file mode 100644 index 0000000000..f4a98ab19f --- /dev/null +++ b/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md @@ -0,0 +1,111 @@ +[#]: subject: (7 guides about open source to keep your brain busy this summer) +[#]: via: (https://opensource.com/article/21/7/open-source-guides) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +7 guides about open source to keep your brain busy this summer +====== +Download one of our free guides to build a Python-based video game, get +organized with open source tools, work on your home automation project, +or experiment with your Raspberry Pi homelab. +![One chair on a sandy beach][1] + +### Start a new Raspberry Pi project + +The Raspberry Pi has been capturing the hearts and hands of open source enthusiasts for nearly a decade. There are endless options with what you can do with a Raspberry Pi, whether it's [monitoring your garden][2], [setting parental controls][3] (especially handy on those long summer days), or even [tracking aircraft][4] from your own backyard. If any of these cool projects perked your interest but your Raspberry Pi is still collecting dust, then you need to download our guide to nudge you to get started. Before you know it, you'll be working with so many Raspberry Pis, you'll need to learn [how to manage them all][5]! + +**Download: [How to get started with your Raspberry Pi][6]** + +### Design your open source smart home + +One clever and useful way to use your Raspberry Pi is to design your own smart home. Using Home Assistant and other open source tools, your home can be automated on your own terms without a third-party conglomerate. Author [Steve Ovens][7] guides you through every step of the way with a collection of home automation found in this handy eBook. + +**Download: [A practical guide to home automation using open source tools][7]** + +### Get organized + +Maybe you're not quite ready to automate everything in your home yet but are interested in sprucing up the place—your brain space. Why not start with your to-do list? With contributor [Kevin Sonney's][8] productivity guide, you'll become familiar with 6 open source tools to help you stay organized. Once you're through with his tutorials, you'll be organized and have time to finally relax this summer. + +**Download: [6 open source tools for staying organized][9]** + +### Learn how to code + +Computers are everywhere. Wouldn't it be great to be able to talk their language? + +There are lots of languages designed for beginners. Bash is the same scripting language used in the Linux and MacOS terminals, so it makes for a great start if you're new to code. You can [learn it interactively][10], and then download our eBook to learn more. + +**Download:** **[An introduction to programming with Bash][11]** + +### Build a video game with Python + +Another programming language that beginners love is Python. It's equally as popular among school children just learning to code as it is with professional programmers [developing websites][12] and [video editors][13] or [automating the cloud][14]. Regardless of what your eventual goal happens to be, a fun way to start with Python is by programming your own video game. + +**Download: [A guide to building a video game with Python][15]** + +### Discover clever ways to use Jupyter + +To make Python interactive and easy to share, the Jupyter project provides a web-based development environment. You can write your code in "notebook" files, and then send them to other users to make it easy for them to replicate and visualize what you've done. It's the perfect combination of code, documentation, and presentation, and it's surprisingly flexible. Learn more by downloading Moshe Zadka's multifaceted tour through Jupyter. + +**Download: [6 surprising ways to use Jupyter][16]** + +### Experiment with Kubernetes in your homelab + +So you've installed Linux on your Pi, you've logged in, you've set up a new user and [configured sudo][17] to make administration painless, and you're [running all the services][18] you need. Now what? + +If you're comfortable with Linux and server administration, the next step for you could be The Cloud. Get Chris Collins' eBook to learn all about containers, pods, and clusters, all from the comfort of your own homelab. + +**Download: [Running Kubernetes on your Raspberry Pi homelab][19]** + +### Bonus: Book lists + +All work and no play isn't healthy. Summer (or whatever season it is in your part of the world) vacation is meant to be relaxing, and there's nothing quite like sitting back on the porch or beach with a good book. Here are a few recent book lists to spark some ideas: + + * [8 books for open source technologists (2021)][20] + * [A dozen books for all ages][21] + * [8 leadership books for self-improvement][22] + * [6 must-read books for aspiring Cloud Architects][23] + * Our very first [book list from 2010][24] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-source-guides + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chen-mizrach-unsplash.jpg?itok=S_wIO5e8 (One chair on a sandy beach) +[2]: https://opensource.com/article/21/5/monitor-greenhouse-open-source +[3]: https://opensource.com/article/21/3/raspberry-pi-parental-control +[4]: https://opensource.com/article/21/3/tracking-flights-raspberry-pi +[5]: https://opensource.com/article/21/5/raspberry-pi-cockpit +[6]: https://opensource.com/downloads/raspberry-pi-guide +[7]: https://opensource.com/downloads/home-automation-ebook +[8]: https://opensource.com/users/ksonney +[9]: https://opensource.com/downloads/organization-tools +[10]: https://opensource.com/article/19/10/learn-bash-command-line-games#bashcrawl +[11]: https://opensource.com/downloads/bash-programming-guide +[12]: https://opensource.com/article/18/4/flask +[13]: https://opensource.com/article/21/2/linux-python-video +[14]: https://opensource.com/article/19/2/quickstart-guide-ansible +[15]: https://opensource.com/downloads/python-gaming-ebook +[16]: https://opensource.com/downloads/jupyter-guide +[17]: https://opensource.com/article/19/10/know-about-sudo +[18]: https://opensource.com/article/20/5/systemd-units +[19]: https://opensource.com/downloads/kubernetes-raspberry-pi +[20]: https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list +[21]: https://opensource.com/article/20/6/summer-reading-list +[22]: https://enterprisersproject.com/article/2021/5/8-leadership-books-self-improvement +[23]: https://www.redhat.com/architect/books-cloud-architects +[24]: https://opensource.com/life/10/8/open-books-opensourcecom-summer-reading-list From 09944524531f8bdc825ee8b0e239e0dd6692c25f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 5 Jul 2021 05:04:02 +0800 Subject: [PATCH 300/870] =?UTF-8?q?=E9=80=89=E9=A2=98[talk]:=2020210704=20?= =?UTF-8?q?Pricing=20Yourself=20as=20a=20Contractor=20101?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20210704 Pricing Yourself as a Contractor 101.md --- ...04 Pricing Yourself as a Contractor 101.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/talk/20210704 Pricing Yourself as a Contractor 101.md diff --git a/sources/talk/20210704 Pricing Yourself as a Contractor 101.md b/sources/talk/20210704 Pricing Yourself as a Contractor 101.md new file mode 100644 index 0000000000..31c258f304 --- /dev/null +++ b/sources/talk/20210704 Pricing Yourself as a Contractor 101.md @@ -0,0 +1,78 @@ +[#]: subject: (Pricing Yourself as a Contractor 101) +[#]: via: (https://theartofmachinery.com/2021/07/04/pricing_as_contractor_101.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Pricing Yourself as a Contractor 101 +====== + +I’ve been self-employed for most of my career. Sometimes I talk to other people who are interested in leaving a full-time job to do some kind of contracting or service business. By far, the most common newbie mistake that we all seem to make is in pricing ourselves. + +Take [this useful blog post that breaks down employee income vs freelancer income in the US][1]. It estimates that you need $140k revenue as a freelancer in the US to have the equivalent of $100k employee compensation. I remember finding calculations like that really useful when I first started a business. However, some people will look at the result and think, “Gee, I have to make 1.4x as much if I’m self employed. Can I really do that?” + +No, no, no. That thinking is backwards. + +### How to price yourself + +Let’s make up an example. Suppose you’re a full-time-employed software engineer grossing that $100k p.a., and you’re thinking of switching to contracting. + +When you’re self-employed, you have to think like a business because that’s literally how you’re making your living. So you have to add up all your costs and figure out how you’re going to recover them. Spreadsheets get a bad rap (for some good reasons), but they’re actually really useful for this stuff (and a lot of other calculations you’ll do as a business owner). + +The first cost to add to the tally is that $100k. If that sounds weird, it’s what’s called “opportunity cost”. You could have made $100k by staying employed; not making that is effectively a cost you have to justify when planning your business. Mark that cost down, along with any other employment benefits you actually use. If your employer offers on-site lunches, add what it costs you to get lunch each workday of the year. If your employer offers employee discounts on its fitness software, but you don’t use that software anyway, don’t add that benefit as an opportunity cost. + +Other costs depend on what you’re doing and where you live. Employee-provided health insurance isn’t as big a thing in Australia as in the US. On the other hand, compulsory superannuation payments (similar to the US 401(k)) are a big deal. I have my own company, and my major non-salary costs are insurance, accounting/filing, legal (for contract reviews, etc.), debt collection and various online service costs. If you’re counting something durable (like a desk) divide the cost by the estimated number of years you expect to use the thing. + +Anyway, so far this is basically what was in Caleb’s blog post, so to keep things simple, I’ll assume the same $100k nominal salary and $140k equivalent business cost. (Scale everything to match your own circumstances, of course.) Now you need to figure out how to recover that cost. There are about 255 Australian working days in a year, so if you could contract them all out, you’d charge $550 a day (plus sales tax). In reality, you won’t be able to bill the entire year. I’ve taken a higher-risk approach and averaged about 60-70% in the past 6 years of my current stint of self employment. [Accenture’s annual financial reports][2] say they get about 90% “utilization” from their contractors, which I assume means they bill 90% of the total workdays. Let’s assume you’re moderate and bill 75% of work days. That means you recover $140k of costs in 75% of 255 days (or 191 days) by billing about $730 a day (plus sales tax). + +### The mistake + +People new to contracting often react to numbers like that and think, “WTF?! That’s huge!” That’s just one example calculation, but it’s normal for service prices to be around double or more what you might naïvely guess from equivalent full-time employee rates. However, that day rate came from a simple calculation of how much you need to charge to get the equivalent of a $100k salary. It’s the same thing. Thinking otherwise is the critical mistake. + +New contractors are often still unsure. Won’t they sound _greedy_ asking for that much? If your clients have any clue, they’re doing pretty much the same calculation. “I could pay Gentle Blog Reader $730 a day for just as long as I want, or I could pay ~$140k for a full-timer who I won’t even really need every day.” A $100k salary isn’t actually $100k from the employer’s point of view, either. Basing prices on nominal base salaries just doesn’t make sense. Even if you’re selling B2C, your cluey competitors won’t be charging less, at least not sustainably. + +### Why it matters + +That specific example was for contracting, but it’s a basic rule of business economics: unless you’re trying some super-risky growth hacking (and we know how [Pets.com][3] turned out), you need to figure out your costs and set your price high enough to cover them. + +Some people still feel uncomfortable with the price they need to set, and they rationalise dropping the price. Perhaps they think something like, “I’m a really nice person, and if I charge only $400 a day my clients will be even happier.” The problem is that you won’t get the same clients. Cluey clients who would pay $100k a year base salary for an employee won’t pay $400 a day for a contractor to do the same job. Instead, in practice, you might get a few good clients who just didn’t have the budget for $730 a day, but you _will_ get a whole bunch of really bad clients. Think about it. If a stranger offered you a fancy-looking diamond ring for $50, would you pay? Or would you rather buy another ring for a normal price? + +Let me stress that I’m just taking the numbers from Caleb’s post and that everything is relative. Use your own numbers instead. In most parts of the world, $400 a day might be a fantastic rate. However, if you’re a senior fintech developer in Silicon Valley, charging $400 a day will just make you a magnet for terrible clients. Most of the good ones will know something isn’t adding up, and they’ll be scared away. + +What do I mean by bad clients? Browse through [the Clients from Hell blog][4] for a bit. It ranges from a lot of basic annoyance like clients who are never satisfied, or who make unreasonable demands, or who waste your time, all the way to clients who are outright abusive, or who get you to do work to spec before arguing they shouldn’t have to pay because “I don’t want it”. Some clients simply don’t pay at all. + +If _you_ don’t value your own product enough, don’t be shocked if you have customers who don’t value it enough, either. + +It gets worse, though. Good clients tend to work with other good clients. If you’re always available when you say you will be, would you work with people who waste your time? If you treat others with respect, would you work with people who are unreasonable and abusive? On average, your good clients will tend to refer you to other good clients. The reverse is true of bad clients, if they’re even grateful enough to refer you to anyone at all. Therefore, if you charge a good price, your business will tend to grow as you build a reputation. If you undercharge, you’ll find yourself in a downward spiral where you’re not only losing money, but finding it harder and harder to get proper pay at all. + +All of this is just a matter of averages, and if you’re lucky you’ll still get good clients even if you undercharge, and if you’re unlucky you’ll still get bad clients even if you charge the right price. However, if your revenue is already weak, each bad client will really hurt. Hoping to beat the averages isn’t a good plan. + +### “But no one pays that much!” + +Suppose you’re an experienced full-time engineer and you decide to try going independent. You’ll probably find that your calculated rate seems high compared to what you see on a freelancing website. That’s because it’s hard to build up a reputation on freelancing websites. Freelancing websites are most useful for casual buyers who primarily want a low price. + +I think a lot of smart engineers assume career networking is hard and requires super high levels of extroversion, so they have to rely on freelancing websites for work. The bad news is that you need to build up a good reputation to get good pay. The good news is that most people can do it as long as they have skills that are in demand. Networking isn’t about going to so-called “networking events” (they’re actually mostly terrible for networking). Networking tips would make a whole new blog post, but the key is to find good clients in their natural habitats, and to do the things that make them keep coming back and maybe even refer you to other good clients. + +In any case, don’t let freelancing websites or anything else set your price below the equivalent of what you could get from a full-time salary. In fact, [you might even get better than your current salary][5], which is why this is “Pricing 101”. Undercharging, however, will kill your self-employment career. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2021/07/04/pricing_as_contractor_101.html + +作者:[Simon Arneaud][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://calebporzio.com/making-100k-as-an-employee-versus-being-self-employed +[2]: https://www.accenture.com/au-en/about/company/annual-report +[3]: https://en.wikipedia.org/wiki/Pets.com +[4]: https://clientsfromhell.net/ +[5]: https://theartofmachinery.com/2018/10/07/payrise_by_switching_jobs.html From 402025159cbc26ae3b67af79bbdee26e62b6e89b Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 5 Jul 2021 08:38:04 +0800 Subject: [PATCH 301/870] translated --- ...0210628 How to archive files on FreeDOS.md | 91 ------------------- ...0210628 How to archive files on FreeDOS.md | 90 ++++++++++++++++++ 2 files changed, 90 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20210628 How to archive files on FreeDOS.md create mode 100644 translated/tech/20210628 How to archive files on FreeDOS.md diff --git a/sources/tech/20210628 How to archive files on FreeDOS.md b/sources/tech/20210628 How to archive files on FreeDOS.md deleted file mode 100644 index 93c4dfbdae..0000000000 --- a/sources/tech/20210628 How to archive files on FreeDOS.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: subject: (How to archive files on FreeDOS) -[#]: via: (https://opensource.com/article/21/6/archive-files-freedos) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to archive files on FreeDOS -====== -There's a version of tar on FreeDOS, but the de facto standard archiver -on DOS is Zip and Unzip. -![Filing cabinet for organization][1] - -On Linux, you may be familiar with the standard Unix archive command: `tar`. There's a version of `tar` on FreeDOS too (and a bunch of other popular archive programs), but the de facto standard archiver on DOS is Zip and Unzip. Both Zip and Unzip are installed in FreeDOS 1.3 RC4 by default. - -The Zip file format was originally conceived in 1989 by Phil Katz of PKWARE, for the PKZIP and PKUNZIP pair of DOS archive utilities. Katz released the specification for Zip files as an open standard, so anyone could create Zip archives. As a result of the open specification, Zip became a standard archive on DOS. The [Info-ZIP][2] project implements an open source set of `ZIP` and `UNZIP` programs. - -### Zipping files and directories - -You can use `ZIP` at the DOS command line to create archives of files and directories. This is a handy way to make a backup copy of your work or to release a "package" to use in a future FreeDOS distribution. For example, let's say I wanted to make a backup of my project source code, which contains these source files: - -![dir][3] - -I'd like to archive these files -(Jim Hall, [CC-BY SA 4.0][4]) - -`ZIP` sports a ton of command-line options to do different things, but the command line options I use most are `-r` to process directories and subdirectories _recursively_, and `-9` to provide the maximum compression possible. `ZIP` and `UNZIP` use a Unix-like command line, so you can combine options behind the dash: `-9r` will give maximum compression and include subdirectories in the Zip file. - -![zip][5] - -Zipping a directory tree -(Jim Hall, [CC-BY SA 4.0][4]) - -In my example, `ZIP` was able to compress my source files from about 33 kilobytes down to about 22 kilobytes, saving me 11 kilobytes of valuable disk space. You might get different compression ratios depending on what options you give to `ZIP` or what files (and how many) you are trying to store in a Zip file. Generally, very long text files (such as source code) yield good compression—very small text files (like DOS "batch" files of only a few lines) are usually too short to compress well. - -### Unzipping files and directories - -Saving files into a Zip file is great, but you'll eventually need to extract those files somewhere. Let's start by examining what's inside the Zip file we just created. For this, use the `UNZIP` command. You can use a bunch of different options with `UNZIP`, but I find I use just a few common options. - -To list the contents of a Zip file, use the `-l` ("list") option: - -![unzip -l][6] - -Listing the archive file contents with unzip -(Jim Hall, [CC-BY SA 4.0][4]) - -The output allows me to see the 14 entries in the Zip file: 13 files plus the `SRC` directory entry. - -If I want to extract the entire Zip file, I could just use the `UNZIP` command and provide the Zip file as a command-line option. That extracts the Zip file starting at my current working directory. Unless I'm restoring a previous version of something, I usually don't want to overwrite my current files. In that case, I will want to extract the Zip file to a new directory. You can specify the destination path with the `-d` ("destination") command-line option: - -![unzip -d temp][7] - -You can unzip into a destination path with -d -(Jim Hall, [CC-BY SA 4.0][4]) - -Sometimes I want to extract a single file from a Zip file. In this example, let's say I wanted to extract `TEST.EXE`, a DOS executable program. To extract a single file, you specify the full path _from the Zip file_ that you want to extract. By default, `UNZIP` will extract this file using the path provided in the Zip file. To omit the path information, you can add the `-j` ("junk the path") option. - -You can also combine options. Let's extract the `SRC\TEST.EXE` program from the Zip file, but omit the full path and save it in the `TEMP` directory: - -![unzip -j][8] - -Combining options with unzip -(Jim Hall, [CC-BY SA 4.0][4]) - -Because Zip files are an open standard, we continue to see Zip files today. Every Linux distribution supports Zip files using the Info-ZIP programs. Your Linux file manager may also have Zip file support—on the GNOME file manager, you should be able to right-click on a folder and select "Compress" from the drop-down menu. You'll have the option to create a new archive file, including a Zip file. - -Creating and managing Zip files is a key skill for any DOS user. You can learn more about `ZIP` and `UNZIP` at the Info-ZIP website, or use the `-h` ("help") option on the command line to print out a list of options. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/archive-files-freedos - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) -[2]: http://infozip.sourceforge.net/ -[3]: https://opensource.com/sites/default/files/uploads/dir.png (I'd like to archive these files) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/uploads/zip-9r.png (Zipping a directory tree) -[6]: https://opensource.com/sites/default/files/uploads/unzip-l.png (Listing the archive file contents with unzip) -[7]: https://opensource.com/sites/default/files/uploads/unzip-d.png (You can unzip into a destination path with -d) -[8]: https://opensource.com/sites/default/files/uploads/unzip-j.png (Combining options with unzip) diff --git a/translated/tech/20210628 How to archive files on FreeDOS.md b/translated/tech/20210628 How to archive files on FreeDOS.md new file mode 100644 index 0000000000..a3719145a1 --- /dev/null +++ b/translated/tech/20210628 How to archive files on FreeDOS.md @@ -0,0 +1,90 @@ +[#]: subject: (How to archive files on FreeDOS) +[#]: via: (https://opensource.com/article/21/6/archive-files-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 FreeDOS 上归档文件 +====== +有一个 FreeDOS 版的 tar,但 DOS 上事实上的标准归档工具是 Zip 和 Unzip。 +![Filing cabinet for organization][1] + +在Linux上,你可能熟悉标准的 Unix 归档命令:`tar`。FreeDOS 上也有 `tar` 的版本(还有其他一些流行的归档程序),但 DOS 上事实上的标准归档程序是 Zip 和 Unzip。Zip 和 Unzip 都默认安装在 FreeDOS 1.3 RC4 中。 + +Zip 文件格式最初是由 PKWARE 的 Phil Katz 在 1989 年为 PKZIP 和 PKUNZIP 这对 DOS 归档工具构思的。Katz 将 Zip 文件的规范作为一个开放标准发布,因此任何人都可以创建 Zip 档案。作为开放规范的结果,Zip 成为 DOS 上的一个标准归档。[Info-ZIP][2] 项目实现了一套开源的 `ZIP` 和 `UNZIP` 程序。 + +### 对文件和目录进行压缩 + +你可以在 DOS 命令行中使用 `ZIP` 来创建文件和目录的归档。这是一个方便的方法,可以为你的工作做一个备份,或者发布一个“包”,在未来的 FreeDOS 发行中使用。例如,假设我想为我的项目源码做一个备份,其中包含这些源文件: + +![dir][3] + +我想把这些文件归档 +(Jim Hall,[CC-BY SA 4.0][4]) + +`ZIP` 有大量的命令行选项来做不同的事情,但我最常使用的命令行选项是 `-r` 来处理目录和子目录_递归_,以及 `-9` 来提供可能的最大压缩。`ZIP` 和 `UNZIP` 使用类似 Unix 的命令行,所以你可以在破折号后面组合选项:`-9r` 将提供最大压缩并在 Zip 文件中包括子目录。 + +![zip][5] + +压缩一个目录树 +(Jim Hall,[CC-BY SA 4.0][4]) + +在我的例子中,`ZIP` 能够将我的源文件从大约 33KB 压缩到大约 22KB,为我节省了 11KB 的宝贵磁盘空间。你可能会得到不同的压缩率,这取决于你给 `ZIP` 的选项,或者你想在 Zip 文件中存储什么文件(以及有多少)。一般来说,非常长的文本文件(如源码)会产生良好的压缩效果,而非常小的文本文件(如只有几行的 DOS “批处理”文件)通常太短,无法很好地压缩。 + +### 解压文件和目录 + +将文件保存到 Zip 文件中是很好的,但你最终会需要将这些文件解压到某个地方。让我们首先检查一下我们刚刚创建的 Zip 文件里有什么。为此,使用 `UNZIP `命令。你可以在 `UNZIP`中使用一堆不同的选项,但我发现我只使用几个常用的选项。 + +要列出一个 Zip 文件的内容,使用 `-l` (“list”) 选项。 + +![unzip -l][6] + +用 unzip 列出归档文件的内容 +(Jim Hall,[CC-BY SA 4.0][4]) + +该输出允让我看到 Zip 文件中的 14 个条目:13 个文件加上 `SRC` 目录。 + +如果我想提取整个 Zip 文件,我可以直接使用 `UNZIP` 命令并提供 Zip 文件作为命令行选项。这样就可以从我当前的工作目录开始提取 Zip 文件了。除非我正在恢复某个东西的先前版本,否则我通常不想覆盖我当前的文件。在这种情况下,我希望将 Zip 文件解压到一个新的目录。你可以用 `-d` (“destination”) 命令行选项指定目标路径。 + +![unzip -d temp][7] + +你可以用 -d 来解压到目标路径 +(Jim Hall,[CC-BY SA 4.0][4]) + +有时我想从一个 Zip 文件中提取一个文件。在这个例子中,假设我想提取一个 DOS 可执行程序 `TEST.EXE`。要提取单个文件,你要指定你想提取的 Zip 文件的完整路径。默认情况下,`UNZIP` 将使用 Zip 文件中提供的路径解压该文件。要省略路径信息,你可以添加 `-j`(“junk the path”) 选项。 + +你也可以合并选项。让我们从 Zip 文件中提取 `SRC\TEST.EXE` 程序,但省略完整路径并将其保存在 `TEMP` 目录下: + +![unzip -j][8] + +unzip 结合选项 +(Jim Hall,[CC-BY SA 4.0][4]) + +因为 Zip 文件是一个开放的标准,所以我们会今天继续看到 Zip 文件。每个 Linux 发行版都支持使用 Info-ZIP 程序的 Zip 文件。你的 Linux 文件管理器可能也支持 Zip 文件。在 GNOME 文件管理器中,你应该可以右击一个文件夹并从下拉菜单中选择“压缩”。你可以选择创建一个新的归档文件,包括 Zip 文件。 + +创建和管理 Zip 文件是任何 DOS 用户的一项关键技能。你可以在 Info-ZIP 网站上了解更多关于 `ZIP` 和 `UNZIP` 的信息,或者在命令行上使用 `h`(“帮助”)选项来打印选项列表。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/archive-files-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) +[2]: http://infozip.sourceforge.net/ +[3]: https://opensource.com/sites/default/files/uploads/dir.png (I'd like to archive these files) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/zip-9r.png (Zipping a directory tree) +[6]: https://opensource.com/sites/default/files/uploads/unzip-l.png (Listing the archive file contents with unzip) +[7]: https://opensource.com/sites/default/files/uploads/unzip-d.png (You can unzip into a destination path with -d) +[8]: https://opensource.com/sites/default/files/uploads/unzip-j.png (Combining options with unzip) From 492fd0ec293fbafc1bb2108fddbc6415daa3805c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 5 Jul 2021 08:41:20 +0800 Subject: [PATCH 302/870] translating --- ...entify flowers and trees with this open source mobile app.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md b/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md index 9d83d17888..eb6ffb1c67 100644 --- a/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md +++ b/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/open-source-plantnet) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6555f61e8abb27cd758597195cce4f3b57ff7474 Mon Sep 17 00:00:00 2001 From: Zioyi Date: Mon, 5 Jul 2021 09:54:21 +0800 Subject: [PATCH 303/870] translated --- sources/tech/20180416 Cgo and Python.md | 351 --------------------- translated/tech/20180416 Cgo and Python.md | 349 ++++++++++++++++++++ 2 files changed, 349 insertions(+), 351 deletions(-) delete mode 100644 sources/tech/20180416 Cgo and Python.md create mode 100644 translated/tech/20180416 Cgo and Python.md diff --git a/sources/tech/20180416 Cgo and Python.md b/sources/tech/20180416 Cgo and Python.md deleted file mode 100644 index 3e70df6334..0000000000 --- a/sources/tech/20180416 Cgo and Python.md +++ /dev/null @@ -1,351 +0,0 @@ -Cgo and Python -============================================================ - -![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_hero.png?auto=format&w=1900&dpr=1) - - - -If you look at the [new Datadog Agent][8], you might notice most of the codebase is written in Go, although the checks we use to gather metrics are still written in Python. This is possible because the Datadog Agent, a regular Go binary, [embeds][9] a CPython interpreter that can be called whenever it needs to execute Python code. This process can be made transparent using an abstraction layer so that you can still write idiomatic Go code even when there’s Python running under the hood. - -[video](https://youtu.be/yrEi5ezq2-c) - -There are a number of reasons why you might want to embed Python in a Go application: - -* It is useful during a port; gradually moving portions of an existing Python project to the new language without losing any functionality during the process. - -* You can reuse existing Python software or libraries without re-implementing them in the new language. - -* You can dynamically extend your software by loading and executing regular Python scripts, even at runtime. - -The list could go on, but for the Datadog Agent the last point is crucial: we want you to be able to execute custom checks or change existing ones without forcing you to recompile the Agent, or in general, to compile anything. - -Embedding CPython is quite easy and well documented. The interpreter itself is written in C and a C API is provided to programmatically perform operations at a very low level, like creating objects, importing modules, and calling functions. - -In this article we’ll show some code examples, and we’ll focus on keeping the Go code idiomatic while interacting with Python at the same time, but before we proceed we need to address a small gap: the embedding API is C but our main application is Go, how can this possibly work? - -![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_1.png?auto=format&fit=max&w=847) - -### Introducing cgo - -There are [a number of good reasons][10] why you might not want to introduce cgo in your stack, but embedding CPython is one of those cases where you must. [Cgo][11] is not a language nor a compiler. It’s a [Foreign Function Interface][12] (FFI), a mechanism we can use in Go to invoke functions and services written in a different language, specifically C. - -When we say “cgo” we’re actually referring to a set of tools, libraries, functions, and types that are used by the go toolchain under the hood so we can keep doing `go build` to get our Go binaries. An absolutely minimal example of a program using cgo looks like this: - -``` -package main - -// #include -import "C" -import "fmt" - -func main() { - fmt.Println("Max float value of float is", C.FLT_MAX) -} - -``` - -The comment block right above the `import "C"` instruction is called a “preamble” and can contain actual C code, in this case an header inclusion. Once imported, the “C” pseudo-package lets us “jump” to the foreign code, accessing the `FLT_MAX` constant. You can build the example by invoking `go build`, the same as if it was plain Go. - -If you want to have a look at all the work cgo does under the hood, run `go build -x`. You’ll see the “cgo” tool will be invoked to generate some C and Go modules, then the C and Go compilers will be invoked to build the object modules and finally the linker will put everything together. - -You can read more about cgo on the [Go blog][13]. The article contains more examples and few useful links to get further into details. - -Now that we have an idea of what cgo can do for us, let’s see how we can run some Python code using this mechanism. -![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_2.png?auto=format&fit=max&w=847) - -### Embedding CPython: a primer - -A Go program that, technically speaking, embeds CPython is not as complicated as you might expect. In fact, at the bare minimum, all we have to do is initialize the interpreter before running any Python code and finalize it when we’re done. Please note that we’re going to use Python 2.x throughout all the examples but everything we’ll see can be applied to Python 3.x as well with very little adaptation. Let’s look at an example: - -``` -package main - -// #cgo pkg-config: python-2.7 -// #include -import "C" -import "fmt" - -func main() { - C.Py_Initialize() - fmt.Println(C.GoString(C.Py_GetVersion())) - C.Py_Finalize() -} - -``` - -The example above does exactly what the following Python code would do: - -``` -import sys -print(sys.version) - -``` - -You can see we put a `#cgo` directive in the preamble; those directives are passed to the toolchain to let you change the build workflow. In this case, we tell cgo to invoke “pkg-config” to gather the flags needed to build and link against a library called “python-2.7” and pass those flags to the C compiler. If you have the CPython development libraries installed in your system along with pkg-config, this would let you keep using a plain `go build` to compile the example above. - -Back to the code, we use `Py_Initialize()` and `Py_Finalize()` to set up and shut down the interpreter and the `Py_GetVersion` C function to retrieve the string containing the version information for the embedded interpreter. - -If you’re wondering, all the cgo bits we need to put together to invoke the C Python API are boilerplate code. This is why the Datadog Agent relies on [go-python][14] for all the embedding operations; the library provides a Go friendly thin wrapper around the C API and hides the cgo details. This is another basic embedding example, this time using go-python: - -``` -package main - -import ( - python "github.com/sbinet/go-python" -) - -func main() { - python.Initialize() - python.PyRun_SimpleString("print 'hello, world!'") - python.Finalize() -} - -``` - -This looks closer to regular Go code, no more cgo exposed and we can use Go strings back and forth while accessing the Python API. Embedding looks powerful and developer friendly. Time to put the interpreter to good use: let’s try to load a Python module from disk. - -We don’t need anything complex on the Python side, the ubiquitous “hello world” will serve the purpose: - -``` -# foo.py -def hello(): - """ - Print hello world for fun and profit. - """ - print "hello, world!" - -``` - -The Go code is slightly more complex but still readable: - -``` -// main.go -package main - -import "github.com/sbinet/go-python" - -func main() { - python.Initialize() - defer python.Finalize() - - fooModule := python.PyImport_ImportModule("foo") - if fooModule == nil { - panic("Error importing module") - } - - helloFunc := fooModule.GetAttrString("hello") - if helloFunc == nil { - panic("Error importing function") - } - - // The Python function takes no params but when using the C api - // we're required to send (empty) *args and **kwargs anyways. - helloFunc.Call(python.PyTuple_New(0), python.PyDict_New()) -} - -``` - -Once built, we need to set the `PYTHONPATH` environment variable to the current working dir so that the import statement will be able to find the `foo.py`module. From a shell, the command would look like this: - -``` -$ go build main.go && PYTHONPATH=. ./main -hello, world! - -``` -![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_3.png?auto=format&fit=max&w=847) - -### The dreadful Global Interpreter Lock - -Having to bring in cgo in order to embed Python is a tradeoff: builds will be slower, the Garbage Collector won’t help us managing memory used by the foreign system, and cross compilation will be non-trivial. Whether or not these are concerns for a specific project can be debated, but there’s something I deem not negotiable: the Go concurrency model. If we couldn’t run Python from a goroutine, using Go altogether would make very little sense. - -Before playing with concurrency, Python, and cgo, there’s something we need to know: it’s the Global Interpreter Lock, also known as the GIL. The GIL is a mechanism widely adopted in language interpreters (CPython is one of those) preventing more than one thread from running at the same time. This means that no Python program executed by CPython will be ever able to run in parallel within the same process. Concurrency is still possible and in the end, the lock is a good tradeoff between speed, security, and implementation simplicity. So why should this pose a problem when it comes to embedding? - -When a regular, non-embedded Python program starts, there’s no GIL involved to avoid useless overhead in locking operations; the GIL starts the first time some Python code requests to spawn a thread. For each thread, the interpreter creates a data structure to store information about the current state and locks the GIL. When the thread has finished, the state is restored and the GIL unlocked, ready to be used by other threads. - -When we run Python from a Go program, none of the above happens automatically. Without the GIL, multiple Python threads could be created by our Go program. This could cause a race condition leading to fatal runtime errors, and most likely a segmentation fault bringing down the whole Go application. - -The solution to this problem is to explicitly invoke the GIL whenever we run multithreaded code from Go; the code is not complex because the C API provides all the tools we need. To better expose the problem, we need to do something CPU bounded from Python. Let’s add these functions to our foo.py module from the previous example: - -``` -# foo.py -import sys - -def print_odds(limit=10): - """ - Print odds numbers < limit - """ - for i in range(limit): - if i%2: - sys.stderr.write("{}\n".format(i)) - -def print_even(limit=10): - """ - Print even numbers < limit - """ - for i in range(limit): - if i%2 == 0: - sys.stderr.write("{}\n".format(i)) - -``` - -We’ll try to print odd and even numbers concurrently from Go, using two different goroutines (thus involving threads): - -``` -package main - -import ( - "sync" - - "github.com/sbinet/go-python" -) - -func main() { - // The following will also create the GIL explicitly - // by calling PyEval_InitThreads(), without waiting - // for the interpreter to do that - python.Initialize() - - var wg sync.WaitGroup - wg.Add(2) - - fooModule := python.PyImport_ImportModule("foo") - odds := fooModule.GetAttrString("print_odds") - even := fooModule.GetAttrString("print_even") - - // Initialize() has locked the the GIL but at this point we don't need it - // anymore. We save the current state and release the lock - // so that goroutines can acquire it - state := python.PyEval_SaveThread() - - go func() { - _gstate := python.PyGILState_Ensure() - odds.Call(python.PyTuple_New(0), python.PyDict_New()) - python.PyGILState_Release(_gstate) - - wg.Done() - }() - - go func() { - _gstate := python.PyGILState_Ensure() - even.Call(python.PyTuple_New(0), python.PyDict_New()) - python.PyGILState_Release(_gstate) - - wg.Done() - }() - - wg.Wait() - - // At this point we know we won't need Python anymore in this - // program, we can restore the state and lock the GIL to perform - // the final operations before exiting. - python.PyEval_RestoreThread(state) - python.Finalize() -} - -``` - -While reading the example you might note a pattern, the pattern that will become our mantra to run embedded Python code: - -1. Save the state and lock the GIL. - -2. Do Python. - -3. Restore the state and unlock the GIL. - -The code should be straightforward but there’s a subtle detail we want to point out: notice that despite seconding the GIL mantra, in one case we operate the GIL by calling `PyEval_SaveThread()` and `PyEval_RestoreThread()`, in another (look inside the goroutines) we do the same with `PyGILState_Ensure()`and `PyGILState_Release()`. - -We said when multithreading is operated from Python, the interpreter takes care of creating the data structure needed to store the current state, but when the same happens from the C API, we’re responsible for that. - -When we initialize the interpreter with go-python, we’re operating in a Python context. So when `PyEval_InitThreads()` is called it initializes the data structure and locks the GIL. We can use `PyEval_SaveThread()` and `PyEval_RestoreThread()` to operate on already existing state. - -Inside the goroutines, we’re operating from a Go context and we need to explicitly create the state and remove it when done, which is what `PyGILState_Ensure()` and `PyGILState_Release()` do for us. -![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_4.png?auto=format&fit=max&w=847) - -### Unleash the Gopher - -At this point we know how to deal with multithreading Go code executing Python in an embedded interpreter but after the GIL, another challenge is right around the corner: the Go scheduler. - -When a goroutine starts, it’s scheduled for execution on one of the `GOMAXPROCS`threads available—[see here][15] for more details on the topic. If a goroutine happens to perform a syscall or call C code, the current thread hands over the other goroutines waiting to run in the thread queue to another thread so they can have better chances to run; the current goroutine is paused, waiting for the syscall or the C function to return. When this happens, the thread tries to resume the paused goroutine, but if this is not possible, it asks the Go runtime to find another thread to complete the goroutine and goes to sleep. The goroutine is finally scheduled to another thread and it finishes. - -With this in mind, let’s see what can happen to a goroutine running some Python code when a goroutine is moved to a new thread:: - -1. Our goroutine starts, performs a C call, and pauses. The GIL is locked. - -2. When the C call returns, the current thread tries to resume the goroutine, but it fails. - -3. The current thread tells the Go runtime to find another thread to resume our goroutine. - -4. The Go scheduler finds an available thread and the goroutine is resumed. - -5. The goroutine is almost done and tries to unlock the GIL before returning. - -6. The thread ID stored in the current state is from the original thread and is different from the ID of the current thread. - -7. Panic! - -Luckily for us, we can force the Go runtime to always keep our goroutine running on the same thread by calling the LockOSThread function from the runtime package from within a goroutine: - -``` -go func() { - runtime.LockOSThread() - - _gstate := python.PyGILState_Ensure() - odds.Call(python.PyTuple_New(0), python.PyDict_New()) - python.PyGILState_Release(_gstate) - wg.Done() -}() - -``` - -This will interfere with the scheduler and might introduce some overhead, but it’s a price that we’re willing to pay to avoid random panics. - -### Conclusions - -In order to embed Python, the Datadog Agent has to accept a few tradeoffs: - -* The overhead introduced by cgo. - -* The task of manually handling the GIL. - -* The limitation of binding goroutines to the same thread during execution. - -We’re happy to accept each of these for the convenience of running Python checks in Go. But by being conscious of the tradeoffs, we’re able to minimize their effect. Regarding other limitations introduced to support Python, we have few countermeasures to contain potential issues: - -* The build is automated and configurable so that devs have still something very similar to `go build`. - -* A lightweight version of the agent can be built stripping out Python support entirely simply using Go build tags. - -* Such a version only relies on core checks hardcoded in the agent itself (system and network checks mostly) but is cgo free and can be cross compiled. - -We’ll re-evaluate our options in the future and decide whether keeping around cgo is still worth it; we could even reconsider whether Python as a whole is still worth it, waiting for the [Go plugin package][16] to be mature enough to support our use case. But for now the embedded Python is working well and transitioning from the old Agent to the new one couldn’t be easier. - -Are you a polyglot who loves mixing different programming languages? Do you love learning about the inner workings of languages to make your code more performant? [Join us at Datadog!][17] - --------------------------------------------------------------------------------- - -via: https://www.datadoghq.com/blog/engineering/cgo-and-python/ - -作者:[ Massimiliano Pippi][a] -译者:[Zioyi](https://github.com/Zioyi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://github.com/masci -[1]:http://twitter.com/share?url=https://www.datadoghq.com/blog/engineering/cgo-and-python/ -[2]:http://www.reddit.com/submit?url=https://www.datadoghq.com/blog/engineering/cgo-and-python/ -[3]:https://www.linkedin.com/shareArticle?mini=true&url=https://www.datadoghq.com/blog/engineering/cgo-and-python/ -[4]:https://www.datadoghq.com/blog/category/under-the-hood -[5]:https://www.datadoghq.com/blog/tag/agent -[6]:https://www.datadoghq.com/blog/tag/golang -[7]:https://www.datadoghq.com/blog/tag/python -[8]:https://github.com/DataDog/datadog-agent/ -[9]:https://docs.python.org/2/extending/embedding.html -[10]:https://dave.cheney.net/2016/01/18/cgo-is-not-go -[11]:https://golang.org/cmd/cgo/ -[12]:https://en.wikipedia.org/wiki/Foreign_function_interface -[13]:https://blog.golang.org/c-go-cgo -[14]:https://github.com/sbinet/go-python -[15]:https://morsmachine.dk/go-scheduler -[16]:https://golang.org/pkg/plugin/ -[17]:https://www.datadoghq.com/careers/ diff --git a/translated/tech/20180416 Cgo and Python.md b/translated/tech/20180416 Cgo and Python.md new file mode 100644 index 0000000000..7107f8af58 --- /dev/null +++ b/translated/tech/20180416 Cgo and Python.md @@ -0,0 +1,349 @@ +Cgo 与 Python +============================================================ + +![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_hero.png?auto=format&w=1900&dpr=1) + + + +如果你查看 [new Datadog Agent][8],你可能会注意到大部分代码库是用 Go 编写的,但我们用来收集指标的检查仍然是用 Python 编写的。这大概是因为 Datadog Agent 是基于一个[嵌入][9] CPython 解释器的 GO,可以在任何时候按需执行 Python 代码。这个过程通过抽象层来透明化,使得你可以编写惯用的 Go 代码来运行后台的 Python。 + +[视频](https://youtu.be/yrEi5ezq2-c) + +在 Go 应用程序中嵌入 Python 的原因有很多: + +* 它在过渡期间很有用;逐步将现有 Python 项目的部分迁移到新语言,而不会在此过程中丢失任何功能。 + +* 你可以复用现有的 Python 软件或库,而无需用新语言重新实现。 + +* 你可以通过加载去执行常规 Python 脚本来动态扩展你软件,甚至在运行时也可以。 + +理由还可以列很多,但对于 Datadog Agent 来说,最后一点至关重要:我们希望做到无需重新编译 Agent,或者说编译任何内容就能够执行自定义检查或更改现有检查。 + +嵌入 CPython 非常简单,而且文档齐全。解释器本身是用 C 编写的,并且提供了一个 C API 以编程方式来执行底层操作,例如创建对象、导入模块和调用函数。 + +在本文中,我们将展示一些代码示例,我们将会在与 Python 交互的同时继续保持 Go 代码的惯用语,但在我们继续之前,我们需要解决一个间隙:嵌入 API 是 C 但我们的主要应用程序是 Go,这怎么可能工作? + +![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_1.png?auto=format&fit=max&w=847) + +### 介绍 cgo + +有[很多好的理由][10] 说服你为什么不要在堆栈中引入 cgo,但嵌入 CPython 是你必须这样做的原因。[Cgo][11] 不是语言,也不是编译器。它是 [Foreign Function Interface][12] (FFI),一种让我们可以在 Go 中使用来调用不同语言(特别是 C)编写的函数和服务的机制。 + +当我们提起“cgo”时,我们实际上指的是 Go 工具链在底层使用的一组工具、库、函数和类型,因此我们可以通过执行 `go build` 来获取我们的 Go 二进制文件。下面是使用 cgo 的示例程序: + +``` +package main + +// #include +import "C" +import "fmt" + +func main() { + fmt.Println("Max float value of float is", C.FLT_MAX) +} + +``` + +在这种包含标头情况下,`import "C"` 指令上方的注释块称为“前导码”,可以包含实际的 C 代码。导入后,我们可以通过“C”伪包来“跳转”到外部代码,访问常量`FLT_MAX`。你可以通过调用 `go build` 来构建,它就像普通的 Go 一样。 + +如果你想查看 cgo 在这背后到底做了什么,可以运行 `go build -x`。你将看到“cgo”工具将被调用以生成一些 C 和 Go 模块,然后将调用 C 和 Go 编译器来构建目标模块,最后链接器将所有内容放在一起。 + +你可以在 [Go Blog][13] 上阅读更多有关 cgo 的信息,文章包含更多的例子以及一些有用的链接来做进一步了解细节。 + +现在我们已经了解了 cgo 可以为我们做什么,让我们看看如何使用这种机制运行一些 Python 代码。 +![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_2.png?auto=format&fit=max&w=847) + +### 嵌入 CPython: a primer + +从技术上讲,嵌入 CPython 的 Go 程序并没有你想象的那么复杂。事实上,我们只需在运行 Python 代码之前初始化解释器,并在完成后关闭它。请注意,我们在所有示例中使用 Python 2.x,但我们只需做很少的调整就可以应用于 Python 3.x。让我们看一个例子: + +``` +package main + +// #cgo pkg-config: python-2.7 +// #include +import "C" +import "fmt" + +func main() { + C.Py_Initialize() + fmt.Println(C.GoString(C.Py_GetVersion())) + C.Py_Finalize() +} + +``` + +上面的示例与以下 Python 代码完全相同: + +``` +import sys +print(sys.version) + +``` + +你可以看到我们在开头加入了一个 `#cgo` 指令;这些指令被会被传递到工具链,你就改变了构建工作流程。在这种情况下,我们告诉 cgo 调用`pkg-config`来收集构建并链接名为“python-2.7”的库所需的标志,并将这些标志传递给 C 编译器。如果你的系统中安装了 CPython 开发库和 pkg-config,你只需要运行 `go build` 来编译上面的示例。 + +回到代码,我们使用`Py_Initialize()` 和`Py_Finalize()` 来初始化和关闭解释器,并使用`Py_GetVersion` C 函数来获取嵌入式解释器版本信息的字符串。 + +如果你更近一步,我们可以把所有调用 C Python API 的 cgo 代码一起,这就是 Datadog Agent 进行所有嵌入式操作所有依赖的 [go-python][14] 做的事情;该库为 C API 提供了一个 Go 友好的轻量级包,并隐藏了 cgo 细节。这是另一个基本的嵌入式示例,这次使用 go-python: +``` +package main + +import ( + python "github.com/sbinet/go-python" +) + +func main() { + python.Initialize() + python.PyRun_SimpleString("print 'hello, world!'") + python.Finalize() +} + +``` + +这看起来更接近普通 Go 代码,不再暴露 cgo,我们可以在访问 Python API 时来回使用 Go 字符串。嵌入式看起来功能强大且对开发人员友好,是时候充分利用解释器了:让我们尝试从磁盘加载 Python 模块。 + +在 Python 方面我们不需要任何复杂的东西,无处不在的“hello world”就可以达到目的: + +``` +# foo.py +def hello(): + """ + Print hello world for fun and profit. + """ + print "hello, world!" + +``` + +Go 代码稍微复杂一些,但仍然可读: + +``` +// main.go +package main + +import "github.com/sbinet/go-python" + +func main() { + python.Initialize() + defer python.Finalize() + + fooModule := python.PyImport_ImportModule("foo") + if fooModule == nil { + panic("Error importing module") + } + + helloFunc := fooModule.GetAttrString("hello") + if helloFunc == nil { + panic("Error importing function") + } + + // The Python function takes no params but when using the C api + // we're required to send (empty) *args and **kwargs anyways. + helloFunc.Call(python.PyTuple_New(0), python.PyDict_New()) +} + +``` + +首次构建,我们需要将 `PYTHONPATH` 环境变量设置为当前工作目录,以便导入语句能够找到 `foo.py` 模块。在 shell 中,该命令如下所示: + +``` +$ go build main.go && PYTHONPATH=. ./main +hello, world! + +``` +![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_3.png?auto=format&fit=max&w=847) + +### 可怕的全局解释器锁 + +为了嵌入 Python 必须引入 cgo 需要权衡:构建速度会变慢,垃圾收集器不会帮助我们管理外部系统使用的内存,交叉编译也很难。这些是否是针对特定项目的问题可以讨论,但我认为有一些不容商量的问题:Go 并发模型。如果我们不能从 goroutine 运行 Python,那么使用 Go 就没有意义了。 + +在处理并发、Python 和 cgo 之前,我们还需要知道一些事情:它就是全局解释器锁,也称为 GIL。GIL 是语言解释器(CPython 就是其中之一)中广泛采用的一种机制,可防止多个线程同时运行。这意味着 CPython 执行的任何 Python 程序都无法在同一进程中并行运行。并发仍然是可能的,锁是速度、安全性和实现之间的一个很好的权衡,那么,当涉及到嵌入时,为什么这会造成问题呢? + +当一个常规的、非嵌入式的 Python 程序启动时,不涉及 GIL 以避免锁定操作中的无用开销;在某些 Python 代码请求生成线程时 GIL 首次启动。对于每个线程,解释器创建一个数据结构来存储当前的相关状态信息并锁定 GIL。当线程完成时,状态被恢复,GIL 被解锁,准备被其他线程使用。 + +当我们从 Go 程序运行 Python 时,上述情况都不会自动发生。如果没有 GIL,我们的 Go 程序可以创建多个 Python 线程,这可能会导致竞争条件,从而导致致命的运行时错误,并且很可能是分段错误导致整个 Go 应用程序瘫痪。 + +解决方案是在我们从 Go 运行多线程代码时显式调用 GIL;代码并不复杂,因为 C API 提供了我们需要的所有工具。为了更好地暴露这个问题,我们需要写一些受 CPU 限制的 Python 代码。让我们将这些函数添加到前面示例中的 foo.py 模块中: + +``` +# foo.py +import sys + +def print_odds(limit=10): + """ + Print odds numbers < limit + """ + for i in range(limit): + if i%2: + sys.stderr.write("{}\n".format(i)) + +def print_even(limit=10): + """ + Print even numbers < limit + """ + for i in range(limit): + if i%2 == 0: + sys.stderr.write("{}\n".format(i)) + +``` + +我们将尝试从 Go 并发打印奇数和偶数,使用两个不同的 goroutines(因此涉及线程): + +``` +package main + +import ( + "sync" + + "github.com/sbinet/go-python" +) + +func main() { + // The following will also create the GIL explicitly + // by calling PyEval_InitThreads(), without waiting + // for the interpreter to do that + python.Initialize() + + var wg sync.WaitGroup + wg.Add(2) + + fooModule := python.PyImport_ImportModule("foo") + odds := fooModule.GetAttrString("print_odds") + even := fooModule.GetAttrString("print_even") + + // Initialize() has locked the the GIL but at this point we don't need it + // anymore. We save the current state and release the lock + // so that goroutines can acquire it + state := python.PyEval_SaveThread() + + go func() { + _gstate := python.PyGILState_Ensure() + odds.Call(python.PyTuple_New(0), python.PyDict_New()) + python.PyGILState_Release(_gstate) + + wg.Done() + }() + + go func() { + _gstate := python.PyGILState_Ensure() + even.Call(python.PyTuple_New(0), python.PyDict_New()) + python.PyGILState_Release(_gstate) + + wg.Done() + }() + + wg.Wait() + + // At this point we know we won't need Python anymore in this + // program, we can restore the state and lock the GIL to perform + // the final operations before exiting. + python.PyEval_RestoreThread(state) + python.Finalize() +} + +``` + +在阅读示例时,您可能会注意到一个模式,该模式将成为我们运行嵌入式 Python 代码的习惯写法: + +1. 保存状态并锁定 GIL。 + +2. 执行 Python. + +3. 恢复状态并解锁 GIL。 + +代码应该很简单,但我们想指出一个微妙的细节:请注意,尽管借用了 GIL 执行,有时我们通过调用 `PyEval_SaveThread()` 和 `PyEval_RestoreThread()` 来操作 GIL,有时(查看 goroutines)我们对 `PyGILState_Ensure()` 和 `PyGILState_Release()` 来做同样的事情。 + +我们说过当从 Python 操作多线程时,解释器负责创建存储当前状态所需的数据结构,但是当同样的事情发生在 C API 时,我们来负责处理。 + +当我们用 go-python 初始化解释器时,我们是在 Python 上下文中操作的。因此,当调用 `PyEval_InitThreads()` 时,它会初始化数据结构并锁定 GIL。我们可以使用 `PyEval_SaveThread()` 和 `PyEval_RestoreThread()` 对已经存在的状态进行操作。 + +在 goroutines 中,我们从 Go 上下文操作,我们需要显式创建状态并在完成后将其删除,这就是 `PyGILState_Ensure()` 和 `PyGILState_Release()` 为我们所做的。 +![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_4.png?auto=format&fit=max&w=847) +扩展程序选项 +### 释放 Gopher + +在这一点上,我们知道如何处理在嵌入式解释器中执行 Python 的多线程 Go 代码,但在 GIL 之后,另一个挑战即将来临:Go 调度程序。 + +当一个 goroutine 启动时,它被安排在可用的 `GOMAXPROCS` 线程之一上执行[参见此处][15] 了解有关该主题的更多详细信息。如果一个 goroutine 碰巧执行了系统调用或调用 C 代码,当前线程会将移交给另一个队列中等待运行的其他 goroutine ,以便它们有更好的机会运行; 当前 goroutine 被暂停,等待系统调用或 C 函数返回。当 C 函数返回时,线程会尝试恢复暂停的 goroutine,但如果这不可能,它会要求 Go runtime 找到另一个线程来完成 goroutine 并进入睡眠状态。 + +考虑到这一点,让我们看看当一个 goroutine 被移动到一个新线程时,运行一些 Python 代码的 goroutine 会发生什么: + +1. 我们的 goroutine 启动,执行 C 调用,暂停,GIL 被锁定。 + +2. 当 C 调用返回时,当前线程尝试恢复 goroutine,但失败。 + +3. 当前线程告诉 Go 运行时寻找另一个线程来恢复我们的 goroutine。 + +4. Go scheduler 找到可用线程并恢复 goroutine。 + +5. goroutine 快完成了,并在返回之前尝试解锁 GIL。The goroutine is almost done and tries to unlock the GIL before returning. + +6. 当前状态中存储的线程ID来自原始线程,与当前线程的ID不同。 + +7. Panic! + +所幸,我们可以通过从 goroutine 中调用运行时包中的 LockOSThread 函数来强制 Go runtime 始终保持我们的 goroutine 在同一线程上运行: + +``` +go func() { + runtime.LockOSThread() + + _gstate := python.PyGILState_Ensure() + odds.Call(python.PyTuple_New(0), python.PyDict_New()) + python.PyGILState_Release(_gstate) + wg.Done() +}() + +``` + +这会干扰 scheduler 并可能引入一些开销,但这是我们也愿意付出代价。 + +### 结论 + +为了嵌入 Python,Datadog Agent 必须接受一些权衡: +* cgo 引入的开销。 + +* 手动处理 GIL 的任务。 + +* 在执行期间将 goroutine 绑定到同一线程的限制。 + +为了能方便在 Go 中运行 Python 检查代码,我们乐此不疲。意识到权衡,我们能够最大限度地减少它们的影响,除了为支持 Python 而引入的其他限制,我们没有对策来控制潜在问题: + +* 构建是自动化和可配置的,因此开发人员仍然需要拥有与 `go build` 非常相似的东西。 + +* agent 的轻量级版本,可以完全剥离 Python 支持,只需使用 Go 构建标签。A lightweight version of the agent can be built stripping out Python support entirely simply using Go build tags. + +* 这样的版本仅依赖于在代理本身中硬编码的核心检查(主要是系统和网络检查),但没有 cgo 并且可以交叉编译。Such a version only relies on core checks hardcoded in the agent itself (system and network checks mostly) but is cgo free and can be cross compiled. + +我们将在未来重新评估我们的选择,并决定是否仍然值得保留 cgo; 我们甚至可以重新考虑 Python 作为一个整体是否仍然值得,等待 [Go plugin package][16] 成熟到足以支持我们的用例。但就目前而言,嵌入式 Python 运行良好,从旧代理过渡到新代理再简单不过了。 + +你是一个喜欢混合不同编程语言的多语言者吗?您喜欢了解语言的内部工作原理以提高您的代码性能吗? [Join us at Datadog!][17] + +-------------------------------------------------------------------------------- + +via: https://www.datadoghq.com/blog/engineering/cgo-and-python/ + +作者:[ Massimiliano Pippi][a] +译者:[Zioyi](https://github.com/Zioyi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://github.com/masci +[1]:http://twitter.com/share?url=https://www.datadoghq.com/blog/engineering/cgo-and-python/ +[2]:http://www.reddit.com/submit?url=https://www.datadoghq.com/blog/engineering/cgo-and-python/ +[3]:https://www.linkedin.com/shareArticle?mini=true&url=https://www.datadoghq.com/blog/engineering/cgo-and-python/ +[4]:https://www.datadoghq.com/blog/category/under-the-hood +[5]:https://www.datadoghq.com/blog/tag/agent +[6]:https://www.datadoghq.com/blog/tag/golang +[7]:https://www.datadoghq.com/blog/tag/python +[8]:https://github.com/DataDog/datadog-agent/ +[9]:https://docs.python.org/2/extending/embedding.html +[10]:https://dave.cheney.net/2016/01/18/cgo-is-not-go +[11]:https://golang.org/cmd/cgo/ +[12]:https://en.wikipedia.org/wiki/Foreign_function_interface +[13]:https://blog.golang.org/c-go-cgo +[14]:https://github.com/sbinet/go-python +[15]:https://morsmachine.dk/go-scheduler +[16]:https://golang.org/pkg/plugin/ +[17]:https://www.datadoghq.com/careers/ From 8464ecad22d80845015151d12a29b4b17ce23a27 Mon Sep 17 00:00:00 2001 From: Zioyi Date: Mon, 5 Jul 2021 09:56:36 +0800 Subject: [PATCH 304/870] fix --- translated/tech/20180416 Cgo and Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20180416 Cgo and Python.md b/translated/tech/20180416 Cgo and Python.md index 7107f8af58..b92c34bebf 100644 --- a/translated/tech/20180416 Cgo and Python.md +++ b/translated/tech/20180416 Cgo and Python.md @@ -259,7 +259,7 @@ func main() { 在 goroutines 中,我们从 Go 上下文操作,我们需要显式创建状态并在完成后将其删除,这就是 `PyGILState_Ensure()` 和 `PyGILState_Release()` 为我们所做的。 ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_4.png?auto=format&fit=max&w=847) -扩展程序选项 + ### 释放 Gopher 在这一点上,我们知道如何处理在嵌入式解释器中执行 Python 的多线程 Go 代码,但在 GIL 之后,另一个挑战即将来临:Go 调度程序。 From 9daca48479130ec7f8df31d45dcdaba4042095fd Mon Sep 17 00:00:00 2001 From: Zioyi Date: Mon, 5 Jul 2021 09:56:48 +0800 Subject: [PATCH 305/870] fix From 1734a7cc07d4e003c466ea7939a3029e3846c06b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Jul 2021 10:38:09 +0800 Subject: [PATCH 306/870] PRF @amwps290 --- ...10517 How to look at the stack with gdb.md | 75 ++++++++----------- 1 file changed, 33 insertions(+), 42 deletions(-) diff --git a/translated/tech/20210517 How to look at the stack with gdb.md b/translated/tech/20210517 How to look at the stack with gdb.md index aa92897150..8a6a8a3975 100644 --- a/translated/tech/20210517 How to look at the stack with gdb.md +++ b/translated/tech/20210517 How to look at the stack with gdb.md @@ -2,15 +2,17 @@ [#]: via: "https://jvns.ca/blog/2021/05/17/how-to-look-at-the-stack-in-gdb/" [#]: author: "Julia Evans https://jvns.ca/" [#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " +[#]: translator: "amwps290" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -使用 GDB 查看程序中栈空间 +使用 GDB 查看程序的栈空间 ====== -昨天我和一些人在闲聊的时候,他们说他们并不了解栈是如何工作的,而且也不知道如何去查看栈空间。 +![](https://img.linux.net.cn/data/attachment/album/202107/05/103738f00boylephggpeyh.jpg) + +昨天我和一些人在闲聊的时候,他们说他们并不真正了解栈是如何工作的,而且也不知道如何去查看栈空间。 这是一个快速教程,介绍如何使用 GDB 查看 C 程序的栈空间。我认为这对于 Rust 程序来说也是相似的。但我这里仍然使用 C 语言,因为我发现用它更简单,而且用 C 语言也更容易写出错误的程序。 @@ -45,19 +47,19 @@ int main() { 我们使用 `gcc -g -O0 test.c -o test` 命令来编译这个程序。 -`-g` 选项会在编译程序中将调式信息也编译进去。这将会使我们查看我们的变量更加容易。 +`-g` 选项会在编译程序中将调式信息也编译进去。这将会使我们查看我们的变量更加容易。 `-O0` 选项告诉 gcc 不要进行优化,我要确保我们的 `x` 变量不会被优化掉。 ### 第一步:启动 GDB -像这样启动 GDB +像这样启动 GDB: ``` $ gdb ./test ``` -它打印出一些 GPL 东西,然后给出一个提示符。让我们在 `main` 函数这里设置一个断点 +它打印出一些 GPL 信息,然后给出一个提示符。让我们在 `main` 函数这里设置一个断点: ``` (gdb) b main @@ -81,8 +83,7 @@ Breakpoint 1, main () at test.c:4 ### 第二步:查看我们变量的地址 -让我们从了解我们的变量开始。 它们每个都在内存中有一个地址,我们可以像这样打印出来: - +让我们从了解我们的变量开始。它们每个都在内存中有一个地址,我们可以像这样打印出来: ``` (gdb) p &x @@ -93,13 +94,13 @@ $2 = (char **) 0x7fffffffe280 $4 = (char (*)[10]) 0x7fffffffe28e ``` -因此,如果我们查看栈的地址,那我们应该能够看到所有的这些变量! +因此,如果我们查看那些地址的堆栈,那我们应该能够看到所有的这些变量! ### 概念:栈指针 我们将需要使用栈指针,因此我将尽力对其进行快速解释。 -有一个名为 ESP 的 x86 寄存器,称为“栈指针”。 基本上,它是当前函数的栈起始地址。 在 GDB 中,您可以使用 `$sp` 来访问它。 当您调用新函数或从函数返回时,栈指针的值会更改。 +有一个名为 ESP 的 x86 寄存器,称为“栈指针stack pointer”。 基本上,它是当前函数的栈起始地址。 在 GDB 中,你可以使用 `$sp` 来访问它。 当你调用新函数或从函数返回时,栈指针的值会更改。 ### 第三步:在 `main` 函数开始的时候,我们查看一下在栈上的变量 @@ -112,7 +113,7 @@ $7 = (void *) 0x7fffffffe270 因此,我们当前函数的栈起始地址是 `0x7fffffffe270`,酷极了。 -现在,让我们使用 GDB 打印出当前函数堆栈开始后的前 40 个字(即160个字节)。 某些内存可能不是栈的一部分,因为我不太确定这里的堆栈有多大。 但是至少开始的地方是栈的一部分。 +现在,让我们使用 GDB 打印出当前函数堆栈开始后的前 40 个字(即 160 个字节)。 某些内存可能不是栈的一部分,因为我不太确定这里的堆栈有多大。 但是至少开始的地方是栈的一部分。 ``` (gdb) x/40x $sp @@ -128,19 +129,17 @@ $7 = (void *) 0x7fffffffe270 0x7fffffffe300: 0xf9ce816d 0x7533d7c8 0xa91a816d 0x7533c789 ``` -我已粗体显示了 stack_string,heap_string 和 x 变量的位置,并改变了颜色(译者注:可以在原网页查看): +我已粗体显示了 `stack_string`,`heap_string` 和 `x` 变量的位置,并改变了颜色: * `x` 是红色字体,并且起始地址是 `0x7fffffffe27c` * `heap_string` 是蓝色字体,起始地址是 `0x7fffffffe280` * `stack_string` 是紫色字体,起始地址是 `0x7fffffffe28e` -我想在此处将一些变量的位置加粗了一点点可能会有点偏差,但这大概是它们所在的位置。 - -您可能会在这里注意到的一件奇怪的事情是 x 的值是 0x5555,但是我们将 x 设置为 10! 那是因为直到我们的 `main` 函数运行之后才真正设置 `x` ,而我们现在才到了 `main` 最开始的地方。 +你可能会在这里注意到的一件奇怪的事情是 `x` 的值是 0x5555,但是我们将 `x` 设置为 `10`! 那是因为直到我们的 `main` 函数运行之后才真正设置 `x` ,而我们现在才到了 `main` 最开始的地方。 ### 第三步:运行到第十行代码后,再次查看一下我们的堆栈 -让我们跳过几行,等待变量实际设置为其初始化值。 到第 10 行时,`x` 应该设置为10。 +让我们跳过几行,等待变量实际设置为其初始化值。 到第 10 行时,`x` 应该设置为 `10`。 首先我们需要设置另一个断点: @@ -159,15 +158,13 @@ Breakpoint 2, main () at test.c:11 11 printf("Enter a string for the stack: "); ``` -好的! 让我们再来看看堆栈里的内容! `gdb` 在这里格式化字节的方式略有不同,实际上我也不太关心这些(译者注:可以查看 GDB 手册中 x 命令,可以指定 c 来控制输出的格式)。 这里提醒一下您,我们的变量在栈上的位置: +好的! 让我们再来看看堆栈里的内容! `gdb` 在这里格式化字节的方式略有不同,实际上我也不太关心这些(LCTT 译注:可以查看 GDB 手册中 `x` 命令,可以指定 `c` 来控制输出的格式)。 这里提醒一下你,我们的变量在栈上的位置: * `x` 是红色字体,并且起始地址是 `0x7fffffffe27c` * `heap_string` 是蓝色字体,起始地址是 `0x7fffffffe280` * `stack_string` 是紫色字体,起始地址是 `0x7fffffffe28e` - - ``` (gdb) x/80x $sp 0x7fffffffe270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 @@ -186,9 +183,9 @@ Breakpoint 2, main () at test.c:11 ### `stack_string` 在内存中是如何表示的 -现在(第10行),`stack_string` 被设置为 “stack”。 让我们看看它在内存中的表示方式。 +现在(第 10 行),`stack_string` 被设置为字符串`stack`。 让我们看看它在内存中的表示方式。 -我们可以像这样打印出字符串中的字节(译者注:可以通过 c 选项直接显示为字符): +我们可以像这样打印出字符串中的字节(LCTT 译注:可以通过 `c` 选项直接显示为字符): ``` (gdb) x/10x stack_string @@ -196,8 +193,7 @@ Breakpoint 2, main () at test.c:11 0x7fffffffe296: 0x00 0x00 ``` - -"stack" 是一个长度为 5 的字符串,相对应 5 个 ASCII 码-`0x73`, `0x74`, `0x61`, `0x63`, 和 `0x6b`。`0x73` 是字符 `s` 的 ASCII 码。 `0x74` 是 `t` 的 ASCII 码。等等... +`stack` 是一个长度为 5 的字符串,相对应 5 个 ASCII 码- `0x73`、`0x74`、`0x61`、`0x63` 和 `0x6b`。`0x73` 是字符 `s` 的 ASCII 码。 `0x74` 是 `t` 的 ASCII 码。等等... 同时我们也使用 `x/1s` 可以让 GDB 以字符串的方式显示: @@ -206,13 +202,11 @@ Breakpoint 2, main () at test.c:11 0x7fffffffe28e: "stack" ``` - - ### `heap_string` 与 `stack_string` 有何不同 你已经注意到了 `stack_string` 和 `heap_string` 在栈上的表示非常不同: -* `stack_string` 是一段字符串内容("stack") +* `stack_string` 是一段字符串内容(`stack`) * `heap_string` 是一个指针,指向内存中的某个位置 这里是 `heap_string` 变量在内存中的内容: @@ -221,7 +215,7 @@ Breakpoint 2, main () at test.c:11 0xa0 0x92 0x55 0x55 0x55 0x55 0x00 0x00 ``` -这些字节实际上应该是从右向左读:因为 X86 是小端模式,因此,`heap_string` 中所存放的内存地址 `0x5555555592a0` +这些字节实际上应该是从右向左读:因为 x86 是小端模式,因此,`heap_string` 中所存放的内存地址 `0x5555555592a0` 另一种方式查看 `heap_string` 中存放的内存地址就是使用 `p` 命令直接打印 : @@ -234,9 +228,9 @@ $6 = 0x5555555592a0 "" `x` 是一个 32 位的整数,可由 `0x0a 0x00 0x00 0x00` 来表示。 -我们还是需要反向来读取这些字节(和我们读取 `heap_string` 需要反过来读是一样的),因此这个数表示的是 `0x000000000a` 或者是 `0x0a`, 它是一个 10; +我们还是需要反向来读取这些字节(和我们读取 `heap_string` 需要反过来读是一样的),因此这个数表示的是 `0x000000000a` 或者是 `0x0a`,它是一个数字 `10`; -这就让我把把 x 设置成了 10; +这就让我把把 `x` 设置成了 `10`。 ### 第四步:从标准输入读取 @@ -256,7 +250,6 @@ gets(heap_string); Breakpoint 3 at 0x555555555205: file test.c, line 16. ``` - 然后继续执行程序: ``` @@ -266,14 +259,14 @@ Continuing. 我们输入两个字符串,为栈上存储的变量输入 `123456789012` 并且为在堆上存储的变量输入 `bananas`; -### 让我们先来看一下 `stack_string` (这里有一个缓存区溢出) +### 让我们先来看一下 `stack_string`(这里有一个缓存区溢出) ``` (gdb) x/1s stack_string 0x7fffffffe28e: "123456789012" ``` -这看起来相当正常,对吗?我们输入了 `12345679012`,然后现在它也被设置成了 `12345679012`(译者注:实测 gcc 8.3 环境下,会直接段错误)。 +这看起来相当正常,对吗?我们输入了 `12345679012`,然后现在它也被设置成了 `12345679012`(LCTT 译注:实测 gcc 8.3 环境下,会直接段错误)。 但是现在有一些很奇怪的事。这是我们程序的栈空间的内容。有一些紫色高亮的内容。 @@ -290,7 +283,7 @@ Continuing. 0x7fffffffe2b8: 0x00 0xa0 0xfc 0xf7 0x01 0x00 0x00 0x00 ``` -令人奇怪的是 **stack_string 只支持 10 个字节**。但是现在当我们输入了 13 个字符以后,发生了什么? +令人奇怪的是 **`stack_string` 只支持 10 个字节**。但是现在当我们输入了 13 个字符以后,发生了什么? 这是一个典型的缓冲区溢出,`stack_string` 将自己的数据写在了程序中的其他地方。在我们的案例中,这还没有造成问题,但它会使你的程序崩溃,或者更糟糕的是,使你面临非常糟糕的安全问题。 @@ -313,7 +306,7 @@ fish: Job 1, './test' terminated by signal SIGABRT (Abort) 这里我猜是 `stack_string` 已经到达了这个函数栈的底部,因此额外的字符将会被写在另一块内存中。 -当你故意去使用这个安全漏洞时,它被称为“堆栈粉碎”,我也不完全了解这是如何检测到的。 +当你故意去使用这个安全漏洞时,它被称为“堆栈粉碎”,而且不知何故有东西在检测这种情况的发生。 我也觉得这很有趣,虽然程序被杀死了,但是当缓冲区溢出发生时它不会立即被杀死——在缓冲区溢出之后再运行几行代码,程序才会被杀死。 好奇怪! @@ -348,7 +341,7 @@ fish: Job 1, './test' terminated by signal SIGABRT (Abort) 我们已经讨论过栈和堆是不同的内存区域,但是你怎么知道它们在内存中的位置呢? -每个进程都有一个名为 `/proc/$PID/maps` 的文件,它显示了每个进程的内存映射。 在这里您可以看到其中的栈和堆。 +每个进程都有一个名为 `/proc/$PID/maps` 的文件,它显示了每个进程的内存映射。 在这里你可以看到其中的栈和堆。 ``` $ cat /proc/24963/maps @@ -364,19 +357,17 @@ $ cat /proc/24963/maps 这有点像旋风之旅,虽然我没有解释所有内容,但希望看到数据在内存中的实际情况可以使你更清楚地了解堆栈的实际情况。 -我真的建议像这样来把玩一下 gdb —— 即使你不理解你在内存中看到的每一件事,我发现实际上像这样看到我程序内存中的数据会使抽象的概念,比如“栈”和“ 堆”和“指针”更容易理解。 +我真的建议像这样来把玩一下 gdb —— 即使你不理解你在内存中看到的每一件事,我发现实际上像这样看到我程序内存中的数据会使抽象的概念,比如“栈”和“堆”和“指针”更容易理解。 ### 更多练习 一些关于思考栈的后续练习的想法(没有特定的顺序): - * 尝试将另一个函数添加到 `test.c` 并在该函数的开头创建一个断点,看看是否可以从 `main` 中找到堆栈! 他们说当你调用一个函数时“堆栈会变小”,你能在 gdb 中看到这种情况吗? + * 尝试将另一个函数添加到 `test.c` 并在该函数的开头创建一个断点,看看是否可以从 `main` 中找到堆栈! 他们说当你调用一个函数时“堆栈会变小”,你能在 gdb 中看到这种情况吗? * 从函数返回一个指向栈上字符串的指针,看看哪里出了问题。 为什么返回指向栈上字符串的指针是不好的? * 尝试在 C 中引起堆栈溢出,并尝试通过在 gdb 中查看堆栈溢出来准确理解会发生什么! * 查看 Rust 程序中的堆栈并尝试找到变量! - * 在 [噩梦课程][1] 中尝试一些缓冲区溢出挑战。每个问题的答案写在 README 文件中,因此如果您不想被宠坏,请避免先去看答案。 所有这些挑战的想法是给你一个二进制文件,你需要弄清楚如何导致缓冲区溢出以使其打印出 “flag” 字符串。 - - + * 在 [噩梦课程][1] 中尝试一些缓冲区溢出挑战。每个问题的答案写在 README 文件中,因此如果你不想被宠坏,请避免先去看答案。 所有这些挑战的想法是给你一个二进制文件,你需要弄清楚如何导致缓冲区溢出以使其打印出 `flag` 字符串。 -------------------------------------------------------------------------------- @@ -385,7 +376,7 @@ via: https://jvns.ca/blog/2021/05/17/how-to-look-at-the-stack-in-gdb/ 作者:[Julia Evans][a] 选题:[lujun9972][b] 译者:[amwps290](https://github.com/amwps290) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d9ec569e57209cb7ea822190b13b46a8c6de227c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Jul 2021 10:45:50 +0800 Subject: [PATCH 307/870] PUB @amwps290 https://linux.cn/article-13550-1.html --- .../20210517 How to look at the stack with gdb.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210517 How to look at the stack with gdb.md (99%) diff --git a/translated/tech/20210517 How to look at the stack with gdb.md b/published/20210517 How to look at the stack with gdb.md similarity index 99% rename from translated/tech/20210517 How to look at the stack with gdb.md rename to published/20210517 How to look at the stack with gdb.md index 8a6a8a3975..5c2f5ced83 100644 --- a/translated/tech/20210517 How to look at the stack with gdb.md +++ b/published/20210517 How to look at the stack with gdb.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "amwps290" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13550-1.html" 使用 GDB 查看程序的栈空间 ====== From b079e9c15319529753bf184bc07fbfa960cb261b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Jul 2021 11:36:33 +0800 Subject: [PATCH 308/870] PRF @zepoch --- ...Use Python to parse configuration files.md | 47 ++++++++----------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210625 Use Python to parse configuration files.md b/translated/tech/20210625 Use Python to parse configuration files.md index c6be0c7288..242953c558 100644 --- a/translated/tech/20210625 Use Python to parse configuration files.md +++ b/translated/tech/20210625 Use Python to parse configuration files.md @@ -3,32 +3,34 @@ [#]: author: "Moshe Zadka https://opensource.com/users/moshez" [#]: collector: "lujun9972" [#]: translator: "zepoch" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -使用Python解析配置文件 +使用 Python 解析配置文件 ====== -第一步是选择配置文件的格式:INI、JSON、YAML 或 TOML。 -![Python programming language logo with question marks][1] +> 第一步是选择配置文件的格式:INI、JSON、YAML 或 TOML。 -有时,程序需要足够的参数,将它们全部作为命令行参数或环境变量既不让人愉快也不可行。 在这些情况下,您将需要使用配置文件。 +![](https://img.linux.net.cn/data/attachment/album/202107/05/113551tm0d0yp0px0xzp0n.jpg) -有几种流行的配置文件格式。 其中包括古老的(虽然偶尔定义不足)`INI`格式,虽然流行但有时难以手写的`JSON`格式,广泛但偶尔在细节方面令人惊讶的`YAML`格式,以及最新添加的`TOML `,很多人还没有听说过。 +有时,程序需要足够的参数,将它们全部作为命令行参数或环境变量既不让人愉快也不可行。 在这些情况下,你将需要使用配置文件。 -您的首要任务是选择一种格式,然后记录该选择。 解决了这个简单的部分之后就是时候解析配置了。 +有几种流行的配置文件格式。其中包括古老的(虽然有时定义不明确)INI 格式,虽然流行但有时难以手写的 JSON 格式,使用广泛但有时在细节方面令人意外的 YAML 格式,以及很多人还没有听说过的最新出现的 TOML。 -有时,在配置中拥有一个与“抽象“数据相对应的类是一个不错的想法。 因为这段代码不会对配置做任何事情,所以这是展示解析逻辑最简单的方式。 +你的首要任务是选择一种格式,然后记录该选择。解决了这个简单的部分之后就是时候解析配置了。 + +有时,在配置中拥有一个与“抽象“数据相对应的类是一个不错的想法。因为这段代码不会对配置做任何事情,所以这是展示解析逻辑最简单的方式。 想象一下文件处理器的配置:它包括一个输入目录、一个输出目录和要提取的文件。 配置类的抽象定义可能类似于: +``` +from __future__ import annotations +``` ``` -`from __future__ import annotations`[/code] [code] - import attr @attr.frozen @@ -44,8 +46,7 @@ class Configuration: parameters: Parameters ``` -为了使特定于格式的代码更简单,您还将编写一个函数来从字典中解析此类。 请注意,这假设配置将使用破折号,而不是下划线。 这种差异并不少见。 - +为了使特定于格式的代码更简单,你还需要编写一个函数来从字典中解析此类。请注意,这假设配置将使用破折号,而不是下划线。 这种差异并不少见。 ``` def configuration_from_dict(details): @@ -68,7 +69,6 @@ JSON(JavaScript Object Notation)是一种类似于 JavaScript 的格式。 以下是 JSON 格式的示例配置: - ``` json_config = """ { @@ -88,7 +88,6 @@ json_config = """ 解析逻辑使用 `json` 模块将 JSON 解析为 Python 的内置数据结构(字典、列表、字符串),然后从字典中创建类: - ``` import json def configuration_from_json(data): @@ -102,7 +101,6 @@ INI 格式,最初只在 Windows 上流行,之后成为配置标准格式。 这是与 INI 相同的配置: - ``` ini_config=""" [files] @@ -116,7 +114,6 @@ patterns = ['*.txt', '*.md'] Python 可以使用内置的 `configparser` 模块解析它。解析器充当类似 `dict` 的对象,因此可以直接传递给 `configuration_from_dict`: - ``` import configparser @@ -128,11 +125,10 @@ def configuration_from_ini(data): ### YAML -YAML (Yet Another Markup Language) 是 JSON 的扩展,旨在更易于手动编写。 部分 YAML 需要通过具有较长的规范来实现这一点。 +YAML(Yet Another Markup Language)是 JSON 的扩展,旨在更易于手动编写。为了实现了这一点,部分原因是有一个很长的规范。 以下是 YAML 中的相同配置: - ``` yaml_config = """ files: @@ -145,8 +141,7 @@ parameters: """ ``` -要让 Python 解析它,您需要安装第三方模块。 最受欢迎的是`PyYAML`(`pip install pyyaml`)。 YAML 解析器还返回可以传递给 `configuration_from_dict` 的内置 Python 数据类型。 但是,YAML 解析器需要一个字节流,因此您需要将字符串转换为字节流。 - +要让 Python 解析它,你需要安装第三方模块。最受欢迎的是`PyYAML`(`pip install pyyaml`)。 YAML 解析器还返回可以传递给 `configuration_from_dict` 的内置 Python 数据类型。但是,YAML 解析器需要一个字节流,因此你需要将字符串转换为字节流。 ``` import io @@ -159,11 +154,10 @@ def configuration_from_yaml(data): ### TOML -TOML(Tom's Own Markup Language)旨在成为 YAML 的轻量级替代品。 规范比较短,已经在一些地方流行了(比如 Rust 的包管理器 Cargo 就用它来进行包配置)。 +TOML(Tom's Own Markup Language)旨在成为 YAML 的轻量级替代品。其规范比较短,已经在一些地方流行了(比如 Rust 的包管理器 Cargo 就用它来进行包配置)。 这是与 TOML 相同的配置: - ``` toml_config = """ [files] @@ -175,8 +169,7 @@ patterns = [ "*.txt", "*.md",] """ ``` -为了解析 TOML,您需要安装第三方包。 最流行的一种被简单地称为 `toml`。 与 YAML 和 JSON 一样,它返回基本的 Python 数据类型。 - +为了解析 TOML,你需要安装第三方包。最流行的一种被简单地称为 `toml`。 与 YAML 和 JSON 一样,它返回基本的 Python 数据类型。 ``` import toml @@ -185,9 +178,9 @@ def configuration_from_toml(data): return configuration_from_dict(parsed) ``` -### Summary总结 +### 总结 -选择配置格式是一种微妙的权衡。 但是,一旦您做出决定,Python 就可以使用少量代码来解析大多数流行的格式。 +选择配置格式是一种微妙的权衡。但是,一旦你做出决定,Python 就可以使用少量代码来解析大多数流行的格式。 -------------------------------------------------------------------------------- @@ -196,7 +189,7 @@ via: https://opensource.com/article/21/6/parse-configuration-files-python 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 679e910658c3a3eaf413078c86eca28918ca31e1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Jul 2021 11:37:18 +0800 Subject: [PATCH 309/870] PUB @zepoch https://linux.cn/article-13551-1.html --- .../20210625 Use Python to parse configuration files.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210625 Use Python to parse configuration files.md (98%) diff --git a/translated/tech/20210625 Use Python to parse configuration files.md b/published/20210625 Use Python to parse configuration files.md similarity index 98% rename from translated/tech/20210625 Use Python to parse configuration files.md rename to published/20210625 Use Python to parse configuration files.md index 242953c558..b021b100af 100644 --- a/translated/tech/20210625 Use Python to parse configuration files.md +++ b/published/20210625 Use Python to parse configuration files.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13551-1.html" 使用 Python 解析配置文件 ====== From 324cb9bf61b51e2c0ca80ca8635c400c0a43ffd0 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Mon, 5 Jul 2021 20:17:47 +0800 Subject: [PATCH 310/870] Update and rename sources/tech/20210624 View statistics about your code with Tokei.md to translated/tech/20210624 View statistics about your code with Tokei.md --- ...w statistics about your code with Tokei.md | 201 ----------------- ...w statistics about your code with Tokei.md | 202 ++++++++++++++++++ 2 files changed, 202 insertions(+), 201 deletions(-) delete mode 100644 sources/tech/20210624 View statistics about your code with Tokei.md create mode 100644 translated/tech/20210624 View statistics about your code with Tokei.md diff --git a/sources/tech/20210624 View statistics about your code with Tokei.md b/sources/tech/20210624 View statistics about your code with Tokei.md deleted file mode 100644 index 67549bebda..0000000000 --- a/sources/tech/20210624 View statistics about your code with Tokei.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: subject: (View statistics about your code with Tokei) -[#]: via: (https://opensource.com/article/21/6/tokei) -[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -View statistics about your code with Tokei -====== -Learn details about projects' programming languages and more. -![A screen of code.][1] - -Recently, GitHub added a small indicator that shows details about projects, including what programming languages a project uses. Before this, it was hard for new contributors to know this type of information about the projects they were interested in. - -This addition is helpful, but what if you want to know the same information about projects in your local repository? That's where [Tokei][2] comes in handy. It's a tool that tells you code statistics about a project, which is especially useful when you want to build a project with people who are proficient in different languages. - -### Exploring Tokei - -According to its [README][3], "Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language." The introduction to its v.12.1.0 release [elaborates][4], "Tokei is a fast and accurate code analysis CLI tool and library, allowing you to easily and quickly see how many blank lines, comments, and lines of code are in your codebase." It can identify over 150 programming languages. - - -``` -$ ./tokei ~/exa/src ~/Work/wildfly/jaxrs -================== -Language   Files Lines Code Comments Blank -Java        46    6135  4324  945     632 -XML         23    5211  4839  473     224 -\--------------------------------- -Rust -Markdown -\----------------------------------- -Total -``` - -### Install Tokei - -To install Tokei in Fedora: - - -``` -`$ sudo dnf install tokei` -``` - -To install it with Rust's Cargo package manager: - - -``` -`$ cargo install tokei` -``` - -### Use Tokei - -To list code statistics for the current directory: - - -``` -$ tokei -=============================================================================== - Language            Files        Lines         Code     Comments       Blanks -=============================================================================== - Ada                    10         2840         1681          560          599 - Assembly                4         2508         1509          458          541 - GNU Style Assembly      4         2751         1528          748          475 - Autoconf               16         2294         1153          756          385 - Automake                1           45           34            0           11 - BASH                    4         1895         1602          133          160 - Batch                   2            4            4            0            0 - C                     330       206433       150241        23402        32790 - C Header              342        60941        24682        29143         7116 - CMake                  48         4572         3459          548          565 - C#                      9         1615          879          506          230 - C++                     5          907          599          136          172 - Dockerfile              2           16           10            0            6 - Fish                    1           87           77            5            5 - HTML                    1          545          544            1            0 - JSON                    5         8995         8995            0            0 - Makefile               10          504          293           72          139 - Module-Definition      12         1183         1046           65           72 - MSBuild                 1          141          140            0            1 - Pascal                  4         1443         1016          216          211 - Perl                    2          189          137           16           36 - Python                  4         1257          949          112          196 - Ruby                    1           23           18            1            4 - Shell                  15         1860         1411          222          227 - Plain Text             35        29425            0        26369         3056 - TOML                   64         3180         2302          453          425 - Visual Studio Pro|     30        14597        14597            0            0 - Visual Studio Sol|      6          655          650            0            5 - XML                     1          116           95           17            4 - YAML                    2           81           56           12           13 - Zsh                     1           59           48            8            3 -\------------------------------------------------------------------------------- - Markdown               55         4677            0         3214         1463 - |- C                    1            2            2            0            0 - |- Rust                19          336          268           20           48 - |- TOML                23           61           60            0            1 - (Total)                           5076          330         3234         1512 -\------------------------------------------------------------------------------- - Rust                  496       210966       188958         5348        16660 - |- Markdown           249        17676         1551        12502         3623 - (Total)                         228642       190509        17850        20283 -=============================================================================== - Total                1523       566804       408713        92521        65570 -=============================================================================== -$ -``` - -The following command prints out the supported languages and extensions: - - -``` -$ tokei -l -ABNF -ABAP -ActionScript -Ada -Agda -Alex -Alloy -Arduino C++ -AsciiDoc -ASN.1 -ASP -ASP.NET -Assembly -GNU Style Assembly -``` - -If you run `tokei` on two files and specify their location as an argument, it prints the stats for individual files in a last-in-first-out format: - -![Running Tokei on two files][5] - -(Sudeshna Sur, [CC BY-SA 4.0][6]) - -By default, `tokei` outputs only data about the languages used, but using the `--files` flag provides individual file statistics: - - -``` -$ tokei ~/exa/src --files -=========================================================================================== - Language                              Files      Lines      Code             Comments     Blanks -=========================================================================================== - Rust                                   54          9339        7070             400       1869 - |- Markdown                            33          1306           0            1165        141 - (Total)                                           10645        7070        1565       2010 -\------------------------------------------------------------------------------------------- - /home/ssur/exa/src/theme/default_theme.rs           130         107           0         23 - /home/ssur/exa/src/output/render/times.rs            30          24           0          6 - /home/ssur/exa/src/output/render/users.rs            98          76           0         22 - /home/ssur/exa/src/output/render/size.rs            182         141           3         38 - /home/ssur/exa/src/output/render/octal.rs           116          88           0         28 - /home/ssur/exa/src/output/render/mod.rs              33          20           3         10 - /home/ssur/exa/src/output/render/inode.rs            28          20           0          8 - /home/ssur/exa/src/output/render/links.rs            87          65           0         22 - /home/ssur/exa/src/output/render/groups.rs          123          93           0         30 - |ome/ssur/exa/src/output/render/filetype.rs          31          26           0          5 - /home/ssur/exa/src/output/render/blocks.rs           57          40           0         17 - /home/ssur/exa/src/output/render/git.rs             108          87           0         21 - |/ssur/exa/src/output/render/permissions.rs         204         160           3         41 - /home/ssur/exa/src/output/grid.rs                    67          51           3         13 - /home/ssur/exa/src/output/escape.rs                  26          18           4          4 - /home/ssur/exa/src/theme/lsc.rs                     235         158          39         38 - /home/ssur/exa/src/options/theme.rs                 159         124           6         29 - /home/ssur/exa/src/options/file_name.rs              46          39           0          7 - /home/ssur/exa/src/options/flags.rs                  84          63           6         15 - /home/ssur/exa/src/fs/mod.rs                         10           8           0          2 - /home/ssur/exa/src/fs/feature/mod.rs                 33          25           0          8 -\-- /home/ssur/exa/src/output/time.rs --------------------------------------------------------------- - |- Rust                                             215          170          5         40 - |- Markdown                                          28            0         25          3 -``` - -### Conclusion - -I found it very easy to use `tokei` to learn more about my code statistics. Another good thing about `tokei` is that it can be used as a library, which makes it easy to integrate into other projects. Visit Tokei's [Crate.io page][7] and [Docs.rs][8] to learn more about its usage. If you would like to get involved, you can also contribute to Tokei through its [GitHub repository][2]. - -Do you find Tokei useful? Let us know in the comments section below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/tokei - -作者:[Sudeshna Sur][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/sudeshna-sur -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_development_programming_screen.png?itok=BgcSm5Pl (A screen of code.) -[2]: https://github.com/XAMPPRocky/tokei -[3]: https://github.com/XAMPPRocky/tokei/blob/master/README.md -[4]: https://github.com/XAMPPRocky/tokei/releases/tag/v12.1.0 -[5]: https://opensource.com/sites/default/files/uploads/tokei-two-files_0.png (Running Tokei on two files) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://crates.io/crates/tokei -[8]: https://docs.rs/tokei/12.1.2/tokei/ diff --git a/translated/tech/20210624 View statistics about your code with Tokei.md b/translated/tech/20210624 View statistics about your code with Tokei.md new file mode 100644 index 0000000000..32d26fe45f --- /dev/null +++ b/translated/tech/20210624 View statistics about your code with Tokei.md @@ -0,0 +1,202 @@ +[#]: subject: "View statistics about your code with Tokei" +[#]: via: "https://opensource.com/article/21/6/tokei" +[#]: author: "Sudeshna Sur https://opensource.com/users/sudeshna-sur" +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用Tokei查看有关代码的统计信息 +====== + +了解有关项目编程语言的详细信息。 +![A screen of code.][1] + +近来,GitHub 添加了一个小指标来展示项目的细节,包括项目使用的编程语言。在这之前,对一个新的贡献者来说,了解他们感兴趣的项目的信息是较为困难的。 + +这个补充很有帮助,但是如果您想知道有关本地存储库中项目的相同信息该怎么办呢? 这正是 [Tokei][2] 派上用场的地方。这是一个当你想和精通不同语言的人想要构建一个项目时可以告诉你项目的代码数据的特别有用的工具。 + +### Exploring Tokei探索 Tokei + +通过它的 [README][3],“Tokei 是一个可以展示你的代码数据的程序。Tokei 将会展示文件的数量,和这些文件中不同语言的代码、注释、空白的行数。“它的 v.12.1.0 release [elaborates][4] 是这样子介绍的,”Tokei 是一个快速准确的代码分析 CLI 工具和库,可以使你轻松快速地在你的代码库中看到有多少空白、评论和代码行“。它能够识别超过 150 中编程语言。 + + +``` +$ ./tokei ~/exa/src ~/Work/wildfly/jaxrs +================== +Language Files Lines Code Comments Blank +Java 46 6135 4324 945 632 +XML 23 5211 4839 473 224 +\--------------------------------- +Rust +Markdown +\----------------------------------- +Total +``` + +### 安装 Tokei + +在 Fedora 上安装 Tokei: + + +``` +`$ sudo dnf install tokei` +``` + +用 Rust's Cargo 包管理器安装: + + +``` +`$ cargo install tokei` +``` + +### 使用 Tokei + +To list code statistics for the current directory: + + +``` +$ tokei +=============================================================================== + Language Files Lines Code Comments Blanks +=============================================================================== + Ada 10 2840 1681 560 599 + Assembly 4 2508 1509 458 541 + GNU Style Assembly 4 2751 1528 748 475 + Autoconf 16 2294 1153 756 385 + Automake 1 45 34 0 11 + BASH 4 1895 1602 133 160 + Batch 2 4 4 0 0 + C 330 206433 150241 23402 32790 + C Header 342 60941 24682 29143 7116 + CMake 48 4572 3459 548 565 + C# 9 1615 879 506 230 + C++ 5 907 599 136 172 + Dockerfile 2 16 10 0 6 + Fish 1 87 77 5 5 + HTML 1 545 544 1 0 + JSON 5 8995 8995 0 0 + Makefile 10 504 293 72 139 + Module-Definition 12 1183 1046 65 72 + MSBuild 1 141 140 0 1 + Pascal 4 1443 1016 216 211 + Perl 2 189 137 16 36 + Python 4 1257 949 112 196 + Ruby 1 23 18 1 4 + Shell 15 1860 1411 222 227 + Plain Text 35 29425 0 26369 3056 + TOML 64 3180 2302 453 425 + Visual Studio Pro| 30 14597 14597 0 0 + Visual Studio Sol| 6 655 650 0 5 + XML 1 116 95 17 4 + YAML 2 81 56 12 13 + Zsh 1 59 48 8 3 +\------------------------------------------------------------------------------- + Markdown 55 4677 0 3214 1463 + |- C 1 2 2 0 0 + |- Rust 19 336 268 20 48 + |- TOML 23 61 60 0 1 + (Total) 5076 330 3234 1512 +\------------------------------------------------------------------------------- + Rust 496 210966 188958 5348 16660 + |- Markdown 249 17676 1551 12502 3623 + (Total) 228642 190509 17850 20283 +=============================================================================== + Total 1523 566804 408713 92521 65570 +=============================================================================== +$ +``` + +下面的命令打印出了支持的语言和拓展: + + +``` +$ tokei -l +ABNF +ABAP +ActionScript +Ada +Agda +Alex +Alloy +Arduino C++ +AsciiDoc +ASN.1 +ASP +ASP.NET +Assembly +GNU Style Assembly +``` + +如果你在两个文件夹上运行 `tokei` 并指定其位置作为参数,它将以先入先出的规则打印单个文件的统计数据: + +![Running Tokei on two files][5] + +(Sudeshna Sur, [CC BY-SA 4.0][6]) + +默认情况下,`tokei` 仅仅输出有关语言的数据,但是使用 `--files` 标记可提供单个文件统计信息: + + +``` +$ tokei ~/exa/src --files +=========================================================================================== + Language Files Lines Code Comments Blanks +=========================================================================================== + Rust 54 9339 7070 400 1869 + |- Markdown 33 1306 0 1165 141 + (Total) 10645 7070 1565 2010 +\------------------------------------------------------------------------------------------- + /home/ssur/exa/src/theme/default_theme.rs 130 107 0 23 + /home/ssur/exa/src/output/render/times.rs 30 24 0 6 + /home/ssur/exa/src/output/render/users.rs 98 76 0 22 + /home/ssur/exa/src/output/render/size.rs 182 141 3 38 + /home/ssur/exa/src/output/render/octal.rs 116 88 0 28 + /home/ssur/exa/src/output/render/mod.rs 33 20 3 10 + /home/ssur/exa/src/output/render/inode.rs 28 20 0 8 + /home/ssur/exa/src/output/render/links.rs 87 65 0 22 + /home/ssur/exa/src/output/render/groups.rs 123 93 0 30 + |ome/ssur/exa/src/output/render/filetype.rs 31 26 0 5 + /home/ssur/exa/src/output/render/blocks.rs 57 40 0 17 + /home/ssur/exa/src/output/render/git.rs 108 87 0 21 + |/ssur/exa/src/output/render/permissions.rs 204 160 3 41 + /home/ssur/exa/src/output/grid.rs 67 51 3 13 + /home/ssur/exa/src/output/escape.rs 26 18 4 4 + /home/ssur/exa/src/theme/lsc.rs 235 158 39 38 + /home/ssur/exa/src/options/theme.rs 159 124 6 29 + /home/ssur/exa/src/options/file_name.rs 46 39 0 7 + /home/ssur/exa/src/options/flags.rs 84 63 6 15 + /home/ssur/exa/src/fs/mod.rs 10 8 0 2 + /home/ssur/exa/src/fs/feature/mod.rs 33 25 0 8 +\-- /home/ssur/exa/src/output/time.rs --------------------------------------------------------------- + |- Rust 215 170 5 40 + |- Markdown 28 0 25 3 +``` + +### 总结 + +我发现使用 `tokei` 来了解我的代码统计数据十分容易。另一个使用 `tokei` 的好处就是它可以用作为一个很容易集成到其他项目的库。访问 Tokei 的 [Crate.io page][7] 和 [Docs.rs][8] 网站来了解其更多用法。如果你想参与其中,你也可以通过它的 [GitHub repository][2] 来为 Tokei 作贡献。 + +你是否觉得 Tokei 很有用呢?可以在下方的评论区告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/tokei + +作者:[Sudeshna Sur][a] +选题:[lujun9972][b] +译者:[zepoch](https://github.com/zepoch) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_development_programming_screen.png?itok=BgcSm5Pl "A screen of code." +[2]: https://github.com/XAMPPRocky/tokei +[3]: https://github.com/XAMPPRocky/tokei/blob/master/README.md +[4]: https://github.com/XAMPPRocky/tokei/releases/tag/v12.1.0 +[5]: https://opensource.com/sites/default/files/uploads/tokei-two-files_0.png "Running Tokei on two files" +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://crates.io/crates/tokei +[8]: https://docs.rs/tokei/12.1.2/tokei/ From 70c92aa17b90b70dd8504cc65cfef6dc73253fab Mon Sep 17 00:00:00 2001 From: zxy-wyx <86962296+zxy-wyx@users.noreply.github.com> Date: Mon, 5 Jul 2021 21:35:40 +0800 Subject: [PATCH 311/870] Update 20200124 Gartner- Data-center spending will inch up this year.md --- ...24 Gartner- Data-center spending will inch up this year.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md b/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md index 03fbef5355..6f78bf6d65 100644 --- a/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md +++ b/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zxy-wyx) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -42,7 +42,7 @@ via: https://www.networkworld.com/article/3515314/data-center-spending-will-inch 作者:[Andy Patrizio][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zxy-wyx](https://github.com/zxy-wyx) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 32a666bf4acfea0b2654197c326727c373613b04 Mon Sep 17 00:00:00 2001 From: zxy-wyx <86962296+zxy-wyx@users.noreply.github.com> Date: Mon, 5 Jul 2021 21:52:30 +0800 Subject: [PATCH 312/870] Update 20200124 Gartner- Data-center spending will inch up this year.md --- ...0124 Gartner- Data-center spending will inch up this year.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md b/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md index 6f78bf6d65..f6e3d73fa5 100644 --- a/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md +++ b/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md @@ -42,7 +42,7 @@ via: https://www.networkworld.com/article/3515314/data-center-spending-will-inch 作者:[Andy Patrizio][a] 选题:[lujun9972][b] -译者:[zxy-wyx](https://github.com/zxy-wyx) +译者:[zxy-wyx](https://github.com/zxy-wy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 06149bb20d8197980b52f282d8395ffe7bceb915 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Jul 2021 05:03:04 +0800 Subject: [PATCH 313/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210705=20?= =?UTF-8?q?Things=20to=20do=20after=20installing=20Fedora=2034=20Workstati?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210705 Things to do after installing Fedora 34 Workstation.md --- ... after installing Fedora 34 Workstation.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20210705 Things to do after installing Fedora 34 Workstation.md diff --git a/sources/tech/20210705 Things to do after installing Fedora 34 Workstation.md b/sources/tech/20210705 Things to do after installing Fedora 34 Workstation.md new file mode 100644 index 0000000000..26240956dc --- /dev/null +++ b/sources/tech/20210705 Things to do after installing Fedora 34 Workstation.md @@ -0,0 +1,168 @@ +[#]: subject: (Things to do after installing Fedora 34 Workstation) +[#]: via: (https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/) +[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Things to do after installing Fedora 34 Workstation +====== + +![][1] + +Using a new operating system can be a lot of fun. But it often becomes confusing when we first use it, especially for new users who are not very familiar with computer systems. For those of you who are using Fedora for the first time and have successfully installed Fedora 34 Workstation, this article can be an initial guide. I’m sure that you want to feel more at home with your new fresh Fedora. These are several things to do after installing your Fedora 34 Workstation. + +### System update + +Maybe you think that you have installed the most recent version of Fedora 34 Workstation, so your Fedora should be up to date. But you still have to make sure that your Fedora Linux has all the updated packages. Because in every new release of an operating system, usually there are still many things that continue to be improved. You can use the terminal or GNOME software to run the update. + +If you want to update via the terminal, then you just have to open a terminal and type the following command. + +``` +$ sudo dnf update +``` + +But if you want to do it with GNOME _Software_, open the application by selecting _Activities_ then locating and selecting the _Software_ item in the taskbar at the bottom of the screen. When it opens select the _Update_s tab at the top. After that you just click the _Download_ button. An update may require a restart afterwards and _Update_ will tell you that. + +![GNOME Software location in the taskbar at the bottom of the screen][2] + +_note: another way to select Activities is to press the super key on the keyboard. Super key is the button that has the Windows logo on most keyboards._ + +![Gnome Software showing Updates][3] + +### System settings + +You can view and configure your device’s system through _System Settings_. These include items like network, keyboard, mouse, sound, displays, etc. You can run it by pressing the _super_ key on your keyboard, clicking _Show Applications_ in the task bar at the bottom of the window, then selecting _Settings_. Configure it according to your needs. + +![Settings menu showing Network selected][4] + +### Additional repositories + +Maybe some packages you need are not available to be installed from the official Fedora Repository. You can add software repositories with the _dnf config-manager_ command. Please be careful if you want to add other repositories besides the official Fedora repository. + +The first thing you should do is define a new repository by adding a new file ending in _.repo_ to the _/etc/yum.repos.d/_ directory. Run the following command in the terminal. + +``` +$ sudo dnf config-manager --add-repo /etc/yum.repos.d/file_name.repo +``` + +_note: replace file_name with the repository file name._ + +Or you can use GNOME _Software_. Open it as described in the System Update section above. Now select the “hamburger” icon (three horizontal lines) on the top right and select _Software Repositories_. You can add the repository from there using the _Install_ option. + +![GNOME Software showing location of Software Repositories menu][5] + +Most people will enable RPM Fusion. It’s a third party repository. You can read about third party repositories in [Fedora Docs][6]. + +### Fastest mirror and Delta RPM + +There are several things you can do to speed up your download times when using DNF to update your system. You can enable Fastest Mirror and Delta RPM. Edit _/etc/dnf/dnf.conf_ using a text editor, such as gedit or nano. Here’s the example to open _dnf.conf_ file with _nano_ in _terminal_. + +``` +$ sudo nano /etc/dnf/dnf.conf +``` + +Append the following line onto your _dnf.conf_ file. + +``` +fastestmirror=true +deltarpm=true +``` + +Press _ctrl+o_ to save the file then _ctrl+x_ to quit from _nano_. + +### Multimedia plugins for audio and video + +You may need some plugins for your multimedia needs. You can install multimedia plugins by running this command in a terminal. + +``` +$ sudo dnf group upgrade --with-optional Multimedia +``` + +Please pay attention to the regulations and standards in your country regarding multimedia codecs. You can read about this in [Fedora Docs][7]. + +### Tweaks and Extentions + +Fedora 34 Workstation comes with GNOME as the default Desktop Environment. We can do various configurations of GNOME by using Tweaks and Extensions, like changing themes, changing buttons in the window dialog, and many more. + +Open your terminal and run this command to install GNOME Tweaks. + +``` +$ sudo dnf install gnome-tweaks +``` + +And run this command to install GNOME Extensions. + +``` +$ sudo dnf install gnome-extensions-app +``` + +Do the same way as above when you search for _GNOME Software_. Select _Activities_ or press the _super_ key then select _Show Applications_ to see a list of installed applications. You can find both applications in the list. You can do the same thing every time you want to search for installed applications. Then do the configuration with your preferences with _Tweaks_ and _Extensions_. + +![GNOME Tweaks][8] + +![GNOME Extensions][9] + +### Install applications + +When you first install Fedora, you will find several installed apps. You can add other applications according to your needs with GNOME Software. Do the same way to open GNOME Software as described earlier. Then find the application you want, select the application, and then press the Install button. + +![GNOME Software][10] + +Or you can do it with terminal. Here are the commands to find and install the application. + +Command to search for available applications: + +``` +$ sudo dnf search application_name +``` + +The command to install the application: + +``` +$ sudo dnf install application_name +``` + +Commands to remove installed applications: + +``` +$ sudo dnf remove application_name +``` + +_note: replace application_name with the name of the application._ + +You can search for installed applications by viewing them in _Show Applications_. Select _Activities_ or press the _super_ key and select _Show Applications_. Then you can select the application you want to run from the list. + +![Installed application list][11] + +### Conclusion + +Fedora Workstation is an easy-to-use and customizable operating system. There are many things you can do after installing Fedora 34 Workstation according to your needs. This article is just a basic guide for your first steps before you have more fun with your Fedora Linux system. You can read [Fedora Docs][12] for more detailed information. I hope you enjoy using Fedora Linux. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ + +作者:[Arman Arisman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Cover_ThingsToDo.png +[2]: https://fedoramagazine.org/wp-content/uploads/2021/07/GNOME_Software_location-1024x576.png +[3]: https://fedoramagazine.org/wp-content/uploads/2021/07/Software_Updates-1024x735.png +[4]: https://fedoramagazine.org/wp-content/uploads/2021/07/Settings-1024x764.png +[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/Software_Hamburger_-1-1024x685.png +[6]: https://docs.fedoraproject.org/en-US/quick-docs/setup_rpmfusion/ +[7]: https://docs.fedoraproject.org/en-US/quick-docs/assembly_installing-plugins-for-playing-movies-and-music/ +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/Tweaks-1024x733.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/GNOME_Extensions.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/GNOME_Software-1-1024x687.png +[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/Show_Application-1024x576.png +[12]: https://docs.fedoraproject.org/en-US/fedora/f34/ From f50cc5edecd4a4f4e14d5c0944fd4c36bbb45efc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Jul 2021 05:03:27 +0800 Subject: [PATCH 314/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210706=20?= =?UTF-8?q?Element:=20A=20Cross-Platform=20Decentralized=20Open-Source=20M?= =?UTF-8?q?essaging=20App?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210706 Element- A Cross-Platform Decentralized Open-Source Messaging App.md --- ...Decentralized Open-Source Messaging App.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 sources/tech/20210706 Element- A Cross-Platform Decentralized Open-Source Messaging App.md diff --git a/sources/tech/20210706 Element- A Cross-Platform Decentralized Open-Source Messaging App.md b/sources/tech/20210706 Element- A Cross-Platform Decentralized Open-Source Messaging App.md new file mode 100644 index 0000000000..31709b65dd --- /dev/null +++ b/sources/tech/20210706 Element- A Cross-Platform Decentralized Open-Source Messaging App.md @@ -0,0 +1,158 @@ +[#]: subject: (Element: A Cross-Platform Decentralized Open-Source Messaging App) +[#]: via: (https://itsfoss.com/element/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Element: A Cross-Platform Decentralized Open-Source Messaging App +====== + +There are many open-source messaging applications available, especially if you are looking for [WhatsApp replacements][1] on both desktop and mobile. + +Element is one of them, which is a decentralized alternative for private messaging that you can use to interact with individuals, communities, or businesses. + +### Element: Privacy-Friendly Open-Source Messenger Built on Matrix Network + +![][2] + +Matrix is an open standard for secure and decentralized communication. And Element is the messaging client that uses that. + +Element is also a part of the Matrix.org Foundation — so you will find most of the same team responsible for this. + +Originally, it was known as [Riot][3], which we covered back then. But, after the [rebranding][4], it is now known as “Element”, which comes with an improved user experience and constantly focusing on making decentralized communication common for instant messaging. + +![][5] + +Element is not just another open-source messenger, it gives you the ability to do a lot of things. + +Here, let me highlight some of the key features along with some details about it that follows as you read on. + +### Features of Element + +![][6] + +Element is more of an all-in-one messenger than a replacement of something. You could choose it as an [open-source alternative to Slack][7] or a private alternative to any instant messenger like Telegram. + +Some of the options that you get with it are: + + * End-to-End encryption chat room + * Public communities (may not be encrypted) + * Direct voice call + * Conference call in the community + * Meet Jitsi integration (one of the [open-source alternatives to Zoom][8]) + * File sharing + * Emoji and Sticker support + * Moderation tools for managing communities + * Extensive anti-spam options + * Ability to bridge other services like Slack, Discord, IRC, and more + * Offers paid managed hosting to have control over your data + * Cross-signed device verification for message privacy/security + * Fine grained notification settings + * Email notifications + * Ability to restore using encryption keys + * Make yourself discoverable to the entire Matrix network using your email or number + + + +The features offered by Element may sound to be overwhelming for a user who just wants private messaging. + +But fortunately, all those features do not get in the way unless you explicitly access/configure them. So that’s a good thing. + +First, let me address the installation instructions for Linux and I’ll give you some insights on how my experience with Element was (on both Linux desktop and Android). + +### Installing Element in Linux + +Element officially supports Debian/Ubuntu for installation. You can just add the package repository and install element. + +The commands used for this is: + +``` +sudo apt install -y wget apt-transport-https + +sudo wget -O /usr/share/keyrings/riot-im-archive-keyring.gpg https://packages.riot.im/debian/riot-im-archive-keyring.gpg + +echo "deb [signed-by=/usr/share/keyrings/riot-im-archive-keyring.gpg] https://packages.riot.im/debian/ default main" | sudo tee /etc/apt/sources.list.d/riot-im.list + +sudo apt update + +sudo apt install element-desktop +``` + +Do note that they are still using Riot.im domain to host packages even after rebranding — so not to be confused with the older Riot messaging app. + +You can also find it in AUR for Arch-based distros — but I’m not quite sure about how well it works. + +Unfortunately, there’s no [Flatpak][9] or [Snap][10] package available. So, if you are using a distribution that isn’t officially supported by Element, the best place to explore solutions/raise issues will be their [GitHub page][11]. + +Now, before you get started using it, let me give you some heads up with my thoughts on it. + +### Element on Linux and Android: Here’s What You Need to Know + +To start with — the user experience is fantastic on both Android and desktop. I tried it on Linux Mint, and it worked flawlessly. + +You do not need a mobile number to sign up. Just create a username and add an email account to it, and you’re done. + +![][12] + +One can opt for a paid homeserver (your own matrix network) or just join the free Matrix homeserver offered. + +**Keep in mind,** if you are signing up for free, you may not get to experience all the features — like the ability to see who’s online. You can only do that with your own server, the free Matrix server restricts certain functionalities like that to be able to accommodate an unlimited number of free users. + +When signing in to a mobile device, you will have to verify the session by scanning a QR code prompted on Element’s desktop app. + +Once done, you can explore and join public communities available or create your own. + +Most of the existing public communities do not have end-to-end encryption enabled. So make sure you know what you are doing before messaging in any of the public communities. + +While Element supports bridging IRC, Slack, and others or adding bots to a community — it is just not supported for an encrypted community. So, you need to have an unencrypted community to be able to use bots and bridges. + +![][13] + +A **word of caution**: + +Element is getting popular, and scammers/spammers are attracted to the platform because it does not need any valuable personal information to get started. + +So **make sure that you do not trust anyone and keep your identity safe** by not using your real profile picture or work email, especially if you are joining the public communities. + +Element is constantly improving and offers plenty of features for several use-cases. I don’t see a problem with it being an open-source Discord replacement as well (in some way). + +I was impressed with the level of notification controls that it gives and an added email notification option (which is enabled by default). You can choose to have notifications based on the keywords that you find interesting, what an exciting feature to have! + +![][14] + +Overall, Element may not be the perfect replacement for everything you use right now but it is shaping up to be an all-in-one alternative to many proprietary options. + +I’ve had a good experience with Element so far and I’m confident about its future. What do you think? Willing to try Element on Linux? + +Feel free to let me know your thoughts on this. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/element/ + +作者:[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/private-whatsapp-alternatives/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/element-io.png?resize=800%2C531&ssl=1 +[3]: https://itsfoss.com/riot-desktop/ +[4]: https://itsfoss.com/riot-to-element/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/element-ui.png?resize=800%2C602&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/element-settings.png?resize=800%2C673&ssl=1 +[7]: https://itsfoss.com/open-source-slack-alternative/ +[8]: https://itsfoss.com/open-source-video-conferencing-tools/ +[9]: https://itsfoss.com/what-is-flatpak/ +[10]: https://itsfoss.com/install-snap-linux/ +[11]: https://github.com/vector-im +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/element-sign-in.png?resize=800%2C581&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/element-bridge-bots.png?resize=800%2C517&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/element-notifications.png?resize=800%2C547&ssl=1 From 2cd5db1bcd965a85b5bd569300a901b86c064b07 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Jul 2021 05:03:50 +0800 Subject: [PATCH 315/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210705=20?= =?UTF-8?q?Enter=20invisible=20passwords=20using=20this=20Python=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210705 Enter invisible passwords using this Python module.md --- ...ible passwords using this Python module.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 sources/tech/20210705 Enter invisible passwords using this Python module.md diff --git a/sources/tech/20210705 Enter invisible passwords using this Python module.md b/sources/tech/20210705 Enter invisible passwords using this Python module.md new file mode 100644 index 0000000000..4fd97fc29d --- /dev/null +++ b/sources/tech/20210705 Enter invisible passwords using this Python module.md @@ -0,0 +1,158 @@ +[#]: subject: (Enter invisible passwords using this Python module) +[#]: via: (https://opensource.com/article/21/7/invisible-passwords-python) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Enter invisible passwords using this Python module +====== +Give your password an extra layer of security with GPG and the Python +getpass module. +![Password lock][1] + +Passwords are particularly problematic for programmers. You're not supposed to store them without encrypting them, and you're not supposed to reveal what's been typed when your user enters one. This became particularly important to me when I decided I wanted to boost security on my laptop. I encrypt my home directory—but once I log in, any password stored as plain text in a configuration file is potentially exposed to prying eyes. + +Specifically, I use an application called [Mutt][2] as my email client. It lets me read and compose emails in my Linux terminal, but normally it expects a password in its configuration file. I restricted permissions on my Mutt config file so that only I can see it, but I'm the only user of my laptop, so I'm not really concerned about authenticated users inadvertently looking at my configs. Instead, I wanted to protect myself from absent-mindedly posting my config online, either for bragging rights or version control, with my password exposed. In addition, although I have no expectations of unwelcome guests on my system, I did want to ensure that an intruder couldn't obtain my password just by running `cat` on my config. + +### Python GnuPG + +The Python module `python-gnupg` is a Python wrapper for the `gpg` application. The module's name is `python-gnupg`, which you must not confuse with a module called `gnupg`. + +[GnuPG][3] (GPG) is the default encryption system for Linux, and I've been using it since 2009 or so. I feel comfortable with it and have a high level of trust in its security. + +I decided that the best way to get my password into Mutt was to store my password inside an encrypted GPG file, create a prompt for my GPG password to unlock the encrypted file, and hand the password over to Mutt (actually to the `offlineimap` command, which I use to synchronize my laptop with the email server). + +[Getting user input with Python][4] is pretty easy. You make a call to `input`, and whatever the user types is stored as a variable: + + +``` +print("Enter password: ") +myinput = input() + +print("You entered: ", myinput) +``` + +My problem was when I typed a password into the terminal in response to my password prompt, everything I typed was visible to anyone looking over my shoulder or scrolling through my terminal history: + + +``` +$ ./test.py +Enter password: my-Complex-Passphrase +``` + +### Invisible password entry with getpass + +As is often the case, there's a Python module that's already solved my problem. The module is `getpass4`, and from the user's perspective, it behaves exactly like `input` except without displaying what the user is typing. + +You can install both modules with [pip][5]: + + +``` +$ python -m pip install --user \ +python-gnupg getpass4 +``` + +Here's my Python script to create a password prompt: + + +``` +#!/usr/bin/env python +# by Seth Kenlon +# GPLv3 + +# install deps: +# python3 -m pip install --user python-gnupg getpass4 + +import gnupg +import getpass +from pathlib import Path + +def get_api_pass(): +    homedir = str(Path.home()) +    gpg = gnupg.GPG(gnupghome=os.path.join(homedir,".gnupg"), use_agent=True) +    passwd = getpass.getpass(prompt="Enter your GnuPG password: ", stream=None) + +    with open(os.path.join(homedir,'.mutt','pass.gpg'), 'rb') as f: +        apipass = (gpg.decrypt_file(f, passphrase=passwd)) + +    f.close() + +    return str(apipass) +    +if __name__ == "__main__": +    apipass = get_api_pass() +    print(apipass) +``` + +Save the file as `password_prompt.py` if you want to try it out. If you're using `offlineimap` and want to use this solution for your own password entry, then save it to some location you can point `offlineimap` to in your `.offlineimaprc` file (I use `~/.mutt/password_prompt.py`). + +### Testing the password prompt + +To see the script in action, you first must create an encrypted file (I'll assume that you already have GPG set up): + + +``` +$ echo "hello world" > pass +$ gpg --encrypt pass +$ mv pass.gpg ~/.mutt/pass.gpg +$ rm pass +``` + +Now run the Python script: + + +``` +$ python ~/.mutt/password_prompt.py +Enter your GPG password: +hello world +``` + +Nothing displays as you type, but as long as you enter your GPG passphrase correctly, you will see the test message. + +### Integrating the password prompt with offlineimap + +I needed to integrate my new prompt with the `offlineimap` command. I chose Python for this script because I knew that `offlineimap` can make calls to Python applications. If you're an `offlineimap` user, you'll appreciate that the only "integration" required is changing two lines in your `.offlineimaprc` file. + +First, add a line referencing the Python file: + + +``` +`pythonfile = ~/.mutt/password_prompt.py` +``` + +And then replace the `remotepasseval` line in `.offlineimaprc` with a call to the `get_api_pass()` function in `password_prompt.py`: + + +``` +`remotepasseval = get_api_pass()` +``` + +No more passwords in your config file! + +### Security matters + +It sometimes feels almost paranoid to think about security minutiae on your personal computer. Does your SSH config really need to be restricted to 600? Does it really matter that your email password is in an inconsequential config file buried within a hidden folder called, of all things, `.mutt`? Probably not. + +And yet knowing that I don't have sensitive data quietly hidden away in my config files makes it a lot easier for me to commit files to public Git repositories, to copy and paste snippets into support forums, and to share my knowledge in the form of actual, known-good configuration files. For that alone, improved security has made my life easier. And with so many great Python modules available to help, it's easy to implement. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/invisible-passwords-python + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/password.jpg?itok=ec6z6YgZ (Password lock) +[2]: http://www.mutt.org/ +[3]: https://gnupg.org/ +[4]: https://opensource.com/article/20/12/learn-python +[5]: https://opensource.com/article/19/11/python-pip-cheat-sheet From b75653e23cbf227a674485b68993e67d0e4a8e26 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Jul 2021 05:04:09 +0800 Subject: [PATCH 316/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210705=20?= =?UTF-8?q?How=20I=20avoid=20breaking=20functionality=20when=20modifying?= =?UTF-8?q?=20legacy=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210705 How I avoid breaking functionality when modifying legacy code.md --- ...unctionality when modifying legacy code.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210705 How I avoid breaking functionality when modifying legacy code.md diff --git a/sources/tech/20210705 How I avoid breaking functionality when modifying legacy code.md b/sources/tech/20210705 How I avoid breaking functionality when modifying legacy code.md new file mode 100644 index 0000000000..a84b4e751d --- /dev/null +++ b/sources/tech/20210705 How I avoid breaking functionality when modifying legacy code.md @@ -0,0 +1,116 @@ +[#]: subject: (How I avoid breaking functionality when modifying legacy code) +[#]: via: (https://opensource.com/article/21/7/legacy-code) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How I avoid breaking functionality when modifying legacy code +====== +Extract methods give the biggest bang for the buck when it comes to +modifying legacy code while avoiding the risk of breaking the +functionality. +![Coding on a computer][1] + +Allow me a bit of introspection. I've been working in the software engineering field for 31 years. During those 31 years, I've modified a lot of legacy software. + +Over time, I've formed certain habits when working with legacy code. Because on most projects I get paid to deliver working software that is easy to maintain, I cannot afford the luxury of taking my sweet time trying to fully understand the legacy code I am about to modify. So, I tend to skim. Skimming the code helps me quickly identify relevant portions in the repo. It is a race against time, and I don't have cycles at my disposal to dwell on less-relevant minutia. I'm always going for the most relevant area in the code. Once I find it, I slow down and start analyzing it. + +I rely heavily on my power tools—integrated development environments (IDEs). It doesn't matter which power tool; these days, they're all pretty much capable of doing the same thing. What's important to me is having the ability to quickly find where functions are called and where variables are used. + +Sooner or later, after I'm done skimming the code and analyzing the code segment I intend to change, I identify a place where I want to insert some code. Now that I understand the meaning of the classes, components, and objects involved in performing the function, I write a test first. + +After that, I write code to make the test pass. I type the name of the object I intend to use and then press the dot key (**.**) and the IDE responds by giving me a full list of methods defined for that object. All those methods are callable from the location where my cursor is. + +I then pick the method that makes sense to me. I fill in the blanks (that is, I supply values for the expected arguments/parameters), save the change, and run the test. If the test passes, I'm done with that micro change. + +I typically repeat this activity many times per hour. Throughout the workday, it is not unusual to see it repeated dozens, even hundreds of times. + +I believe the way I modify software is not unique to my work habits. I think it describes a typical flow that many (I'd even say most) software engineers adhere to. + +### A few observations + +The first thing apparent in this way of modifying legacy software is the absence of any work on documentation. Experience shows that software developers very rarely spend time reaching out for documentation. Time spent preparing the documentation and generating it to produce HTML-style online documents is often wasted. + +Instead, most developers rely solely upon power tools. And rightly so—IDEs never lie, as they always offer the real-time picture of the system they are modifying, and documentation is usually stale. + +Another thing is that developers don't read the source code the way it was written. When writing code from scratch (first pass), many developers tend to write long functions. Source code tends to bunch up. Bunching code up makes it easier to read and reason about on the first pass and debug. But after the first pass, people rarely, if ever, consume the code the way it was written. If we catch ourselves reading a whole function from beginning to end, it is most likely because we have exhausted all other options and have no choice but to slow down and read the code in a pedestrian way. However, in my experience, that slow and orderly reading of the code seldom happens. + +### Problems caused by bunched-up code + +If you were to leave the code as it was written during the first pass (i.e., long functions, a lot of bunched-up code for easy initial understanding and debugging), it would render IDEs powerless. If you cram all capabilities an object can offer into a single, giant function, later, when you're trying to utilize that object, IDEs will be of no help. IDEs will show the existence of one method (which will probably contain a large list of parameters providing values that enforce the branching logic inside that method). So, you won't know how to really use that object unless you open its source code and read its processing logic very carefully. And even then, your head will probably hurt. + +Another problem with hastily cobbled-up, "bunched-up" code is that its processing logic is not testable. While you can still write an end-to-end test for that code (input values and the expected output values), you have no way of knowing if the bunched-up code is doing any other potentially risky processing. Also, you have no way of testing for edge cases, unusual scenarios, difficult-to-reproduce scenarios, etc. That renders your code untestable, which is a very bad thing to live with. + +### Break up bunched-up code by extracting methods + +Long functions or methods are always a sign of muddled thinking. When a block of code contains numerous statements, it usually means it is doing way too much processing. Cramming a lot of processing in one place typically means the developer hasn't carefully thought things through. + +You don't need to look further than into how companies are typically organized. Instead of having hundreds of employees working in a single department, companies tend to break up into numerous smaller departments. That way, it is much clearer where responsibilities lie. + +Software code is no different. An application exists to automate a lot of intricate processing. Processing gets broken into multiple smaller steps, so each step must be mapped onto a separate, isolated block of code. You create such separate, isolated, and autonomous blocks of code by extracting methods. You take a long, bulky block of code and break it up by extracting responsibilities into separate blocks of code. + +### Extracted methods enable better naming + +Developers write software code, but it is much more often consumed (i.e., read) by developers than written. + +When consuming software code, it helps if the code is expressive. Expressiveness boils down to proper structure and proper naming. Consider the following statement: + + +``` +`if((x && !y) && !b) || (b && y) && !(z >= 65))` +``` + +It would be literally impossible to understand the meaning and the intention of this statement without running the code and stepping through it with a debugger. Such activity is called GAK (Geek at Keyboard). It is 100% unproductive and quite wasteful. + +Here is where the extract method and proper naming practices come to the rescue. Take the complex statement contained within the `if` statement, extract it into its own method, and give that method a meaningful name. For example: + + +``` +public bool IsEligible(bool b, bool x, bool y, int z) { +  return ((x && !y) && !b) || (b && y) && !(z >= 65); +} +``` + +Now replace the ugly `if` statement with a more readable statement: + + +``` +`if(IsEligible(b, x, y, z))` +``` + +Of course, you should also replace dumb one-character variable names with more meaningful names to improve readability. + +### Reusing legacy code + +Experience shows that any functionality that is not extracted and properly named and moved to the most reasonable class will never be reused. The extract method fosters frequent reuse, which goes a long way toward improving code quality. + +### Testing legacy code + +Writing tests for existing code is hard and feels less rewarding than doing [test-driven development][2] (TDD). Even after you determine that there should be several tests to ensure production code works as expected, when you realize production code must be changed to enable testing, you often decide to skip writing tests. In such situations, achieving your goal to deliver testable code, slowly but surely, keeps diminishing. + +Writing tests for legacy code is tedious because it often requires a lot of time and code to set up the preconditions. That's the opposite of how you write tests when doing TDD, where time spent writing preconditions is minimal. + +The best way to make legacy code testable is to practice the extract method approach. Locating a block of code nested in loops and conditionals and extracting it enables you to write small, precise tests. Such tests on extracted functions improve not only the testability of the code but also the understandability. If legacy code becomes more understandable thanks to extracting methods and writing legible tests, the chance of introducing defects is drastically reduced. + +### Conclusion + +Most of the discussion about extracting methods would not be necessary with TDD. Writing one test first, then making the test pass, then scanning that code for more insights into how the code should be structured and improved, making improvements, and finally making changes to part of the code base guarantees there will be no need to worry about extracting methods. Since legacy code usually means code that was not crafted with TDD methodology, you are forced to adopt a different approach. In my experience, extract methods give the biggest bang for the buck when it comes to modifying legacy code while avoiding the risk of breaking the functionality. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/legacy-code + +作者:[Alex Bunardzic][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://opensource.com/article/20/1/test-driven-development From 3dc1311f9fab85852042255843a04fc9e6ec89e9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 6 Jul 2021 08:49:43 +0800 Subject: [PATCH 317/870] translated --- ... parse Bash program configuration files.md | 155 ------------------ ... parse Bash program configuration files.md | 155 ++++++++++++++++++ 2 files changed, 155 insertions(+), 155 deletions(-) delete mode 100644 sources/tech/20210628 How to parse Bash program configuration files.md create mode 100644 translated/tech/20210628 How to parse Bash program configuration files.md diff --git a/sources/tech/20210628 How to parse Bash program configuration files.md b/sources/tech/20210628 How to parse Bash program configuration files.md deleted file mode 100644 index b957badf30..0000000000 --- a/sources/tech/20210628 How to parse Bash program configuration files.md +++ /dev/null @@ -1,155 +0,0 @@ -[#]: subject: (How to parse Bash program configuration files) -[#]: via: (https://opensource.com/article/21/6/bash-config) -[#]: author: (David Both https://opensource.com/users/dboth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to parse Bash program configuration files -====== -Separating config files from code enables anyone to change their -configurations without any special programming skills. -![bash logo on green background][1] - -Keeping program configurations separate from code is important. It enables non-programmers to alter configurations without having to modify the program's code. With compiled binary executables, that would be impossible for non-programmers because it not only requires access to source files (which we do have with open source programs) but also a programmer's skill set. Few people have that, and most people don't want to learn. - -With shell languages such as Bash, source code access is available by definition since shell scripts are not compiled into binary formats. Despite that openness, it is not a particularly good idea for non-programmers to root around in shell scripts and alter them. Even knowledgeable developers and sysadmins can make accidental changes that cause errors or worse. - -So placing configuration items into easily maintained text files provides separation and allows non-programmers to edit configuration elements without the danger of making unintentional changes to the code. Many developers do this for programs written in compiled languages because they don't expect the users to be developers. For many of the same reasons, it also makes sense to do this with interpreted shell languages. - -### The usual way - -As with many other languages, you can write code for a Bash program that reads and parses ASCII text configuration files, reads the variable name, and sets values as the program code executes. For example, a configuration file might look like this: - - -``` -var1=LinuxGeek46 -var2=Opensource.com -``` - -The program would read that file, parse each line, and set the values into each variable. - -### Sourcing - -Bash uses a much easier method for parsing and setting variables called _sourcing_. Sourcing an external file from an executable shell program is a simple method for including the content of that file into a shell program in its entirety. In one sense, this is very much like compiled language `include` statements that include library files at runtime. Such a file can include any type of Bash code, including variable assignments. - -As usual, it is easier to demonstrate than to explain. - -First, create a `~/bin` directory (if it does not already exist), and make it the present working directory (PWD). The [Linux Filesystem Hierarchical Standard][2] defines `~/bin` as the appropriate place for users to store their executable files. - -Create a new file in this directory. Name it `main` and make it executable: - - -``` -[dboth@david bin]$ touch main -[dboth@david bin]$ chmod +x main -[dboth@david bin]$ -``` - -Add the following content to this executable file: - - -``` -#!/bin/bash -Name="LinuxGeek" -echo $Name -``` - -And execute this Bash program: - - -``` -[dboth@david bin]$ ./main -LinuxGeek -[dboth@david bin]$ -``` - -Create a new file and call it `~/bin/data`. This file does not need to be executable. Add the following information to it: - - -``` -# Sourced code and variables -echo "This is the sourced code from the data file." -FirstName="David" -LastName="Both" -``` - -Add three lines to the `main` program so that it looks like this: - - -``` -#!/bin/bash -Name="LinuxGeek" -echo $Name -source ~/bin/data -echo "First name: $FirstName" -echo "LastName: $LastName" -``` - -Rerun the program: - - -``` -[dboth@david bin]$ ./main -LinuxGeek -This is the sourced code from the data file. -First name: David -LastName: Both -[dboth@david bin]$ -``` - -There is one more really cool thing to know about sourcing. You can use a single dot (`.`) as a shortcut for the `source` command. Change the `main` file to substitute the `.` in place of `source`: - - -``` -#!/bin/bash -Name="LinuxGeek" -echo $Name -. ~/bin/data -echo "First name: $FirstName" -echo "LastName: $LastName" -``` - -And run the program again. The result should be exactly the same as the previous run. - -### Starting Bash - -Every Linux host that uses Bash—which is pretty much all of them since Bash is the default shell for all distributions—includes some excellent, built-in examples of sourcing. - -Whenever a Bash shell starts, its environment must be configured so that it is usable. There are five main files and one directory that are used to configure the Bash environment. They are listed here along with their main functions: - - * `/etc/profile`: System-wide environment and startup programs - * `/etc/bashrc`: System-wide functions and aliases - * `/etc/profile.d/`: Directory that contains system-wide scripts for configuring various command-line tools such as `vim` and `mc` and any custom configuration scripts a sysadmin creates - * `~/.bash_profile`: User-specific environment and startup programs - * `~/.bashrc`: User-specific aliases and functions - * `~/.bash_logout`: User-specific commands to execute when the user logs out - - - -Try to trace the execution sequence through these files and determine which sequence it uses for a non-login Bash initialization versus a log-in Bash initialization. I did this in Chapter 17 of Volume 1 in my Linux training series, [_Using and administering Linux: Zero to sysadmin_][3]. - -I'll give you one hint. It all starts with the `~/.bashrc` script. - -### Conclusion - -This article explored sourcing for pulling code and variable assignments into a Bash program. This method of parsing variables from a configuration file is fast, easy, and flexible. It provides a method for separating Bash code from variable assignments to allow non-programmers to set the values of those variables. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/bash-config - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) -[2]: http://refspecs.linuxfoundation.org/fhs.shtml -[3]: http://www.both.org/?page_id=1183 diff --git a/translated/tech/20210628 How to parse Bash program configuration files.md b/translated/tech/20210628 How to parse Bash program configuration files.md new file mode 100644 index 0000000000..ad1f6b216f --- /dev/null +++ b/translated/tech/20210628 How to parse Bash program configuration files.md @@ -0,0 +1,155 @@ +[#]: subject: (How to parse Bash program configuration files) +[#]: via: (https://opensource.com/article/21/6/bash-config) +[#]: author: (David Both https://opensource.com/users/dboth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何解析 Bash 程序的配置文件 +====== +将配置文件与代码分开,使任何人都可以改变他们的配置,而不需要任何特殊的编程技巧。 +![bash logo on green background][1] + +将程序配置与代码分开是很重要的。它使非程序员能够改变配置而不需要修改程序的代码。如果是编译的二进制可执行文件,这对非程序员来说是不可能的,因为它不仅需要访问源文件(我们在开源程序中会这样),而且还需要程序员的技能组合。很少有人有这种能力,而且大多数人都不想学习。 + +对于像 Bash 这样的 shell 语言,由于 shell 脚本没有被编译成二进制格式,所以从定义上讲,源码是可以访问的。尽管有这种开放性,但对于非程序员来说,在 shell 脚本中钻研和修改它们并不是一个特别好的主意。即使是经验丰富的开发人员和系统管理员,也会意外地做出一些改变,导致错误或更糟。 + +因此,将配置项放在容易维护的文本文件中,提供了分离,并允许非程序员编辑配置,而不会有对代码进行意外修改的危险。许多开发者对用编译语言编写的程序都是这样做的,因为他们并不期望用户是开发者。由于许多相同的原因,对解释型 shell 语言这样做也是有意义的。 + +### 通常的方式 + +和其他许多语言一样, 你可以为 Bash 程序编写代码, 读取并解析 ASCII 文本的配置文件, 读取变量名称, 并在程序代码执行时设置值. 例如,一个配置文件可能看起来像这样: + + +``` +var1=LinuxGeek46 +var2=Opensource.com +``` + +程序将读取文件,解析每一行,并将值设置到每个变量中。 + +### Sourcing + +Bash 使用一种更简单的方法来解析和设置变量, 叫做 _sourcing_. 从一个可执行的 shell 程序中获取一个外部文件是一种简单的方法,可以将该文件的内容完整地引入 shell 程序中。在某种意义上,这很像编译语言的 `include` 语句,在运行时包括库文件。这样的文件可以包括任何类型的 Bash 代码,包括变量赋值。 + +像往常一样,演示比解释更容易。 + +首先,创建一个 `~/bin` 目录(如果它还不存在的话),并将其作为当前工作目录 (PWD)。[Linux 文件系统分层标准][2]将 `~/bin` 定义为用户存储可执行文件的适当位置。 + +在这个目录下创建一个新文件。将其命名为 `main`,并使其可执行: + + +``` +[dboth@david bin]$ touch main +[dboth@david bin]$ chmod +x main +[dboth@david bin]$ +``` + +在这个可执行文件中添加以下内容: + + +``` +#!/bin/bash +Name="LinuxGeek" +echo $Name +``` + +并执行这个 Bash 程序: + + +``` +[dboth@david bin]$ ./main +LinuxGeek +[dboth@david bin]$ +``` + +创建一个新的文件并命名为 `~/bin/data`。这个文件不需要是可执行的。在其中添加以下信息: + + +``` +# Sourced code and variables +echo "This is the sourced code from the data file." +FirstName="David" +LastName="Both" +``` + +在 `main` 程序中增加三行,看起来像这样: + + +``` +#!/bin/bash +Name="LinuxGeek" +echo $Name +source ~/bin/data +echo "First name: $FirstName" +echo "LastName: $LastName" +``` + +重新运行该程序: + + +``` +[dboth@david bin]$ ./main +LinuxGeek +This is the sourced code from the data file. +First name: David +LastName: Both +[dboth@david bin]$ +``` + +关于 sourcing 还有一件非常酷的事情要知道。你可以使用一个单点(`.`)作为 `source` 命令的快捷方式。改变 `main` 文件,用 `.` 代替 `source`。 + + + +``` +#!/bin/bash +Name="LinuxGeek" +echo $Name +. ~/bin/data +echo "First name: $FirstName" +echo "LastName: $LastName" +``` + +并再次运行该程序。其结果应该与之前的运行完全相同。 + +### 运行 Bash + +每一台使用 Bash 的 Linux 主机(几乎所有主机都是,因为 Bash 是所有发行版的默认 shell),都包括一些优秀的、内置的 sourcing 示例。 + +每当 Bash shell 运行时,它的环境必须被配置成可以使用的样子。有五个主要文件和一个目录用于配置 Bash 环境。它们和它们的主要功能如下: + + * `/etc/profile`: 全系统环境和启动程序 + * `/etc/bashrc`: 全系统的函数和别名 + * `/etc/profile.d/`: 包含全系统脚本的目录,用于配置各种命令行工具,如 `vim` 和 `mc` 以及系统管理员创建的任何自定义配置脚本 + * `~/.bash_profile`: 用户特定的环境和启动程序 + * `~/.bashrc`: 用户特定的别名和函数 + * `~/.bash_logout`: 用户特定的命令,在用户注销时执行 + + + +试着通过这些文件追踪执行顺序,确定它在非登录 Bash 初始化和登录 Bash 初始化中使用的顺序。我在我的 Linux 培训系列[_使用和管理 Linux:从零到系统管理员_][3]的第一卷第 17 章中做了这个工作。 + +给你一个提示。这一切都从 `~/.bashrc` 脚本开始。 + +### 总结 + +这篇文章探讨了在 Bash 程序中引用代码和变量的方法。这种从配置文件中解析变量的方法是快速、简单和灵活的。它提供了一种将 Bash 代码与变量赋值分开的方法,以使非程序员能够设置这些变量的值。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/bash-config + +作者:[David Both][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/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: http://refspecs.linuxfoundation.org/fhs.shtml +[3]: http://www.both.org/?page_id=1183 From ed408af568b9063e9feb8e1ceb7c748017de3249 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 6 Jul 2021 08:54:14 +0800 Subject: [PATCH 318/870] translating --- .../tech/20210630 Parse JSON configuration files with Groovy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210630 Parse JSON configuration files with Groovy.md b/sources/tech/20210630 Parse JSON configuration files with Groovy.md index d3fccc1976..4590f9e55f 100644 --- a/sources/tech/20210630 Parse JSON configuration files with Groovy.md +++ b/sources/tech/20210630 Parse JSON configuration files with Groovy.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/groovy-parse-json) [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 02c653c4628ca5ff8dcfec2f4d19920154dceb25 Mon Sep 17 00:00:00 2001 From: MM-BCY <86788030+MM-BCY@users.noreply.github.com> Date: Tue, 6 Jul 2021 09:47:04 +0800 Subject: [PATCH 319/870] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210508 My weird jobs before tech.md | 47 ------------------- .../20210508 My weird jobs before tech.md | 36 ++++++++++++++ 2 files changed, 36 insertions(+), 47 deletions(-) delete mode 100644 sources/talk/20210508 My weird jobs before tech.md create mode 100644 translated/talk/20210508 My weird jobs before tech.md diff --git a/sources/talk/20210508 My weird jobs before tech.md b/sources/talk/20210508 My weird jobs before tech.md deleted file mode 100644 index a878cfed51..0000000000 --- a/sources/talk/20210508 My weird jobs before tech.md +++ /dev/null @@ -1,47 +0,0 @@ -[#]: subject: (My weird jobs before tech) -[#]: via: (https://opensource.com/article/21/5/weird-jobs-tech) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) -[#]: collector: (lujun9972) -[#]: translator: (MM-BCY) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -My weird jobs before tech -====== -You never know where you will travel from your first job. -![Yellow plane flying in the air, Beechcraft D17S][1] - -I had a few weird jobs before I hit tech. - -I was a junior assistant in an aircraft repair shop, which meant tasks like cleaning dirty metal parts in solvent (wow, things were different back in the '70s). My most fun task there was ironing Dacron aircraft fabric onto the wooden ailerons and horizontal stabilizer on a beautiful old Beechcraft Staggerwing that was in the shop for a rebuild. - -One summer during university, I worked at the same airport on the team that mixed the fire retardant and pumped it into the fire suppression aircraft ("[water bombers][2]"). That was probably the dirtiest job I ever had, but loading the aircraft was pretty cool. There was a small flap about two meters off the ground that you would stick your finger into after attaching the filling hose to the coupling. Then the person on the pump would start the pump. When you felt your finger get wet, you waved for the pump master to stop the pump. Meanwhile, the incredibly noisy right-side radial engine was running a few meters in front of you, with the propellers doing a great job of blowing off all the red dust that accumulated on you from mixing the retardant in the first place. If you screwed up and let the airplane get too full, they would have to taxi over to a patch of ground and dump the load right there, since they would be too heavy to take off otherwise. - -Two other summers, I worked for the local Pepsi, 7-Up, and Orange Crush distributor delivering crates of soft drinks to stores and restaurants. That was definitely the most physically demanding job I ever had. Think of a five-high stack of wooden crates with each containing a dozen 750ml glass bottles of soft drinks on a hand truck. Think of pulling that up to a second-floor restaurant. Think of that restaurant getting 120 crates per week... 24 trips up those stairs and back down again with all the empties. A small truck would typically have 300 or so crates of soft drinks on board. We were paid by the load, not by the hour, so the goal was to get done early and hit the beach. - -### My tech jobs - -Delivering sodas was my last summer job during university. I graduated the next year with a degree in mathematics and a lot of computer courses, especially numerical analysis, under my belt. My first job in tech was working for a small computer services consultant. I used SPSS to do a bunch of analysis on some sport fishing surveys, wrote a few hundred lines of PL/1 to print concert tickets on the IBM 3800 laser printer in the service bureau where we rented time, and started working on some programs to analyze forest statistics. I eventually went to work for the client needing forestry statistics, becoming a partner in the mid-1980s. By then we were doing a lot more than measuring trees and no longer using a timesharing bureau to do our computations. We bought a Unix minicomputer, which we upgraded in the late 1980s to a network of Sun workstations. - -I spent some time working on a big development project headquartered in Kuala Lumpur, Malaysia. Then we bought our first geographic information system, and I spent most of my time in the late 1980s and 1990s working with our customers who needed to customize that software to meet their business needs. By the early 2000s, my three older partners were getting ready to retire, and I was trying to understand how I fit into the long-term picture of our no-longer-small company of 200 or so employees. Our new employee-owners couldn't really figure that one out either, and in 2002, I found myself in Chile, looking to see if the Chile-Canada Free Trade Agreement provided a reasonable opportunity to move some of our business to Latin America. - -That business started off formally in 2004. The Canadian parent, meanwhile, was badly sideswiped by a combination of some investments that, in the light of the 2007–2009 economic meltdown, no longer seemed so wise, and it was forced to close its doors in 2011. However, by that time, the Chilean subsidiary was a going concern, so our original employee and I became partners and purchased it from the asset sale. It's still going today, doing a lot of cool stuff in the social-environmental space, and I'm often a part of that, especially when my trusty mathematics and computational background are useful. - -As a side hustle, I develop and support a horse racing information system for a wonderful man who has made a career out of buying and selling racehorses in India. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/weird-jobs-tech - -作者:[Chris Hermansen][a] -选题:[lujun9972][b] -译者:[MM-BCY](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yellow_plane_fly_air.jpg?itok=pEcrCVJT (Yellow plane flying in the air, Beechcraft D17S) -[2]: https://worldairphotography.wordpress.com/2016/08/22/air-tanker-history-in-canada-part-one/amp/ diff --git a/translated/talk/20210508 My weird jobs before tech.md b/translated/talk/20210508 My weird jobs before tech.md new file mode 100644 index 0000000000..452d0c400a --- /dev/null +++ b/translated/talk/20210508 My weird jobs before tech.md @@ -0,0 +1,36 @@ +[#]: subject: (My weird jobs before tech) +[#]: via: (https://opensource.com/article/21/5/weird-jobs-tech) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: (MM-BCY) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +我在科技行业之前的奇怪工作 +====== +你永远不会知道从你的第一份工作到现在你会去哪里。! +在我加入技术部之前,我做过一些奇怪的工作。 +我是一家飞机修理店的初级助理,这意味着我的任务就像是清洗溶剂中的脏金属零件这样(哇,70年代的情况可不一样了)。我在那里最有趣的任务是在一架正在修理中的漂亮的老式比奇飞机倾斜机翼的木制副翼和水平稳定器上熨烫涤纶飞机的布料。 +在大学期间的一个夏天,,我在同一个机场的一个团队工作,混合了阻燃剂,然后把它注入灭火飞机(“[水弹][2]”)。那可能是我做过的最脏的工作了,但是给飞机装货还是挺酷的。有一个小皮瓣约两米离地面,你可以把你的手指插入后,连接灌装软管的耦合。然后泵上的人启动泵。当你觉得你的手指湿了,你挥手让泵主停止泵。与此同时,在你前方几米处,右侧的辐射状引擎噪音极大,螺旋桨吹掉了你身上因混合阻燃剂而积聚的红色粉尘。如果你搞砸了,让飞机装得太满,他们就得滑到一块地方,把货卸在那里,因为它们太重了,以至于无法在其他地方起飞。 +另外两个夏天,我在当地的百事可乐,七喜,橙色粉碎经销商那里工作,给商店和餐馆送一箱箱的软饮料。这绝对是我做过的体力要求最高的工作。想象一下一个五层高的木箱,每个木箱里装着一打750毫升的软饮料玻璃瓶,放在一辆手推车上。想象一下把它搬到二楼的餐厅,想象那家餐厅每周能拿到120箱... 24次爬楼梯,然后又带着空瓶子下来。一辆小卡车上通常会有300箱左右的软饮料。我们的工资是按负荷计算的,不是按小时计算的,所以我们的目标是早点完工,然后去海滩。 +我的技术工作 +送苏打水是我大学期间最后一份暑期工作。第二年我毕业了,获得了数学学位,还修了很多计算机课程,尤其是数值分析。我在技术部的第一份工作,是为一家小型电脑服务顾问公司工作。我用 社会科学统计套装软件 对一些钓鱼调查做了一些分析,写了几百行程序设计语言在我们按时间租来的服务局的 ibm 3800激光打印机上打印演唱会门票,并开始研究一些程序来分析森林统计。我最终为需要林业统计的客户工作,在20世纪80年代中期成为合伙人。那时我们已经不仅仅是测量树木,也不再使用分时局来进行计算了。我们买了一台 unix 小型计算机,我们在80年代后期升级到 sun 工作站网络 +我花了一些时间研究一个大型开发项目,总部设在马来西亚吉隆坡。然后我们买了第一个地理信息系统,在80年代末和90年代,我花了大部分时间和我们的客户一起工作,他们需要定制软件来满足他们的业务需求。到了21世纪初,我的三个老合伙人都准备退休了,我试图弄明白,我是如何融入我们这个不再是小公司的,大约200名员工的长期图景的。我们的新员工老板也不明白这一点,2002年,我来到智利,想看看智利-加拿大自由贸易协定,是否提供了一个合理的机会,把我们的部分业务转移到拉丁美洲。 +2004年正式成立。与此同时,这家加拿大母公司受到了一系列投资的严重影响,鉴于2007-2009年的经济衰退,这些投资似乎不再那么明智,它在2011年被迫关门。然而,那时候,智利子公司还在经营,所以我们原来的雇员和我成了合伙人,通过资产出售买下了它。直到今天,它仍在运行,在社会环境领域做了很多很酷的事情,我经常成为其中的一部分,特别是当我可靠的数学和计算背景非常有用的时候。 +作为一个副业,我为一个在印度买卖赛马的出色男人,开发和支持一个赛马信息系统。 +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/weird-jobs-tech + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[MM-BCY](https://github.com/MM-BCY) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yellow_plane_fly_air.jpg?itok=pEcrCVJT (Yellow plane flying in the air, Beechcraft D17S) +[2]: https://worldairphotography.wordpress.com/2016/08/22/air-tanker-history-in-canada-part-one/amp/ From b9a516178360bee5b9e5f113dde62834ab342552 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Tue, 6 Jul 2021 11:10:43 +0800 Subject: [PATCH 320/870] translating --- ...des about open source to keep your brain busy this summer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md b/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md index f4a98ab19f..b134d41845 100644 --- a/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md +++ b/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/open-source-guides) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7faacc4da6453ba23eb8defa3c5508e91f581556 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Jul 2021 11:25:04 +0800 Subject: [PATCH 321/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MM-BCY 感谢您,完成了第一篇翻译贡献! (请以后注意保持原文中的 markdown 格式,可参见我的校对,RUBY 标签是额外添加用于必要的情况下做中英文对照) --- .../20210508 My weird jobs before tech.md | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/translated/talk/20210508 My weird jobs before tech.md b/translated/talk/20210508 My weird jobs before tech.md index 452d0c400a..21cd1ecf9b 100644 --- a/translated/talk/20210508 My weird jobs before tech.md +++ b/translated/talk/20210508 My weird jobs before tech.md @@ -3,22 +3,35 @@ [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) [#]: collector: (lujun9972) [#]: translator: (MM-BCY) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -我在科技行业之前的奇怪工作 +我在进入技术行业之前的奇怪工作 ====== -你永远不会知道从你的第一份工作到现在你会去哪里。! -在我加入技术部之前,我做过一些奇怪的工作。 -我是一家飞机修理店的初级助理,这意味着我的任务就像是清洗溶剂中的脏金属零件这样(哇,70年代的情况可不一样了)。我在那里最有趣的任务是在一架正在修理中的漂亮的老式比奇飞机倾斜机翼的木制副翼和水平稳定器上熨烫涤纶飞机的布料。 -在大学期间的一个夏天,,我在同一个机场的一个团队工作,混合了阻燃剂,然后把它注入灭火飞机(“[水弹][2]”)。那可能是我做过的最脏的工作了,但是给飞机装货还是挺酷的。有一个小皮瓣约两米离地面,你可以把你的手指插入后,连接灌装软管的耦合。然后泵上的人启动泵。当你觉得你的手指湿了,你挥手让泵主停止泵。与此同时,在你前方几米处,右侧的辐射状引擎噪音极大,螺旋桨吹掉了你身上因混合阻燃剂而积聚的红色粉尘。如果你搞砸了,让飞机装得太满,他们就得滑到一块地方,把货卸在那里,因为它们太重了,以至于无法在其他地方起飞。 -另外两个夏天,我在当地的百事可乐,七喜,橙色粉碎经销商那里工作,给商店和餐馆送一箱箱的软饮料。这绝对是我做过的体力要求最高的工作。想象一下一个五层高的木箱,每个木箱里装着一打750毫升的软饮料玻璃瓶,放在一辆手推车上。想象一下把它搬到二楼的餐厅,想象那家餐厅每周能拿到120箱... 24次爬楼梯,然后又带着空瓶子下来。一辆小卡车上通常会有300箱左右的软饮料。我们的工资是按负荷计算的,不是按小时计算的,所以我们的目标是早点完工,然后去海滩。 -我的技术工作 -送苏打水是我大学期间最后一份暑期工作。第二年我毕业了,获得了数学学位,还修了很多计算机课程,尤其是数值分析。我在技术部的第一份工作,是为一家小型电脑服务顾问公司工作。我用 社会科学统计套装软件 对一些钓鱼调查做了一些分析,写了几百行程序设计语言在我们按时间租来的服务局的 ibm 3800激光打印机上打印演唱会门票,并开始研究一些程序来分析森林统计。我最终为需要林业统计的客户工作,在20世纪80年代中期成为合伙人。那时我们已经不仅仅是测量树木,也不再使用分时局来进行计算了。我们买了一台 unix 小型计算机,我们在80年代后期升级到 sun 工作站网络 -我花了一些时间研究一个大型开发项目,总部设在马来西亚吉隆坡。然后我们买了第一个地理信息系统,在80年代末和90年代,我花了大部分时间和我们的客户一起工作,他们需要定制软件来满足他们的业务需求。到了21世纪初,我的三个老合伙人都准备退休了,我试图弄明白,我是如何融入我们这个不再是小公司的,大约200名员工的长期图景的。我们的新员工老板也不明白这一点,2002年,我来到智利,想看看智利-加拿大自由贸易协定,是否提供了一个合理的机会,把我们的部分业务转移到拉丁美洲。 -2004年正式成立。与此同时,这家加拿大母公司受到了一系列投资的严重影响,鉴于2007-2009年的经济衰退,这些投资似乎不再那么明智,它在2011年被迫关门。然而,那时候,智利子公司还在经营,所以我们原来的雇员和我成了合伙人,通过资产出售买下了它。直到今天,它仍在运行,在社会环境领域做了很多很酷的事情,我经常成为其中的一部分,特别是当我可靠的数学和计算背景非常有用的时候。 -作为一个副业,我为一个在印度买卖赛马的出色男人,开发和支持一个赛马信息系统。 + +> 你永远不会知道从你的第一份工作会走到哪里! + +![Yellow plane flying in the air, Beechcraft D17S][1] + +在我从事技术工作之前,我做过一些奇怪的工作。 + +我是一家飞机修理厂的初级助理,这意味着我的工作要在溶剂中清洗肮脏的金属零件(哇,70 年代的事情可和现在不一样)。我在那里最有趣的工作是熨烫涤纶飞机的布料,放到一架正在修理中的漂亮的老式比奇交错式双翼机Beechcraft Staggerwing的木制副翼和水平稳定器上。 + +在大学期间的一个夏天,我在同一个机场的一个团队工作,混合阻燃剂,然后把它注入灭火飞机(“[水轰炸机][2]water bomber”)。那可能是我做过的最脏的工作了,但是给飞机装载还是挺酷的。有一个离地面约两米的小挡板,你可以在把填充软管连接到接头后把手指伸进去。然后泵上的人启动泵。当你觉得你的手指湿了,就挥手让管理泵的人停止泵。与此同时,在你前方几米处运行的右侧径向引擎噪音极大,螺旋桨吹掉了你身上因混合阻燃剂而积聚的红色粉尘。如果你搞砸了,让飞机装得太满,他们就得滑到一块地方,把货卸在那里,否则他们会太重而无法起飞。 + +另外两个夏天,我在当地的百事可乐、七喜、Orange Crush 经销商那里工作,给商店和餐馆送一箱箱的软饮料。这绝对是我做过的最重的体力活了。想想看,在一辆手推车上堆放着五层高的木箱,每个木箱里装着一打 750 毫升的软饮料玻璃瓶。想想把它搬到二楼的餐厅,想想那家餐厅每周要运 120 箱……爬 24 次楼,然后又带着所有的空瓶子下来。一辆小卡车上通常会有 300 箱左右的软饮料。我们的工资是按载重计算的,而不是按小时计算的,所以我们的目标是早点完工,然后去海滩。 + +### 我的技术工作 + +送苏打水是我大学期间最后一份暑期工作。第二年我毕业了,获得了数学学位,还修了很多计算机课程,尤其是数值分析。我在技术领域的第一份工作,是为一家小型电脑服务咨询公司工作。我用 SPSS 对一些运动钓鱼调查做了一些分析,写了几百行 PL/1,在我们按时间租来的服务部门的 IBM 3800 激光打印机上打印演唱会门票,并开始研究一些程序来分析森林统计数据。我最终为需要林业统计的客户工作,在 20 世纪 80 年代中期成为合伙人。那时我们已经不仅仅是测量树木,也不再使用分时服务部门timesharing bureau来进行计算了。我们买了一台 UNIX 小型计算机,我们在 80 年代后期升级到 SUN 工作站网络。 + +我在一个大型开发项目上工作了一段时间,它的总部设在马来西亚吉隆坡。然后我们买了第一个地理信息系统,在 80 年代末和 90 年代,我的大部分时间都在和我们的客户一起工作,他们需要定制软件来满足他们的业务需求。到了 21 世纪初,我的三个老合伙人都准备退休了,我试图弄明白,我是如何融入我们这个不再是小公司的,大约 200 名员工的长期图景。我们新的员工老板也不明白这一点,2002 年,我来到智利,想看看智利-加拿大自由贸易协定,是否提供了一个合理的机会,把我们的部分业务转移到拉丁美洲。 + +该业务在 2004 年正式成立。与此同时,加拿大的母公司由于一些投资组合受到严重影响,在 2007-2009 年的经济衰退的情况下,这些投资似乎不再那么明智,它在 2011 年被迫倒闭。然而,那时候,智利子公司还在经营,所以我们原来的雇员和我成了合伙人,通过资产出售买下了它。直到今天,它仍在运行,在社会环境领域做了很多很酷的事情,我经常参与其中,特别是当我可靠的数学和计算背景有用的时候。 + +作为一个副业,我为一个在印度以买卖赛马为业的人开发和支持一个赛马信息系统。 + -------------------------------------------------------------------------------- via: https://opensource.com/article/21/5/weird-jobs-tech @@ -26,7 +39,7 @@ via: https://opensource.com/article/21/5/weird-jobs-tech 作者:[Chris Hermansen][a] 选题:[lujun9972][b] 译者:[MM-BCY](https://github.com/MM-BCY) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0d597110a6a63722a47941f0b83de123189203fc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Jul 2021 11:25:55 +0800 Subject: [PATCH 322/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @MM-BCY 本文首发地址:https://linux.cn/article-13553-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/MM-BCY --- .../talk => published}/20210508 My weird jobs before tech.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210508 My weird jobs before tech.md (98%) diff --git a/translated/talk/20210508 My weird jobs before tech.md b/published/20210508 My weird jobs before tech.md similarity index 98% rename from translated/talk/20210508 My weird jobs before tech.md rename to published/20210508 My weird jobs before tech.md index 21cd1ecf9b..33c1d30cb9 100644 --- a/translated/talk/20210508 My weird jobs before tech.md +++ b/published/20210508 My weird jobs before tech.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (MM-BCY) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13553-1.html) 我在进入技术行业之前的奇怪工作 ====== From 6a1bc890d1cbd643174f71fb5abdde4ccda41bf3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Jul 2021 11:43:37 +0800 Subject: [PATCH 323/870] PRF @zePoch --- ...w statistics about your code with Tokei.md | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/translated/tech/20210624 View statistics about your code with Tokei.md b/translated/tech/20210624 View statistics about your code with Tokei.md index 32d26fe45f..af58a91a7c 100644 --- a/translated/tech/20210624 View statistics about your code with Tokei.md +++ b/translated/tech/20210624 View statistics about your code with Tokei.md @@ -3,24 +3,24 @@ [#]: author: "Sudeshna Sur https://opensource.com/users/sudeshna-sur" [#]: collector: "lujun9972" [#]: translator: "zepoch" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -使用Tokei查看有关代码的统计信息 +使用 Tokei 查看有关代码的统计信息 ====== -了解有关项目编程语言的详细信息。 -![A screen of code.][1] +> 了解有关项目编程语言的详细信息。 + +![](https://img.linux.net.cn/data/attachment/album/202107/06/114306ar6zjnrr92rn2vnz.jpg) 近来,GitHub 添加了一个小指标来展示项目的细节,包括项目使用的编程语言。在这之前,对一个新的贡献者来说,了解他们感兴趣的项目的信息是较为困难的。 这个补充很有帮助,但是如果您想知道有关本地存储库中项目的相同信息该怎么办呢? 这正是 [Tokei][2] 派上用场的地方。这是一个当你想和精通不同语言的人想要构建一个项目时可以告诉你项目的代码数据的特别有用的工具。 -### Exploring Tokei探索 Tokei - -通过它的 [README][3],“Tokei 是一个可以展示你的代码数据的程序。Tokei 将会展示文件的数量,和这些文件中不同语言的代码、注释、空白的行数。“它的 v.12.1.0 release [elaborates][4] 是这样子介绍的,”Tokei 是一个快速准确的代码分析 CLI 工具和库,可以使你轻松快速地在你的代码库中看到有多少空白、评论和代码行“。它能够识别超过 150 中编程语言。 +### 探索 Tokei +据其 [README][3],“Tokei 是一个可以展示你的代码数据的程序。Tokei 将会展示文件的数量,和这些文件中不同语言的代码、注释、空白的行数。”它的 v.12.1.0 版本 [elaborates][4] 是这样子介绍的,“Tokei 是一个快速准确的代码分析 CLI 工具和库,可以使你轻松快速地在你的代码库中看到有多少空白、评论和代码行”。它能够识别超过 150 种编程语言。 ``` $ ./tokei ~/exa/src ~/Work/wildfly/jaxrs @@ -28,10 +28,10 @@ $ ./tokei ~/exa/src ~/Work/wildfly/jaxrs Language Files Lines Code Comments Blank Java 46 6135 4324 945 632 XML 23 5211 4839 473 224 -\--------------------------------- +--------------------------------- Rust Markdown -\----------------------------------- +----------------------------------- Total ``` @@ -39,22 +39,19 @@ Total 在 Fedora 上安装 Tokei: - ``` -`$ sudo dnf install tokei` +$ sudo dnf install tokei ``` 用 Rust's Cargo 包管理器安装: - ``` -`$ cargo install tokei` +$ cargo install tokei ``` ### 使用 Tokei -To list code statistics for the current directory: - +要列出当前目录中的代码统计: ``` $ tokei @@ -92,13 +89,13 @@ $ tokei XML 1 116 95 17 4 YAML 2 81 56 12 13 Zsh 1 59 48 8 3 -\------------------------------------------------------------------------------- +------------------------------------------------------------------------------- Markdown 55 4677 0 3214 1463 |- C 1 2 2 0 0 |- Rust 19 336 268 20 48 |- TOML 23 61 60 0 1 (Total) 5076 330 3234 1512 -\------------------------------------------------------------------------------- +------------------------------------------------------------------------------- Rust 496 210966 188958 5348 16660 |- Markdown 249 17676 1551 12502 3623 (Total) 228642 190509 17850 20283 @@ -110,7 +107,6 @@ $ 下面的命令打印出了支持的语言和拓展: - ``` $ tokei -l ABNF @@ -133,11 +129,8 @@ GNU Style Assembly ![Running Tokei on two files][5] -(Sudeshna Sur, [CC BY-SA 4.0][6]) - 默认情况下,`tokei` 仅仅输出有关语言的数据,但是使用 `--files` 标记可提供单个文件统计信息: - ``` $ tokei ~/exa/src --files =========================================================================================== @@ -146,7 +139,7 @@ $ tokei ~/exa/src --files Rust 54 9339 7070 400 1869 |- Markdown 33 1306 0 1165 141 (Total) 10645 7070 1565 2010 -\------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------------- /home/ssur/exa/src/theme/default_theme.rs 130 107 0 23 /home/ssur/exa/src/output/render/times.rs 30 24 0 6 /home/ssur/exa/src/output/render/users.rs 98 76 0 22 @@ -168,14 +161,14 @@ $ tokei ~/exa/src --files /home/ssur/exa/src/options/flags.rs 84 63 6 15 /home/ssur/exa/src/fs/mod.rs 10 8 0 2 /home/ssur/exa/src/fs/feature/mod.rs 33 25 0 8 -\-- /home/ssur/exa/src/output/time.rs --------------------------------------------------------------- +-- /home/ssur/exa/src/output/time.rs --------------------------------------------------------------- |- Rust 215 170 5 40 |- Markdown 28 0 25 3 ``` ### 总结 -我发现使用 `tokei` 来了解我的代码统计数据十分容易。另一个使用 `tokei` 的好处就是它可以用作为一个很容易集成到其他项目的库。访问 Tokei 的 [Crate.io page][7] 和 [Docs.rs][8] 网站来了解其更多用法。如果你想参与其中,你也可以通过它的 [GitHub repository][2] 来为 Tokei 作贡献。 +我发现使用 `tokei` 来了解我的代码统计数据十分容易。另一个使用 `tokei` 的好处就是它可以用作为一个很容易集成到其他项目的库。访问 Tokei 的 [Crate.io page][7] 和 [Docs.rs][8] 网站来了解其更多用法。如果你想参与其中,你也可以通过它的 [GitHub 仓库][2] 来为 Tokei 作贡献。 你是否觉得 Tokei 很有用呢?可以在下方的评论区告诉我们。 @@ -186,7 +179,7 @@ via: https://opensource.com/article/21/6/tokei 作者:[Sudeshna Sur][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c037f798575c5ee0e17361f9e8f2ea400a3d449a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Jul 2021 11:44:24 +0800 Subject: [PATCH 324/870] PUB @zEpoch https://linux.cn/article-13554-1.html --- .../20210624 View statistics about your code with Tokei.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210624 View statistics about your code with Tokei.md (99%) diff --git a/translated/tech/20210624 View statistics about your code with Tokei.md b/published/20210624 View statistics about your code with Tokei.md similarity index 99% rename from translated/tech/20210624 View statistics about your code with Tokei.md rename to published/20210624 View statistics about your code with Tokei.md index af58a91a7c..290dddf1b4 100644 --- a/translated/tech/20210624 View statistics about your code with Tokei.md +++ b/published/20210624 View statistics about your code with Tokei.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13554-1.html" 使用 Tokei 查看有关代码的统计信息 ====== From 58a45a750717dce9e87d7d6fcab18717a8103430 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Jul 2021 05:03:04 +0800 Subject: [PATCH 325/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210707=20?= =?UTF-8?q?How=20to=20Know=20if=20Your=20System=20Uses=20MBR=20or=20GPT=20?= =?UTF-8?q?Partitioning=20[on=20Windows=20and=20Linux]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md --- ... GPT Partitioning -on Windows and Linux.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md diff --git a/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md b/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md new file mode 100644 index 0000000000..5532fd9485 --- /dev/null +++ b/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md @@ -0,0 +1,114 @@ +[#]: subject: (How to Know if Your System Uses MBR or GPT Partitioning [on Windows and Linux]) +[#]: via: (https://itsfoss.com/check-mbr-or-gpt/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Know if Your System Uses MBR or GPT Partitioning [on Windows and Linux] +====== + +Knowing the correct partitioning scheme of your disk could be crucial when you are installing Linux or any other operating system. + +There are two popular partitioning schemes; the older MBR and the newer GPT. Most computers use GPT these days. + +While creating the live or bootable USB, some tools (like [Rufus][1]) ask you the type of disk partitioning in use. If you choose GPT with an MBR disk, the bootable USB might not work. + +In this tutorial, I’ll show various methods to check the disk partitioning scheme on Windows and Linux systems. + +### Check whether your system uses MBR or GPT on Windows systems + +While there are several ways to check the disk partitioning scheme in Windows including command line ones, I’ll stick with the GUI methods. + +Press the Windows button and search for ‘disk’ and then click on “**Create and format disk partitions**“. + +![][2] + +In here, **right-click on the disk** for which you want to check the partitioning scheme. In the right-click context menu, **select Properties**. + +![Right click on the disk and select properties][3] + +In the Properties, go to **Volumes** tab and look for **Partition style**. + +![In Volumes tab, look for Partition style][4] + +As you can see in the screenshot above, the disk is using GPT partitioning scheme. For some other systems, it could show MBR or MSDOS partitioning scheme. + +Now you know how to check disk partitioning scheme in Windows. In the next section, you’ll learn to do the same in Linux. + +### Check whether your system uses MBR or GPT on Linux + +There are several ways to check whether a disk uses MBR or GPT partitioning scheme in Linux as well. This includes commands and GUI tools. + +Let me first show the command line method and then I’ll show a couple of GUI methods. + +#### Check disk partitioning scheme in Linux command line + +The command line method should work on all Linux distributions. + +Open a terminal and use the following command with sudo: + +``` +sudo parted -l +``` + +The above command is actually a CLI-based [partitioning manager in Linux][5]. With the option -l, it lists the disks on your system along with the details about those disks. It includes partitioning scheme information. + +In the output, look for the line starting with **Partition Table**: + +![][6] + +In the above screenshot, the disk has GPT partitioning scheme. For **MBR**, it would show **msdos**. + +You learned the command line way. But if you are not comfortable with the terminal, you can use graphical tools as well. + +#### Checking disk information with GNOME Disks tool + +Ubuntu and many other GNOME-based distributions have a built-in graphical tool called Disks that lets you handle the disks in your system. + +You can use the same tool for getting the partition type of the disk as well. + +![][7] + +#### Checking disk information with Gparted graphical tool + +If you don’t have the option to use GNOME Disks tool, no worries. There are other tools available. + +One such popular tool is Gparted. You should find it in the repositories of most Linux distributions. If not installed already, [install Gparted][8] using your distribution’s software center or [package manager][9]. + +In Gparted, select the disk and from the menu select **View->Device** Information. It will start showing the disk information in the bottom-left area and this information includes the partitioning scheme. + +![][10] + +See, not too complicated, was it? Now you know multiple ways of figuring our whether the disks in your system use GPT or MBR partitioning scheme. + +On the same note, I would also like to mention that sometimes disks also have a [hybrid partitioning scheme][11]. This is not common and most of the time it is either MBR or GPT. + +Questions? Suggestions? Please leave a comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/check-mbr-or-gpt/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://rufus.ie/en_US/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/disc-management-windows.png?resize=800%2C561&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/gpt-check-windows-1.png?resize=800%2C603&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/gpt-check-windows-2-1.png?resize=800%2C600&ssl=1 +[5]: https://itsfoss.com/partition-managers-linux/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-if-mbr-or-gpt-in-Linux.png?resize=800%2C446&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-if-mbr-or-gpt-in-Linux-gui.png?resize=800%2C548&ssl=1 +[8]: https://itsfoss.com/gparted/ +[9]: https://itsfoss.com/package-manager/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-disk-partitioning-scheme-linux-gparted.jpg?resize=800%2C555&ssl=1 +[11]: https://www.rodsbooks.com/gdisk/hybrid.html From f40a3487e39c69da75360095461a6183a3ea9c1a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Jul 2021 05:03:29 +0800 Subject: [PATCH 326/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210706=20?= =?UTF-8?q?Send=20and=20receive=20Gmail=20from=20the=20Linux=20command=20l?= =?UTF-8?q?ine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210706 Send and receive Gmail from the Linux command line.md --- ...ceive Gmail from the Linux command line.md | 265 ++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 sources/tech/20210706 Send and receive Gmail from the Linux command line.md diff --git a/sources/tech/20210706 Send and receive Gmail from the Linux command line.md b/sources/tech/20210706 Send and receive Gmail from the Linux command line.md new file mode 100644 index 0000000000..8c4630cb42 --- /dev/null +++ b/sources/tech/20210706 Send and receive Gmail from the Linux command line.md @@ -0,0 +1,265 @@ +[#]: subject: (Send and receive Gmail from the Linux command line) +[#]: via: (https://opensource.com/article/21/7/gmail-linux-terminal) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Send and receive Gmail from the Linux command line +====== +Use Mutt to send and receive email from your terminal, even if you're +using hosted service such as Gmail. +![woman on laptop sitting at the window][1] + +I'm a [Mutt][2] user. I like viewing and composing emails in the convenience of my Linux terminal. With a lightweight and minimal client like Mutt, I know that I can have my email available regardless of system specifications or internet access. And because I have a Linux terminal open more often than not, my email client essentially has no footprint on my desktop real estate. It's hidden away in a [terminal tab or multiplexer pane][3], so I can ignore it when I don't need it but get to it quickly when I do need it. + +A commonly perceived problem with Mutt is that most of us use hosted email accounts these days and interact with actual email protocols only superficially. Mutt (and ELM before it) was created back in simpler times, when checking email was a call to `uucp` and a glance at `/var/mail`. However, it's adapted nicely to developing technology and works well with all sorts of modern protocols like POP, IMAP, and even LDAP, so you can use Mutt even if you're using Gmail as your email host. + +Because it's relatively rare to run your own email server today, and because Gmail is very common, this tutorial assumes you're using Mutt with Gmail. If you're concerned about email privacy, consider opening an account with [ProtonMail][4] or [Tutanota][5], both of which provide fully encrypted email. Tutanota has many [open source components][6], and ProtonMail provides an [IMAP bridge][7] for paid users so that you don't have to work around accessing your email outside a browser. However, many companies, schools, and organizations don't run their own email services and just use Gmail, so you may have a Gmail account whether you want one or not. + +If you are [running your own email server][8], setting up Mutt is even easier than what I demonstrate in this article, so just dive right in. + +### Install Mutt + +On Linux, you can install Mutt from your distribution's software repository and then create a `.mutt` directory to hold its configuration files: + + +``` +$ sudo dnf install mutt +$ mkdir ~/.mutt +``` + +On macOS, use [MacPorts][9] or [Homebrew][10]. On Windows, use [Chocolatey][11]. + +Mutt is a mail user agent (MUA), meaning its job is to read, compose, and send email to an outbound mail spool. It's the job of some other application or service to actually transfer a message to or from a mail server (although there's a lot of integration with Mutt so that it seems like it's doing all the work even when it's not.) Understanding this separation of tasks can help configuration make a little more sense. + +It also explains why you must have helper applications (in addition to Mutt) depending on what service you need to communicate with. For this article, I use IMAP so that my local copy of email and my email provider's remote copy of mail remain synchronized. Should you decide to use POP instead, that configuration is even easier to configure and can be done without any external tools. IMAP integration, however, requires OfflineIMAP, a Python application available from [its GitHub repository][12]. + +Eventually, you'll be able to install it with the `python3 -m pip` command, but as of this writing, you must install OfflineIMAP manually because it's still being ported from Python 2 to Python 3. + +OfflineIMAP requires `imaplib2`, which is also in heavy development, so I prefer doing a manual install of that, as well. The process is the same: clone the source code repository with Git, change into the directory, and install with `pip`. + +First, install the `rfc6555` dependency: + + +``` +`$ python3 -m pip install --user rfc6555` +``` + +Next, install `imaplib2` from source: + + +``` +$ git clone [git@github.com][13]:jazzband/imaplib2.git +$ pushd imaplib2.git +$ python3 -m pip install --upgrade --user . +$ popd +``` + +Finally, install OfflineIMAP from source: + + +``` +$ git clone [git@github.com][13]:OfflineIMAP/offlineimap3.git +$ pushd offlineimap3.git +$ python3 -m pip install --upgrade --user . +$ popd +``` + +If you're using Cygwin on Windows, then you must also install [Portalocker][14]. + +### Configure OfflineIMAP + +OfflineIMAP reads the configuration file `~/.offlineimaprc` by default. A template for this file, named `offlineimap.conf`, is included in the Git repository you cloned to install OfflineIMAP. Move the example file to your home directory: + + +``` +`$ mv offlineimap3.git/offlineimap.conf ~/.offlineimaprc` +``` + +Open the file in your favorite text editor and read through it. It's a well-commented file, and it's good to get familiar with the options available. + +Here's my `.offlineimaprc` as an example, with comments removed for brevity. Some values may be slightly different for you, but this gives you a reasonable idea of what your end product ought to look like: + + +``` +[general] +ui = ttyui +accounts = %your-gmail-username% +pythonfile = ~/.mutt/password_prompt.py +fsync = False + +[Account %your-gmail-username%] +localrepository = %your-gmail-username%-Local +remoterepository = %your-gmail-username%-Remote +status_backend = sqlite +postsynchook = notmuch new + +[Repository %your-gmail-username%-Local] +type = Maildir +localfolders = ~/.mail/%your-gmail-username%-gmail.com +nametrans = lambda folder: {'drafts':  '[Gmail]/Drafts', +                            'sent':    '[Gmail]/Sent Mail', +                            'flagged': '[Gmail]/Starred', +                            'trash':   '[Gmail]/Trash', +                            'archive': '[Gmail]/All Mail', +                            }.get(folder, folder) + +[Repository %your-gmail-username%-Remote] +maxconnections = 1 +type = Gmail +remoteuser = %your-gmail-username%@gmail.com +remotepasseval = '%your-gmail-API-password%' +## remotepasseval = get_api_pass() +sslcacertfile = /etc/ssl/certs/ca-bundle.crt +realdelete = no +nametrans = lambda folder: {'[Gmail]/Drafts':    'drafts', +                            '[Gmail]/Sent Mail': 'sent', +                            '[Gmail]/Starred':   'flagged', +                            '[Gmail]/Trash':     'trash', +                            '[Gmail]/All Mail':  'archive', +                            }.get(folder, folder) +folderfilter = lambda folder: folder not in ['[Gmail]/Trash', +                                             '[Gmail]/Important', +                                             '[Gmail]/Spam', +                                             ] +``` + +There are two replaceable values in this file: `%your-gmail-username%` and `%your-gmail-API-password%`. Replace the first with your Gmail user name. That's the part of your email address on the left of the `@gmail.com` part. You must acquire the second value from Google through a two-factor authentication (2FA) setup process (even though you don't need to use 2FA to check email). + +### Set up 2FA for Gmail + +Google expects its users to use the Gmail website for email, so when you attempt to access your email outside of Gmail's interface, you're essentially doing so as a developer (even if you don't consider yourself a developer). In other words, you're creating what Google considers an "app." To obtain a developer-level _app password_, you must set up 2FA; through that process, you get an app password, which Mutt can use to log in outside the usual browser interface. + +For safety, you can also add a recovery email address. To do that, go to Google's [Account Security page][15] and scroll down to **Recovery email**. + +To set up 2FA, go back to the Account Security page, and click on **2-step Verification** to activate and configure it. This requires a mobile phone for setup. + +After activating 2FA, you get a new Google Account Security option: **App passwords**. Click on it to create a new app password for Mutt. Google generates the password for you, so copy it and paste it into your `.offlineimaprc` file in the place of the `%your-gmail-API-password%` value. + +Placing your API password in your `.offlineimaprc` file stores it in plain text, which can be dangerous. For a long while, I did this and felt fine about it because my home directory is encrypted. However, in the interest of better security, I now encrypt my API password with GnuPG. That's somewhat beyond the scope of this article, but I've written an article demonstrating how to [set up GPG password integration][16]. + +### Enable IMAP in Gmail + +There's one last thing before you can say goodbye to the Gmail web interface forever: You must enable IMAP access to your Gmail account. + +To do this, go to the Gmail web interface, click the "cog" icon in the upper-right corner, and select **See all settings**. In Gmail **Settings**, click the **POP/IMAP** tab, and enable the radio button next to **Enable IMAP**. Save your settings. + +Now Gmail is configured to give you access to your email outside a web browser. + +### Configure Mutt + +Now that you're all set up for Mutt, you'll be happy to learn that configuring Mutt is the easy part. As with [.bashrc][17], [.zshrc][18], and .emacs files, there are many examples of very good .muttrc files available on the internet. For my configuration file, I borrowed options and ideas from [Kyle Rankin][19], [Paul Frields][20], and many others, so I've abbreviated my .muttrc file to just the essentials in the interest of simplicity: + + +``` +set ssl_starttls=yes +set ssl_force_tls=yes + +set from='[tux@example.com][21]' +set realname='Tux Example' + +set folder = imaps://imap.gmail.com/ +set spoolfile = imaps://imap.gmail.com/INBOX +set postponed="imaps://imap.gmail.com/[Gmail]/Drafts" +set smtp_url="smtp://smtp.gmail.com:25" +set move = no +set imap_keepalive = 900 +set record="imaps://imap.gmail.com/[Gmail]/Sent Mail" + +# Paths +set folder           = ~/.mail +set alias_file       = ~/.mutt/alias +set header_cache     = "~/.mutt/cache/headers" +set message_cachedir = "~/.mutt/cache/bodies" +set certificate_file = ~/.mutt/certificates +set mailcap_path     = ~/.mutt/mailcap +set tmpdir           = ~/.mutt/temp +set signature        = ~/.mutt/sig +set sig_on_top       = yes + +# Basic Options +set wait_key = no +set mbox_type = Maildir +unset move               # gmail does that + +# Sidebar Patch +set sidebar_visible = yes +set sidebar_width   = 16 +color sidebar_new color221 color233 + +## Account Settings +# Default inbox +set spoolfile = "+example.com/INBOX" + +# Mailboxes to show in the sidebar. +mailboxes +INBOX \ +          +sent \ +          +drafts + +# Other special folder +set postponed = "+example.com/drafts" + +# navigation +macro index gi "<change-folder>=example.com/INBOX<enter>" "Go to inbox" +macro index gt "<change-folder>=example.com/sent" "View sent" +``` + +Nothing in this file requires changing, but consider replacing the fake name `Tux Example` and the fake address `example.com` with something that applies to you. Copy and paste this text into a file and save it as `~/.mutt/muttrc`. + +### Launch Mutt + +Before launching Mutt, run `offlineimap` from a terminal to sync your computer with the remote server. The first run of this takes _a long time_, so leave it running overnight. + +Once your account has synchronized, you can launch Mutt: + + +``` +`$ mutt` +``` + +Mutt prompts you for permission to create the directories it needs to organize your email activity and then displays a view of your inbox. + +![Mutt email client][22] + +### Learn Mutt + +Learning Mutt is a mixture of exploring the application and finding your favorite hacks for your .muttrc config. For example, my config file integrates Emacs for composing messages, LDAP so that I can search through contacts, GnuPG so that I can encrypt and decrypt messages, link harvesting, HTML views, and much more. You can make Mutt anything you want it to be (as long as you want it to be an email client), and the more you experiment, the more you discover. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/gmail-linux-terminal + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: http://www.mutt.org/ +[3]: https://opensource.com/article/21/5/linux-terminal-multiplexer +[4]: https://protonmail.com +[5]: https://tutanota.com +[6]: https://github.com/tutao/tutanota +[7]: https://protonmail.com/bridge/ +[8]: https://www.redhat.com/sysadmin/configuring-email-server +[9]: https://opensource.com/article/20/11/macports +[10]: https://opensource.com/article/20/6/homebrew-mac +[11]: https://opensource.com/article/20/3/chocolatey +[12]: https://github.com/OfflineIMAP/offlineimap3 +[13]: mailto:git@github.com +[14]: https://pypi.org/project/portalocker +[15]: https://myaccount.google.com/security +[16]: https://opensource.com/article/21/6/enter-invisible-passwords-using-python-module +[17]: https://opensource.com/article/18/9/handy-bash-aliases +[18]: https://opensource.com/article/19/9/adding-plugins-zsh +[19]: https://twitter.com/kylerankin +[20]: https://twitter.com/stickster +[21]: mailto:tux@example.com +[22]: https://opensource.com/sites/default/files/mutt.png (Mutt email client) From 771a58f6e9ffff9e733edc81b7687437fa56c7f9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Jul 2021 05:03:49 +0800 Subject: [PATCH 327/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210706=20?= =?UTF-8?q?Edit=20PDFs=20on=20the=20Linux=20command=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210706 Edit PDFs on the Linux command line.md --- ...706 Edit PDFs on the Linux command line.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210706 Edit PDFs on the Linux command line.md diff --git a/sources/tech/20210706 Edit PDFs on the Linux command line.md b/sources/tech/20210706 Edit PDFs on the Linux command line.md new file mode 100644 index 0000000000..05c961c4f2 --- /dev/null +++ b/sources/tech/20210706 Edit PDFs on the Linux command line.md @@ -0,0 +1,101 @@ +[#]: subject: (Edit PDFs on the Linux command line) +[#]: via: (https://opensource.com/article/21/7/qpdf-command-line) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Edit PDFs on the Linux command line +====== +Use qpdf and poppler-utils to split, modify, and combine PDF files. +![Text editor on a browser, in blue][1] + +Many of the documents you receive come in PDF format. Sometimes those PDFs need to be manipulated. For example, pages might need to be removed or added, or you might need to sign or change a specific page. + +Whether good or bad, this is the reality we all live in. + +There are some fancy graphical user interface tools that let you edit PDFs, but I have always been most comfortable with the command line. Of the many command-line tools for this task, the ones I use when I want to modify a PDF are `qpdf` and `poppler-utils`. + +### Install + +On Linux, you can install `qpdf` and `poppler-utils` using your package manager (such as `apt` or `dnf`.) For example, on Fedora: + + +``` +`$ sudo dnf install qpdf poppler-utils` +``` + +On macOS, use [MacPorts][2] or [Homebrew][3]. On Windows, use [Chocolatey][4]. + +### qpdf + +The `qpdf` command can do a lot, but I mostly use it for: + + 1. Splitting a PDF into separate pages + 2. Concatenating, or combining, PDFs into one file + + + +To split a PDF into separate pages: + + +``` +`qpdf --split-pages original.pdf split.pdf` +``` + +This generates files like `split-01.pdf`, `split-02.pdf`, and so on. Each file is a single-page PDF file. + +Concatenating files is a little subtler: + + +``` +`qpdf --empty concatenated.pdf --pages split-*.pdf --` +``` + +This is what `qpdf` does by default. The `--empty` option tells qpdf to start with an empty file. The two dashes (`--`) at the end signals that there are no more files to process. This is a case where the parameters reflect an internal model, rather than what people use it for, but at least it runs and produces valid PDFs! + +### poppler-utils + +This package contains several utilities, but the one I use the most is [pdftoppm][5], which converts PDF files to portable pixmap (`ppm`) image files. I usually use it after I split pages with `qpdf` and need to convert a specific page to an image that I can modify. The `ppm` format is not well known, but the important thing about it is that most image manipulation methods, including [ImageMagick][6], [Pillow][7], and many other options, work with it. Most of these tools can save files back to PDF, too. + +### Workflow + +My usual workflow is: + + * Use `qpdf` to split the PDF into pages. + * Use `poppler-utils` to convert the pages that need to be changed into images. + * Modify the images as needed and save them to PDF. + * Use `qpdf` to concatenate the pages back into one PDF. + + + +### Other tools + +There are many great open source commands to deal with PDFs, whether you're [shrinking them][8], [creating them from text files][9], [converting documents][10], or trying your best to [avoid them altogether][11]. What are your favorite open source PDF utilities? Please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/qpdf-command-line + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://opensource.com/article/20/11/macports +[3]: https://opensource.com/article/20/6/homebrew-mac +[4]: https://opensource.com/article/20/3/chocolatey +[5]: https://www.xpdfreader.com/pdftoppm-man.html +[6]: https://opensource.com/article/17/8/imagemagick +[7]: https://opensource.com/article/20/8/edit-images-python +[8]: https://opensource.com/article/20/8/reduce-pdf +[9]: https://opensource.com/article/20/5/pandoc-cheat-sheet +[10]: https://opensource.com/article/21/3/libreoffice-command-line +[11]: https://opensource.com/article/19/3/comic-book-archive-djvu From b2be79e43bfa68736f14d351f682579fefe9637b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Jul 2021 05:04:09 +0800 Subject: [PATCH 328/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210706=20?= =?UTF-8?q?Why=20you=20need=20to=20use=20Kubernetes=20schema=20validation?= =?UTF-8?q?=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210706 Why you need to use Kubernetes schema validation tools.md --- ... use Kubernetes schema validation tools.md | 216 ++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 sources/tech/20210706 Why you need to use Kubernetes schema validation tools.md diff --git a/sources/tech/20210706 Why you need to use Kubernetes schema validation tools.md b/sources/tech/20210706 Why you need to use Kubernetes schema validation tools.md new file mode 100644 index 0000000000..be587490fe --- /dev/null +++ b/sources/tech/20210706 Why you need to use Kubernetes schema validation tools.md @@ -0,0 +1,216 @@ +[#]: subject: (Why you need to use Kubernetes schema validation tools) +[#]: via: (https://opensource.com/article/21/7/kubernetes-schema-validation) +[#]: author: (Eyar Zilberman https://opensource.com/users/eyarz) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why you need to use Kubernetes schema validation tools +====== +Compare schema validation tools that help you avoid misconfigurations in +your Kubernetes clusters. +![Net catching 1s and 0s or data in the clouds][1] + +How do you ensure the stability of your Kubernetes (K8s) clusters? How do you know that your manifests are syntactically valid? Are you sure you don't have any invalid data types? Are any mandatory fields missing? + +Most often, we become aware of these misconfigurations only at the worst time: when we're trying to deploy the new manifests. + +Specialized tools and a "shift-left" approach make it possible to verify a Kubernetes schema before it's applied to a cluster. This article addresses how you can avoid misconfigurations and which tools are the best to use. + +> ## TL;DR +> +> Running schema validation tests is important, and the sooner the better. If all machines (e.g., local developer environments, continuous integration [CI], etc.) have access to your Kubernetes cluster, run `kubectl --dry-run` in server mode on every code change. If this isn't possible and you want to perform schema validation tests offline, use kubeconform together with a policy-enforcement tool to have optimal validation coverage. + +### Schema-validation tools + +Verifying the state of Kubernetes manifests may seem like a trivial task because the Kubernetes command-line interface (CLI), kubectl, can verify resources before they're applied to a cluster. You can verify the schema by using the [dry-run][2] flag (`--dry-run=client/server`) when specifying the `kubectl create` or `kubectl apply` commands; these will perform the validation without applying Kubernetes resources to the cluster. + +But I can assure you that it's actually more complex. A running Kubernetes cluster must obtain the schema for the set of resources being validated. So, when incorporating manifest verification into a CI process, you must also manage connectivity and credentials to perform the validation. This becomes even more challenging when dealing with multiple microservices in several environments (e.g., prod, dev, etc.). + +[Kubeval][3] and [kubeconform][4] are CLI tools developed to validate Kubernetes manifests without requiring a running Kubernetes environment. Because kubeconform was inspired by kubeval, they operate similarly; verification is performed against pre-generated JSON schemas created from the OpenAPI specifications ([swagger.json][5]) for each Kubernetes version. All that remains [to run][6] the schema validation tests is to point the tool executable to a single manifest, directory or pattern. + +![Kubeval and kubeconform ][7] + +(Eyar Zilberman, [CC BY-SA 4.0][8]) + +### Comparing the tools + +Now that you're aware of the tools available for Kubernetes schema validation, let's compare some core abilities—misconfiguration coverage, speed tests, support for different versions, Custom Resource Definitions support, and docs—in: + + * kubeval + * kubeconform + * kubectl dry-run in client mode + * kubectl dry-run in server mode + + + +#### Misconfiguration coverage + +I donned my QA hat and generated some (basic) Kubernetes manifest files with some [intentional misconfigurations][9] and then ran them against all four tools. + +Misconfig/Tool | + +kubeval / +kubeconform + +| + +kubectl dry-run +in client mode + +| + +kubectl dry-run +in server mode + +---|---|---|--- +[API deprecation][10] | ✅ Caught | ✅ Caught | ✅ Caught +[Invalid kind value][11] | ✅ Caught | ❌ Didn't catch | ✅ Caught +[Invalid label value][12] | ❌ Didn't catch | ❌ Didn't catch | ✅ Caught +[Invalid protocol type][13] | ✅ Caught | ❌ Didn't catch | ✅ Caught +[Invalid spec key][14] | ✅ Caught | ✅ Caught | ✅ Caught +[Missing image][15] | ❌ Didn't catch | ❌ Didn't catch | ✅ Caught +[Wrong K8s indentation][16] | ✅ Caught | ✅ Caught | ✅ Caught + +In summary: all misconfiguration was caught by `kubectl` dry-run in server mode. + +Some misconfigurations were caught by everything: + + * Invalid spec key: Caught successfully by everything! + * API deprecation: Caught successfully by everything! + * Wrong k8s indentation: Caught successfully by everything! + + + +However, some had mixed results: + + * Invalid kind value: Caught by Kubeval / Kubeconform but missed by Kubectl client. + * Invalid protocol type: Caught by Kubeval / Kubeconform but missed by Kubectl client. + * Invalid label value: Missed by both Kubeval / Kubeconform and Kubectl client. + * Missing image: Missed by both Kubeval / Kubeconform and Kubectl client. + + + +Conclusion: Running kubectl dry-run in server mode caught all misconfigurations, while kubeval/kubeconform missed two of them. It's also interesting to see that running kubectl dry-run in client mode is almost useless because it's missing some obvious misconfigurations and also requires a connection to a running Kubernetes environment. + + * All the schemas validation tests were performed against Kubernetes version 1.18.0. + * Because kubeconform is based on kubeval, they provide the same result when run against the files with the misconfigurations. + * kubectl is one tool, but each mode (client or server) produces a different result (as you can see from the table). + + + +#### Benchmark speed test + +I used [hyperfine][17] to benchmark the execution time of each tool. First, I ran it against all the [files with misconfigurations][18] (seven files in total). Then I ran it against [100 Kubernetes files][19] (all the files contain the same config). + +Results for running the tools against seven files with different Kubernetes schema misconfigurations: + +Tool | Mean | Min | Max +---|---|---|--- +kubeconform | 0.2 ms ± 0.3 ms | 0.0 ms | 2.3 ms +kubeval | 1.443 s ± 1.551 s | 0.741 s | 5.842 s +kubectl --dry-run=client | 1.92 s ± 0.035 s | 1.872 s | 2.009 s +kubectl --dry-run=server | 2.288 s ± 0.027 s | 2.241 s | 2.323 s + +Results for running the tools against 100 files with valid Kubernetes schemas: + +Tool | Mean | Min | Max +---|---|---|--- +kubeconform | 0.3 ms ± 0.3 ms | 0.0 ms | 1.9 ms +kubeval | 1.152 s ± 0.197 s | 0.989 s | 1.669 s +kubectl --dry-run=client | 1.274 s ± 0.028 s | 1.234 s | 1.313 s +kubectl --dry-run=server | 60.675 s ± 0.546 s | 60.489 s | 62.228 s + +Conclusion: While kubeconform (#1), kubeval (#2), and kubectl `--dry-run=client` (#3) provide fast results on both tests, kubectl `--dry-run=server` (#4) is slower, especially when it evaluates 100 files. Yet 60 seconds for generating a result is still a good outcome in my opinion. + +#### Kubernetes versions support + +Both kubeval and kubeconform accept the Kubernetes schema version as a flag. Although both tools are similar (as mentioned, kubeconform is based on kubeval), one of the key differences is that each tool relies on its own set of pre-generated JSON schemas: + + * **Kubeval:** [instrumenta/kubernetes-json-schema][20] (last commit: [133f848][21] on April 29, 2020) + * **Kubeconform:** [yannh/kubernetes-json-schema][22] (last commit: [a660f03][23] on May 15, 2021) + + + +As of May 2021, kubeval supports Kubernetes schema versions only up to 1.18.1, while kubeconform supports the latest Kubernetes schema available, 1.21.0. With kubectl, it's a little bit trickier. I don't know which version of kubectl introduced the dry run, but I tried it with Kubernetes version 1.16.0 and it still worked, so I know it's available in Kubernetes versions 1.16.0–1.18.0. + +The variety of supported Kubernetes schemas is especially important if you want to migrate to a new Kubernetes version. With kubeval and kubeconform, you can set the version and start evaluating which configurations must be changed to support the cluster upgrade. + +Conclusion: The fact that kubeconform has all the schemas for all the different Kubernetes versions available—and also doesn't require Minikube setup (as kubectl does)—makes it a superior tool when comparing these capabilities to its alternatives. + +### Other things to consider + +#### Custom Resource Definition (CRD) support + +Both kubectl dry-run and kubeconform support the [CRD][24] resource type, while kubeval does not. According to kubeval's docs, you can pass a flag to kubeval to tell it to ignore missing schemas so that it will not fail when testing a bunch of manifests where only some are resource type CRD. + +#### Documentation + +Kubeval is a more popular project than kubeconform; therefore, its community and [documentation][25] are more extensive. Kubeconform doesn't have official docs, but it does have a [well-written README][26] file that explains its capabilities pretty well. The interesting part is that although Kubernetes-native tools such as kubectl are usually well-documented, it was really hard to find the information needed to understand how the `dry-run` flag works and its limitations. + +Conclusion: Although it's not as famous as kubeval, the CRD support and good-enough documentation make kubeconform the winner, in my opinion. + +### Strategies for validating Kubernetes schema using these tools + +Now that you know the pros and cons of each tool, here are some best practices for leveraging them within your Kubernetes production-scale development flow: + + * ⬅️ Shift-left: When possible, the best setup is to run `kubectl --dry-run=server` on every code change. You probably can't do that because you can't allow every developer or CI machine in your organization to have a connection to your cluster. So, the second-best effort is to run kubeconform. + * 🚔 Because kubeconform doesn't cover all common misconfigurations, it's recommended to run it with a policy enforcement tool on every code change to fill the coverage gap. + * 💸 Buy vs. build: If you enjoy the [engineering overhead][27], then kubeconform + [conftest][28] is a great combination of tools to get good coverage. Alternatively, there are tools that can provide you with an out-of-the-box experience to help you save time and resources, such as [Datree][29] (whose schema validation is powered by kubeconform). + * 🚀 During the CD step, it shouldn't be a problem to connect with your cluster, so you should always run `kubectl --dry-run=server` before deploying your new code changes. + * 👯 Another option for using kubectl dry-run in server mode, without having a connection to your Kubernetes environment, is to run Minikube + `kubectl --dry-run=server`. The downside of this hack is that you must also set up the Minikube cluster like prod (i.e., same volumes, namespace, etc.), or you'll encounter errors when trying to validate your Kubernetes manifests. + + + +_Thank you to_ [_Yann Hamon_][30] _for creating kubeconform—it's awesome! This article wouldn't be possible without you. Thank you for all of your guidance._ + +* * * + +_This article originally appeared on [Datree.io][31] and is reprinted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/kubernetes-schema-validation + +作者:[Eyar Zilberman][a] +选题:[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/eyarz +[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://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/576-dry-run/README.md +[3]: https://github.com/instrumenta/kubeval/tree/master/kubeval +[4]: https://github.com/yannh/kubeconform +[5]: https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json +[6]: https://github.com/datreeio/kubernetes-schema-validation#running-schema-validation-tests +[7]: https://opensource.com/sites/default/files/uploads/kubeval-and-kubeconform.png (Kubeval and kubeconform ) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://github.com/datreeio/kubernetes-schema-validation#misconfigs +[10]: https://github.com/datreeio/kubernetes-schema-validation#api-deprecationyaml +[11]: https://github.com/datreeio/kubernetes-schema-validation#invalid-kind-valueyaml +[12]: https://github.com/datreeio/kubernetes-schema-validation#invalid-label-valueyaml +[13]: https://github.com/datreeio/kubernetes-schema-validation#invalid-protocol-typeyaml +[14]: https://github.com/datreeio/kubernetes-schema-validation#invalid-spec-keyyaml +[15]: https://github.com/datreeio/kubernetes-schema-validation#missing-imageyaml +[16]: https://github.com/datreeio/kubernetes-schema-validation#wrong-k8s-indentationyaml +[17]: https://github.com/sharkdp/hyperfine +[18]: https://github.com/datreeio/kubernetes-schema-validation/tree/main/misconfigs +[19]: https://github.com/datreeio/kubernetes-schema-validation/tree/main/benchmark +[20]: https://github.com/instrumenta/kubernetes-json-schema +[21]: https://github.com/instrumenta/kubernetes-json-schema/commit/133f84871ccf6a7a7d422cc40e308ae1c044c2ab +[22]: https://github.com/yannh/kubernetes-json-schema +[23]: https://github.com/yannh/kubernetes-json-schema/commit/a660f03314fad36fb4cbfb4fa2f9a76b7766cf51 +[24]: https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/ +[25]: https://kubeval.instrumenta.dev/ +[26]: https://github.com/yannh/kubeconform/blob/master/Readme.md +[27]: https://jrott.com/posts/why-buy/ +[28]: https://www.conftest.dev/ +[29]: https://hub.datree.io/schema-validation/?utm_source=our_blog&utm_medium=schema-validation +[30]: https://github.com/yannh +[31]: https://www.datree.io/resources/kubernetes-schema-validation From d2ee750a4730541598eb8a97f05a4bb9b6e44df3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 7 Jul 2021 08:40:35 +0800 Subject: [PATCH 329/870] translating --- ... trees with this open source mobile app.md | 99 ------------------- ... trees with this open source mobile app.md | 98 ++++++++++++++++++ 2 files changed, 98 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20210703 Identify flowers and trees with this open source mobile app.md create mode 100644 translated/tech/20210703 Identify flowers and trees with this open source mobile app.md diff --git a/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md b/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md deleted file mode 100644 index eb6ffb1c67..0000000000 --- a/sources/tech/20210703 Identify flowers and trees with this open source mobile app.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: (Identify flowers and trees with this open source mobile app) -[#]: via: (https://opensource.com/article/21/7/open-source-plantnet) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Identify flowers and trees with this open source mobile app -====== -PlantNet combines open source technology with crowdsourced knowledge to -help you become an amateur botanist. -![Fire pink flower in Maggie Valley, NC][1] - -Where I live, there are lots of trails and roads lined with flowers and trees. My community is famous for its annual maple festival, and maple trees are easy for me to identify. However, there are many other trees I cannot identify by name. Flowers are the same: dandelions are easy to spot, but I don't know the names of the wildflowers that line my walking path. - -Recently my wife told me about PlantNet, a mobile application that can identify these flowers and trees. It's available on iOS and Android, and it's free, so I decided to try it out. - -### Identifying plants the open source way - -I downloaded the app on my phone and began using it to identify some of the flowers and trees on my walks around the village. As I became familiar with the app, I noticed that the pictures I took (and those taken by other users) are shared with a Creative Commons Attribution-ShareAlike (CC-BY-SA) license. Further investigation revealed that PlantNet is [open source][2]. You can use the application anonymously if you like or become a registered member of the community. - -According to the [Cos4Cloud][3] citizen science project, "PlantNet is a participatory citizen science platform for collecting, sharing, and reviewing plant observations based on automated identification. Its objective is to monitor plant biodiversity and facilitate access to plant knowledge by the general public." It uses image-recognition techniques to inventory biodiversity. - -The project's development began in 2009 by botanists and computer scientists in France. It started out as a [web application][4], and the smartphone app launched in 2013. The project is part of the [Floris'Tic][5] initiative, another French project that aims to promote scientific, technical, and industrial culture in plant sciences. - -PlantNet allows users to utilize a smartphone's camera to collect visual specimens, which are identified by software and the community. These photos are then shared with millions of people worldwide who are part of the PlantNet network. - -The project says, "The PlantNet system works by comparing visual patterns transmitted by users via photos of plant organs (flowers, fruits, leaves …) that they seek to determine. These images are analyzed and compared to an image bank produced collaboratively and enriched daily. The system then offers a possible list of species with its illustrations." - -### Using PlantNet - -The mobile application is easy to use. Launch it from the app's icon on your smartphone. - -![PlantNet smartphone icon][6] - -(Don Watkins, [CC BY-SA 4.0][7]) - -When the application opens, you see the specimens you've already collected in your library. The Camera icon at the bottom of the display allows you to use your camera to add pictures to your photo library. - -![Pl@ntnet homescreen][8] - -(Don Watkins, [CC BY-SA 4.0][7]) - -Choose the Camera option, and point your phone's camera at a tree or flower you want to identify. After you take the picture, click on the option (leaf, flower, bark, fruit, and so on) that matches the specimen you want to identify. - -![Selecting plant type to identify][9] - -(Don Watkins, [CC BY-SA 4.0][7]) - -For example, if you're trying to identify a specimen by its leaf characteristics, choose **leaf**. PlantNet assigns a degree of certainty about its identification, ranging from a high to a low percentage. You can also use your smartphone's GPS function to add location information to your data collection automatically, and you can also add a note. - -![Identified plant][10] - -(Don Watkins, [CC BY-SA 4.0][7]) - -You can access all the observations you have uploaded and keep track of whether the community has approved them either on your smartphone or by logging into the website with your user ID (if you create an account). From the web interface, you can also download a record of your observations in CSV or spreadsheet formats. - -![Pl@ntnet provides user stats][11] - -(Don Watkins, [CC BY-SA 4.0][7]) - -### The great outdoors - -I particularly enjoy that PlantNet links to Wikipedia so that I can read more information about the plant data I collect. - -There are currently approximately 12 million PlantNet users worldwide, so the data set is growing all the time. The application is free to use for up to 500 requests per day. It also features an API that delivers data in JSON format, so you can even use Pl
antNet's visual identification engine as a web service. - -One very nice thing about PlantNet is that it combines crowdsourced knowledge and open source technology to connect users to each other and with the great outdoors. There's no better reason to support open source software than this. - -A complete description of the application and its developers is available on [YouTube][12] (in French with English subtitles). You can also learn more about the project on [PlantNet][13]'s website. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/open-source-plantnet - -作者:[Don Watkins][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fire-pink-flower-maggie-valley.jpg?itok=q6Ev7TSr (Fire pink flower in Maggie Valley, NC) -[2]: https://github.com/plantnet -[3]: https://cos4cloud-eosc.eu/citizen-science-innovation/cos4cloud-citizen-observatories/plntnet/ -[4]: https://identify.plantnet.org/ -[5]: http://floristic.org/ -[6]: https://opensource.com/sites/default/files/uploads/plantnet-icon.jpg (PlantNet smartphone icon) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://opensource.com/sites/default/files/uploads/plantnet_camera.jpg (Pl@ntnet homescreen) -[9]: https://opensource.com/sites/default/files/uploads/plantnet_plant-type.jpg (Selecting plant type to identify) -[10]: https://opensource.com/sites/default/files/uploads/plantnet-identification.jpg (Identified plant) -[11]: https://opensource.com/sites/default/files/uploads/plantnet_user-stats.jpg (Pl@ntnet provides user stats) -[12]: https://www.youtube.com/watch?v=W_cBqaPfRFE -[13]: https://plantnet.org/ diff --git a/translated/tech/20210703 Identify flowers and trees with this open source mobile app.md b/translated/tech/20210703 Identify flowers and trees with this open source mobile app.md new file mode 100644 index 0000000000..9d0ece7c92 --- /dev/null +++ b/translated/tech/20210703 Identify flowers and trees with this open source mobile app.md @@ -0,0 +1,98 @@ +[#]: subject: (Identify flowers and trees with this open source mobile app) +[#]: via: (https://opensource.com/article/21/7/open-source-plantnet) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用这个开源移动应用来识别花草和树木 +====== +PlantNet 将开源技术与众包知识结合起来,帮助你成为业余植物学家。 +![Fire pink flower in Maggie Valley, NC][1] + +在我居住的地方,有很多小路和道路两旁都有花草树木。我所在的社区因其每年的枫树节而闻名,枫树对我来说很容易识别。然而,还有许多其他的树我无法识别名字。花也是如此:蒲公英很容易发现,但我不知道在我的步行道上的野花的名字。 + +最近,我的妻子告诉我了 PlantNet,一个可以识别这些花草和树木的移动应用。它可以在 iOS 和 Android 上使用,而且是免费的,所以我决定试试。 + +### 以开源的方式识别植物 + +我在手机上下载了这个应用程序,开始用它来识别我在村子周围散步时的一些花草和树木。随着我对这个应用的熟悉,我注意到我拍摄的图片(以及其他用户拍摄的图片)是以知识共享署名-相同方式共享(CC-BY-SA)的许可方式共享的。进一步的调查显示,PlantNet 是[开源][2]的。如果你喜欢,你可以匿名使用该应用,或者成为社区的注册成员。 + +根据 [Cos4Cloud][3] 公民科学项目,“PlantNet 是一个参与性的公民科学平台,用于收集、分享和审查基于自动识别的植物观察结果。它的目标是监测植物的生物多样性,促进公众对植物知识的获取”。它使用图像识别技术来清点生物多样性。 + +该项目的开发始于 2009 年,由法国的植物学家和计算机科学家进行。它最初是一个[网络应用][4],而智能手机应用程序于 2013 年推出。该项目是 [Floris'Tic][5] 倡议的一部分,这是法国的另一个项目,旨在促进植物科学的科学、技术和工业文化。 + +PlantNet 允许用户利用智能手机的摄像头来收集视觉标本,并由软件和社区进行识别。然后,这些照片将与全世界数百万加入 PlantNet 网络的人分享。 + +该项目说:“PlantNet 系统的工作原理是比较用户通过他们寻求确定的植物器官(花、果实、叶……)的照片传送的视觉模式。这些图像被分析,并与每天协作制作和充实的图像库进行比较。然后,该系统提供一个可能的物种清单及其插图”。 + +### 使用 PlantNet + +该应用很容易使用。从你的智能手机上的应用图标启动它。 + +![PlantNet smartphone icon][6] + +(Don Watkins, [CC BY-SA 4.0][7]) + +当应用打开时,你会看到你已经在资料库中收集的标本。显示屏底部的相机图标允许你使用你的相机将图片添加到你的照片库。 + +![Pl@ntnet homescreen][8] + +(Don Watkins, [CC BY-SA 4.0][7]) + +选择“相机”选项,将手机的摄像头对准你想识别的树木或花草。拍完照后,点击与你想识别的标本相匹配的选项(叶、花、树皮、果实等)。 + +![Selecting plant type to identify][9] + +(Don Watkins, [CC BY-SA 4.0][7]) + +例如,如果你想通过叶子的特征来识别一个标本,请选择**叶子**。PlantNet 对其识别的确定程度进行了分配,从高到低的百分比不等。你还可以使用你的智能手机的 GPS 功能,将位置信息自动添加到你的数据收集中,你还可以添加注释。 + +![Identified plant][10] + +(Don Watkins, [CC BY-SA 4.0][7]) + +你可以在你的智能手机上或通过你的用户 ID(如果你创建了一个账户)登录网站,访问你上传的所有观测数据,并跟踪社区是否批准了它们。从网站界面上,你也可以下载 CSV 或电子表格格式的观察记录。 + +![Pl@ntnet provides user stats][11] + +(Don Watkins, [CC BY-SA 4.0][7]) + +### 很好的户外活动 + +我特别喜欢 PlantNet 与维基百科的链接,这样我就可以阅读更多关于我收集的植物数据的信息。 + +目前全球大约有 1200 万 PlantNet 用户,所以数据集一直在增长。该应用是免费使用的,每天最多有 500 个请求。它还有一个 API,以 JSON 格式提供数据,所以你甚至可以把 Pl antNet 的视觉识别引擎作为一个网络服务使用。 + +PlantNet 的一个非常好的地方是,它结合了众包知识和开源技术,将用户相互联系起来,并与很好的户外活动联系起来。没有比这更好的理由来支持开源软件了。 + +关于该应用及其开发者的完整描述可在 [YouTube][12] 上找到(有法语、英文字幕)。你也可以在 [PlantNet][13] 的网站上了解更多该项目。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-source-plantnet + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fire-pink-flower-maggie-valley.jpg?itok=q6Ev7TSr (Fire pink flower in Maggie Valley, NC) +[2]: https://github.com/plantnet +[3]: https://cos4cloud-eosc.eu/citizen-science-innovation/cos4cloud-citizen-observatories/plntnet/ +[4]: https://identify.plantnet.org/ +[5]: http://floristic.org/ +[6]: https://opensource.com/sites/default/files/uploads/plantnet-icon.jpg (PlantNet smartphone icon) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/plantnet_camera.jpg (Pl@ntnet homescreen) +[9]: https://opensource.com/sites/default/files/uploads/plantnet_plant-type.jpg (Selecting plant type to identify) +[10]: https://opensource.com/sites/default/files/uploads/plantnet-identification.jpg (Identified plant) +[11]: https://opensource.com/sites/default/files/uploads/plantnet_user-stats.jpg (Pl@ntnet provides user stats) +[12]: https://www.youtube.com/watch?v=W_cBqaPfRFE +[13]: https://plantnet.org/ From 15fcad9cd6221498e12366aef0cbb1ed1529b445 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 7 Jul 2021 08:43:28 +0800 Subject: [PATCH 330/870] translating --- ...210705 Enter invisible passwords using this Python module.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210705 Enter invisible passwords using this Python module.md b/sources/tech/20210705 Enter invisible passwords using this Python module.md index 4fd97fc29d..0d18bad392 100644 --- a/sources/tech/20210705 Enter invisible passwords using this Python module.md +++ b/sources/tech/20210705 Enter invisible passwords using this Python module.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/invisible-passwords-python) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c76656ac6fe7688540addbeee9bee411d8e7eb93 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Jul 2021 10:40:27 +0800 Subject: [PATCH 331/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zz-air 这篇翻译不够仔细,翻译后应该自己审读一遍。此外,建议选取更有价值的文章和自己更熟悉的领域。 --- .../20210621 Jim Hall- How Do You Fedora.md | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/translated/talk/20210621 Jim Hall- How Do You Fedora.md b/translated/talk/20210621 Jim Hall- How Do You Fedora.md index cc4a0f7085..1f295ff258 100644 --- a/translated/talk/20210621 Jim Hall- How Do You Fedora.md +++ b/translated/talk/20210621 Jim Hall- How Do You Fedora.md @@ -3,53 +3,51 @@ [#]: author: (Karimi Hari Priya https://fedoramagazine.org/author/haripriya21/) [#]: collector: (lujun9972) [#]: translator: (zz-air) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Jim Hall: 你觉得 Fedora 怎么样? +Jim Hall,你觉得 Fedora 怎么样? ====== ![][1] -我们最近采访了 Jim Hall 关于他如何使用 Fedora. 这个部分是在一个 Fedora 杂志 [系列][2] 上。 该系列介绍了Fedora用户以及他们如何使用Fedora来完成任务。 如果您对本系列的下一期采访感兴趣,请通过 [反馈表][3] 与我们联系。 +我们最近采访了 Jim Hall,了解他是如何使用 Fedora 的。这个 Fedora 杂志 [系列][2] 中的一篇。该系列介绍了 Fedora 用户以及他们如何使用 Fedora 来完成任务。如果你对本系列的后继采访感兴趣,请通过 [反馈表][3] 与我们联系。 -## **Jim Hall 是谁?** +### Jim Hall 是谁? -Jim Hall 曾担任高等教育和政府部门的首席信息管超过8年,最近创办了咨询公司 [Hallmentum][4]。 他的大部分工作包括培训、研讨会和指导帮助新的IT领导者发展领导技能,也帮助当前的IT领导者更好地发挥领导能力。除了咨询 Jim 还担任大学水平的兼职教师, 目前教授管理信息系统(MIS)和技术与专业写作课程。 +Jim Hall 曾担任高等教育和政府部门的首席信息官超过 8 年,最近创办了咨询公司 [Hallmentum][4]。他的大部分工作包括培训、研讨会和指导,帮助新的 IT 领导者发展领导技能,也帮助当前的 IT 领导者更好地发挥领导力。除了咨询,Jim 还担任大学的兼职教师,目前教授管理信息系统(MIS)和技术与专业写作课程。 -Jim 是怎么长大的? Jim 童年时代的英雄来自电视和电影,包括蝙蝠侠和汉索罗。 Jim 长期以来最喜欢看的电影是《星球打字:新希望》。 Jim 说:“我是一个星球大战迷” Jim 最喜欢吃意大利菜。 “我喜欢的意大利菜可能是炖鸡”。 Jim 的观点是诚实、创造力、想象力、好奇心和开放性是一个人所能拥有的五大品质。 +Jim 是如何成长的? Jim 童年时代的英雄来自电视和电影,包括蝙蝠侠和汉索罗。Jim 长期以来最喜欢看的电影是《星球大战:新希望》。Jim 说:“我是一个星球大战迷。”Jim 最喜欢吃意大利菜,“我喜欢意大利菜!我最喜欢的意大利菜可能是炖鸡”。Jim 的观点是,诚实、创造力、想象力、好奇心和开放性是一个人所能拥有的五个好品质。 -他喜欢写作,这很好,因为他的日常工作主要是写作。 他花了很多时间为像OpenSource.com、CloudSavvy IT 和 Linux Magazine等网站撰写“如何”文章。现在他正在写一本关于C编程的书。除了写作,他还玩电子游戏来放松。他有一台 PlayStation 4游戏机,大多数周六下午他都会坐在电视机前玩游戏。 +他喜欢写作,非常好的是他的日常工作主要是写作。他花了很多时间为像 OpenSource.com、 CloudSavvy IT 和 Linux Magazine 等网站撰写“如何”类文章。现在他正在写一本关于 C 编程的书。除了写作,他还玩电子游戏来放松。他有一台 PlayStation 4 游戏机,大多数周六下午他都会坐在电视机前玩游戏。 -## **Fedora 社区** +### Fedora 社区 -Jim 从1993年开始使用 Linux 。 他的第一个 Linux 发行版本是软著陆 Linux 系统 (SLS) 1.03, 运行 Linux 内核 0.99 补丁级别 11。 “从那以后,我一直是家里全职 Linux 用户”。 Jim在很久以前参加了Fedora核心时代的一个Linux会议之后,对Fedora的参与度更高了。 Jim 和 Tom 在这遇见了“斑点” 卡拉威, 他们开始谈论 Fedora. “ 斑点鼓励我用另一种方式来做贡献:找到bug并报告它们。这就是我参与测试所有Beta版本的原因”. +Jim 从 1993 年开始使用 Linux。他的第一个 Linux 发行版是 Softlanding Linux System(SLS)1.03,运行 Linux 内核 0.99,补丁级别 11。“从那以后,我一直是家里的全职 Linux 用户”。Jim 在很久以前参加了 Fedora Core 时代的一个 Linux 会议之后,开始更多参与到 Fedora 中。Jim 在这遇见了 Tom “Spot” Callaway,他们开始谈论 Fedora。“Spot 鼓励我用另一种方式来做贡献:找到 bug 并报告它们。这就是我参与测试所有 Beta 版本的原因”。 -Jim 想在 Fedora 改变什么? 他想看到 getfedora 的倒计时。非盈利的组织网站,他告诉新的Beta版本或新的完整版本合适发布是取决于Fedora项目的改变。 并且 Jim 想让人们都知道,使用 Fedora 是多容易。 “对开源做出贡献最具挑战性的事情是找出如何做出他们的第一个贡献。”Jim补充道,“我不知道我和其他开发人员一样是‘Fedora项目成员’。我只是个用户。但是作为一个从1993年或1994年就开始参与开发开源软件的人,我试图成为社区中一个有帮助的成员。因此,我利用一切机会尝试新的 Fedora 版本,甚至是 Beta 版,如果我发现问题,就让人们知道。” -## **你用什么硬件 ?** +Jim 想在 Fedora 改变什么? 他想在 getfedora.com 上看到一个倒计时,告诉大家新的 Beta 版本或新的完整版本是什么时候发布的,这是 Fedora 项目的一个改变。并且 Jim 想让人们都知道,使用 Fedora 是多么容易。“对开源做出贡献最具挑战性的事情是,弄清楚如何做出他们的第一个贡献。”Jim 补充道,“我不知道我和其他开发人员一样是‘Fedora 项目成员’。我只是个用户。但是作为一个从 1993、1994 年就开始参与开发开源软件的人,我努力成为社区中一个有用的成员。因此,我利用一切机会尝试新的 Fedora 版本,甚至是 Beta 版,如果我发现问题,就会告诉大家。” -Jim 目前正在运行 ThinkCentre M720 Tiny。 它配置了第8代酷睿 i3-8100T (3.10GHz, 6MB 内存), 32GB (16GB + 16GB) DDR4 2666MHz, 因特尔显卡, 256GB 固态硬盘 PCIe-NVME Opal M.2, 英特尔 8265 802.11AC, 和 蓝牙 4.2。 他的显卡是华硕 VE248H。 Jim说:“这一切都很适合 Fedora!”。 +### 你用什么硬件? -他使用 Perixx Periboard-512 人体工程学经典拆分键盘,它从1998年开始取代了他最初的微软天然键盘精英 PS/2 键盘。Jim 说: “我有时候会把我的 Perixx 键盘换成 Unicomp 的 IBM Model M USB克隆键盘。 我很喜欢带有弯曲弹簧动作的点击键盘。 我的是“灰白色”,所以它有种经典的外观和感觉” +Jim 目前正在运行一台 ThinkCentre M720 Tiny。它配置了第 8 代酷睿 i3-8100T(3.10GHz,6MB 缓存)、32GB(16GB + 16GB)DDR4 2666MHz、英特尔显卡、256GB 固态硬盘 PCIe-NVME Opal M.2、英特尔 8265 802.11AC 和 蓝牙 4.2。他的显示器是华硕 VE248H。 Jim 说:“这一切在Fedora上都很好用!”。 -Jim 目前运行的是 Fedora 33 、之前的 Fedora 33 Beta 和 Fedora 32。 Jim说:“我使用 GNOME 3 作为我的桌面。 我发现默认值适合我的大多数需求,所以我没有加载任何GNOME 扩展, 但我确实使用设置和 GNOME 调整了一些东西。 所以我不会做什么大的改变。 例如,我将默认用户界面字体改为使用 Droid Sans Regular 字体。并且我用“设置”来改变键盘快捷键,用Alt-Tab键来切换窗口,而不是切换应用程序。我是在Alt-Tab工作流程中长大的,所以我已经习惯了。”。 他使用火狐和谷歌浏览器来作为他的网络浏览器。 +他使用 Perixx Periboard-512 人体工程学经典分体式键盘,它从 1998 年开始取代了他最初的微软 Natural Keyboard Elitee PS/2 键盘。Jim 说: “我有时候会把我的 Perixx 键盘换成 Unicomp 的 IBM Model M USB 克隆键盘。我很喜欢这种带有扣动式弹簧动作的点击式键盘。我的是‘灰白色’,所以它有种经典的外观和感觉” -为了经营他的咨询业务,Jim依赖于一套应用程序: +### 你用什么软件? - * 使用 [LibreOffice][5] 去写他的书例如,他去年出版了 [《指导按钮》][6],他完全是用 来写这本书的。最近他写了一本关于 [用C语言编写自由DOS程序的书][7] 也用了 LibreOffice 。 - * [INKSCAPE][8] 在矢量格式上用于创造他公司的标志。他的标志从文件上的小角落图像到大幅面的海报或横幅,完美地上下伸缩。并且INKSCAPE允许他导出各种通用格式。Jim说他的广告合作伙伴很欣赏INKSCAPE可以输出到EPS(封装的附言),这使得在产品上打印他的徽标变得很容易。 - * [GIMP][9] 用于其他图形,例如飞溅图片 “我的飞溅图片是我们公司的标准被放在了背景照片上,并且我用它来代替我需要额外装饰的普通标志,比如印刷材料。我也在我的网站上使用了splash图像的一个版本”。 - * [QEMU][10] 运行一个虚拟机,在他那里可以启动 [FreeDOS][11]. “我喜欢使用QEMU,因为我可以在命令行中设置所有需要的选项,这使我在配置虚拟机时有了很大的灵活性。为了使这更容易,我将所有选项放入一个脚本中,并使用该脚本每次使用相同的选项运行QEMU。” - * [Scribus][12] 是用来打印产品的。 Scribus使用起来很容易,它可以创建打印就绪的材料,并带有“全出血”,这意味着任何颜色的背景都会重叠在纸张的边缘。 完全出血需要一个特殊的打印准备文件重叠的打印区域。它甚至还提供切割标记,以便打印机准确地知道要修剪的位置。 +Jim 目前运行的是 Fedora 33,之前是 Fedora 33 Beta 和 Fedora 32。Jim 说:“我使用 GNOME 3 作为我的桌面。我发现默认设置适合我的大多数需求,所以我没有加载任何 GNOME 扩展,但我确实使用‘设置’和 ‘GNOME Tweaks’ 调整了一些东西。所以我没有做什么大的改变。例如,我将默认用户界面字体改为使用 Droid Sans Regular 字体。并且我用‘设置’来改变键盘快捷键,用 `Alt-Tab` 键来切换窗口,而不是切换应用程序。我是在 `Alt-Tab` 工作流程中长大的,所以我已经习惯了。”他使用火狐和谷歌浏览器来作为他的 Web 浏览器。 +为了经营他的咨询业务,Jim 依赖于一套应用程序: - -![Scribus – Postcard][13] - -![QEMU – running as easy as in FreeDOS][14] - -![Libre Office Writer][15] + * 使用 [LibreOffice][5] 去写他的书。例如,他去年出版了 《[Coaching Buttons][6]》,他完全使用 LibreOffice 来写这本书。最近他写了一本关于 [用 C 语言编写 FreeDOS 程序的书][7] 也用了 LibreOffice 。 + ![Libre Office Writer][15] + * [INKSCAPE][8] 为他创建了矢量格式的公司标志。他的标志可以完美地放大缩小,从文件上的小角落图像到大幅面的海报或横幅。并且 INKSCAPE 允许他导出各种通用格式。Jim 说他的广告合作伙伴很欣赏 INKSCAPE 可以输出到EPS(Encapsulated Postscript),这使得在产品上打印他的标志变得很容易。 + * [GIMP][9] 用于其他图形,例如闪屏图片。“我的闪屏图片是我们公司的标志被放在了背景照片上,在我需要额外装饰的地方,比如印刷材料,我用它来替代普通标志。我也在我的网站上使用了闪屏图片的一个版本”。 + * [QEMU][10] 用来运行虚拟机,在他那里可以启动 [FreeDOS][11]。“我喜欢使用 QEMU,因为我可以在命令行中设置所有需要的选项,这使我在配置虚拟机时有了很大的灵活性。为了更方便,我将所有选项放入到一个脚本中,用它来运行QEMU,每次都是相同的选项”。 + ![QEMU – running as easy as in FreeDOS][14] + * [Scribus][12] 是用来打印产品的。Scribus 很容易用来创建具有“全出血”的印刷品,这意味着任何颜色的背景都会与纸张的边缘重叠。全出血需要一个特殊的打印准备文件,与打印区域重叠。它甚至还提供了切割标记,以便打印机准确地知道要修剪的位置。 + ![Scribus – Postcard][13] -------------------------------------------------------------------------------- @@ -58,7 +56,7 @@ via: https://fedoramagazine.org/jim-hall-how-do-you-fedora/ 作者:[Karimi Hari Priya][a] 选题:[lujun9972][b] 译者:[zz-air](https://github.com/zz-air) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a01f25bb17727c9311ff5b0947ab0384df4091be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Jul 2021 10:41:05 +0800 Subject: [PATCH 332/870] PUB @zz-air https://linux.cn/article-13558-1.html --- .../20210621 Jim Hall- How Do You Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210621 Jim Hall- How Do You Fedora.md (99%) diff --git a/translated/talk/20210621 Jim Hall- How Do You Fedora.md b/published/20210621 Jim Hall- How Do You Fedora.md similarity index 99% rename from translated/talk/20210621 Jim Hall- How Do You Fedora.md rename to published/20210621 Jim Hall- How Do You Fedora.md index 1f295ff258..75a941404f 100644 --- a/translated/talk/20210621 Jim Hall- How Do You Fedora.md +++ b/published/20210621 Jim Hall- How Do You Fedora.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (zz-air) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13558-1.html) Jim Hall,你觉得 Fedora 怎么样? ====== From c67434c0099f1b60d2193850c85f6e705bd272db Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Jul 2021 13:10:48 +0800 Subject: [PATCH 333/870] PRF @geekpi --- ...ging and Editing Large Photo Collection.md | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md b/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md index c09bc3261b..c0832e6369 100644 --- a/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md +++ b/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md @@ -3,18 +3,20 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Fotoxx:用于管理和编辑大型照片收藏的开源应用 +Fotoxx:用于管理和编辑大型照片集合的开源应用 ====== +![](https://img.linux.net.cn/data/attachment/album/202107/07/131024ej2kzv824zqb4zz8.jpg) + 说到 [Linux 中的照片管理软件][1],Shotwell 可能是其中最有名的。难怪它在许多发行版中都预装了。 -但是,如果你正在寻找一个类似 Shotwell 的应用,而且速度更快,Fotoxx 可能是一个不错的选择。 +但是,如果你正在寻找一个类似 Shotwell 而速度更快的应用,Fotoxx 可能是一个不错的选择。 -它可能没有一个现代的用户界面,但它在处理大量照片收藏时速度很快。这一点很重要,因为索引和显示成千上万张照片的缩略图可能需要相当多的时间和计算资源。 +它可能没有一个现代的用户界面,但它在处理大量照片集合时速度很快。这一点很重要,因为索引和显示成千上万张照片的缩略图可能需要相当多的时间和计算资源。 ### 用 Fotoxx 在 Linux 中管理照片并编辑它们 @@ -30,19 +32,15 @@ Fotoxx:用于管理和编辑大型照片收藏的开源应用 ![Map view][3] -由于它专注于管理大型照片集,它有几个批处理功能,可以重命名、调整大小、复制/移动、转换图像格式和编辑元数据。 +由于它专注于管理大型照片集合,有几个批处理功能,可以重命名、调整大小、复制/移动、转换图像格式和编辑元数据。 你可以选择图片来创建相册和幻灯片,所有这些都是在去重图片的情况下进行的。照片可以组合成 360 度的全景图。 -Fotoxx 还有几个编辑功能,可以用来修饰图片,添加效果(如素描,绘画)、修剪、旋转等。 +Fotoxx 还有几个编辑功能,可以用来修饰图片,添加效果(如素描、绘画)、修剪、旋转等。 -还有一些选项可以去除旧的、扫描过的照片打印件上的红眼和尘斑。 +还有一些选项可以去除旧的、扫描照片打印件上的红眼和尘斑。 -我可以继续列举功能清单,但这没有结束。它的网站描述了它的全部功能,你应该去看看。 - -[Fotoxx Feature Overview][4] - -如果你感兴趣,你可以观看这个演示 Fotoxx 功能的视频。 +我可以继续列举功能清单,但这太长了。它的网站描述了它的[全部功能][4],你应该去看看。 ### 在 Linux 上安装 Fotoxx @@ -60,11 +58,9 @@ sudo apt install fotoxx ![][6] -我注意到,尽管在一分钟左右的时间内索引了 4700 多张,但它并没有立即开始显示图片。我不得不**点击 Gallery->All Folders,然后选择文件夹,然后它就显示了图片**。所以,这一点要记住。 +我注意到,尽管在一分钟左右的时间内索引了 4700 多张,但它并没有立即开始显示图片。我不得不**点击 Gallery->All Folders,然后选择文件夹,然后它就显示了图片**。所以,这一点要记住。 -Fotoxx 是一个功能广泛的工具,你需要一些时间来适应它并探索它的所有功能。它的网站列出了几个例子,你应该看看。 - -[Fotoxx Feature Examples][4] +Fotoxx 是一个功能广泛的工具,你需要一些时间来适应它并探索它的[所有功能][4]。它的网站列出了几个例子,你应该看看。 正如我前面所说,它不是最漂亮的应用,但它大量的功能列表可以完成任务。如果你是一个摄影师或有大量的图片收藏,你可以试试 Fotoxx,看看它是否符合你的需要。当你试过后,请在评论区分享你的经验。 @@ -75,7 +71,7 @@ via: https://itsfoss.com/fotoxx/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5c39fbdc91cf62018b5b9e626a1e5505e455e534 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Jul 2021 13:11:34 +0800 Subject: [PATCH 334/870] PUB @geekpi https://linux.cn/article-13559-1.html --- ...rce App for Managing and Editing Large Photo Collection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md (98%) diff --git a/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md b/published/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md similarity index 98% rename from translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md rename to published/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md index c0832e6369..c9cc852a72 100644 --- a/translated/tech/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md +++ b/published/20210629 Fotoxx- An Open Source App for Managing and Editing Large Photo Collection.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13559-1.html) Fotoxx:用于管理和编辑大型照片集合的开源应用 ====== From b7c599de3d5dfd2bd5c71d1b450591893a3a1e05 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Wed, 7 Jul 2021 22:43:08 +0800 Subject: [PATCH 335/870] translating --- ...210706 Send and receive Gmail from the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210706 Send and receive Gmail from the Linux command line.md b/sources/tech/20210706 Send and receive Gmail from the Linux command line.md index 8c4630cb42..269c84b1e4 100644 --- a/sources/tech/20210706 Send and receive Gmail from the Linux command line.md +++ b/sources/tech/20210706 Send and receive Gmail from the Linux command line.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/gmail-linux-terminal) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ae625fa673d546efc90962362c02aa1fd7fcb231 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Jul 2021 05:03:31 +0800 Subject: [PATCH 336/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210707=20?= =?UTF-8?q?Generate=20passwords=20on=20the=20Linux=20command=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210707 Generate passwords on the Linux command line.md --- ...ate passwords on the Linux command line.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210707 Generate passwords on the Linux command line.md diff --git a/sources/tech/20210707 Generate passwords on the Linux command line.md b/sources/tech/20210707 Generate passwords on the Linux command line.md new file mode 100644 index 0000000000..9ccffabc40 --- /dev/null +++ b/sources/tech/20210707 Generate passwords on the Linux command line.md @@ -0,0 +1,116 @@ +[#]: subject: (Generate passwords on the Linux command line) +[#]: via: (https://opensource.com/article/21/7/generate-passwords-pwgen) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Generate passwords on the Linux command line +====== +Create passwords that meet specific criteria on the command line. +![Password lock][1] + +Most websites and applications ask users to create accounts with secure passwords so that they can provide tailored user experiences. While this tips the odds in favor of website developers, it certainly doesn't make life easier for users. + +Sometimes the rules for creating passwords are so strict that it's hard to get a good and allowable combination. It would be much easier to have a tool that generates secure passwords that meet whatever rules the website or application requires. + +This is where pwgen comes into play. According to its [man page][2], "the pwgen program generates passwords which are designed to be easily memorized by humans, while being as secure as possible." It returns multiple password options that meet the criteria you provide so that you can select the one that you prefer (and might be more likely to remember). + +### Install pwgen + +On Linux, you can install pwgen using your package manager. For instance, on Fedora: + + +``` +`$ sudo dnf install pwgen` +``` + +On macOS, use [MacPorts][3] or [Homebrew][4]. On Windows, use [Chocolatey][5]. + +### Generate passwords with pwgen + +There are several ways to pass arguments to pwgen to generate passwords, depending on what parameters you need. Here are some examples; consult the man page for more options. + +If you need a secure, hard-to-remember password of a specific length, run `pwgen --secure` (or `-s` for short) followed by the character length you need: + + +``` +$ pwgen -s 25 +pnFBg9jB8AlKL3feOuS2ZwMGb xlmDRoaLssduXTdGV6jkQhUGY O3IUB3CH7ry2kD4ZrSoODzWez +dENuvhkF3mmeb4FfXd4VPU2dE EMCi1sHFKHUVmbVajXWleFBzD 4UXJIu3JztVzYz6qJktBB3KCv +AF9WM7hmG89cpTlg8PksI7jsL LSSaT7DD4IT8DUgRAgY8Zt06m Nths10uT0bIMGsPuE0XEHDxsj +6YjLRbg3VnGnrzkoQCmrneLmm Tam1Mftac5RxrZPoXJtXx1Qdy BPqePJW4LdTtFnuZOepKEj0o0 +Ss8veqqf95zusqYPsfE7mLb93 4KuZdReO5lhKff7Xv1en1Hefs is7hjLnDrVCUJ7Hh6zYUzfppn +UXOfENPRJYWiroIWEt5IgAwdJ t8i4hM4cDuL8pN1rpFKHnx7yw Wr7gyuyU2br7aCbiH5M5ogvc6 +evk90lUmK2rOUWGgnqmznn0a9 Lflyc9svJfaBRRMin24j0P9ec hIzyJIwCpklDjgOb5PrMkyPCI +bhYcaV7GXfUiCMZ1kvMnlmKLx v4EJew54u6s4ZCirOTAWjfPQ2 IdemhbOHOm4Qo70WGibaNTOpO +j6XkmdB3LBfqZf5mbL3GndliG PpZbeXfWOFCpNARyXt1FWPAb8 OLQS2HFuqkiSg56sdxNsg5vaJ +1g666HxJPQ6l2L0RlaDEMoi50 1t6au7VuTN9HVPpiVmd1Gurli 46OAWypvwtZZUdBEfaHSunjpw +0LiRj9dbtMuI4cbDES8O4gYRq 2HPiaq5AANvVT32fWqNIruu3R 3lT5B107WoUbHsELkKUjnEEih +gLmYUTp0XZJWvIVbA5rFvBT54 LEm6QVeTMinc056DC9c4V55cV ipV45Ewj704365byKhY8zn766 +``` + +Run `pwgen –symbols` (or `-y` for short) followed by the desired character length to generate a password that has special characters: + + +``` +$ pwgen -y 25 +Osh0chahxe0won9aech4ese?v pemoh2ohm9aim;iu4Eiy"ah0y Taiqu;o2aeSh+o4aedoagait3 +Vei;phoh5owai5jui+t|ei3ot teu!w7mahxoh0Po7ohph8Iez6 quie#phooCeu2lohm5shaPaer +eTh5AechaexieToh9ez5eeZ;e nuloh1ico0Nool:eG<aiv`ah, Heeghuo8ahzii1Iep~ie_ch7p +oe6Xee6uchei7Oroothail~iL ahjie!Chee.W4wah[wuu]phoo ees7ieb!i[ibahhei1xoz2Woh +Atei9ooLu7lo~sh>aig@ae9No OVahh2OhNgahtu8iethaR@i7o ouFai8ahP@eil4Ieh5le5ipu5 +eeT4tahW0ieng9fe?i5auM3ie seet0ohc4aiJei]koiGha2zu% iuh@oh4eix0Vuphi?o,hei9me +loh0Aeph=eix(ohghe6chee3z ahgh2eifiew8dahG_aeph8woo oe!B4iasaeHo`ungie3taekoh +cei!c<ung&u,shee6eir7Eigo va6phou8ooYuoquohghi-n6Qu eeph4ni\chi2shohg3Die1hia +uCagha8Toos2bahLai7phuph` Zue2thieng9ohhoo~shoh6ese Aet7Lio1ailee^qu4hiech5ie +dee]kuwu9OhTh3shoi2eijoGe daethahH6ahV3eekoo9aep$an aehiiMaquieHee9moh`l_oh4l +aec#ii6Chophu3aigh*ai#le4 looleihoog:uo4Su"thiediec eeTh{o7Eechah7eeJ2uCeish! +oi3jaiphoof$aiy;ieriexeiP Thozool3aipi|cahfu0Ha~e1e az/u8iel2Jaeph2vooshai9Wi +``` + +Run `pwgen --capitalize` (or `-c` for short) followed by the character length to generate a password with at least one capital letter: + + +``` +$ pwgen -c 25 +pheipichusheta6ieJ4xai4ai seiLeiciev7ijoy5Uez7Iepee Foobeisheec7ooGahbicholo6 +shenahsheevigh3pha1Ie5aev taiTheitahne3oong4joegh9d ooshieV0ooGhaelabuyahsh7t +ieniech0Uajeh8nieYaak0foh dohm5Pee3jeeshahm1eipei0a aemoob8Lequeesho8ahreiwee +keineeCh5ieZejafitith6Osh Tahn3nohl6iewaimee6oofied Aed2Woh7nae5ohgh2toh1ieph +le4agheeb0bieth0Ui7ielais Iunoo4lev1aiG4NohfoTh3ro5 iLai7eiQuohXosh8ooyiev6wu +eezib2zoh2ohsh0cooSahluK6 baekiew8bo5oeMouthi7taCee iep6Puungae0uushogah4rohw +chohm5leogae2zeiph1OL0uK2 oosieCaishievahvig3Iaphai ii9AemieYeepe1ahciSei8ees +ie3aighaiy9TaX6bae8soKe6t sooDaivi4mia8Eireech8ope9 moi9uk3bauv0ahY4to0aedie7 +que8seHu4shu7Veib6noe7dai shuyuj9aiphoip2Ier4oole1u Thoaziebah1Ieph2Veec0Ohm8 +auqua4Kaitie9sei6quoh7chi jeewaituH3Ohsaisahp0viequ ueh1quaibidoh6Bae6ri0Mee2 +lae3aiJaiNgoh7yieghozev7o Di2vohfahr7uo7ohSh0voh5sh Jeurahxiedeiyoom3aechaS7d +thung2pheiy2tooBeenuN8ia3 foh0oge1athei0oowieZen0ai iexei0io1vohsieThuCoy5ogi +tohHe3uu2eXieheeQuoh7eit8 aiMieCeizeivu1ooch8aih0sh Riojei2yoah0AiWeiRoMieQu0 +``` + +### Make it easy + +Good, randomized passwords are hard to invent, especially because the human brain tends to prefer patterns. Make password generation easier on yourself by using pwgen. With a good [open source password manager][6], you can benefit from passwords that are hard to guess but easy to use from start to finish. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/generate-passwords-pwgen + +作者:[Sumantro Mukherjee][a] +选题:[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/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/password.jpg?itok=ec6z6YgZ (Password lock) +[2]: https://linux.die.net/man/1/pwgen +[3]: https://opensource.com/article/20/11/macports +[4]: https://opensource.com/article/20/6/homebrew-mac +[5]: https://opensource.com/article/20/3/chocolatey +[6]: https://opensource.com/article/16/12/password-managers From fecd0f0f627517192f1c76435230743a72781c26 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Jul 2021 05:03:52 +0800 Subject: [PATCH 337/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210707=20?= =?UTF-8?q?Open=20source=20tools=20and=20tips=20for=20improving=20your=20L?= =?UTF-8?q?inux=20PC's=20performance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210707 Open source tools and tips for improving your Linux PC-s performance.md --- ...r improving your Linux PC-s performance.md | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 sources/tech/20210707 Open source tools and tips for improving your Linux PC-s performance.md diff --git a/sources/tech/20210707 Open source tools and tips for improving your Linux PC-s performance.md b/sources/tech/20210707 Open source tools and tips for improving your Linux PC-s performance.md new file mode 100644 index 0000000000..e31bfd908c --- /dev/null +++ b/sources/tech/20210707 Open source tools and tips for improving your Linux PC-s performance.md @@ -0,0 +1,192 @@ +[#]: subject: (Open source tools and tips for improving your Linux PC's performance) +[#]: via: (https://opensource.com/article/21/7/improve-linux-pc-performance) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Open source tools and tips for improving your Linux PC's performance +====== +Make changes to your software (and how you use it) to improve your Linux +computer's performance. +![Business woman on laptop sitting in front of window][1] + +This is the third in a series of articles that explain how to improve your Linux personal computer's performance. My first article described how to unleash performance by [identifying and resolving bottlenecks][2]. My second article showed how to improve performance by [upgrading your PC's hardware][3]. + +This article completes the series by presenting software performance tips. It also explores ways to improve performance by changing how you use your computer. Some of these behavioral changes may be obvious to many Opensource.com readers, but they might not be to the end users you support. + +The goal is a simple approach to improving Linux PC performance. As in my previous articles, I use all open source tools. There's no need for anything else. + +### How to measure improvements + +Before you make any change to your computer, assess performance to ensure that the change would be beneficial. After making the update, you might want to inspect the system a second time to verify that the modification succeeded. + +Several open source graphical tools make performance monitoring easy. They include the [GNOME System Monitor][4], [KDE System Guard][5], [GKrellM][6], [Stacer][7], [Conky][8], and [Glances][9]. (In my first article in this series, I showed how to monitor performance using the GNOME System Monitor.) + +Whichever tool you pick, look very closely at your processor and memory use. You might also want to monitor other hardware resources, such as disk and USB storage, the graphics processor, and the internet connection. + +The ultimate performance arbiter for a personal computer is its responsiveness. Quick? You're good. Sluggish… that indicates room for improvement. + +Most Linux distributions require little configuration by personal computer users: they're efficient from the start. However, an overview of the important tools you use daily can be useful when you're narrowing your focus on what could use optimization. + +### Tweak your browser + +Most users run their browser nearly all the time. For some, it's their only app. So browser selection and tuning potentially offer big payoffs. + +Here are some tuning tips: + + * As research by the Brave browser indicates, many website ads and trackers [consume over half the CPU][10] your PC spends on page processing. So block ads with a browser extension like [uBlock Origin][11], and block trackers with a tool like [Privacy Badger][12]. + * Disable autoplay for videos and animation (including those little video windows that automatically appear and run in the corner of your screen). In Firefox, you can install the open source [Disable HTML5 Autoplay][13] extension. In Chromium or Google Chrome, install the open source [Yet Another Autoplay Blocker][14] extension. + * Remove all non-essential add-ons and extensions from the browser. Carefully consider whether each is worth its overhead. + + + +#### Browser tips for powerful PCs + +For a high-end PC, select a browser that leverages your abundant processor and memory resources to provide optimal web surfing. Multiprocess, multithread browsers work best. Your goal is to apply all your hardware power for a better browsing experience. + +Which browser performs best? That's a highly debatable issue that requires a separate article for an answer. Many people start their search with Chromium or Firefox, popular open source products that are widely respected for their ability to leverage hardware for high-performance browsing. There are many other [open source browsers][15] you might try, though. + +#### Browser tips for low-end PCs + +For a limited-resource PC, you don't want a browser that consumes resources and swamps your PC. Instead, you want one that performs efficiently using limited resources. Call it a lightweight browser. It probably won't be the one that spawns lots of processes and threads. + +Users hold different views about which lightweight browser performs best. I've had good experience with [Dillo][16]. [Wikipedia][17] provides a comprehensive list of lightweight browsers, if you'd like to research others. Keep in mind that most lightweight browsers sacrifice some features and functions to reduce PC resource consumption. + +For a limited-resource PC, you can reduce browser resource consumption by opening only a couple of tabs at a time rather than a dozen. Close tabs you're done using. And run only a single instance of one browser at a time. + +JavaScript can add a lot of demand on your browser, so toggle it off when you don't need it. Most browsers offer add-ons that allow you to manage JavaScript on a per-website basis or by flipping it on or off at your direction. Firefox offers several such extensions. I use one called [JavaScript Toggle On and Off][18]. + +On low-end PCs, you can also tailor browser performance to your liking by manually starting and stopping background tab processing. Just click on the page-load button in the browser to toggle processing on or off for a web page. In Firefox, for example, this button is located on the left side of the toolbar. + +Here's how to use this. If you want to load a specific web page quickly, toggle off page loading in other tabs so that they don't compete with your page of interest. Conversely, if you're spending a lot of time reading a web page you've already loaded, let other tabs load their pages in the background while you're occupied. In this way, you can often browse with decent performance, even on a minimal-resource computer. + +### Stop multitasking + +Some apps, including games, video editors, and virtual machine hosts, require more resources than others. For best performance when you run a resource hog, run _only_ that program. Conversely, don't run a resource hog in the background while focusing on some other app. + +This performance principle applies everywhere: Limit how many apps you use at one time, and close any you aren't using. Limit concurrency, and you improve performance for the apps you run. + +Background processing presents a similar opportunity. Virus scanners, software updates, backups, image copies, filesystem verification, and big downloads are resource-intensive. Schedule these activities for off-hours to optimize performance. A good open source GUI scheduler makes this easy. For example, you can [install and use Zeit][19], and [KCron][20] is available in many repositories. + +### Choose software wisely + +Your software choices make a big difference in how much processor and memory your computer uses. + +For many people today, this hardly matters. Their state-of-the-art personal computers have more than enough processing power and memory to quickly run any app they choose. (If this is you, you can skip this section.) Yet, software choices remain crucial for others. + +#### Office suites + +If you run LibreOffice or OpenOffice, but you don't use **Base** (the database creation component), then it's safe to disable the Java runtime. You can do this in the **Tools** > **Options** > **LibreOffice** > **Advanced** setting panel. + +Alternately, replace your big office suite with what's commonly known as **GNOME Office**. This includes [AbiWord][21] and [Gnumeric][22], both of which require less from your hardware and are functionally equivalent to a word processor and spreadsheet for many users. + +You could even consider ditching the local office suite altogether. Instead, offload your workload to the cloud with a product like [Etherpad][23], [EtherCalc][24], or the [ONLYOFFICE suite][25]. + +This principle applies generally. If you have a low-end computer, offload whatever you can to the cloud. This is why [Chromebooks][26] are effective, even though most offer low-power hardware. + +#### Desktop environment + +Your desktop environment runs every minute you use your PC. If it's not responsive, install a lighter desktop that requires fewer resources. I recommend [Xfce][27], [LXQt or LXDE][28]. + +Whichever desktop you use, you can increase its responsiveness by disabling visual effects. Turn off things like animation, compositing, and the thumbnail images in your file manager, or use a file manager (such as [PCManFM, XFE, or Thunar][29]) without those features. This can have a noticeable impact on slower computers because your screen is involved in every mouse click. Use keyboard shortcuts to eliminate having to move your hand between the mouse and keyboard. + +You can configure some desktops to use a lightweight window manager. The window manager dictates how windows look and feel and how users interact with these elements. + +If you really want to skimp on resources, forgo a desktop altogether in favor of a simple windows manager. Popular choices include [JWM][30], [Openbox][31], and [Fluxbox][32]. These run faster than a full desktop but at the cost of a less user-friendly interface. For example, you often can't put icons on your desktop, and you may not have a system tray or dock. + +### Right-size your Linux distribution for your PC + +Your Linux distribution can impact PC performance. Some distros assume they're running on powerful state-of-the-art computers, while others are designed to run with fewer resources. So if you're running a full-featured distro and it doesn't perform well, test a lightweight alternative to see if it improves responsiveness. + +Testing different distros is easy. Just download the Linux distro you want to try. [Write it to a USB memory stick][33] with an open source tool like [Fedora Media Writer][34] or [Unetbootin][35]. Then boot your PC from the memory stick to test drive the distro. Start up one of the system monitoring tools I mentioned earlier, and measure whether the new distro uses hardware more efficiently. + +The lightest distros I've used are AntiX and Puppy Linux. These use window managers instead of a desktop, bundle lightweight apps, and are specifically designed to run on limited-resource computers. They even run well on 15-year-old machines! (You can even [refurbish old computers using lightweight Linux software][36].) + +The tradeoff is that their desktops aren't glitzy. Their interfaces may be unfamiliar to you, and you may have to learn how to configure them as you would a full desktop environment. For some people, that's frustrating, but for others, it's a fun challenge and an opportunity to learn something new. + +### Make PC configuration changes + +I'll conclude with some basic Linux configuration changes you may want to try. Taken individually, each won't improve performance enough that you'd notice. But in the aggregate, they can have a measurable impact: + + * Verify that you have optimal device drivers for all devices. + * Avoid overheating to prevent step-downs in CPU speed (CPU throttling). + * Reduce boot time by [reducing the default GRUB_TIMEOUT parameter][37] for the Grub menu.) + * Eliminate unneeded apps and services from your startup list (the programs that run every time you boot your computer). Linux desktop environments typically provide GUI panels for this so that you don't need to edit configuration files or scripts directly. + * Speed updates and downloads by using the fastest mirror available. + * Avoid using swap memory. + * If you do use swap, place it on your fastest device. + * Verify your WiFi is operating at peak bandwidth by comparing its WiFi speed versus when it's directly cabled to your modem. + * Verify your router isn't causing a slowdown by testing internet connection speeds without it. + * Match USB standards between your USB ports and devices to ensure they don't step down to the speed of the slower partner. + * Verify your USB transfer rates with the benchmark feature in GNOME Disks. + * If you must use virtual machines, tune them for performance. + * Clean out old history, log, and junk files with open source GUI tools like [BleachBit][38] and [Sweeper][39]. + * Clean out unused junk files by uninstalling apps you don't use. On Debian-based systems, clean the APT cache. + * Find and delete duplicate files by using an open source GUI tool like [FSlint][40]. + + + +If readers express interest, I'll discuss these tweaks in detail in a future article. (Please let me know in the comments if you'd like to see this.) + +### Summary + +In a previous article, I discussed how to identify and remove performance bottlenecks. In my last article, I explained how to efficiently upgrade your Linux PC hardware. This article completes the series by presenting software and behavioral changes that improve PC performance. + +I'm sure you have many good performance tips of your own. Please add your favorites in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/improve-linux-pc-performance + +作者:[Howard Fosdick][a] +选题:[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/howtech +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://opensource.com/article/21/3/linux-performance-bottlenecks +[3]: https://opensource.com/article/21/4/upgrade-linux-hardware +[4]: https://wiki.gnome.org/Apps/SystemMonitor +[5]: https://apps.kde.org/ksysguard/ +[6]: http://gkrellm.srcbox.net/ +[7]: https://oguzhaninan.github.io/Stacer-Web/ +[8]: https://github.com/brndnmtthws/conky +[9]: https://nicolargo.github.io/glances/ +[10]: https://brave.com/accurately-predicting-ad-blocker-savings/ +[11]: https://github.com/gorhill/uBlock +[12]: https://privacybadger.org/ +[13]: https://addons.mozilla.org/en-US/firefox/addon/disable-autoplay/ +[14]: https://chrome.google.com/webstore/detail/yet-another-autoplay-bloc/fjekfkbibnnjlkfjaeifgecjfmpmdaad +[15]: https://opensource.com/article/19/7/open-source-browsers +[16]: https://www.dillo.org +[17]: https://en.wikipedia.org/wiki/Comparison_of_lightweight_web_browsers +[18]: https://addons.mozilla.org/en-US/firefox/addon/javascript-toggler/ +[19]: https://github.com/loimu/zeit +[20]: https://apps.kde.org/kcron/ +[21]: https://flathub.org/apps/details/com.abisource.AbiWord +[22]: http://www.gnumeric.org +[23]: https://etherpad.org/ +[24]: http://ethercalc.net +[25]: https://opensource.com/article/20/12/onlyoffice-docs +[26]: https://opensource.com/article/21/2/chromebook-linux +[27]: https://opensource.com/article/19/12/xfce-linux-desktop +[28]: https://opensource.com/article/19/12/lxqt-lxde-linux-desktop +[29]: https://opensource.com/business/15/4/eight-linux-file-managers +[30]: https://opensource.com/article/19/12/joes-window-manager-linux-desktop +[31]: https://opensource.com/article/19/12/openbox-linux-desktop +[32]: https://opensource.com/article/19/12/fluxbox-linux-desktop +[33]: https://opensource.com/article/20/4/first-linux-computer +[34]: https://opensource.com/article/20/10/fedora-media-writer +[35]: https://opensource.com/life/14/10/test-drive-linux-nothing-flash-drive +[36]: https://opensource.com/article/19/7/how-make-old-computer-useful-again +[37]: https://www.unixmen.com/quick-tip-change-grub-2-default-timeout/ +[38]: https://www.bleachbit.org/ +[39]: https://apps.kde.org/sweeper/ +[40]: https://github.com/pixelb/fslint From 37fe84876916e64845a78a1b0972c52006c3390c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Jul 2021 05:04:09 +0800 Subject: [PATCH 338/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210707=20?= =?UTF-8?q?Parsing=20config=20files=20with=20Java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210707 Parsing config files with Java.md --- ...20210707 Parsing config files with Java.md | 358 ++++++++++++++++++ 1 file changed, 358 insertions(+) create mode 100644 sources/tech/20210707 Parsing config files with Java.md diff --git a/sources/tech/20210707 Parsing config files with Java.md b/sources/tech/20210707 Parsing config files with Java.md new file mode 100644 index 0000000000..56e086085e --- /dev/null +++ b/sources/tech/20210707 Parsing config files with Java.md @@ -0,0 +1,358 @@ +[#]: subject: (Parsing config files with Java) +[#]: via: (https://opensource.com/article/21/7/parsing-config-files-java) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Parsing config files with Java +====== +Implement persistent settings when you're writing software in Java. +![Person drinking a hot drink at the computer][1] + +When you write an application, you often want users to be able to configure how they interact with it and how it interacts with their system. These are commonly called "preferences" or "settings," and they're stored in "preference files" or "configuration files," or just "configs." There are many different formats for config files, including INI, JSON, YAML, and XML, and every language parses these languages differently. This article discusses some of the ways you can implement persistent settings when you're writing software in the [Java programming language][2]. + +### Choose a format + +Writing configuration files is surprisingly flexible. I've kept configuration options in a simple comma-delimited text file, and I've kept options in highly detailed YAML or XML. The most important thing about configuration files is that they are consistent and predictable. This makes it easy for you to write code that can quickly and easily extract data from the configuration file, as well as save and update options when the user decides to make a change. + +There are [several popular formats for configuration files][3]. Java has libraries for most of the common configuration formats, but in this article, I'll use the XML format. For some projects, you might choose to use XML for its inherent ability to provide lots of metadata about the data it contains, while for others, you may choose to avoid it due to its verbosity. Java makes working with XML relatively easy because it includes robust XML libraries by default. + +### XML basics + +XML is a big topic. Just one of the books I own about XML is over 700 pages. Fortunately, using XML doesn't require in-depth knowledge of all its many features. Like HTML, XML is a hierarchical markup language with opening and closing tags, which may contain zero or more data. Here's a sample snippet of XML: + + +``` +<xml> +  <node> +    <element>Penguin</element> +  </node> +</xml> +``` + +In this rather self-descriptive example, here are the terms that XML parsers use: + + * **Document:** The `` tag opens a _document_, and the `` tag closes it. + * **Node:** The `` tag is a _node_. + * **Element:** The `Penguin`, from the first `<` to the last `>`, is an _element_. + * **Content:** In the `` element, the string `Penguin` is the _content_. + + + +Believe it or not, that's all you need to know about XML to be able to write and parse it. + +### Create a sample config file + +A minimal example of a config file is all you need to learn how to parse XML. Imagine a config file tracking some display properties of a GUI window: + + +``` +<xml> +  <window> +    <theme>Dark</theme> +    <fullscreen>0</fullscreen> +    <icons>Tango</icons> +</window> +</xml> +``` + +Create a directory called `~/.config/DemoXMLParser`: + + +``` +`$ mkdir ~/.config/DemoXMLParser` +``` + +On Linux, the `~/.config` directory is the default configuration file location, as defined by the [Freedesktop][4] specification. If you're on an operating system that doesn't follow Freedesktop standards, you can still use this location, but you may have to create all the directories yourself. + +Copy and paste the sample configuration XML into a file and save it as `~/.config/DemoXMLParser/myconfig.xml`. + +### Parse XML with Java + +If you're new to Java, start by reading my [7 tips for new Java developers][5] article. Once you're relatively comfortable with Java, open your favorite integrated development environment (IDE) and create a new project. I call mine **myConfigParser**. + +Without worrying too much about imports and error catching initially, you can instantiate a parser using the standard Java extensions found in the `javax` and `java.io` libraries. If you're using an IDE, you'll be prompted to import the appropriate libraries; otherwise, you can find a full list of libraries in the complete version of this code later in this article. + + +``` +Path configPath = Paths.get([System][6].getProperty("user.home"), ".config", "DemoXMLParser"); +[File][7] configFile = new [File][7](configPath.toString(), "myconfig.xml"); + +DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + +DocumentBuilder builder = null; +builder = factory.newDocumentBuilder(); + +[Document][8] doc = null; +doc = builder.parse(configFile); +doc.getDocumentElement().normalize(); +``` + +This example code uses the `java.nio.Paths` library to locate the user's home directory, adding the default configuration location to the path. Then it defines the configuration file to be parsed as a File object using the `java.io.File` library. + +Next, it uses the `javax.xml.parsers.DocumentBuilder` and `javax.xml.parsers.DocumentBuilderFactory` libraries to create an internal document builder so that the Java program can ingest and parse XML data. + +Finally, Java builds a document called `doc` and loads the `configFile` file into it. Using `org.w3c.dom` libraries, it normalizes the ingested XML data. + +That's essentially it. Technically, you're done parsing the data. But parsed data isn't of much use to you if you can't access it, so write some queries to extract important values from your configuration. + +### Accessing XML values with Java + +Getting data from your ingested XML document is a matter of referencing a specific node and then "walking" through the elements it contains. It's common to use a series of loops to iterate through elements in nodes, but I'll keep that to a minimum here, just to keep the code easy to read: + + +``` +NodeList nodes = doc.getElementsByTagName("window"); + +for (int i = 0; i < nodes.getLength(); i++) { + Node mynode = nodes.item(i); + System.out.println("Property = " + mynode.getNodeName()); +        + if (mynode.getNodeType() == Node.ELEMENT_NODE) { +   Element myelement = (Element) mynode; +              +   System.out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); +   System.out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); +   System.out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); + } +} +``` + +This sample code creates a `NodeList` object called `nodes` using the `org.w3c.dom.NodeList;` library. This object contains any child node with a name that matches the string `window`, which is the only node in the sample config file created in this article. + +Next, it creates a for-loop to iterate over the `nodes` list, taking each node in order of appearance and processing it with an if-then loop. The if-then loop creates an `Element` object called `myelement` that contains all elements within the current node. You can query the elements using methods like `getChildNodes`, `getElementById`, and others, as [documented][9] by the project. + +In this example, the elements are essentially the configuration keys. The values are stored as the content of the element, which you can extract with the `.getTextContent` method. + +Run the code either in your IDE or as a binary: + + +``` +$ java ./DemoXMLParser.java +Property = window +Theme = Dark +Fullscreen = 0 +Icon set = Tango +``` + +Here's the full code: + + +``` +package myConfigParser; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class ConfigParser { + +        public static void main([String][10][] args) { +                Path configPath = Paths.get([System][6].getProperty("user.home"), ".config", "DemoXMLParser"); +                [File][7] configFile = new [File][7](configPath.toString(), "myconfig.xml"); +                DocumentBuilderFactory factory = +                DocumentBuilderFactory.newInstance(); +                DocumentBuilder builder = null; +                +                try { +                        builder = factory.newDocumentBuilder(); +                } catch (ParserConfigurationException e) { +                        e.printStackTrace(); +                } +        +                [Document][8] doc = null; +        +                try { +                        doc = builder.parse(configFile); +                } catch (SAXException e) { +                        e.printStackTrace(); +                } catch ([IOException][11] e) { +                        e.printStackTrace(); +                } +        doc.getDocumentElement().normalize(); +        +        NodeList nodes = doc.getElementsByTagName("window"); +        for (int i = 0; i < nodes.getLength(); i++) { +           Node mynode = nodes.item(i); +           [System][6].out.println("Property = " + mynode.getNodeName()); +            +           if (mynode.getNodeType() == Node.ELEMENT_NODE) { +               [Element][12] myelement = ([Element][12]) mynode; + +               [System][6].out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); +               [System][6].out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); +               [System][6].out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); +           } // close if +        } // close for +    } // close method +} //close class +``` + +### Updating XML with Java + +From time to time, a user is going to change a preference. The `org.w3c.dom` libraries can update the contents of an XML element; you only have to select the XML element the same way you did when reading it. Instead of using the `.getTextContent` method, you use the `.setTextContent` method: + + +``` +updatePref = myelement.getElementsByTagName("fullscreen").item(0); +updatePref.setTextContent("1"); + +[System][6].out.println("Updated fullscreen to " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent());   +``` + +This changes the XML document in your application's memory, but it doesn't write the data back to the drive. Using a combination of `javax` and `w3c` libraries, you can place your ingested XML back into your configuration file: + + +``` +TransformerFactory transformerFactory = TransformerFactory.newInstance(); + +Transformer xtransform; +xtransform = transformerFactory.newTransformer(); + +DOMSource mydom = new DOMSource(doc); +StreamResult streamResult = new StreamResult(configFile); + +xtransform.transform(mydom, streamResult); +``` + +This silently overwrites the previous configuration file with transformed data. + +Here's the full code, complete with the updater: + + +``` +package myConfigParser; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class ConfigParser { + +        public static void main([String][10][] args) { +                Path configPath = Paths.get([System][6].getProperty("user.home"), ".config", "DemoXMLParser"); +                [File][7] configFile = new [File][7](configPath.toString(), "myconfig.xml"); +                DocumentBuilderFactory factory = +                DocumentBuilderFactory.newInstance(); +                DocumentBuilder builder = null; +                +                try { +                        builder = factory.newDocumentBuilder(); +                } catch (ParserConfigurationException e) { +                        // TODO Auto-generated catch block +                        e.printStackTrace(); +                } +        +                [Document][8] doc = null; +        +                try { +                        doc = builder.parse(configFile); +                } catch (SAXException e) { +                        // TODO Auto-generated catch block +                        e.printStackTrace(); +                } catch ([IOException][11] e) { +                        // TODO Auto-generated catch block +                        e.printStackTrace(); +                } +        doc.getDocumentElement().normalize(); +        Node updatePref = null; +//        NodeList nodes = doc.getChildNodes(); +        NodeList nodes = doc.getElementsByTagName("window"); +        for (int i = 0; i < nodes.getLength(); i++) { +           Node mynode = nodes.item(i); +           [System][6].out.println("Property = " + mynode.getNodeName()); +            +           if (mynode.getNodeType() == Node.ELEMENT_NODE) { +               [Element][12] myelement = ([Element][12]) mynode; + +               [System][6].out.println("Theme = " + myelement.getElementsByTagName("theme").item(0).getTextContent()); +               [System][6].out.println("Fullscreen = " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent()); +               [System][6].out.println("Icon set = " + myelement.getElementsByTagName("icons").item(0).getTextContent()); + +               updatePref = myelement.getElementsByTagName("fullscreen").item(0); +               updatePref.setTextContent("2"); +               [System][6].out.println("Updated fullscreen to " + myelement.getElementsByTagName("fullscreen").item(0).getTextContent());           +           } // close if +            +        }// close for + +        // write DOM back to the file +        TransformerFactory transformerFactory = TransformerFactory.newInstance(); +        Transformer xtransform; + +        DOMSource mydom = new DOMSource(doc); +        StreamResult streamResult = new StreamResult(configFile); + +        try { +                xtransform = transformerFactory.newTransformer(); +                xtransform.transform(mydom, streamResult); +        } catch (TransformerException e) { +                e.printStackTrace(); +        } +                        +    } // close method +} //close class +``` + +### Keep configuration trouble-free + +Configuration can be a deceptively simple routine. You might start with a simple plain text config format while your application has only a few configurable features, but as you introduce more options, reading or writing incorrect data can cause unexpected behavior from your application. One way to help keep your configuration process safe from failure is to use a strict format like XML and to lean on your programming language's built-in features to handle the complexity. + +I like using Java and XML for this very reason. When I try to read the wrong configuration value, Java lets me know, often because the node my code claims to want to read doesn't exist in the XML path I expect. XML's highly structured format helps me keep my code reliable, and that benefits both the users and the developer. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/parsing-config-files-java + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hot drink at the computer) +[2]: https://opensource.com/resources/java +[3]: https://opensource.com/article/21/6/what-config-files +[4]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +[5]: https://opensource.com/article/19/10/java-basics +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+document +[9]: https://www.w3.org/2003/01/dom2-javadoc/org/w3c/dom/Document.html +[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception +[12]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+element From aacfa8d047729b3ab30bf15505963fa94e34c557 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Jul 2021 05:04:34 +0800 Subject: [PATCH 339/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210707=20?= =?UTF-8?q?Nextcloud=20Hub=2022=20Makes=20It=20Easy=20to=20Collaborate=20a?= =?UTF-8?q?nd=20Manage=20Groups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210707 Nextcloud Hub 22 Makes It Easy to Collaborate and Manage Groups.md --- ...t Easy to Collaborate and Manage Groups.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/news/20210707 Nextcloud Hub 22 Makes It Easy to Collaborate and Manage Groups.md diff --git a/sources/news/20210707 Nextcloud Hub 22 Makes It Easy to Collaborate and Manage Groups.md b/sources/news/20210707 Nextcloud Hub 22 Makes It Easy to Collaborate and Manage Groups.md new file mode 100644 index 0000000000..9ecf8b2ccf --- /dev/null +++ b/sources/news/20210707 Nextcloud Hub 22 Makes It Easy to Collaborate and Manage Groups.md @@ -0,0 +1,101 @@ +[#]: subject: (Nextcloud Hub 22 Makes It Easy to Collaborate and Manage Groups) +[#]: via: (https://news.itsfoss.com/nextcloud-hub-22-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Nextcloud Hub 22 Makes It Easy to Collaborate and Manage Groups +====== + +[Nextcloud][1] is one of the best open-source remote working tools available. + +With every new release, it is just keeps getting better. The latest Nextcloud Hub 22 release introduces significant improvements to the workflow and a new app that should make it easier to collaborate and efficiently manage groups. + +### Nextcloud Hub 22: What’s New? + +Here, let me highlight the key changes involved in the release. + +#### Collectives App to Manage and Share Knowledge + +![][2] + +Taking notes or managing information that you consume in an individual level is doable. But, how do you ease knowledge management and sharing for a group of individuals? + +Collectives app comes to the rescue with Nextcloud 22 that lets you create pages/subpages to structure knowledge and cross-document links to interlink information. + +You can manage access to the information using user-defined groups, which is also a new feature introduced with this release. + +#### User-defined Groups + +![][3] + +Normally, the administrator manages groups/teams. But, with user-defined groups i.e. **Circles**, you can add anyone from your contacts to form a group without needing an administrator. + +A circle is a custom group anyone can create. You can also choose to make it visible to other members or keep it private. + +This lets you easily share tasks/files with a particular circle. + +#### Integrated Chat and Task Management + +As part of an improved workflow, Nextcloud 22 lets you turn a chat message to deck card to quickly assign a task. + +![][4] + +You will get the ability to tweak the due date and assign it to someone specific. + +Also, you can easily share the deck card created in a chat room of your choice. + +#### Document Signing & Approval + +![][5] + +Another major improvement to the workflow is the introduction of document signing capabilities within Nextcloud and the document approval option. + +You get support for PDF signing tools like LibreSign and DocuSign. You can get a formal signature for any of your documents without leaving Nextcloud, make things more convenient. + +The approval option also lets you share proposals or applications and get a response within Nextcloud. + +#### Other Improvements + +With Nextcloud 22, you can finally restore deleted calendar events. When deleted, the calendar events reside in a trash bin, which gives you the chance to look back for about a month. + +In addition to the new features, there are performance and security upgrades as well. + +If you are curious, you can check out the [official announcement post][6] about this release. + +You should find the latest Nextcloud version available to download for desktop, mobile, and server in the official website. + +[Download Nextcloud 22][7] + +If you want help installing it in your server, go through our tutorial on [installing Nextcloud with Docker][8]. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/nextcloud-hub-22-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/nextcloud/ +[2]: https://i0.wp.com/i.ytimg.com/vi/yeKRhD3GG3Y/hqdefault.jpg?w=780&ssl=1 +[3]: https://i0.wp.com/i.ytimg.com/vi/AD--RNtC89Y/hqdefault.jpg?w=780&ssl=1 +[4]: https://i2.wp.com/i.ytimg.com/vi/OOOTYMpXXvQ/hqdefault.jpg?w=780&ssl=1 +[5]: https://i1.wp.com/i.ytimg.com/vi/iqx3E1a3FfA/hqdefault.jpg?w=780&ssl=1 +[6]: https://nextcloud.com/blog/nextcloud-hub-22-introduces-approval-workflows-integrated-knowledge-management-and-decentralized-group-administration/ +[7]: https://nextcloud.com/install/ +[8]: https://linuxhandbook.com/install-nextcloud-docker/ From 0aec42aa51b4a9c4c8e67cfaf04caa18ccc00e49 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 8 Jul 2021 08:37:50 +0800 Subject: [PATCH 340/870] translating --- ...se JSON configuration files with Groovy.md | 312 ------------------ ...se JSON configuration files with Groovy.md | 309 +++++++++++++++++ 2 files changed, 309 insertions(+), 312 deletions(-) delete mode 100644 sources/tech/20210630 Parse JSON configuration files with Groovy.md create mode 100644 translated/tech/20210630 Parse JSON configuration files with Groovy.md diff --git a/sources/tech/20210630 Parse JSON configuration files with Groovy.md b/sources/tech/20210630 Parse JSON configuration files with Groovy.md deleted file mode 100644 index 4590f9e55f..0000000000 --- a/sources/tech/20210630 Parse JSON configuration files with Groovy.md +++ /dev/null @@ -1,312 +0,0 @@ -[#]: subject: (Parse JSON configuration files with Groovy) -[#]: via: (https://opensource.com/article/21/6/groovy-parse-json) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Parse JSON configuration files with Groovy -====== -Sidestep the debate on whether or not to use JSON as a configuration -format and just learn how to parse it using Groovy. -![Looking back with binoculars][1] - -Applications typically include some type of default or "out-of-the-box" state or configuration, as well as some way for users to customize that configuration for their needs. - -For example, [LibreOffice Writer][2] gives access to stuff like user data, fonts, language settings, and (much) more through **Tools > Options** on its menu bar. Some applications (like LibreOffice) provide a point-and-click user interface to manage these settings. Some, like [Tracker][3] (the GNOME task that indexes files), use XML files. And some, especially JavaScript-based applications, use JSON, despite the protestations of many (for example, [this writer][4] and [this other writer][5]). - -In this article, I'll sidestep the debate about whether or not to use JSON as a configuration file format and explain how to parse this kind of information using the [Groovy programming language][6]. Groovy is based on Java but with a different set of design priorities that make Groovy feel more like Python. - -### Install Groovy - -Since Groovy is based on Java, it also requires a Java installation. You might find recent and decent versions of Java and Groovy in your Linux distribution's repositories. Or you can install Groovy following the [instructions][7] on its website. A nice alternative for Linux users is [SDKMan][8], which you can use to get multiple versions of Java, Groovy, and many other related tools. For this article, I'll use my distro's OpenJDK11 release and SDKMan's Groovy 3.0.7 release. - -### The demo JSON configuration file - -For this demonstration, I snagged this JSON from [Drupal][9]—it's the main configuration file used by the Drupal CMS—and saved it in the file `config.json`: - - -``` -{ -  "vm": { -    "ip": "192.168.44.44", -    "memory": "1024", -    "synced_folders": [ -      { -        "host_path": "data/", -        "guest_path": "/var/www", -        "type": "default" -      } -    ], -    "forwarded_ports": [] -  }, -  "vdd": { -    "sites": { -      "drupal8": { -        "account_name": "root", -        "account_pass": "root", -        "account_mail": "[box@example.com][10]", -        "site_name": "Drupal 8", -        "site_mail": "[box@example.com][10]", -        "vhost": { -          "document_root": "drupal8", -          "url": "drupal8.dev", -          "alias": ["www.drupal8.dev"] -        } -      }, -      "drupal7": { -        "account_name": "root", -        "account_pass": "root", -        "account_mail": "[box@example.com][10]", -        "site_name": "Drupal 7", -        "site_mail": "[box@example.com][10]", -        "vhost": { -          "document_root": "drupal7", -          "url": "drupal7.dev", -          "alias": ["www.drupal7.dev"] -        } -      } -    } -  } -} -``` - -This is a nice, complex JSON file with several levels of structure, like: - - -``` -`<>.vdd.sites.drupal8.account_name` -``` - -and some lists like: - - -``` -`<>.vm.synced_folders` -``` - -Here, `<>` represents the unnamed top level. Let's see how Groovy handles that. - -### Parsing JSON with Groovy - -Groovy comes with the `groovy.json` package, which is full of all sorts of cool stuff. One of the best parts is the `JsonSlurper` class, which includes several `parse()` methods that convert JSON to a Groovy `Map`—a data structure with values stored against keys. - -Here's a nice, short Groovy program named `config1.groovy` that creates a `JsonSlurper` instance, then calls one of its `parse()` methods to parse the JSON in a file and convert it to a `Map` instance called `config`, and finally writes out that map: - - -``` -import groovy.json.JsonSlurper - -def jsonSlurper = new JsonSlurper() - -def config = jsonSlurper.parse(new File('config.json')) - -println "config = $config" -``` - -Run this program on the command line in a terminal: - - -``` -$ groovy config1.groovy -config = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] -$ -``` - -The output shows a top-level map with two keys: `vm` and `vdd`. Each key references its own map of values. Notice the empty list referenced by the `forwarded_ports` key. - -Huh. That was easy, but all it did was print things out. How do you get at the various components? Here's another program that shows how to access the value stored at `config.vm.ip`: - - -``` -import groovy.json.JsonSlurper - -def jsonSlurper = new JsonSlurper() - -def config = jsonSlurper.parse(new File('config.json')) - -println "config.vm.ip = ${config.vm.ip}" -``` - -Run it: - - -``` -$ groovy config2.groovy -config.vm.ip = 192.168.44.44 -$ -``` - -Yup, that's easy, too. This takes advantage of Groovy shorthand that means: - - -``` -`config.vm.ip` -``` - -in Groovy is equivalent to: - - -``` -`config['vm']['ip']` -``` - -when `config` and `config.vm` are both instances of `Map`, and both are equivalent to: - - -``` -`config.get("vm").get("ip")` -``` - -in Java. - -So much for just handling the JSON. What if you want to have a standard configuration and let the user override it? In that case, you might want to have a JSON configuration hard-coded in the program, then read the user configuration and override any of the standard configuration settings. - -Say the above configuration is standard, and the user wants to override only a bit of it, just the `ip` and `memory` values in the `vm` structure, and put that in the `userConfig.json` file: - - -``` -{ -  "vm": { -    "ip": "201.201.201.201", -    "memory": "4096", -  } -} -``` - -You could do that using this program: - - -``` -import groovy.json.JsonSlurper - -def jsonSlurper = new JsonSlurper() - -// use parseText() to parse a string rather than reading from a file -// this gives us the “standard configuration” - -def standardConfig = jsonSlurper.parseText(""" -{ -  "vm": { -    "ip": "192.168.44.44", -    "memory": "1024", -    "synced_folders": [ -      { -        "host_path": "data/", -        "guest_path": "/var/www", -        "type": "default" -      } -    ], -    "forwarded_ports": [] -  }, -  "vdd": { -    "sites": { -      "drupal8": { -        "account_name": "root", -        "account_pass": "root", -        "account_mail": "[box@example.com][10]", -        "site_name": "Drupal 8", -        "site_mail": "[box@example.com][10]", -        "vhost": { -          "document_root": "drupal8", -          "url": "drupal8.dev", -          "alias": ["www.drupal8.dev"] -        } -      }, -      "drupal7": { -        "account_name": "root", -        "account_pass": "root", -        "account_mail": "[box@example.com][10]", -        "site_name": "Drupal 7", -        "site_mail": "[box@example.com][10]", -        "vhost": { -          "document_root": "drupal7", -          "url": "drupal7.dev", -          "alias": ["www.drupal7.dev"] -        } -      } -    } -  } -} -""") - -// print out the standard configuration - -println "standardConfig = $standardConfig" - -// read in and parse the user configuration information - -def userConfig = jsonSlurper.parse(new File('userConfig.json')) - -// print out the user configuration information - -println "userConfig = $userConfig" - -// a function to merge the user configuration with the standard - -def mergeMaps(Map input, Map merge) { -    merge.each { k, v -> -        if (v instanceof Map) -            mergeMaps(input[k], v) -        else -            input[k] = v -    } -} - -// merge the configurations and print out the modified -// standard configuration - -mergeMaps(standardConfig, userConfig) - -println "modified standardConfig $standardConfig" -``` - -Run this as: - - -``` -$ groovy config3.groovy -standardConfig = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] -userConfig = [vm:[ip:201.201.201.201, memory:4096]] -modified standardConfig [vm:[ip:201.201.201.201, memory:4096, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] -$ -``` - -The line beginning `modified standardConfig` shows that the `vm.ip` and `vm.memory` values were overridden. - -Sharp-eyed readers will notice that I did not check for malformed JSON , nor was I careful to ensure that the user configuration makes sense (doesn't create new fields, provides reasonable values, and so on). So the cute little recursive method to merge the two maps probably isn't all that practical in the real world. - -Well I had to leave _something_ for homework, didn't I? - -### Groovy resources - -The Apache Groovy site has a lot of great [documentation][11]. Another great Groovy resource is [Mr. Haki][12]. And a really great reason to learn Groovy is to go on and learn [Grails][13], which is a wonderfully productive full-stack web framework built on top of excellent components like Hibernate, Spring Boot, and Micronaut. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/groovy-parse-json - -作者:[Chris Hermansen][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/look-binoculars-sight-see-review.png?itok=NOw2cm39 (Looking back with binoculars) -[2]: https://www.libreoffice.org/discover/writer/ -[3]: https://gitlab.gnome.org/GNOME/tracker -[4]: https://www.lucidchart.com/techblog/2018/07/16/why-json-isnt-a-good-configuration-language/ -[5]: https://medium.com/trabe/stop-using-json-config-files-ab9bc55d82fa -[6]: https://groovy-lang.org/ -[7]: https://groovy.apache.org/download.html -[8]: https://sdkman.io/ -[9]: https://www.drupal.org/node/2008800 -[10]: mailto:box@example.com -[11]: http://groovy-lang.org/documentation.html -[12]: https://blog.mrhaki.com/ -[13]: https://grails.org/ diff --git a/translated/tech/20210630 Parse JSON configuration files with Groovy.md b/translated/tech/20210630 Parse JSON configuration files with Groovy.md new file mode 100644 index 0000000000..58e018ca68 --- /dev/null +++ b/translated/tech/20210630 Parse JSON configuration files with Groovy.md @@ -0,0 +1,309 @@ +[#]: subject: (Parse JSON configuration files with Groovy) +[#]: via: (https://opensource.com/article/21/6/groovy-parse-json) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Groovy 解析 JSON 配置文件 +====== +抛开关于是否使用 JSON 作为配置格式的争论,只需学习如何用 Groovy 来解析它。 +![Looking back with binoculars][1] + +应用程序通常包括某种类型的默认或“开箱即用”的状态或配置,以及某种让用户根据自己的需要定制配置的方式。 + +例如,[LibreOffice Writer][2] 通过其菜单栏上的**工具>选项**,可以访问诸如用户数据、字体、语言设置等(更多)东西。一些应用程序(如 LibreOffice)提供了一个点选式的用户界面来管理这些设置。有些,像 [Tracker][3](GNOME 的任务,用于索引文件),使用 XML 文件。还有一些,特别是基于 JavaScript 的应用,使用 JSON,尽管它有许多人抗议(例如,[这位作者][4]和[这位其他作者][5])。 + +在这篇文章中,我将回避关于是否使用 JSON 作为配置文件格式的争论,并解释如何使用 [Groovy 编程语言][6]来解析这类信息。Groovy 以 Java 为基础,但有一套不同的设计重点,使 Groovy 感觉更像 Python。 + +### 安装 Groovy + +由于 Groovy 是基于 Java 的,它也需要安装 Java。你可能会在你的 Linux 发行版的软件库中找到最近的、合适的 Java 和 Groovy 版本。或者,你可以按照其网站上的[说明][7]安装 Groovy。 Linux 用户的一个不错的选择是 [SDKMan][8],你可以使用它来获取 Java、Groovy 和许多其他相关工具的多个版本。 对于本文,我将使用我的发行版的 OpenJDK11 和 SDKMan 的 Groovy 3.0.7。 + +### 演示的 JSON 配置文件 + +在这个演示中,我从 [Drupal][9] 中截取了这个 JSON 文件,它是 Drupal CMS 使用的主要配置文件,并将其保存在文件 `config.json` 中: + +``` +{ + "vm": { + "ip": "192.168.44.44", + "memory": "1024", + "synced_folders": [ + { + "host_path": "data/", + "guest_path": "/var/www", + "type": "default" + } + ], + "forwarded_ports": [] + }, + "vdd": { + "sites": { + "drupal8": { + "account_name": "root", + "account_pass": "root", + "account_mail": "[box@example.com][10]", + "site_name": "Drupal 8", + "site_mail": "[box@example.com][10]", + "vhost": { + "document_root": "drupal8", + "url": "drupal8.dev", + "alias": ["www.drupal8.dev"] + } + }, + "drupal7": { + "account_name": "root", + "account_pass": "root", + "account_mail": "[box@example.com][10]", + "site_name": "Drupal 7", + "site_mail": "[box@example.com][10]", + "vhost": { + "document_root": "drupal7", + "url": "drupal7.dev", + "alias": ["www.drupal7.dev"] + } + } + } + } +} +``` + +这是一个漂亮的、复杂的 JSON 文件,有几层结构,如: + + +``` +`<>.vdd.sites.drupal8.account_name` +``` + +和一些列表,如: + + +``` +`<>.vm.synced_folders` +``` + +这里,`<>` 代表未命名的顶层。让我们看看 Groovy 是如何处理的。 + +### 用 Groovy 解析 JSON + +Groovy 自带的 `groovy.json` 包,里面有各种很酷的东西。其中最好的部分是 `JsonSlurper` 类,它包括几个 `parse()` 方法,可以将 JSON 转换为 Groovy 的 `Map`,一种根据键值存储的数据结构。 + +下面是一个简短的 Groovy 程序,名为 `config1.groovy`,它创建了一个 `JsonSlurper` 实例,然后调用其中的 `parse()` 方法来解析文件中的 JSON,并将其转换名为 `config` 的 `Map` 实例,最后将该 map 输出: + + +``` +import groovy.json.JsonSlurper + +def jsonSlurper = new JsonSlurper() + +def config = jsonSlurper.parse(new File('config.json')) + +println "config = $config" +``` + +在终端的命令行上运行这个程序: + + +``` +$ groovy config1.groovy +config = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +$ +``` + +输出显示了一个有两个键的顶层 map:`vm` 和 `vdd`。每个键都引用了它自己的值的 map。注意 `forwarded_ports` 键所引用的空列表。 + +这很容易,但它所做的只是把东西打印出来。你是如何获得各种组件的呢?下面是另一个程序,显示如何访问存储在 `config.vm.ip` 的值: + + +``` +import groovy.json.JsonSlurper + +def jsonSlurper = new JsonSlurper() + +def config = jsonSlurper.parse(new File('config.json')) + +println "config.vm.ip = ${config.vm.ip}" +``` + +运行它: + + +``` +$ groovy config2.groovy +config.vm.ip = 192.168.44.44 +$ +``` + +是的,这也很容易。 这利用了 Groovy 速记,这意味着: + + +``` +`config.vm.ip` +``` + +在 Groovy 中等同于: + + +``` +`config['vm']['ip']` +``` + +当 `config `和 `config.vm` 都是 `Map` 的实例,并且都等同于: + + +``` +`config.get("vm").get("ip")` +``` + +在 Java 中。 + +仅仅是处理 JSON 就这么多了。如果你想有一个标准的配置并让用户覆盖它呢?在这种情况下,你可能想在程序中硬编码一个 JSON 配置,然后读取用户配置并覆盖任何标准配置的设置。 + +假设上面的配置是标准的,而用户只想覆盖其中的一点,只想覆盖 `vm` 结构中的 `ip` 和 `memory` 值,并把它放在 `userConfig.json` 文件中: + + +``` +{ + "vm": { + "ip": "201.201.201.201", + "memory": "4096", + } +} +``` + +你可以用这个程序来做: + +``` +import groovy.json.JsonSlurper + +def jsonSlurper = new JsonSlurper() + +// 使用parseText()来解析一个字符串,而不是从文件中读取。 +// 这给了我们一个“标准配置” + +def standardConfig = jsonSlurper.parseText(""" +{ + "vm": { + "ip": "192.168.44.44", + "memory": "1024", + "synced_folders": [ + { + "host_path": "data/", + "guest_path": "/var/www", + "type": "default" + } + ], + "forwarded_ports": [] + }, + "vdd": { + "sites": { + "drupal8": { + "account_name": "root", + "account_pass": "root", + "account_mail": "[box@example.com][10]", + "site_name": "Drupal 8", + "site_mail": "[box@example.com][10]", + "vhost": { + "document_root": "drupal8", + "url": "drupal8.dev", + "alias": ["www.drupal8.dev"] + } + }, + "drupal7": { + "account_name": "root", + "account_pass": "root", + "account_mail": "[box@example.com][10]", + "site_name": "Drupal 7", + "site_mail": "[box@example.com][10]", + "vhost": { + "document_root": "drupal7", + "url": "drupal7.dev", + "alias": ["www.drupal7.dev"] + } + } + } + } +} +""") + +// 打印标准配置 + +println "standardConfig = $standardConfig" + +//读入并解析用户配置信息 + +def userConfig = jsonSlurper.parse(new File('userConfig.json')) + +// 打印出用户配置信息 + +println "userConfig = $userConfig" + +// 一个将用户配置与标准配置合并的函数 + +def mergeMaps(Map input, Map merge) { + merge.each { k, v -> + if (v instanceof Map) + mergeMaps(input[k], v) + else + input[k] = v + } +} + +// 合并配置并打印出修改后的 +// 标准配置 + +mergeMaps(standardConfig, userConfig) + +println "modified standardConfig $standardConfig" +``` + +以下列方式运行: + + +``` +$ groovy config3.groovy +standardConfig = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +userConfig = [vm:[ip:201.201.201.201, memory:4096]] +modified standardConfig [vm:[ip:201.201.201.201, memory:4096, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +$ +``` + +以 `modified standardConfig` 开头的一行显示,`vm.ip` and `vm.memory` 的值被覆盖了。 + +眼尖的读者会注意到,我没有检查畸形的 JSON,也没有仔细确保用户的配置是有意义的(不创建新字段,提供合理的值,等等)。所以用这个递归方法来合并两个 map 在现实中可能并不那么实用。 + +好吧,我必须为家庭作业留下_一些_东西,不是吗? + +### Groovy 资源 + +Apache Groovy 网站有很多很棒的[文档][11]。另一个很棒的 Groovy 资源是 [Mr. Haki][12]。学习 Groovy 的一个非常好的理由是继续学习 [Grails][13],它是一个非常高效的全栈网络框架,建立在 Hibernate、Spring Boot 和 Micronaut 等优秀组件之上。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/groovy-parse-json + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/look-binoculars-sight-see-review.png?itok=NOw2cm39 (Looking back with binoculars) +[2]: https://www.libreoffice.org/discover/writer/ +[3]: https://gitlab.gnome.org/GNOME/tracker +[4]: https://www.lucidchart.com/techblog/2018/07/16/why-json-isnt-a-good-configuration-language/ +[5]: https://medium.com/trabe/stop-using-json-config-files-ab9bc55d82fa +[6]: https://groovy-lang.org/ +[7]: https://groovy.apache.org/download.html +[8]: https://sdkman.io/ +[9]: https://www.drupal.org/node/2008800 +[10]: mailto:box@example.com +[11]: http://groovy-lang.org/documentation.html +[12]: https://blog.mrhaki.com/ +[13]: https://grails.org/ From 9e8816e18eb4faf199c036e6673f0562a2850051 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 8 Jul 2021 08:40:49 +0800 Subject: [PATCH 341/870] translating --- sources/tech/20210706 Edit PDFs on the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210706 Edit PDFs on the Linux command line.md b/sources/tech/20210706 Edit PDFs on the Linux command line.md index 05c961c4f2..5d9ead1807 100644 --- a/sources/tech/20210706 Edit PDFs on the Linux command line.md +++ b/sources/tech/20210706 Edit PDFs on the Linux command line.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/qpdf-command-line) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8d4ce6b09256cd95d3ff228b9a3b160db0e7fefd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Jul 2021 16:36:32 +0800 Subject: [PATCH 342/870] PRF @geekpi --- ... parse Bash program configuration files.md | 47 ++++++++----------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210628 How to parse Bash program configuration files.md b/translated/tech/20210628 How to parse Bash program configuration files.md index ad1f6b216f..8dbcfe394d 100644 --- a/translated/tech/20210628 How to parse Bash program configuration files.md +++ b/translated/tech/20210628 How to parse Bash program configuration files.md @@ -3,25 +3,26 @@ [#]: author: (David Both https://opensource.com/users/dboth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 如何解析 Bash 程序的配置文件 ====== -将配置文件与代码分开,使任何人都可以改变他们的配置,而不需要任何特殊的编程技巧。 -![bash logo on green background][1] -将程序配置与代码分开是很重要的。它使非程序员能够改变配置而不需要修改程序的代码。如果是编译的二进制可执行文件,这对非程序员来说是不可能的,因为它不仅需要访问源文件(我们在开源程序中会这样),而且还需要程序员的技能组合。很少有人有这种能力,而且大多数人都不想学习。 +> 将配置文件与代码分离,使任何人都可以改变他们的配置,而不需要任何特殊的编程技巧。 -对于像 Bash 这样的 shell 语言,由于 shell 脚本没有被编译成二进制格式,所以从定义上讲,源码是可以访问的。尽管有这种开放性,但对于非程序员来说,在 shell 脚本中钻研和修改它们并不是一个特别好的主意。即使是经验丰富的开发人员和系统管理员,也会意外地做出一些改变,导致错误或更糟。 +![](https://img.linux.net.cn/data/attachment/album/202107/08/163606y3287i6c7dqq0223.jpg) + +将程序配置与代码分离是很重要的。它使非程序员能够改变配置而不需要修改程序的代码。如果是编译好的二进制可执行文件,这对非程序员来说是不可能的,因为它不仅需要访问源文件(我们在开源程序中会这样),而且还需要程序员的技能组合。很少有人有这种能力,而且大多数人都不想学习它。 + +对于像 Bash 这样的 shell 语言,由于 shell 脚本没有被编译成二进制格式,所以从定义上讲,源码是可以访问的。尽管有这种开放性,但对于非程序员来说,在 shell 脚本中钻研和修改它们并不是一个特别好的主意。即使是经验丰富的开发人员和系统管理员,也会意外地做出一些导致错误或更糟的改变。 因此,将配置项放在容易维护的文本文件中,提供了分离,并允许非程序员编辑配置,而不会有对代码进行意外修改的危险。许多开发者对用编译语言编写的程序都是这样做的,因为他们并不期望用户是开发者。由于许多相同的原因,对解释型 shell 语言这样做也是有意义的。 ### 通常的方式 -和其他许多语言一样, 你可以为 Bash 程序编写代码, 读取并解析 ASCII 文本的配置文件, 读取变量名称, 并在程序代码执行时设置值. 例如,一个配置文件可能看起来像这样: - +和其他许多语言一样, 你可以为 Bash 程序编写代码,来读取并解析 ASCII 文本的配置文件、读取变量名称并在程序代码执行时设置值。例如,一个配置文件可能看起来像这样: ``` var1=LinuxGeek46 @@ -30,17 +31,18 @@ var2=Opensource.com 程序将读取文件,解析每一行,并将值设置到每个变量中。 -### Sourcing +### 源引 -Bash 使用一种更简单的方法来解析和设置变量, 叫做 _sourcing_. 从一个可执行的 shell 程序中获取一个外部文件是一种简单的方法,可以将该文件的内容完整地引入 shell 程序中。在某种意义上,这很像编译语言的 `include` 语句,在运行时包括库文件。这样的文件可以包括任何类型的 Bash 代码,包括变量赋值。 +Bash 使用一种更简单的方法来解析和设置变量, 叫做源引sourcing。从一个可执行的 shell 程序中获取一个外部文件是一种简单的方法,可以将该文件的内容完整地引入 shell 程序中。在某种意义上,这很像编译语言的 `include` 语句,在运行时包括库文件。这样的文件可以包括任何类型的 Bash 代码,包括变量赋值。 + +(LCTT 译注:对于使用 `source` 或 `.` 命令引入另外一个文件的行为,我们首倡翻译为“源引”。) 像往常一样,演示比解释更容易。 -首先,创建一个 `~/bin` 目录(如果它还不存在的话),并将其作为当前工作目录 (PWD)。[Linux 文件系统分层标准][2]将 `~/bin` 定义为用户存储可执行文件的适当位置。 +首先,创建一个 `~/bin` 目录(如果它还不存在的话),并将其作为当前工作目录(PWD)。[Linux 文件系统分层标准][2] 将 `~/bin` 定义为用户存储可执行文件的适当位置。 在这个目录下创建一个新文件。将其命名为 `main`,并使其可执行: - ``` [dboth@david bin]$ touch main [dboth@david bin]$ chmod +x main @@ -49,7 +51,6 @@ Bash 使用一种更简单的方法来解析和设置变量, 叫做 _sourcing_. 在这个可执行文件中添加以下内容: - ``` #!/bin/bash Name="LinuxGeek" @@ -58,7 +59,6 @@ echo $Name 并执行这个 Bash 程序: - ``` [dboth@david bin]$ ./main LinuxGeek @@ -67,7 +67,6 @@ LinuxGeek 创建一个新的文件并命名为 `~/bin/data`。这个文件不需要是可执行的。在其中添加以下信息: - ``` # Sourced code and variables echo "This is the sourced code from the data file." @@ -77,7 +76,6 @@ LastName="Both" 在 `main` 程序中增加三行,看起来像这样: - ``` #!/bin/bash Name="LinuxGeek" @@ -89,7 +87,6 @@ echo "LastName: $LastName" 重新运行该程序: - ``` [dboth@david bin]$ ./main LinuxGeek @@ -99,9 +96,7 @@ LastName: Both [dboth@david bin]$ ``` -关于 sourcing 还有一件非常酷的事情要知道。你可以使用一个单点(`.`)作为 `source` 命令的快捷方式。改变 `main` 文件,用 `.` 代替 `source`。 - - +关于源引还有一件非常酷的事情要知道。你可以使用一个单点(`.`)作为 `source` 命令的快捷方式。改变 `main` 文件,用 `.` 代替 `source`。 ``` #!/bin/bash @@ -116,20 +111,18 @@ echo "LastName: $LastName" ### 运行 Bash -每一台使用 Bash 的 Linux 主机(几乎所有主机都是,因为 Bash 是所有发行版的默认 shell),都包括一些优秀的、内置的 sourcing 示例。 +每一台使用 Bash 的 Linux 主机(几乎所有主机都是,因为 Bash 是所有发行版的默认 shell),都包括一些优秀的、内置的源引示例。 每当 Bash shell 运行时,它的环境必须被配置成可以使用的样子。有五个主要文件和一个目录用于配置 Bash 环境。它们和它们的主要功能如下: - * `/etc/profile`: 全系统环境和启动程序 - * `/etc/bashrc`: 全系统的函数和别名 - * `/etc/profile.d/`: 包含全系统脚本的目录,用于配置各种命令行工具,如 `vim` 和 `mc` 以及系统管理员创建的任何自定义配置脚本 + * `/etc/profile`: 系统级的环境和启动程序 + * `/etc/bashrc`: 系统级的函数和别名 + * `/etc/profile.d/`: 包含系统级的脚本的目录,用于配置各种命令行工具,如 `vim` 和 `mc` 以及系统管理员创建的任何自定义配置脚本 * `~/.bash_profile`: 用户特定的环境和启动程序 * `~/.bashrc`: 用户特定的别名和函数 * `~/.bash_logout`: 用户特定的命令,在用户注销时执行 - - -试着通过这些文件追踪执行顺序,确定它在非登录 Bash 初始化和登录 Bash 初始化中使用的顺序。我在我的 Linux 培训系列[_使用和管理 Linux:从零到系统管理员_][3]的第一卷第 17 章中做了这个工作。 +试着通过这些文件追踪执行顺序,确定它在非登录 Bash 初始化和登录 Bash 初始化中使用的顺序。我在我的 Linux 培训系列《[使用和管理 Linux:从零到系统管理员][3]》的第一卷第 17 章中这样做过。 给你一个提示。这一切都从 `~/.bashrc` 脚本开始。 @@ -144,7 +137,7 @@ via: https://opensource.com/article/21/6/bash-config 作者:[David Both][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a47fc0e573adacf8d1c8032673b45d2b4bed1d8e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Jul 2021 16:37:19 +0800 Subject: [PATCH 343/870] PUB @geekpi https://linux.cn/article-13561-1.html --- .../20210628 How to parse Bash program configuration files.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210628 How to parse Bash program configuration files.md (98%) diff --git a/translated/tech/20210628 How to parse Bash program configuration files.md b/published/20210628 How to parse Bash program configuration files.md similarity index 98% rename from translated/tech/20210628 How to parse Bash program configuration files.md rename to published/20210628 How to parse Bash program configuration files.md index 8dbcfe394d..64e4569d0f 100644 --- a/translated/tech/20210628 How to parse Bash program configuration files.md +++ b/published/20210628 How to parse Bash program configuration files.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13561-1.html) 如何解析 Bash 程序的配置文件 ====== From 0141da8f9f91539106133882815e7644925ba1bb Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 8 Jul 2021 20:39:53 +0800 Subject: [PATCH 344/870] translating --- sources/tech/20210707 Parsing config files with Java.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210707 Parsing config files with Java.md b/sources/tech/20210707 Parsing config files with Java.md index 56e086085e..c7c3474d5a 100644 --- a/sources/tech/20210707 Parsing config files with Java.md +++ b/sources/tech/20210707 Parsing config files with Java.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/parsing-config-files-java) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Starryi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 361709ef3d5657acf0c72e434a69d99f02fc7188 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Jul 2021 05:04:30 +0800 Subject: [PATCH 345/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210709=20?= =?UTF-8?q?How=20to=20Install=20Zlib=20on=20Ubuntu=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md --- ...709 How to Install Zlib on Ubuntu Linux.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md diff --git a/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md b/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md new file mode 100644 index 0000000000..c244dcaeac --- /dev/null +++ b/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md @@ -0,0 +1,68 @@ +[#]: subject: (How to Install Zlib on Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-zlib-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Install Zlib on Ubuntu Linux +====== + +[Zlib][1] is an open source library for used for data compression. + +As an end user, you are likely to encounter the need of installing Zlib (or zlib devel package) as a dependency of another application. + +But here comes the problem. If you try installing Zlib on Ubuntu, it will throw “unable to locate package zlib” error. + +``` +sudo apt install zlib +Reading package lists... Done +Building dependency tree +Reading state information... Done +E: Unable to locate package zlib +``` + +Why do you see this [unable to locate package error][2]? Because there is no package named zlib. + +If you [use the apt search command][3], you’ll find that the there are a couple of packages that let you install zlib: **zlib1g and zlib1g-dev**. When you have that information, installing them is just one apt command away. + +### Install Zlib on Ubuntu-based Linux distributions + +Open a terminal and use the following command: + +``` +sudo apt install zlib1g +``` + +_**Please keep in mind that the the letter before g is 1 (one), not lowercase L. Many people make this mistake while typing the command.**_ + +The other package, zlib1g-dev is development package. Only install it if you require it otherwise you should be good with the main runtime zlib1g package. + +``` +sudo apt install zlib1g-dev +``` + +You may also download the source code of Zlib [from its website][1] and install it. However, I won’t recommend going the source code way just for installing zlib unless you have a good reason to do so. For example, if you need the latest or a specific version of zlib which is not available in the distribution’s repository. + +It is interesting how a seemingly small stuff like installing zlib could become a pain for two reasons: a different package name and the package name containing a “hidden” numeral one (1) which is confused with lowercase L. + +I hope this quick tip helps you. Feel free to drop your questions, suggestions or a simple “thank you” in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-zlib-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://zlib.net/ +[2]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ +[3]: https://itsfoss.com/apt-search-command/ From 5e2fe4183c6086b622575eb5ee3ff39dd3b748af Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Jul 2021 05:04:49 +0800 Subject: [PATCH 346/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210708=20?= =?UTF-8?q?Encrypt=20and=20decrypt=20files=20with=20a=20passphrase=20on=20?= =?UTF-8?q?Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md --- ...ecrypt files with a passphrase on Linux.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md diff --git a/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md b/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md new file mode 100644 index 0000000000..b1f437299b --- /dev/null +++ b/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md @@ -0,0 +1,119 @@ +[#]: subject: (Encrypt and decrypt files with a passphrase on Linux) +[#]: via: (https://opensource.com/article/21/7/linux-age) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Encrypt and decrypt files with a passphrase on Linux +====== +Age is a simple, easy-to-use tool that allows you to encrypt and decrypt +files with a single passphrase. +![Scissors cutting open access to files][1] + +Encryption and security for protecting files and sensitive documents have long been a concern for users. Even as more and more of our data is housed on websites and cloud services, protected by user accounts with ever-more secure and challenging passwords, there's still great value in being able to store sensitive data on our own filesystems, especially when we can encrypt that data quickly and easily. + +[Age][2] allows you to do this. It is a small, easy-to-use tool that allows you to encrypt a file with a single passphrase and decrypt it as required. + +### Install age + +Age is available to [install][3] from most Linux repositories. + +To install it on Fedora: + + +``` +`$ sudo dnf install age -y` +``` + +On macOS, use [MacPorts][4] or [Homebrew][5]. On Windows, use [Chocolatey][6]. + +### Encrypting and decrypting files with age + +Age can encrypt and decrypt files with either a public key or a passphrase set by the user. + +#### Using age with a public key + +First, generate a public key and write the output to a `key.txt` file: + + +``` +$ age-keygen -o key.txt +Public key: age16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 +``` + +### Encrypt with a public key + +To encrypt a file with your public key: + + +``` +`$ touch mypasswds.txt | age -r ageage16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 > mypass.tar.gz.age` +``` + +In this example, the file `mypasswds.txt` is encrypted with the public key I generated and put inside an encrypted file called `mypass.tar.gz.age`. + +### Decrypt with a public key + +To decrypt the information you've protected, use the `age` command and the `--decrypt` option: + + +``` +`$ age --decrypt -i key.txt -o mypass.tar.gz mypass.tar.gz.age` +``` + +In this example, age uses the key stored in `key.text` and decrypts the file I created in the previous step. + +### Encrypt with a passphrase + +Encrypting a file without a public key is known as symmetrical encryption. It allows a user to set the passphrase to encrypt and decrypt a file. To do so: + + +``` +$ age --passphrase --output mypasswd-encrypted.txt mypasswd.txt +Enter passphrase (leave empty to autogenerate a secure one):   +Confirm passphrase: +``` + +In this example, age prompts you for a passphrase, which it uses to encrypt the input file `mypasswd.txt` and render the file `mypasswd-encrypted.txt` in return. + +### Decrypt with a passphrase + +To decrypt a file encrypted with a passphrase, use the `age` command with the `--decrypt` option: + + +``` +`$ age --decrypt --output passwd-decrypt.txt mypasswd-encrypted.txt` +``` + +In this example, age prompts you for the passphrase, then decrypts the contents of the `mypasswd-encrypted.txt` file into `passwd-decrypt.txt`, as long as you provide the passphrase that matches the one set during encryption. + +### Don't lose your keys + +Whether you're using passphrase encryption or public-key encryption, you _must not_ lose the credentials for your encrypted data. By design, a file encrypted with age cannot be decrypted without the key used to encrypt it. So back up your public key, and remember those passphrases! + +### Easy encryption at last + +Age is a really robust tool. I like to encrypt my sensitive files, especially tax records and other archival data, into a `.tz` file for later access. Age is user-friendly and makes it very easy to get started with encryption on the go. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/linux-age + +作者:[Sumantro Mukherjee][a] +选题:[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/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files) +[2]: https://github.com/FiloSottile/age +[3]: https://github.com/FiloSottile/age#installation +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey From 48c857123aeb5930ed9eb92dd0361b03be212378 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Jul 2021 05:05:06 +0800 Subject: [PATCH 347/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210708=20?= =?UTF-8?q?3=20reasons=20Quarkus=202.0=20improves=20developer=20productivi?= =?UTF-8?q?ty=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210708 3 reasons Quarkus 2.0 improves developer productivity on Linux.md --- ...mproves developer productivity on Linux.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20210708 3 reasons Quarkus 2.0 improves developer productivity on Linux.md diff --git a/sources/tech/20210708 3 reasons Quarkus 2.0 improves developer productivity on Linux.md b/sources/tech/20210708 3 reasons Quarkus 2.0 improves developer productivity on Linux.md new file mode 100644 index 0000000000..a8510faa57 --- /dev/null +++ b/sources/tech/20210708 3 reasons Quarkus 2.0 improves developer productivity on Linux.md @@ -0,0 +1,126 @@ +[#]: subject: (3 reasons Quarkus 2.0 improves developer productivity on Linux) +[#]: via: (https://opensource.com/article/21/7/developer-productivity-linux) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 reasons Quarkus 2.0 improves developer productivity on Linux +====== +New features in Quarkus 2.0 make it easier to test code in the developer +console. +![Person using a laptop][1] + +No matter how long you work as an application developer and no matter what programming language you use, you probably still struggle to increase your development productivity. Additionally, new paradigms, including cloud computing, DevOps, and test-driven development, have significantly accelerated the development lifecycle for individual developers and multifunctional teams. + +You might think open source tools could help fix this problem, but I'd say many open source development frameworks and tools for coding, building, and testing make these challenges worse. Also, it's not easy to find appropriate [Kubernetes][2] development tools to install on Linux distributions due to system dependencies and support restrictions. + +Fortunately, you can increase development productivity on Linux with [Quarkus][3], a Kubernetes-native Java stack. Quarkus 2.0 was released recently with useful new features for testing in the developer console. + +### Interactive developer UX/UI + +If you need to add more than 10 dependencies (e.g., database connections, object-relational mapping, JSON formatting, REST API specifications) to your Java Maven project, you must define more than 60 configurations with keys and values in one or more `application.properties` files. More configurations decrease readability for individual developers and are harder for developer teams to manage. + +Quarkus has an interactive interface to display all dependencies that have been added. It is available at the `localhost:8080/q/dev` endpoint after you start Quarkus dev mode with the `mvn quarkus:dev` command. You can also update configurations in the DEV user interface (UI), as Figure 1 shows, and the changes will automatically sync with the `application.properties` file. + +(Note: You can find the entire Quarkus application code for this article in my [GitHub repository][4].) + +![Quarkus DEV UI][5] + +Figure 1. Quarkus DEV UI (Daniel Oh, [CC BY-SA 4.0][6]) + +### Better continuous testing + +When developing an application, anything from a monolith to microservices, you have to test your code. Often, a dedicated quality assurance (QA) team using external continuous integration (CI) tools is responsible for verifying unit tests. That's worked for years, and it still does, but Quarkus allows programmers to run tests in the runtime environment where their code is running as it's being developed. Quarkus 2.0 provides this continuous testing feature through the command-line interface (CLI) and the DEV UI, as shown in Figure 2. + +![Quarkus Testing in DEV UI][7] + +Figure 2. Quarkus testing in DEV UI (Daniel Oh, [CC BY-SA 4.0][6]) + +Continuous testing is not running when a Quarkus application starts. To start it, click "Tests not running" on the bottom-right of the DEV UI. You can also open a web terminal by clicking "Open" on the left-hand side of the DEV UI. Both of those options are highlighted in Figure 2, and an example test result is shown in Figure 3. + +![Quarkus console in DEV UI][8] + +Figure 3. Quarkus console in DEV UI (Daniel Oh, [CC BY-SA 4.0][6]) + +If you change the code (e.g., "Hello" to "Hi" in the `hello()` method) but not the test code (regardless of whether the feature works), the test will fail, as shown in Figure 4. To fix it, update the test code along with the logic code. + +![Test failures in Quarkus DEV UI][9] + +Figure 4. Test failures in Quarkus DEV UI (Daniel Oh, [CC BY-SA 4.0][6]) + +You can rerun the test cases implemented in the `src/test/java/` directory. This feature alleviates the need to integrate with an external CI tool and ensures functionality while developing business logic continuously. + +### Zero configuration with dev services + +When you're developing for a specific target, it's important that your development environment is an accurate reflection of the environment where it is meant to run. That can make installing a database in a place like a local environment a little difficult. If you're developing on Linux, you could run the requisite database in a container, but they tend to run differently based on what resources are available, and your local environment probably doesn't have the same resources as the target production environment. + +Quarkus 2.0 helps solve this problem by providing dev services built on [Testcontainers][10]. For example, you can test applications if they work in the production database, PostgreSQL, rather than an H2 in-memory datastore with the following [configurations][11]: + + +``` +quarkus.datasource.db-kind = postgresql (1) +quarkus.hibernate-orm.log.sql = true + +quarkus.datasource.username=person (2) +quarkus.datasource.password=password (3) +quarkus.hibernate-orm.database.generation=drop-and-create + +%prod.quarkus.datasource.db-kind = postgresql (4) +%prod.quarkus.datasource.jdbc.url = jdbc:postgresql://db:5432/person (5) +%prod.quarkus.datasource.jdbc.driver=postgresql + +quarkus.datasource.devservices.image-name=postgres:latest (6) +``` + +In the code above: + +(1) The kind of database you will connect for development and test +(2) Datasource username +(3) Datasource password +(4) The kind of database you will connect for production +(5) Datasource URL +(6) The container image name to use for DevServices providers; if the provider is not container-based (e.g., H2 database), then this has no effect + +When Quarkus restarts with the new configuration, the Postgres container image will be created and start running automatically, as in Figure 5. + +![Quarkus DevServices][12] + +Figure 5. Quarkus DevServices (Daniel Oh, [CC BY-SA 4.0][6]) + +This feature enables you to remove the production datastore integration test. It also increases your development productivity due to avoiding environmental disparities in the development loop. + +### Conclusion + +Quarkus 2.0 increases developer productivity with built-in continuous testing, an interactive DEV UI, and dev services. In addition, it offers additional features for improving developer experiences such as [live coding][13], [remote development mode on Kubernetes][14], and unified configurations that accelerate the development loop. Quarkus 2.0 is certainly no exception! Try it out for yourself [here][15]! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/developer-productivity-linux + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://quarkus.io/ +[4]: https://github.com/danieloh30/quarkus-testing +[5]: https://opensource.com/sites/default/files/uploads/quarkus-devui.png (Quarkus DEV UI) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/quarkustesting.png (Quarkus Testing in DEV UI) +[8]: https://opensource.com/sites/default/files/uploads/quarkusconsole.png (Quarkus console in DEV UI) +[9]: https://opensource.com/sites/default/files/uploads/failedtest.png (Test failures in Quarkus DEV UI) +[10]: https://www.testcontainers.org/ +[11]: https://github.com/danieloh30/quarkus-testing/blob/main/src/main/resources/application.properties +[12]: https://opensource.com/sites/default/files/uploads/quarkusdevservices.png (Quarkus DevServices) +[13]: https://quarkus.io/guides/getting-started#development-mode +[14]: https://developers.redhat.com/blog/2021/02/11/enhancing-the-development-loop-with-quarkus-remote-development +[15]: https://quarkus.io/quarkus2/ From 979e58417fde59dfbecad1bb0415101e583f2a91 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Jul 2021 05:05:36 +0800 Subject: [PATCH 348/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210708=20?= =?UTF-8?q?Write=20good=20examples=20by=20starting=20with=20real=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210708 Write good examples by starting with real code.md --- ...ood examples by starting with real code.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20210708 Write good examples by starting with real code.md diff --git a/sources/tech/20210708 Write good examples by starting with real code.md b/sources/tech/20210708 Write good examples by starting with real code.md new file mode 100644 index 0000000000..80077f493a --- /dev/null +++ b/sources/tech/20210708 Write good examples by starting with real code.md @@ -0,0 +1,97 @@ +[#]: subject: (Write good examples by starting with real code) +[#]: via: (https://jvns.ca/blog/2021/07/08/writing-great-examples/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Write good examples by starting with real code +====== + +When I write about programming, I spend a lot of time trying to come up with good examples. I haven’t seen a lot written about how to make examples, so here’s a little bit about my approach to writing examples! + +The basic idea here is to start with real code that you wrote and then remove irrelevant details to make it into a self-contained example instead of coming up with examples out of thin air. + +I’ll talk about two kinds of examples: realistic examples and suprising examples. + +### good examples are realistic + +To see why examples should be realistic, let’s first talk about an unrealistic example! Let’s say we’re trying to explain Python lambdas (which is just the first concept I thought of). You could give this example, of using `map` and a lambda to double a set of numbers. + +``` +numbers = [1, 2, 3, 4] +squares = map(lambda x: x * x, numbers) +``` + +I think this example is unrealistic for a couple of reasons: + + * squaring a set of numbers isn’t something you’re super likely to do in a real program unless it’s for Project Euler or something (there are LOTS of operations on lists that are a lot more likely) + * This usage of `map` is not idiomatic Python, even if you were doing this I would write `[x*x for x in numbers]` instead + + + +A more realistic example of Python lambdas is using them with `sort`, like this; + +``` +children = [{"name": "ashwin", "age": 12}, {"name": "radhika", "age": 3}] +sorted_children = sorted(children, key=lambda x: x['age']) +``` + +But this example is still pretty contrived (why exactly do we need to sort these children by age?). So how do we actually make realistic examples? + +### how to make your examples realistic: look at actual code you wrote + +I think the easiest way to make realistic examples is, instead of pulling an example out of thin air (like I did with that `children` example), instead just start by looking at real code! + +For example, if I grep a bunch of Python code I wrote for `sort.+key`, I find LOTS of real examples of me sorting a list by some criterion, like: + + * `tasks.sort(key=lambda task: task['completed_time'])` + * `emails = reversed(sorted(emails, key=lambda x:x['receivedAt']))` + * `sorted_keysizes = sorted(scores.keys(), key=scores.get)` + * `shows = sorted(dates[date], key=lambda x: x['time']['performanceTime'])` + + + +It’s pretty easy to see a pattern here – a lot of these are sorting by time! So you can see how you could easily put together a simple realistic example of sorting some objects (emails, events, etc) by time. + +### realistic examples help “sell” the concept you’re trying to explain + +When I’m trying to explain an idea (like Python lambdas), I’m usually also trying to convince the reader that it’s worth learning! Python lambdas are super useful! And to convince someone that lambdas are useful, it really helps to show someone how lambdas could help them do a task that they could actually imagine themselves doing, and ideally a task that they’ve done before. + +### distilling down examples from real code can take a long time + +The example I just gave of explaining how to use `sort` with `lambda` is pretty simple and it didn’t take me a long time to come up with, but turning real code into a standalone example can take a really long time! + +For example, I was thinking of including an example of some weird CSS behaviour in this post to illustrate how it’s fun to create examples with weird or surprising behaviour. I spent 2 hours taking a real problem I had this week, making sure I understood what was actually happening with the CSS, and making it into a minimal example. + +In the end it “just” took [5 lines of HTML and a tiny bit of CSS][1] to demonstrate the problem and it doesn’t really look like it took hours to write. But originally it was hundreds of lines of JS/CSS/JavaScript, and it takes time to untangle all that and come up with something small that gets at the heart of the issue! + +But I think it’s worth it to take the time to make examples really clear and minimal – if hundreds of people are reading your example, you’re saving them all so much time! + +### that’s all for now! + +I think there’s a lot more to say about examples – for instance I think there are a few different types of useful examples, like: + + * examples that are surprising to the reader, which are more about changing someone’s mental model than providing code to use directly + * examples that are easy to copy and paste to use as a starting point + + + +but maybe I’ll write about that another day :) + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/07/08/writing-great-examples/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://codepen.io/wizardzines/pen/0eda7725a46c919dcfdd3fa80aff3d41 From db9f78a6f79ff95a94389b892cf323d064199796 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Jul 2021 05:05:59 +0800 Subject: [PATCH 349/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210708=20?= =?UTF-8?q?Linux=20Mint=2020.2=20is=20Now=20Available=20With=20New=20Featu?= =?UTF-8?q?res=20and=20Tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md --- ...w Available With New Features and Tools.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md diff --git a/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md b/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md new file mode 100644 index 0000000000..acc1bb5c56 --- /dev/null +++ b/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md @@ -0,0 +1,98 @@ +[#]: subject: (Linux Mint 20.2 is Now Available With New Features and Tools) +[#]: via: (https://news.itsfoss.com/linux-mint-20-2-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux Mint 20.2 is Now Available With New Features and Tools +====== + +Linux Mint 20.2 beta [arrived][1] a few weeks ago. And now, the final stable release for Linux Mint 20.2 is here. + +This release is an LTS upgrade based on Ubuntu 20.04 that is supported until 2025. + +Let us take a quick look at what’s new with this release and how do you get it. + +### Linux Mint 20.2: What’s New? + +The key highlight of this release is the addition of update notification, which should encourage more users to keep their systems up-to-date to ensure best security. + +It will [not force updates like Windows][2], but it will keep an eye out for how long you don’t apply updates, check system’s uptime, and then prompt you with an update reminder notification. + +![][3] + +You also get to configure the update notifications, which is great. + +Other major upgrades include **Cinnamon 5** desktop environment, a new bulk **file renaming tool** (Bulky), and **Sticky Notes replacing GNote** as the default note application. + +![][4] + +The file renaming tool is available for all the desktop editions, excluding Xfce, because its default file manager (Thunar) already supports the feature. + +Cinnamon 5 is not exactly exciting, but there are some under-the-hood improvements to its performance and nice little option to limit its RAM usage. + +![][5] + +And Sticky Notes is developed in GTK 3, supports HiDPI and offers more features, along with better integration with the system tray. + +![][6] + +### Other Improvements + +[Warpinator app][7] to share files across a network has received some upgrades making it more useful. + +Other desktop environment upgrades include Xfce 4.16 and MATE 1.24. In addition to that, you will find certain subtle UI improvements and several bug fixes. + +Especially addressing issues with NVIDIA graphics, along with the **support for hybrid graphics**, great news for Laptop users! + +To know more about some of the detailed changes, you can refer to the [official announcement][8] for one of the desktop editions. + +### Download or Upgrade to Linux Mint 20.2 + +You can find the stable releases directly from the official website’s [download page][9]. + +[Download Linux Mint 20.2][9] + +If you have Linux Mint 20 or 20.1 installed, you can choose to first apply all the available updates and then an update to your Update Manager. + +Next, make sure that you have a backup (use timeshift if you want) and then head to the Update Manager’s System Upgrade option from the **Edit** menu as shown below. + +![][10] + +When you click on it, you will be greeted with the on-screen instructions to go ahead with the upgrade. You may also refer to the [official upgrade instructions][11] for further help. + +_Have you upgraded yet? What do you think about the latest release? Feel free to share your thoughts in the comments down below._ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-mint-20-2-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-mint-20-2-beta-release/ +[2]: https://news.itsfoss.com/linux-mint-updates-notice/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2MCIgd2lkdGg9IjQ5NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9IjU3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://news.itsfoss.com/warpinator-android-app/ +[8]: https://blog.linuxmint.com/?p=4102 +[9]: https://linuxmint.com/download.php +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2MCIgd2lkdGg9IjUzMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[11]: https://blog.linuxmint.com/?p=4111 From b8f5004d0d341170c2b80b0cdda4e0cad767356a Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 9 Jul 2021 08:51:33 +0800 Subject: [PATCH 350/870] translated --- ...ible passwords using this Python module.md | 158 ------------------ ...ible passwords using this Python module.md | 156 +++++++++++++++++ 2 files changed, 156 insertions(+), 158 deletions(-) delete mode 100644 sources/tech/20210705 Enter invisible passwords using this Python module.md create mode 100644 translated/tech/20210705 Enter invisible passwords using this Python module.md diff --git a/sources/tech/20210705 Enter invisible passwords using this Python module.md b/sources/tech/20210705 Enter invisible passwords using this Python module.md deleted file mode 100644 index 0d18bad392..0000000000 --- a/sources/tech/20210705 Enter invisible passwords using this Python module.md +++ /dev/null @@ -1,158 +0,0 @@ -[#]: subject: (Enter invisible passwords using this Python module) -[#]: via: (https://opensource.com/article/21/7/invisible-passwords-python) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Enter invisible passwords using this Python module -====== -Give your password an extra layer of security with GPG and the Python -getpass module. -![Password lock][1] - -Passwords are particularly problematic for programmers. You're not supposed to store them without encrypting them, and you're not supposed to reveal what's been typed when your user enters one. This became particularly important to me when I decided I wanted to boost security on my laptop. I encrypt my home directory—but once I log in, any password stored as plain text in a configuration file is potentially exposed to prying eyes. - -Specifically, I use an application called [Mutt][2] as my email client. It lets me read and compose emails in my Linux terminal, but normally it expects a password in its configuration file. I restricted permissions on my Mutt config file so that only I can see it, but I'm the only user of my laptop, so I'm not really concerned about authenticated users inadvertently looking at my configs. Instead, I wanted to protect myself from absent-mindedly posting my config online, either for bragging rights or version control, with my password exposed. In addition, although I have no expectations of unwelcome guests on my system, I did want to ensure that an intruder couldn't obtain my password just by running `cat` on my config. - -### Python GnuPG - -The Python module `python-gnupg` is a Python wrapper for the `gpg` application. The module's name is `python-gnupg`, which you must not confuse with a module called `gnupg`. - -[GnuPG][3] (GPG) is the default encryption system for Linux, and I've been using it since 2009 or so. I feel comfortable with it and have a high level of trust in its security. - -I decided that the best way to get my password into Mutt was to store my password inside an encrypted GPG file, create a prompt for my GPG password to unlock the encrypted file, and hand the password over to Mutt (actually to the `offlineimap` command, which I use to synchronize my laptop with the email server). - -[Getting user input with Python][4] is pretty easy. You make a call to `input`, and whatever the user types is stored as a variable: - - -``` -print("Enter password: ") -myinput = input() - -print("You entered: ", myinput) -``` - -My problem was when I typed a password into the terminal in response to my password prompt, everything I typed was visible to anyone looking over my shoulder or scrolling through my terminal history: - - -``` -$ ./test.py -Enter password: my-Complex-Passphrase -``` - -### Invisible password entry with getpass - -As is often the case, there's a Python module that's already solved my problem. The module is `getpass4`, and from the user's perspective, it behaves exactly like `input` except without displaying what the user is typing. - -You can install both modules with [pip][5]: - - -``` -$ python -m pip install --user \ -python-gnupg getpass4 -``` - -Here's my Python script to create a password prompt: - - -``` -#!/usr/bin/env python -# by Seth Kenlon -# GPLv3 - -# install deps: -# python3 -m pip install --user python-gnupg getpass4 - -import gnupg -import getpass -from pathlib import Path - -def get_api_pass(): -    homedir = str(Path.home()) -    gpg = gnupg.GPG(gnupghome=os.path.join(homedir,".gnupg"), use_agent=True) -    passwd = getpass.getpass(prompt="Enter your GnuPG password: ", stream=None) - -    with open(os.path.join(homedir,'.mutt','pass.gpg'), 'rb') as f: -        apipass = (gpg.decrypt_file(f, passphrase=passwd)) - -    f.close() - -    return str(apipass) -    -if __name__ == "__main__": -    apipass = get_api_pass() -    print(apipass) -``` - -Save the file as `password_prompt.py` if you want to try it out. If you're using `offlineimap` and want to use this solution for your own password entry, then save it to some location you can point `offlineimap` to in your `.offlineimaprc` file (I use `~/.mutt/password_prompt.py`). - -### Testing the password prompt - -To see the script in action, you first must create an encrypted file (I'll assume that you already have GPG set up): - - -``` -$ echo "hello world" > pass -$ gpg --encrypt pass -$ mv pass.gpg ~/.mutt/pass.gpg -$ rm pass -``` - -Now run the Python script: - - -``` -$ python ~/.mutt/password_prompt.py -Enter your GPG password: -hello world -``` - -Nothing displays as you type, but as long as you enter your GPG passphrase correctly, you will see the test message. - -### Integrating the password prompt with offlineimap - -I needed to integrate my new prompt with the `offlineimap` command. I chose Python for this script because I knew that `offlineimap` can make calls to Python applications. If you're an `offlineimap` user, you'll appreciate that the only "integration" required is changing two lines in your `.offlineimaprc` file. - -First, add a line referencing the Python file: - - -``` -`pythonfile = ~/.mutt/password_prompt.py` -``` - -And then replace the `remotepasseval` line in `.offlineimaprc` with a call to the `get_api_pass()` function in `password_prompt.py`: - - -``` -`remotepasseval = get_api_pass()` -``` - -No more passwords in your config file! - -### Security matters - -It sometimes feels almost paranoid to think about security minutiae on your personal computer. Does your SSH config really need to be restricted to 600? Does it really matter that your email password is in an inconsequential config file buried within a hidden folder called, of all things, `.mutt`? Probably not. - -And yet knowing that I don't have sensitive data quietly hidden away in my config files makes it a lot easier for me to commit files to public Git repositories, to copy and paste snippets into support forums, and to share my knowledge in the form of actual, known-good configuration files. For that alone, improved security has made my life easier. And with so many great Python modules available to help, it's easy to implement. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/invisible-passwords-python - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/password.jpg?itok=ec6z6YgZ (Password lock) -[2]: http://www.mutt.org/ -[3]: https://gnupg.org/ -[4]: https://opensource.com/article/20/12/learn-python -[5]: https://opensource.com/article/19/11/python-pip-cheat-sheet diff --git a/translated/tech/20210705 Enter invisible passwords using this Python module.md b/translated/tech/20210705 Enter invisible passwords using this Python module.md new file mode 100644 index 0000000000..fb3c1ae7d0 --- /dev/null +++ b/translated/tech/20210705 Enter invisible passwords using this Python module.md @@ -0,0 +1,156 @@ +[#]: subject: (Enter invisible passwords using this Python module) +[#]: via: (https://opensource.com/article/21/7/invisible-passwords-python) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用这个 Python 模块输入不可见的密码 +====== +用 GPG 和 Python 的 getpass 模块给你的密码多一层安全保障。 +![Password lock][1] + +密码对程序员来说尤其成问题。你不应该在不加密的情况下存储它们,而且你也不应该在用户输入密码的时候透露出输入的内容。当我决定要提高我的笔记本电脑的安全性时,这对我来说变得特别重要。我对我的家目录进行了加密,但当我登录后,任何以纯文本形式存储在配置文件中的密码都有可能暴露在偷窥者面前。 + +具体来说,我使用一个名为 [Mutt][2] 的应用作为我的电子邮件客户端。它可以让我在我的 Linux 终端中阅读和撰写电子邮件,但通常它希望在其配置文件中有一个密码。我限制了我的 Mutt 配置文件的权限,以便只有我可以看到它,但我是我的笔记本电脑的唯一用户,所以我并不真的担心经过认证的用户会无意中看到我的配置文件。相反,我想保护自己不至于心不在焉地把我的配置发布到网上,无论是为了吹嘘还是为了版本控制,我的密码都暴露了。此外,虽然我不希望我的系统上有不受欢迎的客人,但我确实想确保入侵者不能通过对我的配置上运行 `cat` 就获得我的密码。 + +### Python GnuPG + +Python 模块 `python-gnupg` 是 `gpg` 应用的一个 Python 封装。该模块的名字是 `python-gnupg`,你不要把它和一个叫做 `gnupg` 的模块混淆。 + +[GnuPG][3](GPG) 是 Linux 的默认加密系统,我从 2009 年左右开始使用它。我对它感到很舒服,对它的安全性有很高的信任。 + +我决定将我的密码输入 Mutt 的最好方法是将我的密码存储在一个加密的 GPG 文件中,创建一个提示我的 GPG 密码来解锁这个加密文件,然后将密码交给 Mutt(实际上是交给 `offlineimap` 命令,我用它来同步我的笔记本和电子邮件服务器)。 + +[用 Python 获取用户输入][4]是非常容易的。对 `input` 进行调用,无论用户输入什么,都会被存储为一个变量: + + +``` +print("Enter password: ") +myinput = input() + +print("You entered: ", myinput) +``` + +我的问题是,当我根据密码提示在终端上输入密码时,我所输入的所有内容对任何从我肩膀上看过去或滚动我的终端历史的人来说都是可见的: + + +``` +$ ./test.py +Enter password: my-Complex-Passphrase +``` + +### 用 getpass 输入不可见密码 + +正如通常的情况一样,有一个 Python 模块已经解决了我的问题。这个模块是 `getpass4`,从用户的角度来看,它的行为和 `input` 完全一样,只是不显示用户输入的内容。 + +你可以用 [pip][5] 安装这两个模块: + + +``` +$ python -m pip install --user \ +python-gnupg getpass4 +``` + +下面是我的 Python 脚本,用于创建密码提示: + + +``` +#!/usr/bin/env python +# by Seth Kenlon +# GPLv3 + +# install deps: +# python3 -m pip install --user python-gnupg getpass4 + +import gnupg +import getpass +from pathlib import Path + +def get_api_pass(): + homedir = str(Path.home()) + gpg = gnupg.GPG(gnupghome=os.path.join(homedir,".gnupg"), use_agent=True) + passwd = getpass.getpass(prompt="Enter your GnuPG password: ", stream=None) + + with open(os.path.join(homedir,'.mutt','pass.gpg'), 'rb') as f: + apipass = (gpg.decrypt_file(f, passphrase=passwd)) + + f.close() + + return str(apipass) + +if __name__ == "__main__": + apipass = get_api_pass() + print(apipass) +``` + +如果你想试试,把文件保存为 `password_prompt.py`。如果你使用 `offlineimap` 并想在你自己的密码输入中使用这个方案,那么把它保存到某个你可以在 `.offlineimaprc` 文件中指向 `offlineimap` 的位置(我使用 `~/.mutt/password_prompt.py`)。 + +### 测试密码提示 + +要查看脚本的运行情况,你首先必须创建一个加密文件(我假设你已经设置了 GPG): + + +``` +$ echo "hello world" > pass +$ gpg --encrypt pass +$ mv pass.gpg ~/.mutt/pass.gpg +$ rm pass +``` + +现在运行 Python 脚本: + + +``` +$ python ~/.mutt/password_prompt.py +Enter your GPG password: +hello world +``` + +当你输入时没有任何显示,但只要你正确输入 GPG 口令,你就会看到测试信息。 + +### 将密码提示符与 offlineimap 整合起来 + +我需要将我的新提示与 `offlineimap` 命令结合起来。我为这个脚本选择了 Python,因为我知道 `offlineimap` 可以对 Python 程序进行调用。如果你是一个 `offlineimap` 用户,你会明白唯一需要的“整合”是在你的 `.offlineimaprc` 文件中改变两行。 + +首先,添加一行引用 Python 文件的内容: + + +``` +`pythonfile = ~/.mutt/password_prompt.py` +``` + +然后将 `.offlineimaprc`中的 `remotepasseval` 行改为调用 `password_prompt.py`中的 `get_api_pass()` 函数: + +``` +`remotepasseval = get_api_pass()` +``` + +配置文件中不再有密码! + +### 安全问题 + +在你的个人电脑上考虑安全问题有时会让人觉得很偏执。你的 SSH 配置是否真的需要限制为 600?隐藏在名为 `.mutt` 的无关紧要的电子邮件密码真的重要吗?也许不重要。 + +然而,知道我没有把敏感数据悄悄地藏在我的配置文件里,使我更容易把文件提交到公共 Git 仓库,把片段复制和粘贴到支持论坛,并以实际的、已知的好的配置文件的形式分享我的知识。仅就这一点而言,安全性的提高使我的生活更加轻松。而且有这么多好的 Python 模块可以提供帮助,这很容易实现。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/invisible-passwords-python + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/password.jpg?itok=ec6z6YgZ (Password lock) +[2]: http://www.mutt.org/ +[3]: https://gnupg.org/ +[4]: https://opensource.com/article/20/12/learn-python +[5]: https://opensource.com/article/19/11/python-pip-cheat-sheet From 9c9e1a9b17bfbdd8426720960b3b1d3a2123de3a Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 9 Jul 2021 08:54:02 +0800 Subject: [PATCH 351/870] translating --- .../20210707 Generate passwords on the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210707 Generate passwords on the Linux command line.md b/sources/tech/20210707 Generate passwords on the Linux command line.md index 9ccffabc40..f92cebad11 100644 --- a/sources/tech/20210707 Generate passwords on the Linux command line.md +++ b/sources/tech/20210707 Generate passwords on the Linux command line.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/generate-passwords-pwgen) [#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9c644ce01b5daea14d301aff7361f9a8724a53ad Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 9 Jul 2021 12:31:46 +0800 Subject: [PATCH 352/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Zioyi 翻译的很好! --- translated/tech/20180416 Cgo and Python.md | 113 +++++++++------------ 1 file changed, 49 insertions(+), 64 deletions(-) diff --git a/translated/tech/20180416 Cgo and Python.md b/translated/tech/20180416 Cgo and Python.md index b92c34bebf..dea1e2c230 100644 --- a/translated/tech/20180416 Cgo and Python.md +++ b/translated/tech/20180416 Cgo and Python.md @@ -1,35 +1,31 @@ -Cgo 与 Python -============================================================ +如何在 Go 中嵌入 Python +================== ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_hero.png?auto=format&w=1900&dpr=1) - - -如果你查看 [new Datadog Agent][8],你可能会注意到大部分代码库是用 Go 编写的,但我们用来收集指标的检查仍然是用 Python 编写的。这大概是因为 Datadog Agent 是基于一个[嵌入][9] CPython 解释器的 GO,可以在任何时候按需执行 Python 代码。这个过程通过抽象层来透明化,使得你可以编写惯用的 Go 代码来运行后台的 Python。 +如果你看一下 [新的 Datadog Agent][8],你可能会注意到大部分代码库是用 Go 编写的,尽管我们用来收集指标的检查仍然是用 Python 编写的。这大概是因为 Datadog Agent 是一个 [嵌入了][9] CPython 解释器的普通 Go 二进制文件,可以在任何时候按需执行 Python 代码。这个过程通过抽象层来透明化,使得你可以编写惯用的 Go 代码而底层运行的是 Python。 [视频](https://youtu.be/yrEi5ezq2-c) 在 Go 应用程序中嵌入 Python 的原因有很多: -* 它在过渡期间很有用;逐步将现有 Python 项目的部分迁移到新语言,而不会在此过程中丢失任何功能。 - -* 你可以复用现有的 Python 软件或库,而无需用新语言重新实现。 - -* 你可以通过加载去执行常规 Python 脚本来动态扩展你软件,甚至在运行时也可以。 +* 它在过渡期间很有用;可以逐步将现有 Python 项目的部分迁移到新语言,而不会在此过程中丢失任何功能。 +* 你可以复用现有的 Python 软件或库,而无需用新语言重新实现。 +* 你可以通过加载去执行常规 Python 脚本来动态扩展你软件,甚至在运行时也可以。 理由还可以列很多,但对于 Datadog Agent 来说,最后一点至关重要:我们希望做到无需重新编译 Agent,或者说编译任何内容就能够执行自定义检查或更改现有检查。 嵌入 CPython 非常简单,而且文档齐全。解释器本身是用 C 编写的,并且提供了一个 C API 以编程方式来执行底层操作,例如创建对象、导入模块和调用函数。 -在本文中,我们将展示一些代码示例,我们将会在与 Python 交互的同时继续保持 Go 代码的惯用语,但在我们继续之前,我们需要解决一个间隙:嵌入 API 是 C 但我们的主要应用程序是 Go,这怎么可能工作? +在本文中,我们将展示一些代码示例,我们将会在与 Python 交互的同时继续保持 Go 代码的惯用语,但在我们继续之前,我们需要解决一个间隙:嵌入 API 是 C 语言,但我们的主要应用程序是 Go,这怎么可能工作? ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_1.png?auto=format&fit=max&w=847) ### 介绍 cgo -有[很多好的理由][10] 说服你为什么不要在堆栈中引入 cgo,但嵌入 CPython 是你必须这样做的原因。[Cgo][11] 不是语言,也不是编译器。它是 [Foreign Function Interface][12] (FFI),一种让我们可以在 Go 中使用来调用不同语言(特别是 C)编写的函数和服务的机制。 +有 [很多好的理由][10] 说服你为什么不要在堆栈中引入 cgo,但嵌入 CPython 是你必须这样做的原因。[cgo][11] 不是语言,也不是编译器。它是 [外部函数接口][12]Foreign Function Interface(FFI),一种让我们可以在 Go 中使用来调用不同语言(特别是 C)编写的函数和服务的机制。 -当我们提起“cgo”时,我们实际上指的是 Go 工具链在底层使用的一组工具、库、函数和类型,因此我们可以通过执行 `go build` 来获取我们的 Go 二进制文件。下面是使用 cgo 的示例程序: +当我们提起 “cgo” 时,我们实际上指的是 Go 工具链在底层使用的一组工具、库、函数和类型,因此我们可以通过执行 `go build` 来获取我们的 Go 二进制文件。下面是使用 cgo 的示例程序: ``` package main @@ -44,16 +40,17 @@ func main() { ``` -在这种包含标头情况下,`import "C"` 指令上方的注释块称为“前导码”,可以包含实际的 C 代码。导入后,我们可以通过“C”伪包来“跳转”到外部代码,访问常量`FLT_MAX`。你可以通过调用 `go build` 来构建,它就像普通的 Go 一样。 +在这种包含头文件情况下,`import "C"` 指令上方的注释块称为“序言preamble”,可以包含实际的 C 代码。导入后,我们可以通过“C”伪包来“跳转”到外部代码,访问常量 `FLT_MAX`。你可以通过调用 `go build` 来构建,它就像普通的 Go 一样。 -如果你想查看 cgo 在这背后到底做了什么,可以运行 `go build -x`。你将看到“cgo”工具将被调用以生成一些 C 和 Go 模块,然后将调用 C 和 Go 编译器来构建目标模块,最后链接器将所有内容放在一起。 +如果你想查看 cgo 在这背后到底做了什么,可以运行 `go build -x`。你将看到 “cgo” 工具将被调用以生成一些 C 和 Go 模块,然后将调用 C 和 Go 编译器来构建目标模块,最后链接器将所有内容放在一起。 -你可以在 [Go Blog][13] 上阅读更多有关 cgo 的信息,文章包含更多的例子以及一些有用的链接来做进一步了解细节。 +你可以在 [Go 博客][13] 上阅读更多有关 cgo 的信息,该文章包含更多的例子以及一些有用的链接来做进一步了解细节。 现在我们已经了解了 cgo 可以为我们做什么,让我们看看如何使用这种机制运行一些 Python 代码。 + ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_2.png?auto=format&fit=max&w=847) -### 嵌入 CPython: a primer +### 嵌入 CPython:一个入门指南 从技术上讲,嵌入 CPython 的 Go 程序并没有你想象的那么复杂。事实上,我们只需在运行 Python 代码之前初始化解释器,并在完成后关闭它。请注意,我们在所有示例中使用 Python 2.x,但我们只需做很少的调整就可以应用于 Python 3.x。让我们看一个例子: @@ -73,19 +70,19 @@ func main() { ``` -上面的示例与以下 Python 代码完全相同: +上面的例子做的正是下面 Python 代码要做的事: ``` import sys print(sys.version) - ``` -你可以看到我们在开头加入了一个 `#cgo` 指令;这些指令被会被传递到工具链,你就改变了构建工作流程。在这种情况下,我们告诉 cgo 调用`pkg-config`来收集构建并链接名为“python-2.7”的库所需的标志,并将这些标志传递给 C 编译器。如果你的系统中安装了 CPython 开发库和 pkg-config,你只需要运行 `go build` 来编译上面的示例。 +你可以看到我们在序言加入了一个 `#cgo` 指令;这些指令被会被传递到工具链,让你改变构建工作流程。在这种情况下,我们告诉 cgo 调用 `pkg-config` 来收集构建和链接名为 `python-2.7` 的库所需的标志,并将这些标志传递给 C 编译器。如果你的系统中安装了 CPython 开发库和 pkg-config,你只需要运行 `go build` 来编译上面的示例。 -回到代码,我们使用`Py_Initialize()` 和`Py_Finalize()` 来初始化和关闭解释器,并使用`Py_GetVersion` C 函数来获取嵌入式解释器版本信息的字符串。 +回到代码,我们使用 `Py_Initialize()` 和 `Py_Finalize()` 来初始化和关闭解释器,并使用 `Py_GetVersion` C 函数来获取嵌入式解释器版本信息的字符串。 + +如果你想知道,所有我们需要放在一起调用 C 语言 Python API的 cgo 代码都是模板代码。这就是为什么 Datadog Agent 依赖 [go-python][14] 来完成所有的嵌入操作;该库为 C API 提供了一个 Go 友好的轻量级包,并隐藏了 cgo 细节。这是另一个基本的嵌入式示例,这次使用 go-python: -如果你更近一步,我们可以把所有调用 C Python API 的 cgo 代码一起,这就是 Datadog Agent 进行所有嵌入式操作所有依赖的 [go-python][14] 做的事情;该库为 C API 提供了一个 Go 友好的轻量级包,并隐藏了 cgo 细节。这是另一个基本的嵌入式示例,这次使用 go-python: ``` package main @@ -103,7 +100,7 @@ func main() { 这看起来更接近普通 Go 代码,不再暴露 cgo,我们可以在访问 Python API 时来回使用 Go 字符串。嵌入式看起来功能强大且对开发人员友好,是时候充分利用解释器了:让我们尝试从磁盘加载 Python 模块。 -在 Python 方面我们不需要任何复杂的东西,无处不在的“hello world”就可以达到目的: +在 Python 方面我们不需要任何复杂的东西,无处不在的“hello world” 就可以达到目的: ``` # foo.py @@ -112,7 +109,6 @@ def hello(): Print hello world for fun and profit. """ print "hello, world!" - ``` Go 代码稍微复杂一些,但仍然可读: @@ -144,26 +140,26 @@ func main() { ``` -首次构建,我们需要将 `PYTHONPATH` 环境变量设置为当前工作目录,以便导入语句能够找到 `foo.py` 模块。在 shell 中,该命令如下所示: +构建时,我们需要将 `PYTHONPATH` 环境变量设置为当前工作目录,以便导入语句能够找到 `foo.py` 模块。在 shell 中,该命令如下所示: ``` $ go build main.go && PYTHONPATH=. ./main hello, world! - ``` + ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_3.png?auto=format&fit=max&w=847) ### 可怕的全局解释器锁 -为了嵌入 Python 必须引入 cgo 需要权衡:构建速度会变慢,垃圾收集器不会帮助我们管理外部系统使用的内存,交叉编译也很难。这些是否是针对特定项目的问题可以讨论,但我认为有一些不容商量的问题:Go 并发模型。如果我们不能从 goroutine 运行 Python,那么使用 Go 就没有意义了。 +为了嵌入 Python 必须引入 cgo ,这是一种权衡:构建速度会变慢,垃圾收集器不会帮助我们管理外部系统使用的内存,交叉编译也很难。对于一个特定的项目来说,这些问题是否是可以争论的,但我认为有一些不容商量的问题:Go 并发模型。如果我们不能从 goroutine 中运行 Python,那么使用 Go 就没有意义了。 -在处理并发、Python 和 cgo 之前,我们还需要知道一些事情:它就是全局解释器锁,也称为 GIL。GIL 是语言解释器(CPython 就是其中之一)中广泛采用的一种机制,可防止多个线程同时运行。这意味着 CPython 执行的任何 Python 程序都无法在同一进程中并行运行。并发仍然是可能的,锁是速度、安全性和实现之间的一个很好的权衡,那么,当涉及到嵌入时,为什么这会造成问题呢? +在处理并发、Python 和 cgo 之前,我们还需要知道一些事情:它就是全局解释器锁Global Interpreter Lock,即 GIL。GIL 是语言解释器(CPython 就是其中之一)中广泛采用的一种机制,可防止多个线程同时运行。这意味着 CPython 执行的任何 Python 程序都无法在同一进程中并行运行。并发仍然是可能的,锁是速度、安全性和实现简易性之间的一个很好的权衡,那么,当涉及到嵌入时,为什么这会造成问题呢? -当一个常规的、非嵌入式的 Python 程序启动时,不涉及 GIL 以避免锁定操作中的无用开销;在某些 Python 代码请求生成线程时 GIL 首次启动。对于每个线程,解释器创建一个数据结构来存储当前的相关状态信息并锁定 GIL。当线程完成时,状态被恢复,GIL 被解锁,准备被其他线程使用。 +当一个常规的、非嵌入式的 Python 程序启动时,不涉及 GIL 以避免锁定操作中的无用开销;在某些 Python 代码首次请求生成线程时 GIL 就启动了。对于每个线程,解释器创建一个数据结构来存储当前的相关状态信息并锁定 GIL。当线程完成时,状态被恢复,GIL 被解锁,准备被其他线程使用。 -当我们从 Go 程序运行 Python 时,上述情况都不会自动发生。如果没有 GIL,我们的 Go 程序可以创建多个 Python 线程,这可能会导致竞争条件,从而导致致命的运行时错误,并且很可能是分段错误导致整个 Go 应用程序瘫痪。 +当我们从 Go 程序运行 Python 时,上述情况都不会自动发生。如果没有 GIL,我们的 Go 程序可以创建多个 Python 线程,这可能会导致竞争条件,从而导致致命的运行时错误,并且很可能出现分段错误导致整个 Go 应用程序崩溃。 -解决方案是在我们从 Go 运行多线程代码时显式调用 GIL;代码并不复杂,因为 C API 提供了我们需要的所有工具。为了更好地暴露这个问题,我们需要写一些受 CPU 限制的 Python 代码。让我们将这些函数添加到前面示例中的 foo.py 模块中: +解决方案是在我们从 Go 运行多线程代码时显式调用 GIL;代码并不复杂,因为 C API 提供了我们需要的所有工具。为了更好地暴露这个问题,我们需要写一些受 CPU 限制的 Python 代码。让我们将这些函数添加到前面示例中的 `foo.py` 模块中: ``` # foo.py @@ -187,7 +183,7 @@ def print_even(limit=10): ``` -我们将尝试从 Go 并发打印奇数和偶数,使用两个不同的 goroutines(因此涉及线程): +我们将尝试从 Go 并发打印奇数和偶数,使用两个不同的 goroutine(因此涉及线程): ``` package main @@ -243,46 +239,39 @@ func main() { ``` -在阅读示例时,您可能会注意到一个模式,该模式将成为我们运行嵌入式 Python 代码的习惯写法: +在阅读示例时,你可能会注意到一个模式,该模式将成为我们运行嵌入式 Python 代码的习惯写法: 1. 保存状态并锁定 GIL。 - -2. 执行 Python. - +2. 执行 Python。 3. 恢复状态并解锁 GIL。 -代码应该很简单,但我们想指出一个微妙的细节:请注意,尽管借用了 GIL 执行,有时我们通过调用 `PyEval_SaveThread()` 和 `PyEval_RestoreThread()` 来操作 GIL,有时(查看 goroutines)我们对 `PyGILState_Ensure()` 和 `PyGILState_Release()` 来做同样的事情。 +代码应该很简单,但我们想指出一个微妙的细节:请注意,尽管借用了 GIL 执行,有时我们通过调用 `PyEval_SaveThread()` 和 `PyEval_RestoreThread()` 来操作 GIL,有时(查看 goroutines 里面)我们对 `PyGILState_Ensure()` 和 `PyGILState_Release()` 来做同样的事情。 我们说过当从 Python 操作多线程时,解释器负责创建存储当前状态所需的数据结构,但是当同样的事情发生在 C API 时,我们来负责处理。 当我们用 go-python 初始化解释器时,我们是在 Python 上下文中操作的。因此,当调用 `PyEval_InitThreads()` 时,它会初始化数据结构并锁定 GIL。我们可以使用 `PyEval_SaveThread()` 和 `PyEval_RestoreThread()` 对已经存在的状态进行操作。 在 goroutines 中,我们从 Go 上下文操作,我们需要显式创建状态并在完成后将其删除,这就是 `PyGILState_Ensure()` 和 `PyGILState_Release()` 为我们所做的。 + ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_divider_4.png?auto=format&fit=max&w=847) ### 释放 Gopher 在这一点上,我们知道如何处理在嵌入式解释器中执行 Python 的多线程 Go 代码,但在 GIL 之后,另一个挑战即将来临:Go 调度程序。 -当一个 goroutine 启动时,它被安排在可用的 `GOMAXPROCS` 线程之一上执行[参见此处][15] 了解有关该主题的更多详细信息。如果一个 goroutine 碰巧执行了系统调用或调用 C 代码,当前线程会将移交给另一个队列中等待运行的其他 goroutine ,以便它们有更好的机会运行; 当前 goroutine 被暂停,等待系统调用或 C 函数返回。当 C 函数返回时,线程会尝试恢复暂停的 goroutine,但如果这不可能,它会要求 Go runtime 找到另一个线程来完成 goroutine 并进入睡眠状态。 +当一个 goroutine 启动时,它被安排在可用的 `GOMAXPROCS` 线程之一上执行,[参见此处][15] 可了解有关该主题的更多详细信息。如果一个 goroutine 碰巧执行了系统调用或调用 C 代码,当前线程会将线程队列中等待运行的其他 goroutine 移交给另一个线程,以便它们有更好的机会运行; 当前 goroutine 被暂停,等待系统调用或 C 函数返回。当这种情况发生时,线程会尝试恢复暂停的 goroutine,但如果这不可能,它会要求 Go 运行时找到另一个线程来完成 goroutine 并进入睡眠状态。 goroutine 最后被安排给另一个线程,它就完成了。 考虑到这一点,让我们看看当一个 goroutine 被移动到一个新线程时,运行一些 Python 代码的 goroutine 会发生什么: -1. 我们的 goroutine 启动,执行 C 调用,暂停,GIL 被锁定。 - -2. 当 C 调用返回时,当前线程尝试恢复 goroutine,但失败。 - +1. 我们的 goroutine 启动,执行 C 调用并暂停。GIL 被锁定。 +2. 当 C 调用返回时,当前线程尝试恢复 goroutine,但失败了。 3. 当前线程告诉 Go 运行时寻找另一个线程来恢复我们的 goroutine。 +4. Go 调度器找到一个可用线程并恢复 goroutine。 +5. goroutine 快完成了,并在返回之前尝试解锁 GIL。 +6. 当前状态中存储的线程 ID 来自原线程,与当前线程的 ID 不同。 +7. 崩溃! -4. Go scheduler 找到可用线程并恢复 goroutine。 - -5. goroutine 快完成了,并在返回之前尝试解锁 GIL。The goroutine is almost done and tries to unlock the GIL before returning. - -6. 当前状态中存储的线程ID来自原始线程,与当前线程的ID不同。 - -7. Panic! - -所幸,我们可以通过从 goroutine 中调用运行时包中的 LockOSThread 函数来强制 Go runtime 始终保持我们的 goroutine 在同一线程上运行: +所幸,我们可以通过从 goroutine 中调用运行时包中的 `LockOSThread` 函数来强制 Go runtime 始终保持我们的 goroutine 在同一线程上运行: ``` go func() { @@ -293,39 +282,35 @@ go func() { python.PyGILState_Release(_gstate) wg.Done() }() - ``` -这会干扰 scheduler 并可能引入一些开销,但这是我们也愿意付出代价。 +这会干扰调度器并可能引入一些开销,但这是我们愿意付出的代价。 ### 结论 为了嵌入 Python,Datadog Agent 必须接受一些权衡: + * cgo 引入的开销。 - * 手动处理 GIL 的任务。 - * 在执行期间将 goroutine 绑定到同一线程的限制。 -为了能方便在 Go 中运行 Python 检查代码,我们乐此不疲。意识到权衡,我们能够最大限度地减少它们的影响,除了为支持 Python 而引入的其他限制,我们没有对策来控制潜在问题: +为了能方便在 Go 中运行 Python 检查,我们很乐意接受其中的每一项。但通过意识到这些权衡,我们能够最大限度地减少它们的影响,除了为支持 Python 而引入的其他限制,我们没有对策来控制潜在问题: * 构建是自动化和可配置的,因此开发人员仍然需要拥有与 `go build` 非常相似的东西。 +* Agent 的轻量级版本,可以使用 Go 构建标签,完全剥离 Python 支持。 +* 这样的版本仅依赖于在 Agent 本身硬编码的核心检查(主要是系统和网络检查),但没有 cgo 并且可以交叉编译。 -* agent 的轻量级版本,可以完全剥离 Python 支持,只需使用 Go 构建标签。A lightweight version of the agent can be built stripping out Python support entirely simply using Go build tags. +我们将在未来重新评估我们的选择,并决定是否仍然值得保留 cgo;我们甚至可以重新考虑整个 Python 是否仍然值得,等待 [Go 插件包][16] 成熟到足以支持我们的用例。但就目前而言,嵌入式 Python 运行良好,从旧代理过渡到新代理再简单不过了。 -* 这样的版本仅依赖于在代理本身中硬编码的核心检查(主要是系统和网络检查),但没有 cgo 并且可以交叉编译。Such a version only relies on core checks hardcoded in the agent itself (system and network checks mostly) but is cgo free and can be cross compiled. - -我们将在未来重新评估我们的选择,并决定是否仍然值得保留 cgo; 我们甚至可以重新考虑 Python 作为一个整体是否仍然值得,等待 [Go plugin package][16] 成熟到足以支持我们的用例。但就目前而言,嵌入式 Python 运行良好,从旧代理过渡到新代理再简单不过了。 - -你是一个喜欢混合不同编程语言的多语言者吗?您喜欢了解语言的内部工作原理以提高您的代码性能吗? [Join us at Datadog!][17] +你是一个喜欢混合不同编程语言的多语言者吗?你喜欢了解语言的内部工作原理以提高你的代码性能吗? -------------------------------------------------------------------------------- via: https://www.datadoghq.com/blog/engineering/cgo-and-python/ -作者:[ Massimiliano Pippi][a] +作者:[Massimiliano Pippi][a] 译者:[Zioyi](https://github.com/Zioyi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 982df3c56291d6148aee6661fa06228880b3ef22 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 9 Jul 2021 12:34:18 +0800 Subject: [PATCH 353/870] PUB @Zioyi https://linux.cn/article-13564-1.html --- {translated/tech => published}/20180416 Cgo and Python.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180416 Cgo and Python.md (100%) diff --git a/translated/tech/20180416 Cgo and Python.md b/published/20180416 Cgo and Python.md similarity index 100% rename from translated/tech/20180416 Cgo and Python.md rename to published/20180416 Cgo and Python.md From 978069c76a9814abb2055468f5736a5373990f57 Mon Sep 17 00:00:00 2001 From: zouchong Date: Fri, 9 Jul 2021 17:13:15 +0800 Subject: [PATCH 354/870] translated --- ...ceive Gmail from the Linux command line.md | 265 ------------------ ...ceive Gmail from the Linux command line.md | 265 ++++++++++++++++++ 2 files changed, 265 insertions(+), 265 deletions(-) delete mode 100644 sources/tech/20210706 Send and receive Gmail from the Linux command line.md create mode 100644 translated/tech/20210706 Send and receive Gmail from the Linux command line.md diff --git a/sources/tech/20210706 Send and receive Gmail from the Linux command line.md b/sources/tech/20210706 Send and receive Gmail from the Linux command line.md deleted file mode 100644 index 269c84b1e4..0000000000 --- a/sources/tech/20210706 Send and receive Gmail from the Linux command line.md +++ /dev/null @@ -1,265 +0,0 @@ -[#]: subject: (Send and receive Gmail from the Linux command line) -[#]: via: (https://opensource.com/article/21/7/gmail-linux-terminal) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Send and receive Gmail from the Linux command line -====== -Use Mutt to send and receive email from your terminal, even if you're -using hosted service such as Gmail. -![woman on laptop sitting at the window][1] - -I'm a [Mutt][2] user. I like viewing and composing emails in the convenience of my Linux terminal. With a lightweight and minimal client like Mutt, I know that I can have my email available regardless of system specifications or internet access. And because I have a Linux terminal open more often than not, my email client essentially has no footprint on my desktop real estate. It's hidden away in a [terminal tab or multiplexer pane][3], so I can ignore it when I don't need it but get to it quickly when I do need it. - -A commonly perceived problem with Mutt is that most of us use hosted email accounts these days and interact with actual email protocols only superficially. Mutt (and ELM before it) was created back in simpler times, when checking email was a call to `uucp` and a glance at `/var/mail`. However, it's adapted nicely to developing technology and works well with all sorts of modern protocols like POP, IMAP, and even LDAP, so you can use Mutt even if you're using Gmail as your email host. - -Because it's relatively rare to run your own email server today, and because Gmail is very common, this tutorial assumes you're using Mutt with Gmail. If you're concerned about email privacy, consider opening an account with [ProtonMail][4] or [Tutanota][5], both of which provide fully encrypted email. Tutanota has many [open source components][6], and ProtonMail provides an [IMAP bridge][7] for paid users so that you don't have to work around accessing your email outside a browser. However, many companies, schools, and organizations don't run their own email services and just use Gmail, so you may have a Gmail account whether you want one or not. - -If you are [running your own email server][8], setting up Mutt is even easier than what I demonstrate in this article, so just dive right in. - -### Install Mutt - -On Linux, you can install Mutt from your distribution's software repository and then create a `.mutt` directory to hold its configuration files: - - -``` -$ sudo dnf install mutt -$ mkdir ~/.mutt -``` - -On macOS, use [MacPorts][9] or [Homebrew][10]. On Windows, use [Chocolatey][11]. - -Mutt is a mail user agent (MUA), meaning its job is to read, compose, and send email to an outbound mail spool. It's the job of some other application or service to actually transfer a message to or from a mail server (although there's a lot of integration with Mutt so that it seems like it's doing all the work even when it's not.) Understanding this separation of tasks can help configuration make a little more sense. - -It also explains why you must have helper applications (in addition to Mutt) depending on what service you need to communicate with. For this article, I use IMAP so that my local copy of email and my email provider's remote copy of mail remain synchronized. Should you decide to use POP instead, that configuration is even easier to configure and can be done without any external tools. IMAP integration, however, requires OfflineIMAP, a Python application available from [its GitHub repository][12]. - -Eventually, you'll be able to install it with the `python3 -m pip` command, but as of this writing, you must install OfflineIMAP manually because it's still being ported from Python 2 to Python 3. - -OfflineIMAP requires `imaplib2`, which is also in heavy development, so I prefer doing a manual install of that, as well. The process is the same: clone the source code repository with Git, change into the directory, and install with `pip`. - -First, install the `rfc6555` dependency: - - -``` -`$ python3 -m pip install --user rfc6555` -``` - -Next, install `imaplib2` from source: - - -``` -$ git clone [git@github.com][13]:jazzband/imaplib2.git -$ pushd imaplib2.git -$ python3 -m pip install --upgrade --user . -$ popd -``` - -Finally, install OfflineIMAP from source: - - -``` -$ git clone [git@github.com][13]:OfflineIMAP/offlineimap3.git -$ pushd offlineimap3.git -$ python3 -m pip install --upgrade --user . -$ popd -``` - -If you're using Cygwin on Windows, then you must also install [Portalocker][14]. - -### Configure OfflineIMAP - -OfflineIMAP reads the configuration file `~/.offlineimaprc` by default. A template for this file, named `offlineimap.conf`, is included in the Git repository you cloned to install OfflineIMAP. Move the example file to your home directory: - - -``` -`$ mv offlineimap3.git/offlineimap.conf ~/.offlineimaprc` -``` - -Open the file in your favorite text editor and read through it. It's a well-commented file, and it's good to get familiar with the options available. - -Here's my `.offlineimaprc` as an example, with comments removed for brevity. Some values may be slightly different for you, but this gives you a reasonable idea of what your end product ought to look like: - - -``` -[general] -ui = ttyui -accounts = %your-gmail-username% -pythonfile = ~/.mutt/password_prompt.py -fsync = False - -[Account %your-gmail-username%] -localrepository = %your-gmail-username%-Local -remoterepository = %your-gmail-username%-Remote -status_backend = sqlite -postsynchook = notmuch new - -[Repository %your-gmail-username%-Local] -type = Maildir -localfolders = ~/.mail/%your-gmail-username%-gmail.com -nametrans = lambda folder: {'drafts':  '[Gmail]/Drafts', -                            'sent':    '[Gmail]/Sent Mail', -                            'flagged': '[Gmail]/Starred', -                            'trash':   '[Gmail]/Trash', -                            'archive': '[Gmail]/All Mail', -                            }.get(folder, folder) - -[Repository %your-gmail-username%-Remote] -maxconnections = 1 -type = Gmail -remoteuser = %your-gmail-username%@gmail.com -remotepasseval = '%your-gmail-API-password%' -## remotepasseval = get_api_pass() -sslcacertfile = /etc/ssl/certs/ca-bundle.crt -realdelete = no -nametrans = lambda folder: {'[Gmail]/Drafts':    'drafts', -                            '[Gmail]/Sent Mail': 'sent', -                            '[Gmail]/Starred':   'flagged', -                            '[Gmail]/Trash':     'trash', -                            '[Gmail]/All Mail':  'archive', -                            }.get(folder, folder) -folderfilter = lambda folder: folder not in ['[Gmail]/Trash', -                                             '[Gmail]/Important', -                                             '[Gmail]/Spam', -                                             ] -``` - -There are two replaceable values in this file: `%your-gmail-username%` and `%your-gmail-API-password%`. Replace the first with your Gmail user name. That's the part of your email address on the left of the `@gmail.com` part. You must acquire the second value from Google through a two-factor authentication (2FA) setup process (even though you don't need to use 2FA to check email). - -### Set up 2FA for Gmail - -Google expects its users to use the Gmail website for email, so when you attempt to access your email outside of Gmail's interface, you're essentially doing so as a developer (even if you don't consider yourself a developer). In other words, you're creating what Google considers an "app." To obtain a developer-level _app password_, you must set up 2FA; through that process, you get an app password, which Mutt can use to log in outside the usual browser interface. - -For safety, you can also add a recovery email address. To do that, go to Google's [Account Security page][15] and scroll down to **Recovery email**. - -To set up 2FA, go back to the Account Security page, and click on **2-step Verification** to activate and configure it. This requires a mobile phone for setup. - -After activating 2FA, you get a new Google Account Security option: **App passwords**. Click on it to create a new app password for Mutt. Google generates the password for you, so copy it and paste it into your `.offlineimaprc` file in the place of the `%your-gmail-API-password%` value. - -Placing your API password in your `.offlineimaprc` file stores it in plain text, which can be dangerous. For a long while, I did this and felt fine about it because my home directory is encrypted. However, in the interest of better security, I now encrypt my API password with GnuPG. That's somewhat beyond the scope of this article, but I've written an article demonstrating how to [set up GPG password integration][16]. - -### Enable IMAP in Gmail - -There's one last thing before you can say goodbye to the Gmail web interface forever: You must enable IMAP access to your Gmail account. - -To do this, go to the Gmail web interface, click the "cog" icon in the upper-right corner, and select **See all settings**. In Gmail **Settings**, click the **POP/IMAP** tab, and enable the radio button next to **Enable IMAP**. Save your settings. - -Now Gmail is configured to give you access to your email outside a web browser. - -### Configure Mutt - -Now that you're all set up for Mutt, you'll be happy to learn that configuring Mutt is the easy part. As with [.bashrc][17], [.zshrc][18], and .emacs files, there are many examples of very good .muttrc files available on the internet. For my configuration file, I borrowed options and ideas from [Kyle Rankin][19], [Paul Frields][20], and many others, so I've abbreviated my .muttrc file to just the essentials in the interest of simplicity: - - -``` -set ssl_starttls=yes -set ssl_force_tls=yes - -set from='[tux@example.com][21]' -set realname='Tux Example' - -set folder = imaps://imap.gmail.com/ -set spoolfile = imaps://imap.gmail.com/INBOX -set postponed="imaps://imap.gmail.com/[Gmail]/Drafts" -set smtp_url="smtp://smtp.gmail.com:25" -set move = no -set imap_keepalive = 900 -set record="imaps://imap.gmail.com/[Gmail]/Sent Mail" - -# Paths -set folder           = ~/.mail -set alias_file       = ~/.mutt/alias -set header_cache     = "~/.mutt/cache/headers" -set message_cachedir = "~/.mutt/cache/bodies" -set certificate_file = ~/.mutt/certificates -set mailcap_path     = ~/.mutt/mailcap -set tmpdir           = ~/.mutt/temp -set signature        = ~/.mutt/sig -set sig_on_top       = yes - -# Basic Options -set wait_key = no -set mbox_type = Maildir -unset move               # gmail does that - -# Sidebar Patch -set sidebar_visible = yes -set sidebar_width   = 16 -color sidebar_new color221 color233 - -## Account Settings -# Default inbox -set spoolfile = "+example.com/INBOX" - -# Mailboxes to show in the sidebar. -mailboxes +INBOX \ -          +sent \ -          +drafts - -# Other special folder -set postponed = "+example.com/drafts" - -# navigation -macro index gi "<change-folder>=example.com/INBOX<enter>" "Go to inbox" -macro index gt "<change-folder>=example.com/sent" "View sent" -``` - -Nothing in this file requires changing, but consider replacing the fake name `Tux Example` and the fake address `example.com` with something that applies to you. Copy and paste this text into a file and save it as `~/.mutt/muttrc`. - -### Launch Mutt - -Before launching Mutt, run `offlineimap` from a terminal to sync your computer with the remote server. The first run of this takes _a long time_, so leave it running overnight. - -Once your account has synchronized, you can launch Mutt: - - -``` -`$ mutt` -``` - -Mutt prompts you for permission to create the directories it needs to organize your email activity and then displays a view of your inbox. - -![Mutt email client][22] - -### Learn Mutt - -Learning Mutt is a mixture of exploring the application and finding your favorite hacks for your .muttrc config. For example, my config file integrates Emacs for composing messages, LDAP so that I can search through contacts, GnuPG so that I can encrypt and decrypt messages, link harvesting, HTML views, and much more. You can make Mutt anything you want it to be (as long as you want it to be an email client), and the more you experiment, the more you discover. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/gmail-linux-terminal - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) -[2]: http://www.mutt.org/ -[3]: https://opensource.com/article/21/5/linux-terminal-multiplexer -[4]: https://protonmail.com -[5]: https://tutanota.com -[6]: https://github.com/tutao/tutanota -[7]: https://protonmail.com/bridge/ -[8]: https://www.redhat.com/sysadmin/configuring-email-server -[9]: https://opensource.com/article/20/11/macports -[10]: https://opensource.com/article/20/6/homebrew-mac -[11]: https://opensource.com/article/20/3/chocolatey -[12]: https://github.com/OfflineIMAP/offlineimap3 -[13]: mailto:git@github.com -[14]: https://pypi.org/project/portalocker -[15]: https://myaccount.google.com/security -[16]: https://opensource.com/article/21/6/enter-invisible-passwords-using-python-module -[17]: https://opensource.com/article/18/9/handy-bash-aliases -[18]: https://opensource.com/article/19/9/adding-plugins-zsh -[19]: https://twitter.com/kylerankin -[20]: https://twitter.com/stickster -[21]: mailto:tux@example.com -[22]: https://opensource.com/sites/default/files/mutt.png (Mutt email client) diff --git a/translated/tech/20210706 Send and receive Gmail from the Linux command line.md b/translated/tech/20210706 Send and receive Gmail from the Linux command line.md new file mode 100644 index 0000000000..d29a72d9ec --- /dev/null +++ b/translated/tech/20210706 Send and receive Gmail from the Linux command line.md @@ -0,0 +1,265 @@ +[#]: subject: (Send and receive Gmail from the Linux command line) +[#]: via: (https://opensource.com/article/21/7/gmail-linux-terminal) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 命令行中收发 Gmail 邮件 +====== +即使你用的是诸如 Gmail 的托管邮件服务,你也可以通过 Mutt 在终端里收发电子邮件。 + +![woman on laptop sitting at the window][1] + +我喜欢在 Linux 终端上读写电子邮件的便捷,因此我是 [Mutt][2] 这个轻量简洁的电子邮件客户端的忠实用户。对于电子邮件服务来说,不同的系统配置和网络接入并不会造成什么影响。这个客户端通常隐藏在我 Linux 终端的[某个标签页或者某个终端复用器的面板][3]上,需要用的时候随时可以调出来,不需要使用的时候放到后台,就不需要在桌面上一直放置一个电子邮件客户端的应用程序。 + +当今我们大多数人使用的都是托管电子邮件账号,在这个在这种使用场景中并不会与电子邮件协议发生过多的直接交互。而 Mutt(以及更早的 ELM)在创立之初实现的是对 `uucp` 的调用,以及对 `/var/mail` 的读取。当然 Mutt 也很与时俱进,随着各种流行的协议(如 POP、IMAP、LDAP)出现,它都实现了良好的支持。因此,即使我们使用的是 Gmail 这种邮件服务,也可以与 Mutt 无缝衔接。 + +在大多数情况下,用户都不会拥有自己的电子邮件服务器,同时大部分用户都会选择 Gmail,因此下文会以 Mutt + Gmail 为例作介绍。如果你比较注重电子邮件隐私,不妨考虑 [ProtonMail][4] 或者 [Tutanota][5],它们都提供完全加密的电子邮件服务。其中 Tutanota 包含很多[开源组件][6],而 ProtonMail 则为付费用户提供 [IMAP 桥][7], 简化了在非浏览器环境下的邮件访问。尽管如此,很多公司、学校和组织都没有自己的电子邮件服务,而是使用 Gmail 提供的邮件服务,这样一来,大部分用户都会有一个 Gmail 邮箱。 + +当然,如果你自己就[拥有电子邮件服务器][8],那么使用 Mutt 就更简单了。下面我们开始介绍。 + +### 安装 Mutt + +在 Linux 系统上,一般可以直接从发行版提供的软件库中安装 Mutt,另外需要在 home 目录中创建一个 `.mutt` 目录以存放配置文件: + + +``` +$ sudo dnf install mutt +$ mkdir ~/.mutt +``` + +在 MacOS 上,可以通过 [MacPorts][9] 或者 [Homebrew][10] 安装;在 Windows 上则可以使用 [Chocolatey][11] 安装。 + +Mutt 是一个邮件用户代理Mail User Agent(MUA),因此它的作用是读取、编写以及向外部邮件池发送邮件,其它邮件应用或者邮件服务则仅仅是负责在用户和邮件服务器之间传递信息,尽管它们可以和 Mutt 进行协作,让我们看起来是邮件应用们实现了所有功能,但实际上并非如此。在弄懂了两者之间的区别之后,我们会对 Mutt 的配置更加清楚。 + +除了 Mutt 之外,我们还需要视乎进行通信的服务种类选择一些辅助应用程序。在本文中我使用的是 IMAP 服务,这可以让我本地的电子邮件副本与电子邮件服务提供商的电子邮件副本保持同步。如果你选择 POP 服务,配置的难度就更下一个台阶了,也无需依赖其它外部工具。我们需要OfflineIMAP 这个 Python 应用程序来实现 IMAP 的集成,这个应用程序可以在[它的 GitHub 存储库][12]获取。 + +OfflineIMAP 目前仍然在从 Python 2 移植到 Python 3,目前需要手动安装,但以后你也可以通过 `python3 -m pip` 命令进行安装。 + +OfflineIMAP 依赖于 `imaplib2` 库,这个库也在开发当中,所以我更喜欢手动安装。同样地,也是通过 Git 将代码库克隆到本地,进入目录后使用 `pip` 安装。 + +首先安装 `rfc6555` 依赖: + + +``` +`$ python3 -m pip install --user rfc6555` +``` + +然后从源码安装 `imaplib2`: + + +``` +$ git clone [git@github.com][13]:jazzband/imaplib2.git +$ pushd imaplib2.git +$ python3 -m pip install --upgrade --user . +$ popd +``` + +最后从源码安装 OfflineIMAP: + + +``` +$ git clone [git@github.com][13]:OfflineIMAP/offlineimap3.git +$ pushd offlineimap3.git +$ python3 -m pip install --upgrade --user . +$ popd +``` + +如果你使用的是 Windows 上的 Cygwin,那么你还需要安装 [Portlocker][14]。 + +### 配置 OfflineIMAP + + OfflineIMAP 默认使用 `~/.offlineimaprc` 这个配置文件,在它的代码库中会有一个名为 `offlineimap.conf` 的配置模板,可以直接将其复制到 home 目录下: + + +``` +`$ mv offlineimap3.git/offlineimap.conf ~/.offlineimaprc` +``` + +你可以使用任何文本编辑器打开浏览这个配置文件,它的注释很完善,便于了解各个可用的配置项。 + +以下是我的 `.offlineimaprc` 配置文件,为了清晰起见,我把其中的注释去掉了。对于你来说其中有些配置项的值可能会略有不同,但或许会为你的配置带来一些启发: + + +``` +[general] +ui = ttyui +accounts = %your-gmail-username% +pythonfile = ~/.mutt/password_prompt.py +fsync = False + +[Account %your-gmail-username%] +localrepository = %your-gmail-username%-Local +remoterepository = %your-gmail-username%-Remote +status_backend = sqlite +postsynchook = notmuch new + +[Repository %your-gmail-username%-Local] +type = Maildir +localfolders = ~/.mail/%your-gmail-username%-gmail.com +nametrans = lambda folder: {'drafts': '[Gmail]/Drafts', + 'sent': '[Gmail]/Sent Mail', + 'flagged': '[Gmail]/Starred', + 'trash': '[Gmail]/Trash', + 'archive': '[Gmail]/All Mail', + }.get(folder, folder) + +[Repository %your-gmail-username%-Remote] +maxconnections = 1 +type = Gmail +remoteuser = %your-gmail-username%@gmail.com +remotepasseval = '%your-gmail-API-password%' +## remotepasseval = get_api_pass() +sslcacertfile = /etc/ssl/certs/ca-bundle.crt +realdelete = no +nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts', + '[Gmail]/Sent Mail': 'sent', + '[Gmail]/Starred': 'flagged', + '[Gmail]/Trash': 'trash', + '[Gmail]/All Mail': 'archive', + }.get(folder, folder) +folderfilter = lambda folder: folder not in ['[Gmail]/Trash', + '[Gmail]/Important', + '[Gmail]/Spam', + ] +``` + +配置文件里有两个可以替换的值,分别是 `%your-gmail-username%` 和 `%your-gmail-API-password%`。其中第一个值需要替换为 Gmail 用户名,也就是邮件地址中 `@gmail.com` 左边的部分。而第二个值则需要通过双因素身份验证(2FA)后从 Google 获取。 + +### 为 Gmail 设置双因素身份验证(2FA) + +Google 希望用户通过 Gmail 网站收发电子邮件,因此当你在 Gmail 网站以外操作电子邮件时,实际上是被 Google 作为“开发者”看待(尽管你没有进行任何开发工作)。也就是说,Google 会认为你正在创建一个应用程序。要获得开发者层面的应用程序密码,就必须设置双因素身份验证。完成了这个过程以后,就可以获得一个应用程序密码,Mutt 可以通过这个密码在浏览器以外的环境登录到你的电子邮箱中。 + +为了安全起见,你还可以在 Google 的[账号安全][15]页面中添加一个用于找回的电子邮件地址。 + +在账号安全页面中,点击“两步验证”(2-step Verification)开始设置 2FA,设置过程中需要用到一部手机。 + +激活 2FA 之后,账号安全页面中会出现“应用程序密码”(App Passwords)选项,点击就可以为 Mutt 创建一个新的应用程序密码。在 Google 生成密码之后,将其替换 `.offlineimaprc` 配置文件中的 `%your-gmail-API-password%` 值。 + +直接将应用程序密码记录在 `.offlineimaprc` 文件中,这种以纯文本形式存储的做法有一定的风险。因为我的 home 目录是加密的,所以我长期以来都是这样做的。但出于安全考虑,我现在已经改为使用 GnuPG 加密应用程序密码,这部分内容不在本文的讨论范围,关于如何设置 GPG 密码集成,可以参考我的[另一篇文章][16]。 + +### 在 Gmail 启用 IMAP + +在启用 IMAP 访问 Gmail 账户之后,你就可以不再打开 Gmail 网站了。 + +在 Gmail 网站页面中,点击右上角的“cog”图标,选择“查看所有设置”(See all settings)。 在 Gmail 设置页面中,点击“POP/IMAP”标签页,并选中“启用 IMAP”(enable IMAP),然后保存设置。 + +现在就可以在浏览器以外访问你的 Gmail 电子邮件了。 + +### 配置 Mutt + +Mutt 的配置过程相对简单。和 [.bashrc][17]、[.zshrc][18]、.emacs 这些配置文件一样,网络上有很多优秀的 .muttrc 配置文件可供参照。我自己的 .muttrc 配置文件则借鉴了 [Kyle Rankin][19]、[Paul Frields][20] 等人的配置项和想法。下面列出我的配置文件的一些要点: + + +``` +set ssl_starttls=yes +set ssl_force_tls=yes + +set from='[tux@example.com][21]' +set realname='Tux Example' + +set folder = imaps://imap.gmail.com/ +set spoolfile = imaps://imap.gmail.com/INBOX +set postponed="imaps://imap.gmail.com/[Gmail]/Drafts" +set smtp_url="smtp://smtp.gmail.com:25" +set move = no +set imap_keepalive = 900 +set record="imaps://imap.gmail.com/[Gmail]/Sent Mail" + +# Paths +set folder = ~/.mail +set alias_file = ~/.mutt/alias +set header_cache = "~/.mutt/cache/headers" +set message_cachedir = "~/.mutt/cache/bodies" +set certificate_file = ~/.mutt/certificates +set mailcap_path = ~/.mutt/mailcap +set tmpdir = ~/.mutt/temp +set signature = ~/.mutt/sig +set sig_on_top = yes + +# Basic Options +set wait_key = no +set mbox_type = Maildir +unset move # gmail does that + +# Sidebar Patch +set sidebar_visible = yes +set sidebar_width = 16 +color sidebar_new color221 color233 + +## Account Settings +# Default inbox +set spoolfile = "+example.com/INBOX" + +# Mailboxes to show in the sidebar. +mailboxes +INBOX \ + +sent \ + +drafts + +# Other special folder +set postponed = "+example.com/drafts" + +# navigation +macro index gi "<change-folder>=example.com/INBOX<enter>" "Go to inbox" +macro index gt "<change-folder>=example.com/sent" "View sent" +``` + +整个配置文件基本是开箱即用的,只需要将其中的 `Tux Example`和 `example.com` 替换为你的实际值,并将其保存为 `~/.mutt/muttrc` 就可以使用了。 + +### 启动 Mutt + +在启动 Mutt 之前,需要先启动 `offlineimap` 将远程邮件服务器上的邮件同步到本地。在首次启动的时候耗时可能会比较长,只需要让它默默运行直到同步完成就可以了。 + +在同步完成后,启动 Mutt: + + +``` +`$ mutt` +``` + +Mutt 会提示你打开用于管理电子邮件的目录权限,并展示收件箱的视图。 + +![Mutt email client][22] + +### 学习使用 Mutt + +在学习使用 Mutt 的过程中,你可以找到最符合你使用习惯的 .muttrc 配置。例如我的 .muttrc 配置文件集成了使用 Emacs 编写邮件、使用 LDAP 搜索联系人、使用 GnuPG 对邮件进行加解密、链接获取、HTML 视图等等一系列功能。你可以让 Mutt 做到任何你想让它做到的事情,你越探索,就能发现越多。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/gmail-linux-terminal + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: http://www.mutt.org/ +[3]: https://opensource.com/article/21/5/linux-terminal-multiplexer +[4]: https://protonmail.com +[5]: https://tutanota.com +[6]: https://github.com/tutao/tutanota +[7]: https://protonmail.com/bridge/ +[8]: https://www.redhat.com/sysadmin/configuring-email-server +[9]: https://opensource.com/article/20/11/macports +[10]: https://opensource.com/article/20/6/homebrew-mac +[11]: https://opensource.com/article/20/3/chocolatey +[12]: https://github.com/OfflineIMAP/offlineimap3 +[13]: mailto:git@github.com +[14]: https://pypi.org/project/portalocker +[15]: https://myaccount.google.com/security +[16]: https://opensource.com/article/21/6/enter-invisible-passwords-using-python-module +[17]: https://opensource.com/article/18/9/handy-bash-aliases +[18]: https://opensource.com/article/19/9/adding-plugins-zsh +[19]: https://twitter.com/kylerankin +[20]: https://twitter.com/stickster +[21]: mailto:tux@example.com +[22]: https://opensource.com/sites/default/files/mutt.png (Mutt email client) From c318a39e82ee7b65f3a4ebf9e924df7f76e9b732 Mon Sep 17 00:00:00 2001 From: zouchong Date: Fri, 9 Jul 2021 17:15:03 +0800 Subject: [PATCH 355/870] translated --- ...210706 Send and receive Gmail from the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20210706 Send and receive Gmail from the Linux command line.md b/translated/tech/20210706 Send and receive Gmail from the Linux command line.md index d29a72d9ec..f319be23e2 100644 --- a/translated/tech/20210706 Send and receive Gmail from the Linux command line.md +++ b/translated/tech/20210706 Send and receive Gmail from the Linux command line.md @@ -234,7 +234,7 @@ via: https://opensource.com/article/21/7/gmail-linux-terminal 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[HankChow](https://github.com/HankChow) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 118dcb78d93ce4d3c10c0d9809b9e0fb6bdba3f8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Jul 2021 05:03:56 +0800 Subject: [PATCH 356/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210709=20?= =?UTF-8?q?OS=20Chroot=20101:=20covering=20btrfs=20subvolumes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210709 OS Chroot 101- covering btrfs subvolumes.md --- ...S Chroot 101- covering btrfs subvolumes.md | 261 ++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 sources/tech/20210709 OS Chroot 101- covering btrfs subvolumes.md diff --git a/sources/tech/20210709 OS Chroot 101- covering btrfs subvolumes.md b/sources/tech/20210709 OS Chroot 101- covering btrfs subvolumes.md new file mode 100644 index 0000000000..01b092cc57 --- /dev/null +++ b/sources/tech/20210709 OS Chroot 101- covering btrfs subvolumes.md @@ -0,0 +1,261 @@ +[#]: subject: (OS Chroot 101: covering btrfs subvolumes) +[#]: via: (https://fedoramagazine.org/os-chroot-101-covering-btrfs-subvolumes/) +[#]: author: (yannick duclap https://fedoramagazine.org/author/cybermeme/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +OS Chroot 101: covering btrfs subvolumes +====== + +![][1] + +OS chroot command allows you to mount and run another Gnu/Linux from within your current Gnu/Linux. It does this by mounting nested partition(s) within your system and it gives you a shell which allows access to this chrooted OS. This will allow you to manage or debug another Gnu/Linux from your running Fedora Linux + +### Intro + +##### Disclaimer + +When I say _chroot_, I mean the command, and _chrootDir_ a folder. _OSext_ is the external OS to work with. All the following commands are executed as superuser. For extra readability I removed the sudo at the beginning, just don’t forget to be superadmin when performing the tasks. […] means I cut some terminal output. + +First I’m going to review how to do a chroot on a classic filesystem (ext4, xfs, fat, etc) and then we’ll see how to do it on our brand new standard Btrfs and its subvolumes. + +The process is similar to that used to [change the root password][2], or that we may use to repair a corrupted fstab (it happens, trust me). We can also use the chroot command to mount a Gnu/Linux in our Fedora Linux in order to perform operations (updates, file recovery, debugging, etc). + +#### A few explanations + +The [chroot][3] command lets you “change” temporarily the root location. This lets you partition a service or a user in the directory tree. + +When you use _chroot_ to run a mounted Gnu/Linux OS, in order for it to be fully functional, you have to mount the special system folders in their “original places in the directory tree” in the chrootDir. This allows the chrooted OS to talk to the kernel. + +These special system folders are: + + * _/dev_ for the devices; + * _/proc_ which contains the information about the system (kernel and process); + * _/sys_ which contains the information about the hardware. + + + +For example, _/dev_ has to be mounted in _chrootDir/dev_. + +As I always learn better by practicing, let’s do some hands on. + +### Filesystems without btrfs subvolumes + +#### The classic method + +In the following example, the partition we are going to mount is the OSext root (_/_). This is located in _/dev/vda2_ and we will mount it in the chrootDir (_/mnt_) directory. _/mnt_ is not a necessity, you can also mount the partition somewhere else. + +``` +# mount /dev/vda2 /mnt +# mount --bind /dev /mnt/dev +# mount -t proc /proc /mnt/proc +# mount -t sysfs /sys /mnt/sys +# mount -t tmpfs tmpfs /mnt/run +# mkdir -p /mnt/run/systemd/resolve/ +# echo 'nameserver 1.1.1.1' > /mnt/run/systemd/resolve/stub-resolv.conf +# chroot /mnt +``` + +The _–bind_ option makes the contents accessible in both locations, _-t_ defines the filesystem type. See the [manpage][4] for more information. + +We will mount _/run_ as _tmpfs_ (in the memory) because we are using systemd-resolved (this is the default now in Fedora). Then we will create the folder and the file _stub-resolv.conf,_ which is associated by a symbolic link to /_etc/resolv.conf_. This file contains the resolver IP. In this example, the resolver is 1.1.1.1, but you can use any resolver IP you like. + +To exit the chroot, the shell command is _exit_. After that, we unmount all the folders we just mounted: + +``` +exit +# umount /mnt/dev +# umount /mnt/proc +# umount /mnt/sys +# umount /mnt/run +# umount /mnt +``` + +#### The case of lvm + +In the case of lvm, the partitions are not available directly and must be mapped first. + +``` +# fdisk -l /dev/vda2 +Disk /dev/vda2: 19 GiB, 20400046080 bytes, 39843840 sectors +[...] +I/O size (minimum/optimal): 512 bytes / 512 bytes + +# mount /dev/vda2 /mnt/ +mount: /mnt: unknown filesystem type 'LVM2_member'. +``` + +As you can see, we are not able to mount _/dev/vda2_ directly. We will now use the lvm tools to locate our partitions. + +``` +# pvscan +PV /dev/vda2 VG cl lvm2 [<19.00 GiB / 0 free] +Total: 1 [<19.00 GiB] / in use: 1 [<19.00 GiB] / in no VG: 0 [0] + +# vgscan +Found volume group "cl" using metadata type lvm2 + +# lvscan +ACTIVE '/dev/cl/root' [10.00 GiB] inherit +ACTIVE '/dev/cl/swap' [2.00 GiB] inherit +ACTIVE '/dev/cl/home' [1.00 GiB] inherit +ACTIVE '/dev/cl/var' [<6.00 GiB] inherit +``` + +So here we can see where the logical volumes are mapped _/dev/cl_ and we can mount these partitions like we did before, using the same method: + +``` +# mount /dev/cl/root /mnt/ +# mount /dev/cl/home /mnt/home/ +# mount /dev/cl/var /mnt/var/ +# mount --bind /dev /mnt/dev +# mount -t proc /proc /mnt/proc +# mount -t sysfs /sys /mnt/sys +# mount -t tmpfs tmpfs /mnt/run +# mkdir -p /mnt/run/systemd/resolve/ +# echo 'nameserver 1.1.1.1' > /mnt/run/systemd/resolve/stub-resolv.conf +# chroot /mnt +``` + +### Btrfs filesystem with subvolumes + +#### Overview of a btrfs partition with subvolumes + +Let’s have a look at the filesystem. + +Fdisk tells us that there are only two partitions on the physical media. + +``` +# fdisk -l +Disk /dev/vda: 20 GiB, 21474836480 bytes, 41943040 sectors + […] + Device Boot Start End Sectors Size Id Type + /dev/vda1 * 2048 2099199 2097152 1G 83 Linux + /dev/vda2 2099200 41943039 39843840 19G 83 Linux +``` + +Here are the contents of the target system’s fstab (OSext): + +``` +UUID=3de441bd-59fc-4a12-8343-8392faab5ac7 / btrfs subvol=root,compress=zstd:1 0 0 +UUID=71dc4f0f-9562-40d6-830b-bea065d4f246 /boot ext4 defaults 1 2 +UUID=3de441bd-59fc-4a12-8343-8392faab5ac7 /home btrfs subvol=home,compress=zstd:1 0 0 +``` + +Looking at the _UUID_s in the _fstab_, we can see that there are two different ones. + +One is an ext4, used here for _/boot_ and the other is a btrfs containing two mount points (the subvolumes), _/_ and _/home_. + +#### Overview of a btrfs filesystem with subvolumes + +Let’s have a look at what is in the btrfs partition (_/dev/vda2_ here) by mounting it directly: + +``` +# mount /dev/vda2 /mnt/ +# ls /mnt/ +home root + +# ls /mnt/root/ +bin dev home lib64 media opt root sbin sys usr +boot etc lib lost+found mnt proc run srv tmp var + +# ls /mnt/home/ +user + +# umount /mnt +``` + +Here we can see that in the mounted partition there are two folders (the subvolumes), that contain lots of different directories (the target file hierarchy). + +To get this information about the subvolumes, there is a much more elegant way. + +``` +# mount /dev/vda2 /mnt/ + +# btrfs subvolume list /mnt +ID 256 gen 178 top level 5 path home +ID 258 gen 200 top level 5 path root +ID 262 gen 160 top level 258 path root/var/lib/machines + +# umount /mnt +``` + +#### Practical chroot with btrfs subvolumes + +Now that we’ve had a look at the contents of our partition, we will mount the system on chrootDir (_/mnt_ in the example). We will do this by adding the mount type as btrfs and the option for subvolume _subvol=SubVolumeName_. We will also add the special system folders and other partitions in the same way. + +``` +# mount /dev/vda2 /mnt/ -t btrfs -o subvol=root + +# ls /mnt/ +bin dev home lib64 media opt root sbin sys usr +boot etc lib lost+found mnt proc run srv tmp var + +# ls /mnt/home/ + + +# mount /dev/vda2 /mnt/home -t btrfs -o subvol=home + +# ls /mnt/home/ +user + +# mount /dev/vda1 /boot +# mount --bind /dev /mnt/dev +# mount -t proc /proc /mnt/proc +# mount -t sysfs /sys /mnt/sys +# mount -t tmpfs tmpfs /mnt/run +# mkdir -p /mnt/run/systemd/resolve/ +# echo 'nameserver 1.1.1.1' > /mnt/run/systemd/resolve/stub-resolv.conf +# chroot /mnt +``` + +When the job is done, we use the shell command _exit_ and unmount all previously mounted directories as well as the chrootDir itself (_/mnt_). + +``` +exit +# umount /mnt/boot +# umount /mnt/sys +# umount /mnt/proc +# umount /mnt/sys +# umount /mnt/run +# umount /mnt +``` + +### Conclusion + +As you can see on the screenshot below, I performed a dnf update on a Fedora Linux 34 Workstation from a live [Fedora 33 security lab CD][5], that way, if a friend needs you to debug his/her/their Gnu/Linux, he/she/they just have to bring the hard drive to you and not the whole desktop/server machine. + +![][6] + +Be careful if you use a different shell between your host OS and OSext (the chrooted OS), for example ksh <-> bash. +In this case you’ll have to make sure that both systems have the same shell installed. + +I hope this will be useful to anyone needing to debug, or if you just need to update your other Fedora Linux in your dual boot and don’t want to have to restart 😉 + +This article just referred to a part of btrfs, for more information you can have a look at the the [wiki][7] which will give you all the information you need. + +Have fun chrooting. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/os-chroot-101-covering-btrfs-subvolumes/ + +作者:[yannick duclap][a] +选题:[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/cybermeme/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/chroot-btrfs-816x345.jpg +[2]: https://fedoramagazine.org/reset-root-password-fedora/ +[3]: https://man7.org/linux/man-pages/man2/chroot.2.html +[4]: https://man7.org/linux/man-pages/man8/mount.8.html +[5]: https://labs.fedoraproject.org/security/download/index.html +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/fedoraSecurity.png +[7]: https://fedoraproject.org/wiki/Btrfs From cb347bf6b30dc475afe9e08041e81c1c24cc0d93 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Jul 2021 05:04:26 +0800 Subject: [PATCH 357/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210709=20?= =?UTF-8?q?What=20you=20need=20to=20know=20about=20security=20policies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210709 What you need to know about security policies.md --- ...ou need to know about security policies.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20210709 What you need to know about security policies.md diff --git a/sources/tech/20210709 What you need to know about security policies.md b/sources/tech/20210709 What you need to know about security policies.md new file mode 100644 index 0000000000..43920a4927 --- /dev/null +++ b/sources/tech/20210709 What you need to know about security policies.md @@ -0,0 +1,90 @@ +[#]: subject: (What you need to know about security policies) +[#]: via: (https://opensource.com/article/21/7/what-security-policy) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What you need to know about security policies +====== +Learn about protecting your personal computer, server, and cloud systems +with SELinux, Kubernetes pod security, and firewalls. +![Lock][1] + +A **security policy** is a set of permissions that govern access to a system, whether the system is an organization, a computer, a network, an application, a file, or any other resource. Security policies often start from the top down: Assume nobody can do anything, and then allow exceptions. + +On a desktop PC, the default policy is that no user may interact with the computer until after logging in. Once you've successfully logged in, you inherit a set of digital permissions (in the form of metadata associated with your login account) to perform some set of actions. The same is true for your phone, a server or network on the internet, or any node in the cloud. + +There are security policies designed for filesystems, firewalls, services, daemons, and individual files. Securing your digital infrastructure is a job that's never truly finished, and that can seem frustrating and intimidating. However, security policies exist so that you don't have to think about who or what can access your data. Being comfortably familiar with potential security issues is important, and reading through known security issues (such as NIST's great [RSS feed][2] for [CVE entries][3]) over your [power breakfast][4] can be more eye-opening than a good cup of coffee, but equally important is being familiar with the tools at your disposal to give you sensible defaults. These vary depending on what you're securing, so this article focuses on three areas: your personal computer, the server, and the cloud. + +### SELinux + +[SELinux][5] is a **labeling system** for your personal computer, servers, and the Linux nodes of the cloud. On a modern Linux system running SELinux, every process has a label, as does every file and directory. In fact, any system object gets a label. Luckily, you're not the one who has to do the labeling. These labels are created for you automatically by SELinux. + +Policy rules govern what access is granted between labeled **processes** and labeled **objects**. The kernel enforces these rules. In other words, SELinux can ensure that an action is safe whether a user appears to deserve the right to perform that action or not. It does this by understanding what processes are permitted. This protects a system from a bad actor who gains escalated permissions—whether it's through a security exploit or by wandering over to your desk after you've gotten up for a coffee refill—by understanding the expected interactions of all of your computer's components. + +For more information about SELinux, read our [illustrated guide to SELinux][6] by Dan Walsh. To learn more about using SELinux, read [A sysadmin's guide to SELinux][7] by Alex Callejas, and download our free [SELinux cheat sheet][8]. + +### Kubernetes pod security + +In the world of the Kubernetes cloud, there are **Security Policies** and **Security Contexts**. + +Pod [Security Policies][9] are an implementation of Kubernetes pod security resources. They are built-in resources that describe specific conditions that pods must conform to in order to be accepted and scheduled. For example, Pod Security Policies can leverage restrictions on which types of volumes a pod may be allowed to mount or what user or group IDs the pod is not allowed to use. Unlike Security Contexts, these are restrictions controlled by the cluster's Control Plane that decide if a given pod is allowed within the Kubernetes system, even before it is created. If the pod spec does not meet the requirements of the Pod Security Policy, it is rejected. + +[Security Contexts][10] are similar to Pod Security Policies, in that they describe what a pod or container can and cannot do but in the context of the container runtime. Recall that the Pod Security Policies are enforced in the Control Plane. Security Contexts are provided in the spec of the pod and describe to the container runtime (e.g., Docker, CRI-O, etc.) specifically how the pod should run. There's a lot of overlap in the kinds of restrictions found in Pod Security Policies and Security Contexts. The former can be thought of as "these are the things a pod in this policy may do," while the latter is "this pod must be run with these specific rules." + +#### The state of Pod Security Policies + +Pod Security Policies are deprecated and will be removed in Kubernetes 1.25. In April 2021, Tabitha Sable of Kubernetes SIG Security wrote about the [deprecation and replacement of Pod Security Policies][11]. There's an open pull request that describes proposed [Kubernetes enhancements][12] with a new admission controller to enforce pod security standards, which is suggested as the replacement for the deprecated Pod Security Policies. The architecture acknowledges, however, that there's a large ecosystem of add-ons and complementary services that can be mixed and matched to provide coverage that meets an organization's needs. + +For now, Kubernetes has published [Pod Security Standards][13] describing the overall concept of layered policy types, from totally unrestricted **Privileged** pods to minimally restricted **Baseline** and then heavily **Restricted** policies, and publishing these example policies as Pod Security Policies. The documentation describes what restrictions make up these different profiles and provide an excellent starting point to get familiar with different types of restrictions that might be applied to a pod to increase security. + +#### Future of security policies + +The future of pod security in Kubernetes will likely include an admission controller like the one proposed in the enhancement PR and a mix of add-ons for tweaking and adjusting how pods run in the cluster, such as [Open Policy Agent][14] (OPA). Kubernetes is extremely flexible given just how complicated its job is, and this change follows the same pattern that has allowed Kubernetes to be so successful: managing container orchestration well and allowing an entire ecosystem of add-ons and tools to enhance and extend the core so that it is not a one-size-fits-all solution. + +### Firewalls + +Protecting your network is just as important as protecting the computers inside it. For that, there are firewalls. Some firewalls come embedded in routers, but computers have firewalls too, and in large organizations, they run the firewall for the entire network. + +Typical firewall policies are constructed by denying all traffic, followed by judicious exceptions for necessary incoming and outgoing communication. Individual users can learn more about the `firewall-cmd` in Seth Kenlon's [Getting started with Linux firewalls][15]. Sysadmins can learn more about firewalls in Seth's [Secure your network with firewall-cmd][16]. And both users and admins can benefit from our free [firewall-cmd cheat sheet][17]. + +### Security policies + +Security policies are important for protecting people and their data no matter what the system. Buildings and tech conferences need security policies to keep people physically safe, and computers need security policies to keep data safe from abuse. + +Spend some time thinking about the security of the systems in your life, getting familiar with the default policies, and choosing your level of comfort for the different risks you identify. Then establish a security policy, and stick to it. As with [backup plans][18], security won't get addressed unless it's _easy_, so make it second nature to maintain good security practices. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/what-security-policy + +作者:[Chris Collins][a] +选题:[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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://nvd.nist.gov/feeds/xml/cve/misc/nvd-rss-analyzed.xml +[3]: https://nvd.nist.gov/vuln/data-feeds#APIS +[4]: https://opensource.com/article/21/6/breakfast +[5]: https://en.wikipedia.org/wiki/Security-Enhanced_Linux +[6]: https://opensource.com/business/13/11/selinux-policy-guide +[7]: https://opensource.com/article/18/7/sysadmin-guide-selinux +[8]: https://opensource.com/downloads/cheat-sheet-selinux +[9]: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ +[10]: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ +[11]: https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/ +[12]: https://github.com/kubernetes/enhancements/issues/2579 +[13]: https://kubernetes.io/docs/concepts/security/pod-security-standards/ +[14]: https://www.openpolicyagent.org/ +[15]: https://opensource.com/article/20/2/firewall-cheat-sheet +[16]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[17]: https://opensource.com/downloads/firewall-cheat-sheet +[18]: https://opensource.com/article/19/3/backup-solutions From 064c951b0f5f2ce0de051e184e6e5b200f3071f2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Jul 2021 05:04:41 +0800 Subject: [PATCH 358/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210709=20?= =?UTF-8?q?Troubleshooting=20bugs=20in=20an=20API=20implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210709 Troubleshooting bugs in an API implementation.md --- ...eshooting bugs in an API implementation.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210709 Troubleshooting bugs in an API implementation.md diff --git a/sources/tech/20210709 Troubleshooting bugs in an API implementation.md b/sources/tech/20210709 Troubleshooting bugs in an API implementation.md new file mode 100644 index 0000000000..a8f5885c8d --- /dev/null +++ b/sources/tech/20210709 Troubleshooting bugs in an API implementation.md @@ -0,0 +1,99 @@ +[#]: subject: (Troubleshooting bugs in an API implementation) +[#]: via: (https://opensource.com/article/21/7/listing-prefixes-s3-implementations) +[#]: author: (Alay Patel https://opensource.com/users/alpatel) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Troubleshooting bugs in an API implementation +====== +Different API versions can cause unexpected problems. +![magnifying glass on computer screen, finding a bug in the code][1] + +As distributed and cloud computing adoption increase, things are intrinsically getting harder to debug. This article shares a situation where you would expect a library to safeguard against different versions of an API. However, it didn't and it caused unexpected behavior that was very hard to debug. This might be a useful example of how ripping out layers of abstractions is sometimes necessary to get to the root cause of a problem in a systematic manner. + +The S3 (Simple Storage Solution) API is an industry standard that provides the capability to interact with cloud storage programmatically. Many cloud providers implement it as one of the ways to interact with the object-store. Having different vendors to choose from is good to avoid vendor lock-in. Also, having different implementations to choose from means you get to select open source implementations of the popular standard that works best for you and your team. + +However, the differences in API versions may cause unexpected problems, as we learned. This article leverages those differences to illustrate the troubleshooting process. + +### Konveyor Crane + +[Crane][2] is part of the [Konveyor community][3], which works to solve problems related to app modernization and portability to further the adoption of Kubernetes. Crane allows users to migrate applications (and the associated data) deployed on OpenShift 3 to OpenShift 4. Behind the scenes, it uses [Velero][4] to orchestrate the migration. Velero uses the object store to perform backup and restore operations. + +### How Velero stores data + +Velero can be configured to use a bucket from the object store as a backup storage location (where backup data is stored). Velero organizes backups in a directory called `/backups` (with `prefix` being configurable). Under the `backups` directory, Velero creates a separate directory for each backup, e.g., `/backups/`. + +Additionally, to ensure that a backup created in the object store is available in the cluster and available for restoration, Velero makes a prefix list of all the directories under `backups`. It uses the ListObjectsV2 S3 API to implement this. The [ListObjectsV2][5] API differs from the [ListObjects][6] API in how it handles pagination. + +### How API differences produced a bug + +The differences between these two API versions are subtle. First, clients see the difference in the request that they send to the S3 server. When requesting a ListObjectV2, the client sends something like this: + + +``` +GET /?list-type=2&delimiter=Delimiter&prefix=Prefix +HTTP/1.1 +Host: Bucket.s3.example.objectstorage.softlayer.net +x-amz-request-payer: RequestPayer +x-amz-expected-bucket-owner: ExpectedBucketOwner +``` + +For ListObjects, the request looks very similar, but it's missing `list-type=2`: + + +``` +GET /?delimiter=Delimiter&marker=Marker&prefix=Prefix +HTTP/1.1 +Host: Bucket.s3.example.objectstorage.softlayer.net +x-amz-request-payer: RequestPayer +x-amz-expected-bucket-owner: ExpectedBucketOwner +``` + +For a server that ignores the `list-type=2` parameter, it is easy to respond to a basic ListObjectsV2 call with a ListObject response type. + +The interesting difference between the API versions' response types is how pagination is implemented. Both versions share a common field called `isTruncated` in the response; this indicates whether the server has sent a complete set of keys in its response. In ListObjectsV2, this field is used along with the `NextContinuousToken` field to get the next page (and, hence, the next set of keys) and is iterated upon until the `isTruncated` field is false. However, in ListObjects API, the `NextMarker` field is used instead. There are subtle differences in how this is implemented. + +### Our observations + +When we observed the Velero debug logs, we discovered 555 total backup objects were found. However, when we ran the [s3cmd][7] command against the same bucket to list objects, it returned 788. After looking at the debug logs of the s3cmd command-line interface (CLI), we found that the s3cmd could talk to the server using ListObjects. We also noticed that the last field on the first page of the s3cmd debug log was the last field Velero saw in its list. This immediately rang bells that pagination is not implemented correctly with the ListObjectsV2 API. + +In a ListObjectsV2 API, the `NextContinuousToken` field is used to take the client to the next page, and the `ListObjectV2Pages` method in the `aws-go-sdk` uses this field in its implementation. The logic is: if the `NextContinuousToken` field is empty, no more pages exist, so set `LastPage=true`. + +Considering that a server could send a ListObject response without a `NextContinuousToken` set on a ListObjectV2Pages API call, it is clear that if the response is pagination with a ListObject response, ListObjectsV2Pages will read only the first page. This is exactly what happened and was verified by observing it in a debugger using a [sample program][8]. + +Simply by changing Velero's implementation to use the ListObjectsPages method (which uses the ListObjects API), Velero was able to report a backup count of 788, which was consistent with the s3cmd CLI. + +Because of this semantic difference, the customer's migration efforts were blocked. The root cause stemmed from the libraries being used, and the analysis unblocked the customer. + +### Conclusion + +This case study shows how implementations of something as widely adopted as the S3 API could have bugs and can cause problems in unexpected ways. + +To follow the technical analysis of how Konveyor's development team is solving modernization and migration issues, check out our engineering [knowledge base][9]. For updates on the Konveyor tools, join the community at [konveyor.io][10] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/listing-prefixes-s3-implementations + +作者:[Alay Patel][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alpatel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga (magnifying glass on computer screen, finding a bug in the code) +[2]: https://www.konveyor.io/crane +[3]: https://www.redhat.com/en/blog/red-hat-and-ibm-research-launch-konveyor-project +[4]: https://velero.io/ +[5]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html +[6]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html +[7]: https://s3tools.org/usage +[8]: https://gist.github.com/alaypatel07/c2a1f34095813e8887ddcb3f6e90d262 +[9]: http://engineering.konveyor.io/ +[10]: https://konveyor.io/ From 7812c846674e96e2261c390284edb67bc715fe7e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Jul 2021 05:04:56 +0800 Subject: [PATCH 359/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210709=20?= =?UTF-8?q?Apply=20lean=20startup=20principles=20to=20your=20open=20source?= =?UTF-8?q?=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210709 Apply lean startup principles to your open source project.md --- ... principles to your open source project.md | 224 ++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 sources/tech/20210709 Apply lean startup principles to your open source project.md diff --git a/sources/tech/20210709 Apply lean startup principles to your open source project.md b/sources/tech/20210709 Apply lean startup principles to your open source project.md new file mode 100644 index 0000000000..3294521866 --- /dev/null +++ b/sources/tech/20210709 Apply lean startup principles to your open source project.md @@ -0,0 +1,224 @@ +[#]: subject: (Apply lean startup principles to your open source project) +[#]: via: (https://opensource.com/article/21/7/lean-startup-open-source) +[#]: author: (Ip Sam https://opensource.com/users/ipkeisam) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Apply lean startup principles to your open source project +====== +Lean startup principles help you manage your open source project with +efficiency and success. +![Mobile devices are a big part of our daily lives][1] + +There are a lot of benefits to starting an open source project. In general, open source projects benefit from collaboration, adoption, transparency, lower ownership costs, development best practices, more contributors and reviewers, and better quality. + +When you contribute to open source projects, you can build your technical and leadership skills, get good experience for your resume, learn new development tools, understand industry trends, work with top engineers around the world, gain mentorship opportunities, meet people with similar interests, improve your people skills, and more. + +When you develop your own open source project, you are much like the CEO of a startup company, and many startups use lean principles. This article demonstrates how you can apply lean startup principles to develop and advance your open source projects. + +### Come up with a good open source idea + +When brainstorming a good open source idea, consider three domains: industry, inventory, and customers. You want to come up with an idea at the intersection of these domains. For example, I am working on an open source project for the hybrid cloud. Cloud computing is my industry. Inventory could be the set of Ansible playbooks available for the cloud computing industry. The customers could be my OpenShift clients interested in using Ansible playbooks to set up their hybrid cloud infrastructure. These get me to the intersection of the three domains, and this could be a great open source idea. + +![A good open source idea][2] + +(Ip Sam, [CC BY-SA 4.0][3]) + +Once you identify your open source idea, start developing a proof of concept (PoC) prototype project, put it into a Git repository, and create the project's backlog: + + 1. Start a simple PoC prototype. + 2. Push the PoC into a public GitHub repository. + 3. Create your README, LICENSE, CONTRIBUTING, and CODE_OF_CONDUCT files. + 4. Set up high-level epics and stories in Jira. + + + +Next, start working on positioning your open source idea for long-term success. Consider your competitors' offerings, customers' needs, and company capabilities. For example, if I know customers want to do cloud automation in an OpenShift cluster, I understand the customers' needs. My team's capabilities are producing Ansible automation to automate OpenShift cluster installation and upgrades. And I need to make sure no competitors are doing similar work. In my open source project, I use Ansible for automation. Other companies may be using shell scripts or PowerShell scripts. Even though they are developing automation technologies, their offerings do not directly interfere with what my open source project is doing. Therefore, I can get into the sweet spot below. + +![Position your open source idea][4] + +(Ip Sam, [CC BY-SA 4.0][3]) + +### Use lean startup principles + +Managing risks is important for an open source project. At any time, a project can lose funding, people, and resources. Business requirements and scope can change. Release schedules can be delayed or canceled. Timelines can change with a lot of uncertainty. As the CEO of your open source project, you can use lean startup principles to minimize risks and maximize profits for your project. + +The lean startup principles focus on developing the minimal viable project (MVP) that gives you value from production as soon as possible. It also pushes for smaller release cycles and fast iteration. Using validated learning through feedback loops from production, you can validate your open source project and make modifications as product data becomes available. + +In the lean startup cycle, first, you come up with your open source idea. Then you convert your idea into code by doing a simple MVP. In between, you set up the build phase (where you build unit tests to ensure the quality of your code), continuous integration/continuous development (CI/CD) pipelines for automated deployments, the cloud computing infrastructure, the developer sandbox, and other development best practices. These are part of your build phase to enable your developers to code faster. + +You need to measure everything from coding to production data. For example, measure the MVP's usability to make sure end users can use it properly. Use monitoring and alerts so that you know when production issues occur. Static code analysis helps you catch code issues and security vulnerabilities. Finally, use feedback data from product users and stakeholders; it helps you measure faster. + +All of this data enables you to learn about your project. You can learn faster by doing more customer interviews or working with customers during development cycles. You can also learn faster by setting up cross-functional teams with other business departments. As you go through the lean startup cycles again in the second iteration, you should be able to code faster, measure faster, and learn faster than in the first iteration. + +![The lean startup cycle diagram][5] + +(Ip Sam, [CC BY-SA 4.0][3]) + +Lean startup methodologies help you create an idea, formulate hypotheses from your idea, create an MVP, and test the MVP to validate your hypotheses. Then you go through what you learned to fine-tune your hypotheses and start your second iteration. + +![Lean startup methodologies][6] + +(Ip Sam, [CC BY-SA 4.0][3]) + +Lean startup is a combination of customer development and agile development. It supports faster iterative development cycles and incremental product development. + +### Leverage design thinking, lean startup, and agile + +![Lean startup and agile][7] + +(Ip Sam, [CC BY-SA 4.0][3]) + +The figure below shows the three cycles of design thinking, lean startup, and agile. The first part is always design thinking (the green cycle), where you gather requirements to define your idea. Often, these come from product managers. Then you move to the lean startup (blue) cycle, where you come up with prototypes, do some experiments, and go through the learning period. Based on your learning, you can enter the agile (yellow) cycle. These often involve the typical two-week sprints, coming up with stories in your product backlogs, bringing stories from the backlog to sprint planning, doing sprint execution, moving stories to completion, and shipping incremental products to production by doing a deployment. At the end, you have the sprint review, sprint demo, and sprint retrospective. After completing the agile cycle, you go back to the blue cycle to begin the build process, measurement, and the next iteration. + +![Design thinking, lean startup, and agile cycles together][8] + +(Ip Sam, [CC BY-SA 4.0][3]) + +Often, you have multiple MVPs before you get to the final product. Use customer feedback and product data to shape the next MVP version. + +![Lean startup MVPs][9] + +(Ip Sam, [CC BY-SA 4.0][3]) + +The project management triangle helps you maintain product quality. Scope, cost, and time are the corners of the triangle. The shape of the triangle represents product quality. If you reduce your scope and costs, the triangle's shape will change, meaning your quality will decrease. + +![Lean project management][10] + +(Ip Sam, [CC BY-SA 4.0][3]) + +Lean startup principles can help you manage scope, cost, and time. By doing each release with the lean startup principles, you can get to incremental changes, small release cycles, small release feature sets, and feedback loops. For each idea, measure if it works, is making money, and generating business value. If your answer to each is yes, begin the reinvestment process to generate more new ideas. + +![Lean releases][11] + +(Ip Sam, [CC BY-SA 4.0][3]) + +### Recruit contributors and build a team + +Project marketing is an important starting point for recruiting contributors and investors into your open source project. Learn how to sell your project, present it at major conferences and events, and demo your PoC or MVP at local developer meetups. If you work for a large organization, you may be able to turn it into an internal project. + +Different people with different backgrounds, working styles, and cultures will come into your project, and your goal is to develop them into a high-performing team. The team will go through learning curves as it finds how to work together. For example, when you get new team members, your team's current working style may not fit them well, and you might get resistance. When individuals do not want to get out of their comfort zone to learn new skills, you might also get resistance. This might create a chaos situation, where team members disagree about how to do things. The team may split into different camps with different ideas. This brings team performance to the lowest point of the team maturity curve. When you reach the lowest point, listen to team members and work to understand their ideas and why people push back, then transform the different ideas into action items. You can leverage voting systems or use product data to validate the ideas. As conflicts are resolved, the team members will start to work better together and integrate their different ways of working into the overall team culture. This is where your team will reach a new status quo and team maturity. + +![Team maturity graph][12] + +(Ip Sam, [CC BY-SA 4.0][3]) + +The lean team management method can help you achieve team maturity. It leverages four levers of control: believe, boundary, measurement, and interactive. + + * **Believe:** This is your team's set of core values. For example, my team believes in quality as a requirement for each product. Therefore, quality is the team's core value. + * **Boundaries:** These relate to setting rules based on core values. For example, my team believes in quality, and we set rules to require unit and integration tests for each code change before committing it into the Git repository. This becomes a boundary for the team. If somebody checks in code without a test, that person is not following the rule, and it's time for you to educate the team members. + * **Measurement:** This includes key performance indicators (KPIs), targets, and budget. For example, my team's KPIs include measuring story cycle time in the sprint, story release time, defect rates, test coverage rate, and product issues. + * **Interactive:** The interactive process is where you revise the product based on your last cycle. Then you start the next iteration for the next set of core values. + + + +![Lean team management][13] + +(Ip Sam, [CC BY-SA 4.0][3]) + +### Minimize waste + +Eight types of waste—defects, overproduction, waiting, non-utilized talent, transportation, inventory, motion, and extra processing—in your development lifecycle harm team productivity. + + * **Defects:** It is cheaper to fix a defect early in the development lifecycle, so many teams use [test-driven development][14] (TDD) to reduce defects. + * **Overproduction:** If you are doing more than what you are asked to do, you are over-producing. This is tied to scope in stories; the scope should be small so that you do not risk overproduction. + * **Waiting:** Waiting is not efficient and wastes your team's resources. During sprint daily standups, identify stories that are blocked or waiting on external dependencies. As a scrum master, it is your job to help escalate these blocking issues to reduce waiting time. + * **Non-used talent:** Unused talent is always a waste, so ensure everyone on the team has enough work to do. + * **Transportation:** If you are moving projects from one team to another, you introduce more learning curves and ramp-up time. Try to reduce how much projects are transported. + * **Inventory:** Too much inventory that can't be sold is a waste. The inventory takes up space in your storage and consumes management time. + * **Motion:** Excessive unnecessary movements, such as going to meetings in different locations or even commuting, are a waste. Many organizations have a work-from-home policy to reduce motion waste. + * **Extra processing:** If you are doing the same validation test repeatedly on the same product, this extra processing might be a waste. Come up with a process flow in your development cycle so that you avoid extra processing. + + + +![Lean waste management][15] + +(Ip Sam, [CC BY-SA 4.0][3]) + +As the CEO of your open source project, your time is very valuable. If it's your job, you only have eight hours a day. If it's your side hustle, your time is even more limited. Lean time management involves a very simple matrix, as shown below. If you have a task that's important to the vision and must be done by you, go ahead and do it. If the task is important to the vision but can be done by a team member, delegate it. If the task is not important to the vision and must be done by you, minimize the time you spend on it. Finally, if the task is not vision-important and can be done by others, it is a waste of resources. + +![Lean time management][16] + +(Ip Sam, [CC BY-SA 4.0][3]) + +### Develop a lean strategy + +Lean strategy is a good way to analyze your open source product to come up with a long-term strategy. Ask yourself these questions: If your open source product did not exist, would your customers suffer any real loss? If so, what type of loss would it be? Is it difficult for your customers to replace your products to meet their needs? For example, if I am doing Ansible playbooks for cluster automation, can my customers replace my Ansible playbooks using a set of shell scripts? What would be the impact on the operational costs and learning curve? + +![Lean strategy questions][17] + +(Ip Sam, [CC BY-SA 4.0][3]) + +The lean strategy hierarchy is (from bottom to top) mission, values, vision, strategy, and balanced scorecard. At the base is your mission: Why do your open source project and team exist? What is your mission statement? Next are the values your team believes in. Vision is how you expect your product to evolve in the next two years. Strategy requires strategic planning. At the very top is the balanced scorecard, where you implement and monitor the plan for your open source project. + +![Lean strategy hierarchy][18] + +(Ip Sam, [CC BY-SA 4.0][3]) + +Your lean strategy statement includes your objective, scope, and competitive advantage. The objective defines what your strategy is designed to do and achieve in a specific time frame. The scope identifies the strategy requirements for your open source product to be successful. Your competitive advantage is the core of your strategy. How will you compete with competitors using this product and your strategy to achieve your objective? + +![Lean strategy statement][19] + +(Ip Sam, [CC BY-SA 4.0][3]) + +Pricing and differentiation are two important factors for achieving profit. You want to offer low price and high differentiation. Ask yourself: How is your product different from your competitors'? What are some features that are unique to your product? If you can maximize differentiation and minimize pricing, you will get to the profit frontier line. + +![Lean Profit Management][20] + +(Ip Sam, [CC BY-SA 4.0][3]) + +### Look to the future + +After running your open source project for a while and tracking everything, it's time to consider where you want to focus next on your journey as the CEO of your open source project. + +Begin by assessing perspective, capability, and profit potential. + + * Perspective involves how your product fulfills customers' needs. For example, can my Ansible playbook reduce manual operations in the OpenShift cluster to save 20% of the customer's operation costs? + * Capability is what your product can do and what new features it can offer. For example, can my Ansible playbooks operate in a way that supports OpenShift 3 and OpenShift 4 clusters? On-premises clusters versus AWS clusters? + * Profit potential includes how much revenue your product is generating for you in a time frame. Does your product fall into the profit frontier margin in the image above? + + + +![What's next?][21] + +(Ip Sam, [CC BY-SA 4.0][3]) + +Open source is the future. There is a lot going on in the open source community, and many companies are moving to open source models. Open source is a great way to get people involved in your project, and lean startup principles help you manage your open source project with efficiency. It will help you and your open source project go a long way. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/lean-startup-open-source + +作者:[Ip Sam][a] +选题:[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/ipkeisam +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mobile-demo-device-phone.png?itok=y9cHLI_F (Mobile devices are a big part of our daily lives) +[2]: https://opensource.com/sites/default/files/uploads/1_opensourceidea.jpg (A good open source idea) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/2_positioning.jpg (Position your open source idea) +[5]: https://opensource.com/sites/default/files/uploads/3_leanstartupcycles.jpg (The lean startup cycle diagram) +[6]: https://opensource.com/sites/default/files/uploads/4_leanstartupmethodologies.jpg (Lean startup methodologies) +[7]: https://opensource.com/sites/default/files/uploads/5_leanstartupagile.jpg (Lean startup and agile) +[8]: https://opensource.com/sites/default/files/uploads/6_designthinkingleanstartupagile.jpg (Design thinking, lean startup, and agile cycles together) +[9]: https://opensource.com/sites/default/files/uploads/7_mvps.jpg (Lean startup MVPs) +[10]: https://opensource.com/sites/default/files/uploads/8_projectmanagementtriangle.jpg (Lean project management) +[11]: https://opensource.com/sites/default/files/uploads/9_leanreleases.jpg (Lean releases) +[12]: https://opensource.com/sites/default/files/uploads/10_teammaturity.jpg (Team maturity graph) +[13]: https://opensource.com/sites/default/files/uploads/11_leanteammanagement.jpg (Lean team management) +[14]: https://opensource.com/article/19/10/test-driven-development-best-practices +[15]: https://opensource.com/sites/default/files/uploads/12_leanwastemanagement.jpg (Lean waste management) +[16]: https://opensource.com/sites/default/files/uploads/13_leantimemanagement_0.jpg (Lean time management) +[17]: https://opensource.com/sites/default/files/uploads/14_leanstrategy.jpg (Lean strategy questions) +[18]: https://opensource.com/sites/default/files/uploads/15_leanstrategyhierarchy.jpg (Lean strategy hierarchy) +[19]: https://opensource.com/sites/default/files/uploads/16_leanstrategystatement.jpg (Lean strategy statement) +[20]: https://opensource.com/sites/default/files/uploads/17_profitfrontier.jpg (Lean Profit Management) +[21]: https://opensource.com/sites/default/files/uploads/18_whatsnext.jpg (What's next?) From caa492e4545ae088ce3bd6c52bddbb69dc03ce7f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 10 Jul 2021 06:19:00 +0800 Subject: [PATCH 360/870] Rename sources/tech/20210709 Apply lean startup principles to your open source project.md to sources/talk/20210709 Apply lean startup principles to your open source project.md --- ...9 Apply lean startup principles to your open source project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210709 Apply lean startup principles to your open source project.md (100%) diff --git a/sources/tech/20210709 Apply lean startup principles to your open source project.md b/sources/talk/20210709 Apply lean startup principles to your open source project.md similarity index 100% rename from sources/tech/20210709 Apply lean startup principles to your open source project.md rename to sources/talk/20210709 Apply lean startup principles to your open source project.md From ef9acfa755b317c7310bb9f569f826d4cc25471c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Jul 2021 06:35:13 +0800 Subject: [PATCH 361/870] PRF&PUB @geekpi https://linux.cn/article-13567-1.html --- ...0210628 How to archive files on FreeDOS.md | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) rename {translated/tech => published}/20210628 How to archive files on FreeDOS.md (73%) diff --git a/translated/tech/20210628 How to archive files on FreeDOS.md b/published/20210628 How to archive files on FreeDOS.md similarity index 73% rename from translated/tech/20210628 How to archive files on FreeDOS.md rename to published/20210628 How to archive files on FreeDOS.md index a3719145a1..b2acc5fec0 100644 --- a/translated/tech/20210628 How to archive files on FreeDOS.md +++ b/published/20210628 How to archive files on FreeDOS.md @@ -3,34 +3,34 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13567-1.html) 如何在 FreeDOS 上归档文件 ====== -有一个 FreeDOS 版的 tar,但 DOS 上事实上的标准归档工具是 Zip 和 Unzip。 -![Filing cabinet for organization][1] -在Linux上,你可能熟悉标准的 Unix 归档命令:`tar`。FreeDOS 上也有 `tar` 的版本(还有其他一些流行的归档程序),但 DOS 上事实上的标准归档程序是 Zip 和 Unzip。Zip 和 Unzip 都默认安装在 FreeDOS 1.3 RC4 中。 +> 虽然有一个 FreeDOS 版的 tar,但 DOS 上事实上的标准归档工具是 Zip 和 Unzip。 -Zip 文件格式最初是由 PKWARE 的 Phil Katz 在 1989 年为 PKZIP 和 PKUNZIP 这对 DOS 归档工具构思的。Katz 将 Zip 文件的规范作为一个开放标准发布,因此任何人都可以创建 Zip 档案。作为开放规范的结果,Zip 成为 DOS 上的一个标准归档。[Info-ZIP][2] 项目实现了一套开源的 `ZIP` 和 `UNZIP` 程序。 +![](https://img.linux.net.cn/data/attachment/album/202107/10/063340wp088ozz1fo9f1e1.jpg) + +在 Linux 上,你可能熟悉标准的 Unix 归档命令:`tar`。FreeDOS 上也有 `tar` 的版本(还有其他一些流行的归档程序),但 DOS 上事实上的标准归档程序是 Zip 和 Unzip。Zip 和 Unzip 都默认安装在 FreeDOS 1.3 RC4 中。 + +Zip 文件格式最初是由 PKWARE 的 Phil Katz 在 1989 年为 PKZIP 和 PKUNZIP 这对 DOS 归档工具构思的。Katz 将 Zip 文件的规范作为一个开放标准发布,因此任何人都可以创建 Zip 档案。作为开放规范的结果,Zip 成为 DOS 上的一个标准归档格式。[Info-ZIP][2] 项目实现了一套开源的 `ZIP` 和 `UNZIP` 程序。 ### 对文件和目录进行压缩 -你可以在 DOS 命令行中使用 `ZIP` 来创建文件和目录的归档。这是一个方便的方法,可以为你的工作做一个备份,或者发布一个“包”,在未来的 FreeDOS 发行中使用。例如,假设我想为我的项目源码做一个备份,其中包含这些源文件: +你可以在 DOS 命令行中使用 `ZIP` 来创建文件和目录的归档。这是一个方便的方法,可以为你的工作做一个备份,或者发布一个“包”,在未来的 FreeDOS 发布中使用。例如,假设我想为我的项目源码做一个备份,其中包含这些源文件: ![dir][3] -我想把这些文件归档 -(Jim Hall,[CC-BY SA 4.0][4]) +*我想把这些文件归档* -`ZIP` 有大量的命令行选项来做不同的事情,但我最常使用的命令行选项是 `-r` 来处理目录和子目录_递归_,以及 `-9` 来提供可能的最大压缩。`ZIP` 和 `UNZIP` 使用类似 Unix 的命令行,所以你可以在破折号后面组合选项:`-9r` 将提供最大压缩并在 Zip 文件中包括子目录。 +`ZIP` 有大量的命令行选项来做不同的事情,但我最常使用的命令行选项是 `-r` 来处理目录和子目录 _递归_,以及使用 `-9` 来提供可能的最大压缩。`ZIP` 和 `UNZIP` 使用类似 Unix 的命令行,所以你可以在破折号后面组合选项:`-9r` 将提供最大压缩并在 Zip 文件中包括子目录。 ![zip][5] -压缩一个目录树 -(Jim Hall,[CC-BY SA 4.0][4]) +*压缩一个目录树* 在我的例子中,`ZIP` 能够将我的源文件从大约 33KB 压缩到大约 22KB,为我节省了 11KB 的宝贵磁盘空间。你可能会得到不同的压缩率,这取决于你给 `ZIP` 的选项,或者你想在 Zip 文件中存储什么文件(以及有多少)。一般来说,非常长的文本文件(如源码)会产生良好的压缩效果,而非常小的文本文件(如只有几行的 DOS “批处理”文件)通常太短,无法很好地压缩。 @@ -42,8 +42,7 @@ Zip 文件格式最初是由 PKWARE 的 Phil Katz 在 1989 年为 PKZIP 和 PKUN ![unzip -l][6] -用 unzip 列出归档文件的内容 -(Jim Hall,[CC-BY SA 4.0][4]) +*用 unzip 列出归档文件的内容* 该输出允让我看到 Zip 文件中的 14 个条目:13 个文件加上 `SRC` 目录。 @@ -51,19 +50,17 @@ Zip 文件格式最初是由 PKWARE 的 Phil Katz 在 1989 年为 PKZIP 和 PKUN ![unzip -d temp][7] -你可以用 -d 来解压到目标路径 -(Jim Hall,[CC-BY SA 4.0][4]) +*你可以用 -d 来解压到目标路径* 有时我想从一个 Zip 文件中提取一个文件。在这个例子中,假设我想提取一个 DOS 可执行程序 `TEST.EXE`。要提取单个文件,你要指定你想提取的 Zip 文件的完整路径。默认情况下,`UNZIP` 将使用 Zip 文件中提供的路径解压该文件。要省略路径信息,你可以添加 `-j`(“junk the path”) 选项。 -你也可以合并选项。让我们从 Zip 文件中提取 `SRC\TEST.EXE` 程序,但省略完整路径并将其保存在 `TEMP` 目录下: +你也可以组合选项。让我们从 Zip 文件中提取 `SRC\TEST.EXE` 程序,但省略完整路径并将其保存在 `TEMP` 目录下: ![unzip -j][8] -unzip 结合选项 -(Jim Hall,[CC-BY SA 4.0][4]) +*unzip 组合选项* -因为 Zip 文件是一个开放的标准,所以我们会今天继续看到 Zip 文件。每个 Linux 发行版都支持使用 Info-ZIP 程序的 Zip 文件。你的 Linux 文件管理器可能也支持 Zip 文件。在 GNOME 文件管理器中,你应该可以右击一个文件夹并从下拉菜单中选择“压缩”。你可以选择创建一个新的归档文件,包括 Zip 文件。 +因为 Zip 文件是一个开放的标准,所以我们会今天继续看到 Zip 文件。每个 Linux 发行版都可以通过 Info-ZIP 程序支持 Zip 文件。你的 Linux 文件管理器可能也支持 Zip 文件。在 GNOME 文件管理器中,你应该可以右击一个文件夹并从下拉菜单中选择“压缩”。你可以选择创建一个包括 Zip 文件在内的新的归档文件。 创建和管理 Zip 文件是任何 DOS 用户的一项关键技能。你可以在 Info-ZIP 网站上了解更多关于 `ZIP` 和 `UNZIP` 的信息,或者在命令行上使用 `h`(“帮助”)选项来打印选项列表。 @@ -74,7 +71,7 @@ via: https://opensource.com/article/21/6/archive-files-freedos 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2220eca4e64e290348b2867f6d2992e73ee1c144 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Jul 2021 06:55:25 +0800 Subject: [PATCH 362/870] PRF&PUB @geekpi https://linux.cn/article-13568-1.html --- ... trees with this open source mobile app.md | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) rename {translated/tech => published}/20210703 Identify flowers and trees with this open source mobile app.md (73%) diff --git a/translated/tech/20210703 Identify flowers and trees with this open source mobile app.md b/published/20210703 Identify flowers and trees with this open source mobile app.md similarity index 73% rename from translated/tech/20210703 Identify flowers and trees with this open source mobile app.md rename to published/20210703 Identify flowers and trees with this open source mobile app.md index 9d0ece7c92..6dd54f9769 100644 --- a/translated/tech/20210703 Identify flowers and trees with this open source mobile app.md +++ b/published/20210703 Identify flowers and trees with this open source mobile app.md @@ -3,30 +3,32 @@ [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13568-1.html) -用这个开源移动应用来识别花草和树木 +用开源移动应用 PlantNet 来识别花草和树木 ====== -PlantNet 将开源技术与众包知识结合起来,帮助你成为业余植物学家。 + +> PlantNet 将开源技术与众包知识结合起来,帮助你成为业余植物学家。 + ![Fire pink flower in Maggie Valley, NC][1] -在我居住的地方,有很多小路和道路两旁都有花草树木。我所在的社区因其每年的枫树节而闻名,枫树对我来说很容易识别。然而,还有许多其他的树我无法识别名字。花也是如此:蒲公英很容易发现,但我不知道在我的步行道上的野花的名字。 +在我居住的地方很多小路和道路两旁都有花草树木。我所在的社区因其每年的枫树节而闻名,枫树对我来说很容易识别。然而,还有许多其他的树我无法识别名字。花也是如此:蒲公英很容易发现,但我不知道在我的步行道上的野花的名字。 最近,我的妻子告诉我了 PlantNet,一个可以识别这些花草和树木的移动应用。它可以在 iOS 和 Android 上使用,而且是免费的,所以我决定试试。 ### 以开源的方式识别植物 -我在手机上下载了这个应用程序,开始用它来识别我在村子周围散步时的一些花草和树木。随着我对这个应用的熟悉,我注意到我拍摄的图片(以及其他用户拍摄的图片)是以知识共享署名-相同方式共享(CC-BY-SA)的许可方式共享的。进一步的调查显示,PlantNet 是[开源][2]的。如果你喜欢,你可以匿名使用该应用,或者成为社区的注册成员。 +我在手机上下载了这个应用程序,开始用它来识别我在村子周围散步时的一些花草和树木。随着我对这个应用的熟悉,我注意到我拍摄的图片(以及其他用户拍摄的图片)是以知识共享署名-相同方式共享(CC-BY-SA)的许可方式共享的。进一步的调查显示,PlantNet 是 [开源][2] 的。如果你喜欢,你可以匿名使用该应用,或者成为社区的注册成员。 根据 [Cos4Cloud][3] 公民科学项目,“PlantNet 是一个参与性的公民科学平台,用于收集、分享和审查基于自动识别的植物观察结果。它的目标是监测植物的生物多样性,促进公众对植物知识的获取”。它使用图像识别技术来清点生物多样性。 -该项目的开发始于 2009 年,由法国的植物学家和计算机科学家进行。它最初是一个[网络应用][4],而智能手机应用程序于 2013 年推出。该项目是 [Floris'Tic][5] 倡议的一部分,这是法国的另一个项目,旨在促进植物科学的科学、技术和工业文化。 +该项目的开发始于 2009 年,由法国的植物学家和计算机科学家进行。它最初是一个 [Web 应用][4],而智能手机应用程序于 2013 年推出。该项目是 [Floris'Tic][5] 倡议的一部分,这是法国的另一个项目,旨在促进植物科学的科学、技术和工业文化。 PlantNet 允许用户利用智能手机的摄像头来收集视觉标本,并由软件和社区进行识别。然后,这些照片将与全世界数百万加入 PlantNet 网络的人分享。 -该项目说:“PlantNet 系统的工作原理是比较用户通过他们寻求确定的植物器官(花、果实、叶……)的照片传送的视觉模式。这些图像被分析,并与每天协作制作和充实的图像库进行比较。然后,该系统提供一个可能的物种清单及其插图”。 +该项目说:“PlantNet 系统的工作原理是,比较用户通过他们寻求鉴定的植物器官(花、果实、叶……)的照片传送的视觉模式。这些图像被分析,并与每天协作制作和充实的图像库进行比较。然后,该系统提供一个可能的物种清单及其插图”。 ### 使用 PlantNet @@ -34,37 +36,27 @@ PlantNet 允许用户利用智能手机的摄像头来收集视觉标本,并 ![PlantNet smartphone icon][6] -(Don Watkins, [CC BY-SA 4.0][7]) - 当应用打开时,你会看到你已经在资料库中收集的标本。显示屏底部的相机图标允许你使用你的相机将图片添加到你的照片库。 ![Pl@ntnet homescreen][8] -(Don Watkins, [CC BY-SA 4.0][7]) - 选择“相机”选项,将手机的摄像头对准你想识别的树木或花草。拍完照后,点击与你想识别的标本相匹配的选项(叶、花、树皮、果实等)。 ![Selecting plant type to identify][9] -(Don Watkins, [CC BY-SA 4.0][7]) - 例如,如果你想通过叶子的特征来识别一个标本,请选择**叶子**。PlantNet 对其识别的确定程度进行了分配,从高到低的百分比不等。你还可以使用你的智能手机的 GPS 功能,将位置信息自动添加到你的数据收集中,你还可以添加注释。 ![Identified plant][10] -(Don Watkins, [CC BY-SA 4.0][7]) - 你可以在你的智能手机上或通过你的用户 ID(如果你创建了一个账户)登录网站,访问你上传的所有观测数据,并跟踪社区是否批准了它们。从网站界面上,你也可以下载 CSV 或电子表格格式的观察记录。 ![Pl@ntnet provides user stats][11] -(Don Watkins, [CC BY-SA 4.0][7]) - ### 很好的户外活动 我特别喜欢 PlantNet 与维基百科的链接,这样我就可以阅读更多关于我收集的植物数据的信息。 -目前全球大约有 1200 万 PlantNet 用户,所以数据集一直在增长。该应用是免费使用的,每天最多有 500 个请求。它还有一个 API,以 JSON 格式提供数据,所以你甚至可以把 Pl antNet 的视觉识别引擎作为一个网络服务使用。 +目前全球大约有 1200 万 PlantNet 用户,所以数据集一直在增长。该应用是免费使用的,每天最多可以有 500 个请求。它还有一个 API,以 JSON 格式提供数据,所以你甚至可以把 Pl antNet 的视觉识别引擎作为一个 Web 服务使用。 PlantNet 的一个非常好的地方是,它结合了众包知识和开源技术,将用户相互联系起来,并与很好的户外活动联系起来。没有比这更好的理由来支持开源软件了。 @@ -77,7 +69,7 @@ via: https://opensource.com/article/21/7/open-source-plantnet 作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 882e3c600faac34220f56b914fee1c6054c7f77d Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 10 Jul 2021 10:17:01 +0800 Subject: [PATCH 363/870] Translating --- sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md b/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md index c244dcaeac..ac2da9cb9d 100644 --- a/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md +++ b/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/install-zlib-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eab6962f48bd9d4eb89dc9bfd9cf7a6588d58b8d Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 10 Jul 2021 11:13:44 +0800 Subject: [PATCH 364/870] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...709 How to Install Zlib on Ubuntu Linux.md | 68 ------------------- ...709 How to Install Zlib on Ubuntu Linux.md | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md create mode 100644 translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md diff --git a/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md b/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md deleted file mode 100644 index ac2da9cb9d..0000000000 --- a/sources/tech/20210709 How to Install Zlib on Ubuntu Linux.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: subject: (How to Install Zlib on Ubuntu Linux) -[#]: via: (https://itsfoss.com/install-zlib-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Install Zlib on Ubuntu Linux -====== - -[Zlib][1] is an open source library for used for data compression. - -As an end user, you are likely to encounter the need of installing Zlib (or zlib devel package) as a dependency of another application. - -But here comes the problem. If you try installing Zlib on Ubuntu, it will throw “unable to locate package zlib” error. - -``` -sudo apt install zlib -Reading package lists... Done -Building dependency tree -Reading state information... Done -E: Unable to locate package zlib -``` - -Why do you see this [unable to locate package error][2]? Because there is no package named zlib. - -If you [use the apt search command][3], you’ll find that the there are a couple of packages that let you install zlib: **zlib1g and zlib1g-dev**. When you have that information, installing them is just one apt command away. - -### Install Zlib on Ubuntu-based Linux distributions - -Open a terminal and use the following command: - -``` -sudo apt install zlib1g -``` - -_**Please keep in mind that the the letter before g is 1 (one), not lowercase L. Many people make this mistake while typing the command.**_ - -The other package, zlib1g-dev is development package. Only install it if you require it otherwise you should be good with the main runtime zlib1g package. - -``` -sudo apt install zlib1g-dev -``` - -You may also download the source code of Zlib [from its website][1] and install it. However, I won’t recommend going the source code way just for installing zlib unless you have a good reason to do so. For example, if you need the latest or a specific version of zlib which is not available in the distribution’s repository. - -It is interesting how a seemingly small stuff like installing zlib could become a pain for two reasons: a different package name and the package name containing a “hidden” numeral one (1) which is confused with lowercase L. - -I hope this quick tip helps you. Feel free to drop your questions, suggestions or a simple “thank you” in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-zlib-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://zlib.net/ -[2]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ -[3]: https://itsfoss.com/apt-search-command/ diff --git a/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md b/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md new file mode 100644 index 0000000000..e910a3ab44 --- /dev/null +++ b/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md @@ -0,0 +1,68 @@ +[#]: subject: "How to Install Zlib on Ubuntu Linux" +[#]: via: "https://itsfoss.com/install-zlib-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Ubuntu Linux 上安装 Zlib +====== + +[Zlib][1] 是一个用于数据压缩的开源库。 + +作为使用者,你可能会遇到需要将 Zlib(或 zlib devel 包)作为另一个应用程序的依赖项的情况。 + +但问题来了,如果你尝试在 Ubuntu 上安装 Zlib,它会抛出 “unable to locate package zlib” 错误。 + +```bash +sudo apt install zlib +Reading package lists... Done +Building dependency tree +Reading state information... Done +E: Unable to locate package zlib +``` + +为什么会看到这个 [Ubable to locate package 错误][2]呢?因为没有名为 zlib 的包。 + +如果你 [使用 apt search 命令][3],你会发现有几个包可以让你安装:**zlib 1g 和 zlib 1g-dev**。当你知道这些后,只需一个 apt 命令就可以安装它们。 + +### 在基于 Ubuntu 的 Linux 发行版上安装 Zlib + +打开终端,使用以下命令: + +```bash +sudo apt install zlib1g +``` + +_**请记住 g 前面的字母是 1(一),而不是小写的 L。很多人在输入命令时都会犯这个错误。**_ + +另一个包,zlib 1g-dev 是开发包。只有在你需要时才安装它,否则你应该使用 zlib 1g 包。 + +```bash +sudo apt install zlib1g-dev +``` + +你也可以[ Zlib 网站][1]下载源代码并安装它。但是,除非你有充分的理由,否则我不推荐使用源代码方式来安装 zlib。例如,如果你需要最新或特定版本的 zlib,但该版本在发行版的仓库中不可用。 + +有趣的是,像安装 zlib 这样看似很小的东西可能会变得很麻烦,有两个原因:一个是不同的包名;另一个是包含“隐藏”数字 1,它与小写 L 混淆了。 + +我希望这个快速提示能帮助到你。随意在评论部分留下你的问题、建议或简单的一句 “thank you”。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-zlib-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://zlib.net/ +[2]: https://itsfoss.com/unable-to-locate-package-error-ubuntu/ +[3]: https://itsfoss.com/apt-search-command/ \ No newline at end of file From 448483a40257f9787faf669cd82be7fd0115c36d Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Sat, 10 Jul 2021 15:28:23 +0800 Subject: [PATCH 365/870] Update and rename sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md to translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md --- ...rce to keep your brain busy this summer.md | 111 ------------------ ...rce to keep your brain busy this summer.md | 110 +++++++++++++++++ 2 files changed, 110 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md create mode 100644 translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md diff --git a/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md b/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md deleted file mode 100644 index b134d41845..0000000000 --- a/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: subject: (7 guides about open source to keep your brain busy this summer) -[#]: via: (https://opensource.com/article/21/7/open-source-guides) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -7 guides about open source to keep your brain busy this summer -====== -Download one of our free guides to build a Python-based video game, get -organized with open source tools, work on your home automation project, -or experiment with your Raspberry Pi homelab. -![One chair on a sandy beach][1] - -### Start a new Raspberry Pi project - -The Raspberry Pi has been capturing the hearts and hands of open source enthusiasts for nearly a decade. There are endless options with what you can do with a Raspberry Pi, whether it's [monitoring your garden][2], [setting parental controls][3] (especially handy on those long summer days), or even [tracking aircraft][4] from your own backyard. If any of these cool projects perked your interest but your Raspberry Pi is still collecting dust, then you need to download our guide to nudge you to get started. Before you know it, you'll be working with so many Raspberry Pis, you'll need to learn [how to manage them all][5]! - -**Download: [How to get started with your Raspberry Pi][6]** - -### Design your open source smart home - -One clever and useful way to use your Raspberry Pi is to design your own smart home. Using Home Assistant and other open source tools, your home can be automated on your own terms without a third-party conglomerate. Author [Steve Ovens][7] guides you through every step of the way with a collection of home automation found in this handy eBook. - -**Download: [A practical guide to home automation using open source tools][7]** - -### Get organized - -Maybe you're not quite ready to automate everything in your home yet but are interested in sprucing up the place—your brain space. Why not start with your to-do list? With contributor [Kevin Sonney's][8] productivity guide, you'll become familiar with 6 open source tools to help you stay organized. Once you're through with his tutorials, you'll be organized and have time to finally relax this summer. - -**Download: [6 open source tools for staying organized][9]** - -### Learn how to code - -Computers are everywhere. Wouldn't it be great to be able to talk their language? - -There are lots of languages designed for beginners. Bash is the same scripting language used in the Linux and MacOS terminals, so it makes for a great start if you're new to code. You can [learn it interactively][10], and then download our eBook to learn more. - -**Download:** **[An introduction to programming with Bash][11]** - -### Build a video game with Python - -Another programming language that beginners love is Python. It's equally as popular among school children just learning to code as it is with professional programmers [developing websites][12] and [video editors][13] or [automating the cloud][14]. Regardless of what your eventual goal happens to be, a fun way to start with Python is by programming your own video game. - -**Download: [A guide to building a video game with Python][15]** - -### Discover clever ways to use Jupyter - -To make Python interactive and easy to share, the Jupyter project provides a web-based development environment. You can write your code in "notebook" files, and then send them to other users to make it easy for them to replicate and visualize what you've done. It's the perfect combination of code, documentation, and presentation, and it's surprisingly flexible. Learn more by downloading Moshe Zadka's multifaceted tour through Jupyter. - -**Download: [6 surprising ways to use Jupyter][16]** - -### Experiment with Kubernetes in your homelab - -So you've installed Linux on your Pi, you've logged in, you've set up a new user and [configured sudo][17] to make administration painless, and you're [running all the services][18] you need. Now what? - -If you're comfortable with Linux and server administration, the next step for you could be The Cloud. Get Chris Collins' eBook to learn all about containers, pods, and clusters, all from the comfort of your own homelab. - -**Download: [Running Kubernetes on your Raspberry Pi homelab][19]** - -### Bonus: Book lists - -All work and no play isn't healthy. Summer (or whatever season it is in your part of the world) vacation is meant to be relaxing, and there's nothing quite like sitting back on the porch or beach with a good book. Here are a few recent book lists to spark some ideas: - - * [8 books for open source technologists (2021)][20] - * [A dozen books for all ages][21] - * [8 leadership books for self-improvement][22] - * [6 must-read books for aspiring Cloud Architects][23] - * Our very first [book list from 2010][24] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/open-source-guides - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chen-mizrach-unsplash.jpg?itok=S_wIO5e8 (One chair on a sandy beach) -[2]: https://opensource.com/article/21/5/monitor-greenhouse-open-source -[3]: https://opensource.com/article/21/3/raspberry-pi-parental-control -[4]: https://opensource.com/article/21/3/tracking-flights-raspberry-pi -[5]: https://opensource.com/article/21/5/raspberry-pi-cockpit -[6]: https://opensource.com/downloads/raspberry-pi-guide -[7]: https://opensource.com/downloads/home-automation-ebook -[8]: https://opensource.com/users/ksonney -[9]: https://opensource.com/downloads/organization-tools -[10]: https://opensource.com/article/19/10/learn-bash-command-line-games#bashcrawl -[11]: https://opensource.com/downloads/bash-programming-guide -[12]: https://opensource.com/article/18/4/flask -[13]: https://opensource.com/article/21/2/linux-python-video -[14]: https://opensource.com/article/19/2/quickstart-guide-ansible -[15]: https://opensource.com/downloads/python-gaming-ebook -[16]: https://opensource.com/downloads/jupyter-guide -[17]: https://opensource.com/article/19/10/know-about-sudo -[18]: https://opensource.com/article/20/5/systemd-units -[19]: https://opensource.com/downloads/kubernetes-raspberry-pi -[20]: https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list -[21]: https://opensource.com/article/20/6/summer-reading-list -[22]: https://enterprisersproject.com/article/2021/5/8-leadership-books-self-improvement -[23]: https://www.redhat.com/architect/books-cloud-architects -[24]: https://opensource.com/life/10/8/open-books-opensourcecom-summer-reading-list diff --git a/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md b/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md new file mode 100644 index 0000000000..c9f52841e7 --- /dev/null +++ b/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md @@ -0,0 +1,110 @@ +[#]: subject: "7 guides about open source to keep your brain busy this summer" +[#]: via: "https://opensource.com/article/21/7/open-source-guides" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +让你的大脑在这个夏天保持忙碌的7个开源指南 +====== + +下载我们的免费指南之一:开发一个基于Python的电子游戏,使用开源工具来让你的生活井井有条,完成家庭自动化项目,或尝试你的树莓派家用实验室。 +![One chair on a sandy beach][1] + +### 开启一个新的树莓派项目 + +近十年来,树莓派一直俘获着开源爱好者的心和手。你可以用树莓派做无数的项目,无论是[监控你的花园][2],[设置家长监控][3](尤其是在那些漫长的夏天),甚至从你自己的后院[跟踪飞机][4]。如果这些很酷的项目激起了你的兴趣,但你的树莓派仍在积灰,那么你需要下载我们的指南来推动你开始。在你知道它之前,你需要学习[如何管理他们][5],因为你将与很多树莓派一起工作! + +**下载:[如何开始你的树莓派工作][6]** + +### 设计你的开源智能家庭 + +一个聪明且有用的方式去使用树莓派的方式是去设计你的智能家庭。使用家庭助手或其他的开源工具,你的家可以按你自己的设置进行自动化而无需借助第三方平台。作者 [Steve Ovens][7] 用这本家庭自动化集锦的手写电子书来指导你的每一步工作。 + +**下载:[使用开源工具实现家庭自动化的实用指南][7]** + +### 将事情梳理地井井有条 + +可能你并没做好准备使得你的家庭完全自动化,但是你可能会对梳理你的思维有兴趣。为什么不从你的 to-do 列表开始呢?在贡献者 [Kevin Sonney][8] 的生产力指导下,你将会熟悉六个开源工具的使用从而帮你把事情安排得井井有条。一旦你使用了他的教程,你就会感到事情井井有条,在这个夏天终于有时间放松了。 + +**下载:[六个可以将事情梳理地井井有条的开源工具][9]** + +### 学习如何写代码 + +电脑无处不在。能吐槽一下很多编程语言对初学者不是很友好吗? + +有许多为初学者设计的编程语言。Bash 是 Linux 和 Macos 终端中使用的相同的脚本语言,如果你新开始写代码,Bash 将会是一个伟大的开始。你可以进行[交互式学习][10],之后下载我们的电子书以了解更多。 + +**下载:[Bash 编程指南][11]** + +### 用 Python 写一个游戏 + +另一个初学者喜欢的编程语言是 Python。它不仅受到仅仅学习编码的中小学生的欢迎,还被专业程序员用来做[网站开发][12],[视频编辑][13]以及[云端自动化][14]。无论你最终的目标是什么,开始 Python 的一个有趣的方式是编写一个自己游戏。 + +**下载:[Python 游戏开发指南][15]** + +### 发现使用 Jpuyter 的巧妙方法 + +为了让Python互动且易于共享,Jupyter 项目提供了基于 Web 的发展环境。您可以在"笔记本"文件中写代码,然后将其发送给其他用户,以便他们轻松复制和可视化您所做的。它是代码、文档和演示文稿的完美组合,而且非常灵活。下载 Moshe Zadka 的多方面指南了解更多关于 Jupyter。 + +**下载:[使用 Jupyer 的六种惊艳方式][16]** + +### 在你的家庭实验室里尝试 Kubernetes + +现在,您已经在你的树莓派上安装了 Linux,已经登录,已设置新用户并[配置 sudo][17] 使得能够进入管理员模式,你正在[运行所有你需要的服务][18] 。之后呢? + +如果您对 Linux 和服务器管理感到满意,您下一步可能是云服务。可以读一下 Chris Collins 的电子书,从你的家庭实验室的舒适中了解所有关于容器,吊舱和集群的信息。 + +**下载: [在你的树莓派家庭实验室上运行 Kubernetes][19]** + +### 福利:书籍列表 + +只工作不休息是不健康的。夏天(或任何季节,它是在你的世界的一部分)假期是为了休息,没有什么比坐在门廊或海滩上读一本好书更休闲人心的。下面是一些最近列出的书,以激发一些想法: + + * [8 本供开源技术专家读的书 (2021)][20] + * [十几本适合所有年龄段的书][21] + * [8 本提升领导力的书籍][22] + * [6 本必读的云架构书籍][23] + * 我们的第一个[2010年至今的书籍列表][24] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-source-guides + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[zepoch](https://github.com/zepoch) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chen-mizrach-unsplash.jpg?itok=S_wIO5e8 "One chair on a sandy beach" +[2]: https://opensource.com/article/21/5/monitor-greenhouse-open-source +[3]: https://opensource.com/article/21/3/raspberry-pi-parental-control +[4]: https://opensource.com/article/21/3/tracking-flights-raspberry-pi +[5]: https://opensource.com/article/21/5/raspberry-pi-cockpit +[6]: https://opensource.com/downloads/raspberry-pi-guide +[7]: https://opensource.com/downloads/home-automation-ebook +[8]: https://opensource.com/users/ksonney +[9]: https://opensource.com/downloads/organization-tools +[10]: https://opensource.com/article/19/10/learn-bash-command-line-games#bashcrawl +[11]: https://opensource.com/downloads/bash-programming-guide +[12]: https://opensource.com/article/18/4/flask +[13]: https://opensource.com/article/21/2/linux-python-video +[14]: https://opensource.com/article/19/2/quickstart-guide-ansible +[15]: https://opensource.com/downloads/python-gaming-ebook +[16]: https://opensource.com/downloads/jupyter-guide +[17]: https://opensource.com/article/19/10/know-about-sudo +[18]: https://opensource.com/article/20/5/systemd-units +[19]: https://opensource.com/downloads/kubernetes-raspberry-pi +[20]: https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list +[21]: https://opensource.com/article/20/6/summer-reading-list +[22]: https://enterprisersproject.com/article/2021/5/8-leadership-books-self-improvement +[23]: https://www.redhat.com/architect/books-cloud-architects +[24]: https://opensource.com/life/10/8/open-books-opensourcecom-summer-reading-list From 1694e554527e932bb9a5912a41ca4880f0088608 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Sat, 10 Jul 2021 22:07:55 +0800 Subject: [PATCH 366/870] Update and rename sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md to translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md (#22472) --- ...rce to keep your brain busy this summer.md | 111 ------------------ ...rce to keep your brain busy this summer.md | 110 +++++++++++++++++ 2 files changed, 110 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md create mode 100644 translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md diff --git a/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md b/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md deleted file mode 100644 index b134d41845..0000000000 --- a/sources/tech/20210704 7 guides about open source to keep your brain busy this summer.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: subject: (7 guides about open source to keep your brain busy this summer) -[#]: via: (https://opensource.com/article/21/7/open-source-guides) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -7 guides about open source to keep your brain busy this summer -====== -Download one of our free guides to build a Python-based video game, get -organized with open source tools, work on your home automation project, -or experiment with your Raspberry Pi homelab. -![One chair on a sandy beach][1] - -### Start a new Raspberry Pi project - -The Raspberry Pi has been capturing the hearts and hands of open source enthusiasts for nearly a decade. There are endless options with what you can do with a Raspberry Pi, whether it's [monitoring your garden][2], [setting parental controls][3] (especially handy on those long summer days), or even [tracking aircraft][4] from your own backyard. If any of these cool projects perked your interest but your Raspberry Pi is still collecting dust, then you need to download our guide to nudge you to get started. Before you know it, you'll be working with so many Raspberry Pis, you'll need to learn [how to manage them all][5]! - -**Download: [How to get started with your Raspberry Pi][6]** - -### Design your open source smart home - -One clever and useful way to use your Raspberry Pi is to design your own smart home. Using Home Assistant and other open source tools, your home can be automated on your own terms without a third-party conglomerate. Author [Steve Ovens][7] guides you through every step of the way with a collection of home automation found in this handy eBook. - -**Download: [A practical guide to home automation using open source tools][7]** - -### Get organized - -Maybe you're not quite ready to automate everything in your home yet but are interested in sprucing up the place—your brain space. Why not start with your to-do list? With contributor [Kevin Sonney's][8] productivity guide, you'll become familiar with 6 open source tools to help you stay organized. Once you're through with his tutorials, you'll be organized and have time to finally relax this summer. - -**Download: [6 open source tools for staying organized][9]** - -### Learn how to code - -Computers are everywhere. Wouldn't it be great to be able to talk their language? - -There are lots of languages designed for beginners. Bash is the same scripting language used in the Linux and MacOS terminals, so it makes for a great start if you're new to code. You can [learn it interactively][10], and then download our eBook to learn more. - -**Download:** **[An introduction to programming with Bash][11]** - -### Build a video game with Python - -Another programming language that beginners love is Python. It's equally as popular among school children just learning to code as it is with professional programmers [developing websites][12] and [video editors][13] or [automating the cloud][14]. Regardless of what your eventual goal happens to be, a fun way to start with Python is by programming your own video game. - -**Download: [A guide to building a video game with Python][15]** - -### Discover clever ways to use Jupyter - -To make Python interactive and easy to share, the Jupyter project provides a web-based development environment. You can write your code in "notebook" files, and then send them to other users to make it easy for them to replicate and visualize what you've done. It's the perfect combination of code, documentation, and presentation, and it's surprisingly flexible. Learn more by downloading Moshe Zadka's multifaceted tour through Jupyter. - -**Download: [6 surprising ways to use Jupyter][16]** - -### Experiment with Kubernetes in your homelab - -So you've installed Linux on your Pi, you've logged in, you've set up a new user and [configured sudo][17] to make administration painless, and you're [running all the services][18] you need. Now what? - -If you're comfortable with Linux and server administration, the next step for you could be The Cloud. Get Chris Collins' eBook to learn all about containers, pods, and clusters, all from the comfort of your own homelab. - -**Download: [Running Kubernetes on your Raspberry Pi homelab][19]** - -### Bonus: Book lists - -All work and no play isn't healthy. Summer (or whatever season it is in your part of the world) vacation is meant to be relaxing, and there's nothing quite like sitting back on the porch or beach with a good book. Here are a few recent book lists to spark some ideas: - - * [8 books for open source technologists (2021)][20] - * [A dozen books for all ages][21] - * [8 leadership books for self-improvement][22] - * [6 must-read books for aspiring Cloud Architects][23] - * Our very first [book list from 2010][24] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/open-source-guides - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chen-mizrach-unsplash.jpg?itok=S_wIO5e8 (One chair on a sandy beach) -[2]: https://opensource.com/article/21/5/monitor-greenhouse-open-source -[3]: https://opensource.com/article/21/3/raspberry-pi-parental-control -[4]: https://opensource.com/article/21/3/tracking-flights-raspberry-pi -[5]: https://opensource.com/article/21/5/raspberry-pi-cockpit -[6]: https://opensource.com/downloads/raspberry-pi-guide -[7]: https://opensource.com/downloads/home-automation-ebook -[8]: https://opensource.com/users/ksonney -[9]: https://opensource.com/downloads/organization-tools -[10]: https://opensource.com/article/19/10/learn-bash-command-line-games#bashcrawl -[11]: https://opensource.com/downloads/bash-programming-guide -[12]: https://opensource.com/article/18/4/flask -[13]: https://opensource.com/article/21/2/linux-python-video -[14]: https://opensource.com/article/19/2/quickstart-guide-ansible -[15]: https://opensource.com/downloads/python-gaming-ebook -[16]: https://opensource.com/downloads/jupyter-guide -[17]: https://opensource.com/article/19/10/know-about-sudo -[18]: https://opensource.com/article/20/5/systemd-units -[19]: https://opensource.com/downloads/kubernetes-raspberry-pi -[20]: https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list -[21]: https://opensource.com/article/20/6/summer-reading-list -[22]: https://enterprisersproject.com/article/2021/5/8-leadership-books-self-improvement -[23]: https://www.redhat.com/architect/books-cloud-architects -[24]: https://opensource.com/life/10/8/open-books-opensourcecom-summer-reading-list diff --git a/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md b/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md new file mode 100644 index 0000000000..c9f52841e7 --- /dev/null +++ b/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md @@ -0,0 +1,110 @@ +[#]: subject: "7 guides about open source to keep your brain busy this summer" +[#]: via: "https://opensource.com/article/21/7/open-source-guides" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +让你的大脑在这个夏天保持忙碌的7个开源指南 +====== + +下载我们的免费指南之一:开发一个基于Python的电子游戏,使用开源工具来让你的生活井井有条,完成家庭自动化项目,或尝试你的树莓派家用实验室。 +![One chair on a sandy beach][1] + +### 开启一个新的树莓派项目 + +近十年来,树莓派一直俘获着开源爱好者的心和手。你可以用树莓派做无数的项目,无论是[监控你的花园][2],[设置家长监控][3](尤其是在那些漫长的夏天),甚至从你自己的后院[跟踪飞机][4]。如果这些很酷的项目激起了你的兴趣,但你的树莓派仍在积灰,那么你需要下载我们的指南来推动你开始。在你知道它之前,你需要学习[如何管理他们][5],因为你将与很多树莓派一起工作! + +**下载:[如何开始你的树莓派工作][6]** + +### 设计你的开源智能家庭 + +一个聪明且有用的方式去使用树莓派的方式是去设计你的智能家庭。使用家庭助手或其他的开源工具,你的家可以按你自己的设置进行自动化而无需借助第三方平台。作者 [Steve Ovens][7] 用这本家庭自动化集锦的手写电子书来指导你的每一步工作。 + +**下载:[使用开源工具实现家庭自动化的实用指南][7]** + +### 将事情梳理地井井有条 + +可能你并没做好准备使得你的家庭完全自动化,但是你可能会对梳理你的思维有兴趣。为什么不从你的 to-do 列表开始呢?在贡献者 [Kevin Sonney][8] 的生产力指导下,你将会熟悉六个开源工具的使用从而帮你把事情安排得井井有条。一旦你使用了他的教程,你就会感到事情井井有条,在这个夏天终于有时间放松了。 + +**下载:[六个可以将事情梳理地井井有条的开源工具][9]** + +### 学习如何写代码 + +电脑无处不在。能吐槽一下很多编程语言对初学者不是很友好吗? + +有许多为初学者设计的编程语言。Bash 是 Linux 和 Macos 终端中使用的相同的脚本语言,如果你新开始写代码,Bash 将会是一个伟大的开始。你可以进行[交互式学习][10],之后下载我们的电子书以了解更多。 + +**下载:[Bash 编程指南][11]** + +### 用 Python 写一个游戏 + +另一个初学者喜欢的编程语言是 Python。它不仅受到仅仅学习编码的中小学生的欢迎,还被专业程序员用来做[网站开发][12],[视频编辑][13]以及[云端自动化][14]。无论你最终的目标是什么,开始 Python 的一个有趣的方式是编写一个自己游戏。 + +**下载:[Python 游戏开发指南][15]** + +### 发现使用 Jpuyter 的巧妙方法 + +为了让Python互动且易于共享,Jupyter 项目提供了基于 Web 的发展环境。您可以在"笔记本"文件中写代码,然后将其发送给其他用户,以便他们轻松复制和可视化您所做的。它是代码、文档和演示文稿的完美组合,而且非常灵活。下载 Moshe Zadka 的多方面指南了解更多关于 Jupyter。 + +**下载:[使用 Jupyer 的六种惊艳方式][16]** + +### 在你的家庭实验室里尝试 Kubernetes + +现在,您已经在你的树莓派上安装了 Linux,已经登录,已设置新用户并[配置 sudo][17] 使得能够进入管理员模式,你正在[运行所有你需要的服务][18] 。之后呢? + +如果您对 Linux 和服务器管理感到满意,您下一步可能是云服务。可以读一下 Chris Collins 的电子书,从你的家庭实验室的舒适中了解所有关于容器,吊舱和集群的信息。 + +**下载: [在你的树莓派家庭实验室上运行 Kubernetes][19]** + +### 福利:书籍列表 + +只工作不休息是不健康的。夏天(或任何季节,它是在你的世界的一部分)假期是为了休息,没有什么比坐在门廊或海滩上读一本好书更休闲人心的。下面是一些最近列出的书,以激发一些想法: + + * [8 本供开源技术专家读的书 (2021)][20] + * [十几本适合所有年龄段的书][21] + * [8 本提升领导力的书籍][22] + * [6 本必读的云架构书籍][23] + * 我们的第一个[2010年至今的书籍列表][24] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-source-guides + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[zepoch](https://github.com/zepoch) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chen-mizrach-unsplash.jpg?itok=S_wIO5e8 "One chair on a sandy beach" +[2]: https://opensource.com/article/21/5/monitor-greenhouse-open-source +[3]: https://opensource.com/article/21/3/raspberry-pi-parental-control +[4]: https://opensource.com/article/21/3/tracking-flights-raspberry-pi +[5]: https://opensource.com/article/21/5/raspberry-pi-cockpit +[6]: https://opensource.com/downloads/raspberry-pi-guide +[7]: https://opensource.com/downloads/home-automation-ebook +[8]: https://opensource.com/users/ksonney +[9]: https://opensource.com/downloads/organization-tools +[10]: https://opensource.com/article/19/10/learn-bash-command-line-games#bashcrawl +[11]: https://opensource.com/downloads/bash-programming-guide +[12]: https://opensource.com/article/18/4/flask +[13]: https://opensource.com/article/21/2/linux-python-video +[14]: https://opensource.com/article/19/2/quickstart-guide-ansible +[15]: https://opensource.com/downloads/python-gaming-ebook +[16]: https://opensource.com/downloads/jupyter-guide +[17]: https://opensource.com/article/19/10/know-about-sudo +[18]: https://opensource.com/article/20/5/systemd-units +[19]: https://opensource.com/downloads/kubernetes-raspberry-pi +[20]: https://opensource.com/article/21/6/2021-opensourcecom-summer-reading-list +[21]: https://opensource.com/article/20/6/summer-reading-list +[22]: https://enterprisersproject.com/article/2021/5/8-leadership-books-self-improvement +[23]: https://www.redhat.com/architect/books-cloud-architects +[24]: https://opensource.com/life/10/8/open-books-opensourcecom-summer-reading-list From deda433e1e975d139118a851ab512bab0327399f Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Sat, 10 Jul 2021 23:20:11 +0800 Subject: [PATCH 367/870] =?UTF-8?q?=E8=AE=A4=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210708 Write good examples by starting with real code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210708 Write good examples by starting with real code.md b/sources/tech/20210708 Write good examples by starting with real code.md index 80077f493a..e3ac4f7d7e 100644 --- a/sources/tech/20210708 Write good examples by starting with real code.md +++ b/sources/tech/20210708 Write good examples by starting with real code.md @@ -2,7 +2,7 @@ [#]: via: (https://jvns.ca/blog/2021/07/08/writing-great-examples/) [#]: author: (Julia Evans https://jvns.ca/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3f36ea9ee6808aa95fbb275681afe215b7571b4b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 11 Jul 2021 05:03:36 +0800 Subject: [PATCH 368/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210711=20?= =?UTF-8?q?How=20to=20Dual=20Boot=20Fedora=20and=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210711 How to Dual Boot Fedora and Windows.md --- ...711 How to Dual Boot Fedora and Windows.md | 242 ++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 sources/tech/20210711 How to Dual Boot Fedora and Windows.md diff --git a/sources/tech/20210711 How to Dual Boot Fedora and Windows.md b/sources/tech/20210711 How to Dual Boot Fedora and Windows.md new file mode 100644 index 0000000000..023ed5963b --- /dev/null +++ b/sources/tech/20210711 How to Dual Boot Fedora and Windows.md @@ -0,0 +1,242 @@ +[#]: subject: (How to Dual Boot Fedora and Windows) +[#]: via: (https://itsfoss.com/dual-boot-fedora-windows/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Dual Boot Fedora and Windows +====== + +_**Brief:** This detailed tutorial shows you **how to dual boot Fedora Linux with Windows 10**, step-by-step, accompanied by proper screenshots._ + +Dual booting Linux and Windows is one of the popular ways to enjoy the full potential of the two operating systems. You have both Linux and Windows installed on the same system and you can choose which one to use after starting your system. + +![On the grub screen, you can select the operating system][1] + +If you have a system with Windows installed already, you’ll learn how to install Fedora alongside Windows in this tutorial. + +### Installing Fedora alongside Windows + +![][2] + +The tutorial has been performed on a system with Windows already installed, GPT partitioning and UEFI boot. It should be applicable to other systems with MBR partitioning and legacy BIOS system as well, but I cannot confirm that. + +Note: If your Windows system uses BitLocker encryption, it will be a good idea to disable it first before you go on installing Fedora. + +#### Requirements + +Here’s what you’ll need to follow this tutorial: + + * A system preinstalled with Windows + * Good speed internet connection + * A USB key (pen drive) with at least 4 GB in size + * Optional: External USB disk for making back up of your existing data on Windows. + * Optional: Windows recovery or bootable disk (if you encounter any major boot issues, you can fix with it). + + + +Let’s see the steps. + +#### Step 1: Make a backup of data on your Windows system [optional] + +Backup is always a good idea. You will be dealing with the disk partitions. In the rare unfortunate case, if you make a mistake and delete the wrong partition, you’ll lose your data. + +The simplest way would to be to copy the data in Documents, Videos, Music, Pictures and other folders to an external USB disk. You can use an external HDD (slower but cheaper) or SSD (faster but expensive) and copy the important files and folders on it. + +Preview | Product | Price | +---|---|---|--- +![SanDisk 500GB Extreme Portable SSD - Up to 1050MB/s - USB-C, USB 3.2 Gen 2 - External Solid State Drive - SDSSDE61-500G-G25][3] ![SanDisk 500GB Extreme Portable SSD - Up to 1050MB/s - USB-C, USB 3.2 Gen 2 - External Solid State Drive - SDSSDE61-500G-G25][3] | [SanDisk 500GB Extreme Portable SSD - Up to 1050MB/s - USB-C, USB 3.2 Gen 2 - External Solid State...][4] | $89.99[][5] | [Buy on Amazon][6] +Preview | Product | Price | +---|---|---|--- +![Toshiba Canvio Advance 1TB Portable External Hard Drive USB 3.0, Black - HDTCA10XK3AA][7] ![Toshiba Canvio Advance 1TB Portable External Hard Drive USB 3.0, Black - HDTCA10XK3AA][7] | [Toshiba Canvio Advance 1TB Portable External Hard Drive USB 3.0, Black - HDTCA10XK3AA][8] | $51.99[][5] | [Buy on Amazon][9] + +#### Step 2: Make some free space for Fedora installation + +You need to create a partition where you’ll be installing Fedora. If you just have C drive, shrink it. If you have D, E or F drive, see if you can move their data to some other partition and delete or shrink one of them. Anything above 40 GB should be comfortable enough space for Fedora. + +In the Windows menu, search for ‘disk partitions’ and go to ‘Create and format hard disk partitions’. + +![][10] + +In the Disk Management tool, right-click on the drive which you want to partition and select **shrink volume**. + +If you have just one partition like this, you need to make some free space out of it for Linux. If you have several partitions of considerable size, use any of them except C drive because it may erase the data. + +![][11] + +#### Step 3: Making a live USB of Fedora in Windows + +Now, this can be done in different ways. You can download the ISO and [use Etcher][12] or Rufus or some other tool to write the ISO image to the USB disk. + +However, Fedora provides a dedicated tool for downloading and making live USB. I am going to use that in this tutorial. The Fedora team put some effort in creating this tool, so why not use it. + +But first, **plug in the USB key**. Now, go to the download page of Fedora: + +[Fedora Download][13] + +You’ll see the option to download the Fedora Media Writer tool for Windows. + +![][14] + +It will download an exe file. Once downloaded, go to your downloads folder and double-click the FedoraMediaWriter exe file to install the Fedora Media Writer tool. Just keep on hitting next. + +![][15] + +Once installed, run the Fedora Media Writer tool. But before that, **make sure that you have plugged in the USB**. + +It will give you the option to install various editions of Fedora. For desktops, go with Workstation. + +![][16] + +On the next screen, you’ll get the option to create live USB. When you hit that button, it starts downloading the ISO. It will also recognize your inserted USB key. + +You need to have a good speed internet connection to download the 2 GB of ISO in a comfortable time span. + +![][17] + +After downloading the ISO, it checks the download automatically and then gives you the option to write the ISO image to the USB disk, i.e. create the live USB. Hit the “Write to Disk” button. + +![][18] + +It will take a couple of minutes to complete the process. It displays “Finished” message and you can close the Fedora Media Writer tool now. + +![][19] + +Good! So now you have the Fedora live USB ready with you. Time to use it for installing Fedora with Windows. + +#### Step 4: Boot from live USB and install Fedora + +Some systems do not allow you to boot from live USB with secure boot. If that’s the case with you, please [disable secure boot][20]. + +At the screen that shows the logo of your system manufacturer, press the **F2 or F10 or F12** key. You may try pressing all of them one by one if you are not sure of the key. But **be quick** when you do that otherwise it will boot into the operating system. + +This key is different for different brand of computers. Some may even use **Esc** or **Del** keys for this purpose. + +![Quickly press F2, F10 or F12 keys at the screen showing your system manufacturer’s logo][21] + +In some rare cases, you may have to [access the UEFI boot settings from within Windows][22]. + +In the BIOS settings, normally, you should see a screen like this. Here, you use the arrow keys to move down to USB option and press enter to boot from the USB. Please note that the screen may look different in different systems. + +![][23] + +If things go right, you should see a screen like below. **Go with the first option “Start Fedora Workstation”:** + +![][24] + +After some seconds, you should boot into the live Fedora session and see the option to try or install it. Go with “Install to Hard Drive”. + +![][25] + +It will ask to choose the language of choice for the installation process. + +![][26] + +The next screen is important. If you had created the free space in the step 2, you should be able to hit on the “Begin Installation”. If you see an exclamation mark on the disk icon under System, click on it and see what kind of disk configuration you can use here. + +If you have more than one disk, you can choose which disk to use for Fedora. + +![][27] + +Select the disk and click on Done. You may see a warning message now. In my case, I did not create free space in the step 2 and hence it complained that there is not enough free space to install Fedora. + +![][28] + +I clicked on reclaim space and shrank the Windows partition here. + +![][29] + +After this, the “Begin Installation” option appeared to start the installation. + +![][30] + +Now it’s just a waiting game. It will take a few minutes to extract files and install them. + +![][31] + +When the process completes, you’ll see the “Finish Installation” button. Hit it. + +![][32] + +You’ll be back to Fedora live session. Click the top right corner to bring down the menu and select Restart. + +![][33] + +When the system starts now, you should see the [Grub bootloader][34] screen with option to boot into Fedora and Windows. + +![][1] + +#### Step 5: Complete Fedora setup + +You are almost there. Did you notice that Fedora didn’t ask you to enter username and password? Many distributions like Ubuntu ask you to create an admin user during the installation itself. On the other hand, Fedora gives you this option when you log in to the installed system for the first time. + +When you first log in, it runs a setup and creation of user and password is part of this initial setup. + +![][35] + +![][36] + +![][37] + +Once you do that, you are ready to enjoy Fedora Linux. + +![][38] + +That’s it. You can enjoy Fedora Linux and Windows in dual boot mode on the same system. + +If you have any questions or if you are facing any issues while following this tutorial, please let me know in the comment system. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dual-boot-fedora-windows/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/dual-boot-grub-screen-fedora-windows.jpg?resize=800%2C350&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-windows-dual-boot.jpg?resize=800%2C450&ssl=1 +[3]: https://i1.wp.com/m.media-amazon.com/images/I/41zwkV8VfPL._SL160_.jpg?ssl=1 +[4]: https://www.amazon.com/dp/B08GTXVG9P?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (SanDisk 500GB Extreme Portable SSD - Up to 1050MB/s - USB-C, USB 3.2 Gen 2 - External Solid State Drive - SDSSDE61-500G-G25) +[5]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[6]: https://www.amazon.com/dp/B08GTXVG9P?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) +[7]: https://i0.wp.com/m.media-amazon.com/images/I/31-nRLIONWL._SL160_.jpg?ssl=1 +[8]: https://www.amazon.com/dp/B08JKFY8FH?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Toshiba Canvio Advance 1TB Portable External Hard Drive USB 3.0, Black - HDTCA10XK3AA) +[9]: https://www.amazon.com/dp/B08JKFY8FH?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/disc-management-windows.png?resize=800%2C561&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/making-free-space-for-dual-boot.jpg?resize=1226%2C728&ssl=1 +[12]: https://itsfoss.com/install-etcher-linux/ +[13]: https://getfedora.org/en/workstation/download/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/download-fedora-media-writer-tool.png?resize=800%2C373&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-Fedora-Media-Writer-tool-Windows.png?resize=745%2C581&ssl=1 +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-media-writer-1.png?resize=800%2C425&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-media-writer-2.jpg?resize=800%2C422&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/writing-fedora-iso-to-usb-with-Fedora-Media-Writer-Tool.png?resize=800%2C285&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedoa-live-usb-with-fedora-media-writer.png?resize=800%2C300&ssl=1 +[20]: https://itsfoss.com/disable-secure-boot-windows/ +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/acer-predator-boot.jpg?resize=800%2C600&ssl=1 +[22]: https://itsfoss.com/access-uefi-settings-windows-10/ +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/select-boot-from-live-usb.jpg?resize=800%2C330&ssl=1 +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-live-screen.jpg?resize=800%2C350&ssl=1 +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/Fedora-install-screen.jpg?resize=800%2C450&ssl=1 +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-1.png?resize=800%2C450&ssl=1 +[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-2.png?resize=800%2C450&ssl=1 +[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-3.png?resize=800%2C450&ssl=1 +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-4.png?resize=800%2C450&ssl=1 +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-5.png?resize=800%2C450&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-6.png?resize=800%2C450&ssl=1 +[32]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/installing-fedora-7.png?resize=800%2C450&ssl=1 +[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/restart-gnome-fedora.jpg?resize=799%2C439&ssl=1 +[34]: https://itsfoss.com/what-is-grub/ +[35]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-1.png?resize=800%2C575&ssl=1 +[36]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-2.png?resize=800%2C593&ssl=1 +[37]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-3.png?resize=800%2C591&ssl=1 +[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/fedora-setup-completed.jpg?resize=800%2C500&ssl=1 From 2258acbacef4a0c8f0d943762f12c770b589154a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 11 Jul 2021 05:04:02 +0800 Subject: [PATCH 369/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210710=20?= =?UTF-8?q?A=20new=20open=20source=20operating=20system=20for=20embedded?= =?UTF-8?q?=20systems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210710 A new open source operating system for embedded systems.md --- ...e operating system for embedded systems.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210710 A new open source operating system for embedded systems.md diff --git a/sources/tech/20210710 A new open source operating system for embedded systems.md b/sources/tech/20210710 A new open source operating system for embedded systems.md new file mode 100644 index 0000000000..e8658cdb55 --- /dev/null +++ b/sources/tech/20210710 A new open source operating system for embedded systems.md @@ -0,0 +1,92 @@ +[#]: subject: (A new open source operating system for embedded systems) +[#]: via: (https://opensource.com/article/21/7/rt-thread-smart) +[#]: author: (Zhu Tianlong https://opensource.com/users/zhu-tianlong) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A new open source operating system for embedded systems +====== +RT-Thread Smart is working to open source the world of IoT and edge +computing. +![An intersection of pipes.][1] + +There's a growing demand for [embedded operating systems][2], and it's best when the one you build upon is open source. The [RT-Thread][3] project's R&D team has spent three years of research and intensive development to arrive at the project's latest offering: RT-Thread Smart. It is a microkernel operating system aimed primarily at midrange to high-end processors such as RISC-V with a memory management unit (MMU) and provides a competitive software platform for all industries in the embedded space. + +### Who needs RT-Thread Smart? + +RT-Thread Smart is a professional, high-performance, microkernel operating system for real-time applications. It offers an open source foundation for embedded devices in any market, including security (e.g., internet protocol cameras), industrial control, onboard devices, consumer electronics, and anything else using embedded technology (which is increasingly coming to mean "everything"). It's significant because, unlike traditional IoT operating systems, a microkernel operating system can fill the gap between a traditional real-time operating system (RTOS) and a comparatively large operating system like Linux to achieve the best balance between real-time performance, cost, security, startup speed, and more. + +### RT-Thread Smart's architecture + +RT-Thread Smart separates a system into kernel mode and user mode by taking advantage of the MMU and system call methods. It then divides the address space for each mode (a 32-bit system provides 4G address space). + +![RT-Thread Smart architecture][4] + +(RT-Thread, [CC BY-SA 4.0)][5] + +The RT-Thread Smart kernel includes the platform's basic functionality and supports customizations. RT-Thread Smart's userspace application environment uses [musl libc][6] to provide [POSIX][7] interface calls and C runtime supports. It also inherits the original RT-Thread ecosystem, using [SCons][8] or other build tools such as [Autotools][9], Makefiles, [CMake][10], and so on to support development, as well as RT-Thread's out-of-the-box online software packages (over 342 at the time of this writing). You can even port Linux applications, such as wget/cURL, BusyBox, OpenSSL, and Simple DirectMedia Layer, to your platform. + +The compressed RT-Thread Smart kernel is just 217KB, with a root filesystem of 127KB. Typical memory usage is about 2MB. + +Including full support for filesystems, network protocol stacks, and multimedia, it takes only three to five seconds for RT-Thread to finish its startup process. Without running any functional components, RT-Thread Smart requires less than 500ms to start and be ready. + +With its integrated Persimmon user interface (UI) component, the time it takes from power-on to a running UI is about one second. In other words, this is a seriously tiny and fast system. Of course, "real time" isn't about startup but how the system performs consistently over time. For RT-Thread, real-time performance is a priority, and the interrupt latency is less than 1 μs, which meets most application cases with the strictest real-time requirements. + +### RT-Thread Smart vs. RT-Thread + +You might be wondering about the differences between RT-Thread Smart and RT-Thread. Simply put, RT-Thread Smart is an RT-Thread RTOS-based operating system, but it integrates the user-state process. The kernel part of RT-Smart is essentially RT-Thread RTOS; it runs on virtual addresses, joins process management, and uses interprocess communication mechanisms, virtual memory/address space management, ELF loaders, and so on, and it makes all of these features components within RT-Thread RTOS. When the IwP components are disabled, RT-Smart falls back onto RT-Thread RTOS. + +Here's a comparison: + +| RT-Thread | RT-Thread Smart +---|---|--- +Supported chips | Cortex-M/R, RISC-V RV32IMAC (and similar), Cortex-A MPU | MPU with MMU, such as Cortex-A +Compiling | The kernel and application are compiled into an image program. | The kernel and application can be separately compiled and executed. +Memory | Runs on a linear address space (even with MMU) and uses virtual addressing with the physical address | Runs on a 32-bit system with the kernel running on more than 1GB, the user-state process has separate address spaces that are isolated from each other. Peripheral drivers must access peripherals with virtual addresses. +Running errors | When an application fails, the overall system collapses. | When an application fails, it does not affect kernel and other process execution. +Running model | Multiprocess model | Multiprocess model (multithread is supported within the process, and kernel threads are supported by the kernel) +User model | Single-user model | Single-user model +API | RT-Thread API, POSIX PSE52 | RT-Thread API (on kernel and userspace), plus a full POSIX API +Real time | Preemptive hard real-time system | Preemptive hard real-time system +Resource utilization | Very small | Relatively small +Debugging | Generally debugged through the emulator | No emulator required according to the way the software debugs + +RT-Thread RTOS is very compact. All applications and subsystems are compiled into the image, and multitasking runs and shares the same address space. + +RT-Thread Smart is independent. Systems and applications are separately compiled and executed. Applications have a complete address space and are kept isolated from each other. It also inherits all the great real-time features of RT-Thread and features a POSIX environment. + +Similarly, they're both compatible with the RT-Thread API, so applications on RT-Thread RTOS can be smoothly ported to RT-Thread Smart. + +### Embed open source + +RT-Thread Smart is an open source project, with its code available on [GitHub][11]. You can download the code and its documentation, give it a try, submit comments and feedback, and help spread it to more open source advocates. Embedded systems should belong to their users, and there are too many embedded developers out there who don't realize what's available. + +If you're a developer, help hack on RT-Thread Smart! As the RT-Thread project continues to advance, we aim to make the exciting worlds of IoT and edge computing open source. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/rt-thread-smart + +作者:[Zhu Tianlong][a] +选题:[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/zhu-tianlong +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=RPkPPtDe (An intersection of pipes.) +[2]: https://opensource.com/article/20/6/open-source-rtos +[3]: https://www.rt-thread.io/ +[4]: https://opensource.com/sites/default/files/uploads/rt-thread-smart.png (RT-Thread Smart architecture) +[5]: https://creativecommons.org/licenses/by-sa/4.0/legalcode +[6]: https://musl.libc.org/ +[7]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[8]: https://scons.org/ +[9]: https://opensource.com/article/19/7/introduction-gnu-autotools +[10]: https://opensource.com/article/21/5/cmake +[11]: https://github.com/RT-Thread/rt-thread/tree/rt-smart From 9a018cb5ecb6f484ff325e6c1ac4b7115c438d08 Mon Sep 17 00:00:00 2001 From: hustdemg Date: Sun, 11 Jul 2021 14:42:53 +0800 Subject: [PATCH 370/870] Update 20210621 Replace man pages with Tealdeer on Linux.md --- .../tech/20210621 Replace man pages with Tealdeer on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md b/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md index 84d05d99cd..4ef1600e37 100644 --- a/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md +++ b/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/tealdeer-linux) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ddl-hust ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 667f00256c78143640d11ea0fc14b8fb39e7b191 Mon Sep 17 00:00:00 2001 From: hustdemg Date: Sun, 11 Jul 2021 16:03:59 +0800 Subject: [PATCH 371/870] translated --- ...eplace man pages with Tealdeer on Linux.md | 49 +++++++------------ 1 file changed, 19 insertions(+), 30 deletions(-) rename {sources => translated}/tech/20210621 Replace man pages with Tealdeer on Linux.md (54%) diff --git a/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md b/translated/tech/20210621 Replace man pages with Tealdeer on Linux.md similarity index 54% rename from sources/tech/20210621 Replace man pages with Tealdeer on Linux.md rename to translated/tech/20210621 Replace man pages with Tealdeer on Linux.md index 4ef1600e37..4b43fbc8de 100644 --- a/sources/tech/20210621 Replace man pages with Tealdeer on Linux.md +++ b/translated/tech/20210621 Replace man pages with Tealdeer on Linux.md @@ -7,39 +7,34 @@ [#]: publisher: ( ) [#]: url: ( ) -Replace man pages with Tealdeer on Linux +在Linux上使用Tealdeer 替代 man 手册 ====== -Tealdeer is a Rust implementation of tldr, which provides -easy-to-understand information about common commands. + +Tealder 是 Rust 版本的tldr(too long dnot's read),对常用的命令提供了易于理解的说明信息。 ![computer screen ][1] -Man pages were my go-to resource when I started exploring Linux. Certainly, `man` is the most frequently used command when a beginner starts getting familiar with the world of the command line. But man pages, with their extensive lists of options and arguments, can be hard to decipher, which makes it difficult to understand whatever you wanted to know. If you want an easier solution with example-based output, I think [tldr][2] is the best option. +Man 手册是我开始探索Linux时最常用的资源。当然,对于初学者熟悉命令行指令而言,`man` 是最频繁使用的指令。但是 man 手册有大量的选项和参数列表,很难被解码,这使得你很难理解你想知道的东西。如果你想要一个更简单的解决方案,有基于例子的输出,我认为[tldr][2]是最好的选择。 -### What's Tealdeer? +### Tealdeer是什么? -[Tealdeer][3] is a wonderful implementation of tldr in Rust. It's a community-driven man page that gives very simple examples of how commands work. The best part about Tealdeer is that it has virtually every command you would normally use. +[Tealdeer][3]是基于Rust,对tldr的一个很好的实现。它是一个社区驱动的手册页,给出了非常简单的命令工作原理的例子。Tealdeer最棒的地方在于它几乎包含了所有你通常会用到的命令。 -### Install Tealdeer - -On Linux, you can install Tealdeer from your software repository. For example, on [Fedora][4]: +### 安装Tealdeer +在 Linux 系统,你可以从软件仓库安装 Tealdeer ,比如在on [Fedora][4]上: ``` `$ sudo dnf install tealdeer` ``` - -On macOS, use [MacPorts][5] or [Homebrew][6]. - -Alternately, you can build and install the tool with Rust's Cargo package manager: - +在 macOS 使用[ MacPorts ][5] 或者 [ Homebrew ][6]. +同样,你可以使用 Rust 的 Cargo 包管理器来编译和安装此工具: ``` `$ cargo install tealdeer` ``` +### 使用 Tealdeer -### Use Tealdeer - -Entering `tldr --list` returns the list of man pages tldr supports, like `touch`, `tar`, `dnf`, `docker`, `zcat`, `zgrep`, and so on: +输入 `tldr-list` 返回 tldr 所支持的书册,比如` touch`, `tar`, `dnf`, `docker`, `zcat`, `zgrep `等; ``` @@ -58,9 +53,7 @@ a2ensite a2query [...] ``` - -Using `tldr` with a specific command (like `tar`) shows example-based man pages that describe all the options that you can do with that command: - +使用 `tldr` 接具体的命令(比如 `tar` )能够显示基于案例的手册页,描述了你可以用该命令做的所有选项。 ``` $ tldr tar @@ -94,26 +87,22 @@ $ tldr tar       tar caf target.tar.xz file1 file2 file3 ``` -To control the cache: - +控制缓存: ```     $ tldr --update     $ tldr --clear-cache ``` -You can give Tealdeer output some color with the `--color` option, setting it to `always`, `auto`, and `never`. The default is `auto`, but I like the added context color provides, so I make mine permanent with this addition to my `~/.bashrc` file: - +你能够控制 Tealdeer 输出的颜色选项,有三种模式选择:总是,自动,从不。默认选项是自动,但我喜欢颜色提供的额外信息,所以我在我的`~/.bashrc `文件中增加了这个别名 ``` `alias tldr='tldr --color always'` ``` +### 结论 +Tealdeer 的美妙之处在于不需要网络连接就可以使用,只有更新缓存的时候才需要联网。因此,即使你处于离线状态,依然能够查找和学习你新学到的命令。更多信息,请查看该工具的[说明文档][8]。 -### Conclusion - -The beauty of Tealdeer is you don't need a network connection to use it, except when you're updating the cache. So, even if you are offline, you can still search for and learn about your new favorite command. For more information, consult the tool's [documentation][8]. - -Would you use Tealdeer? Or are you already using it? Let us know what you think in the comments below. +你会使用 Tealdeer么?或者你已经在使用了?欢迎留言让我们知道。 -------------------------------------------------------------------------------- @@ -121,7 +110,7 @@ via: https://opensource.com/article/21/6/tealdeer-linux 作者:[Sudeshna Sur][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[ddl-hust](https://github.com/ddl-hust) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7321ffff43a4526596d05199e4aac00f003c3e9f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Jul 2021 20:47:11 +0800 Subject: [PATCH 372/870] PRF @ddl-hust --- ...eplace man pages with Tealdeer on Linux.md | 82 ++++++++++--------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/translated/tech/20210621 Replace man pages with Tealdeer on Linux.md b/translated/tech/20210621 Replace man pages with Tealdeer on Linux.md index 4b43fbc8de..c00b821d11 100644 --- a/translated/tech/20210621 Replace man pages with Tealdeer on Linux.md +++ b/translated/tech/20210621 Replace man pages with Tealdeer on Linux.md @@ -2,40 +2,42 @@ [#]: via: (https://opensource.com/article/21/6/tealdeer-linux) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: (ddl-hust ) -[#]: reviewer: ( ) +[#]: translator: (ddl-hust) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -在Linux上使用Tealdeer 替代 man 手册 +在 Linux 上使用 Tealdeer 替代手册页 ====== -Tealder 是 Rust 版本的tldr(too long dnot's read),对常用的命令提供了易于理解的说明信息。 -![computer screen ][1] +> Tealder 是 Rust 版本的 tldr,对常用的命令提供了易于理解的说明信息。 -Man 手册是我开始探索Linux时最常用的资源。当然,对于初学者熟悉命令行指令而言,`man` 是最频繁使用的指令。但是 man 手册有大量的选项和参数列表,很难被解码,这使得你很难理解你想知道的东西。如果你想要一个更简单的解决方案,有基于例子的输出,我认为[tldr][2]是最好的选择。 +![](https://img.linux.net.cn/data/attachment/album/202107/11/204638catii1ro21jmjzmi.jpg) -### Tealdeer是什么? +手册页是我开始探索 Linux 时最常用的资源。当然,对于初学者熟悉命令行指令而言,`man` 是最频繁使用的指令。但是手册页中有大量的选项和参数列表,很难被解读,这使得你很难理解你想知道的东西。如果你想要一个更简单的解决方案,有基于例子的输出,我认为 [tldr][2] (太长不读too long dnot's read)是最好的选择。 -[Tealdeer][3]是基于Rust,对tldr的一个很好的实现。它是一个社区驱动的手册页,给出了非常简单的命令工作原理的例子。Tealdeer最棒的地方在于它几乎包含了所有你通常会用到的命令。 +### Tealdeer 是什么? -### 安装Tealdeer +[Tealdeer][3] 是 tldr 的一个基于 Rust 的实现。它是一个社区驱动的手册页,给出了非常简单的命令工作原理的例子。Tealdeer 最棒的地方在于它几乎包含了所有你通常会用到的命令。 -在 Linux 系统,你可以从软件仓库安装 Tealdeer ,比如在on [Fedora][4]上: +### 安装 Tealdeer + +在 Linux 系统,你可以从软件仓库安装 Tealdeer,比如在 [Fedora][4] 上: ``` -`$ sudo dnf install tealdeer` +$ sudo dnf install tealdeer ``` -在 macOS 使用[ MacPorts ][5] 或者 [ Homebrew ][6]. + +在 macOS 可以使用 [MacPorts][5] 或者 [Homebrew][6]。 同样,你可以使用 Rust 的 Cargo 包管理器来编译和安装此工具: ``` -`$ cargo install tealdeer` +$ cargo install tealdeer ``` + ### 使用 Tealdeer -输入 `tldr-list` 返回 tldr 所支持的书册,比如` touch`, `tar`, `dnf`, `docker`, `zcat`, `zgrep `等; - +输入 `tldr-list` 返回 tldr 所支持的手册页,比如 `touch`、`tar`、`dnf`、`docker`、`zcat`、`zgrep` 等: ``` $ tldr --list @@ -53,56 +55,58 @@ a2ensite a2query [...] ``` -使用 `tldr` 接具体的命令(比如 `tar` )能够显示基于案例的手册页,描述了你可以用该命令做的所有选项。 + +使用 `tldr` 跟上具体的命令(比如 `tar` )能够显示基于示例的手册页,描述了你可以用该命令做的所有选项。 ``` $ tldr tar -  Archiving utility. -  Often combined with a compression method, such as gzip or bzip2. -  More information: <[https://www.gnu.org/software/tar\>][7]. + Archiving utility. + Often combined with a compression method, such as gzip or bzip2. + More information: . -  [c]reate an archive and write it to a [f]ile: + [c]reate an archive and write it to a [f]ile: -      tar cf target.tar file1 file2 file3 + tar cf target.tar file1 file2 file3 -  [c]reate a g[z]ipped archive and write it to a [f]ile: + [c]reate a g[z]ipped archive and write it to a [f]ile: -      tar czf target.tar.gz file1 file2 file3 + tar czf target.tar.gz file1 file2 file3 -  [c]reate a g[z]ipped archive from a directory using relative paths: + [c]reate a g[z]ipped archive from a directory using relative paths: -      tar czf target.tar.gz --directory=path/to/directory . + tar czf target.tar.gz --directory=path/to/directory . -  E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely: + E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely: -      tar xvf source.tar[.gz|.bz2|.xz] + tar xvf source.tar[.gz|.bz2|.xz] -  E[x]tract a (compressed) archive [f]ile into the target directory: + E[x]tract a (compressed) archive [f]ile into the target directory: -      tar xf source.tar[.gz|.bz2|.xz] --directory=directory + tar xf source.tar[.gz|.bz2|.xz] --directory=directory -  [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program: + [c]reate a compressed archive and write it to a [f]ile, using [a]rchive suffix to determine the compression program: -      tar caf target.tar.xz file1 file2 file3 + tar caf target.tar.xz file1 file2 file3 ``` -控制缓存: +如需控制缓存: ``` -    $ tldr --update -    $ tldr --clear-cache +$ tldr --update +$ tldr --clear-cache ``` -你能够控制 Tealdeer 输出的颜色选项,有三种模式选择:总是,自动,从不。默认选项是自动,但我喜欢颜色提供的额外信息,所以我在我的`~/.bashrc `文件中增加了这个别名 +你能够控制 Tealdeer 输出的颜色选项,有三种模式选择:一直、自动、从不。默认选项是自动,但我喜欢颜色提供的额外信息,所以我在我的 `~/.bashrc `文件中增加了这个别名: ``` -`alias tldr='tldr --color always'` +alias tldr='tldr --color always' ``` ### 结论 -Tealdeer 的美妙之处在于不需要网络连接就可以使用,只有更新缓存的时候才需要联网。因此,即使你处于离线状态,依然能够查找和学习你新学到的命令。更多信息,请查看该工具的[说明文档][8]。 -你会使用 Tealdeer么?或者你已经在使用了?欢迎留言让我们知道。 +Tealdeer 的美妙之处在于不需要网络连接就可以使用,只有更新缓存的时候才需要联网。因此,即使你处于离线状态,依然能够查找和学习你新学到的命令。更多信息,请查看该工具的 [说明文档][8]。 + +你会使用 Tealdeer 么?或者你已经在使用了?欢迎留言让我们知道。 -------------------------------------------------------------------------------- @@ -111,7 +115,7 @@ via: https://opensource.com/article/21/6/tealdeer-linux 作者:[Sudeshna Sur][a] 选题:[lujun9972][b] 译者:[ddl-hust](https://github.com/ddl-hust) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f172af9cf62f557b4cf8ebd49e77b7001d53b53d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Jul 2021 20:48:03 +0800 Subject: [PATCH 373/870] PUB @ddl-hust https://linux.cn/article-13570-1.html --- .../20210621 Replace man pages with Tealdeer on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210621 Replace man pages with Tealdeer on Linux.md (98%) diff --git a/translated/tech/20210621 Replace man pages with Tealdeer on Linux.md b/published/20210621 Replace man pages with Tealdeer on Linux.md similarity index 98% rename from translated/tech/20210621 Replace man pages with Tealdeer on Linux.md rename to published/20210621 Replace man pages with Tealdeer on Linux.md index c00b821d11..38fdafe103 100644 --- a/translated/tech/20210621 Replace man pages with Tealdeer on Linux.md +++ b/published/20210621 Replace man pages with Tealdeer on Linux.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ddl-hust) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13570-1.html) 在 Linux 上使用 Tealdeer 替代手册页 ====== From 786abccddfca548b72d46d5e95b06acdec871f10 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 05:03:56 +0800 Subject: [PATCH 374/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210711=20?= =?UTF-8?q?Explore=20waterways=20with=20this=20open=20source=20nautical=20?= =?UTF-8?q?navigation=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210711 Explore waterways with this open source nautical navigation tool.md --- ...is open source nautical navigation tool.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20210711 Explore waterways with this open source nautical navigation tool.md diff --git a/sources/tech/20210711 Explore waterways with this open source nautical navigation tool.md b/sources/tech/20210711 Explore waterways with this open source nautical navigation tool.md new file mode 100644 index 0000000000..2509b03452 --- /dev/null +++ b/sources/tech/20210711 Explore waterways with this open source nautical navigation tool.md @@ -0,0 +1,94 @@ +[#]: subject: (Explore waterways with this open source nautical navigation tool) +[#]: via: (https://opensource.com/article/21/7/open-source-nautical-navigation) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Explore waterways with this open source nautical navigation tool +====== +Whether you're sailing down a local river or setting out on the open +seas, keep track of your nautical location with OpenCPN. +![Boat helm at sunset for navigation][1] + +If you're traveling by boat down your local waterway or sailing around the world, you can bring great navigation software with you and maintain your commitment to open source software. [OpenCPN][2] is free and open source software developed by sailors. It serves as the primary navigation interface for vessels with full-time helm-visible navigational suites. The software is written in C and released under a [GPLv2 license][3]. + +### Install OpenCPN + +OpenCPN can be installed on Linux, macOS, or Windows. Packages are available for [Fedora][4], [Ubuntu][5], and [Raspberry Pi][6]. I installed OpenCPN on my Linux laptop using [Flatpak][7]. For macOS and Windows, you can download and install packages from the [OpenCPN website][8]. + +There's also an [Android app][9] version available from the Google Play store. + +### Use OpenCPN + +Once it's installed, launch OpenCPN to try it out. The main menu bar is located on the left. + +The first choice from the top is **Options**. Here, you can select how the program appears in the display and what units of measurement of speed, distance, and depth to use. You also can set how latitude and longitude are displayed in [decimal degrees][10]. + +![OpenCPN map showing latitude and longitude measurements][11] + +(Don Watkins, [CC BY-SA 4.0][12]) + +### Get charts + +OpenCPN doesn't come preinstalled with charts. Which charts you choose to install are generally determined by your location and, potentially, your destination. + +Many free [charts are available][13], including those from the US NOAA Office of Coast Survey, Marinha Do Brasil (which includes parts of Antarctica), East Asia Hydrographic Commission, many sources of inland European waterway charts, and many other sources. The chart page also links to commercial sources, should you require them. + +### Learn more + +The project provides an excellent [quickstart guide][14] to make it easy for new users. + +The OpenCPN project also has excellent [documentation][15] to guide you through the installation and setup process. It provides step-by-step directions for first use and [installing charts][16]. The program also comes with a list of [supplementary software][17] you can use with it. + +OpenCPN is available in 20 languages. There are lots of how-to videos available on [Vimeo][18] and [YouTube][19] to help you become familiar with the software. + +![OpenCPN map of Long Island and Nantucket Sounds][20] + +(Don Watkins, [CC BY-SA 4.0][12]) + +### Get involved + +David S. Register is the lead developer for the project. He originally developed OpenCPN in 2009 for his own use. Other folks expressed an interest in his software, and now there are thousands of users and more than 40 active developers worldwide. + +You can [get involved][21] with the project by consulting its excellent [developer documentation][22]. + +Take a look at two open source applications that bring the far reaches of space a little bit closer. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-source-nautical-navigation + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/boat-helm-sunset.jpg?itok=g1MYhF_s (Boat helm at sunset) +[2]: https://opencpn.org/ +[3]: https://github.com/OpenCPN/OpenCPN/blob/master/COPYING.gplv2 +[4]: https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:getting_started:opencpn_installation:fedora +[5]: https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:getting_started:opencpn_installation:ubuntu_ppa +[6]: https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:getting_started:opencpn_installation:raspberrypi_rpi2 +[7]: https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:getting_started:opencpn_installation:flatpak +[8]: https://opencpn.org/OpenCPN/info/downloadopencpn.html +[9]: https://www.bigdumboat.com/aocpn/cpnapp.html +[10]: http://wiki.gis.com/wiki/index.php/Decimal_degrees +[11]: https://opensource.com/sites/default/files/uploads/opencpn-map.png (OpenCPN map showing latitude and longitude measurements) +[12]: https://creativecommons.org/licenses/by-sa/4.0/ +[13]: https://opencpn.org/OpenCPN/info/chartsource.html +[14]: https://opencpn.org/OpenCPN/info/quickstart.html +[15]: https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:getting_started:opencpn_installation +[16]: https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:getting_started:chart_installation +[17]: https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:supplementary_hardware +[18]: https://vimeo.com/user17026077/videos +[19]: https://www.youtube.com/results?search_query=OpenCPN +[20]: https://opensource.com/sites/default/files/uploads/opencpn-map2.png (OpenCPN map of Long Island and Nantucket Sounds) +[21]: https://github.com/OpenCPN/OpenCPN +[22]: https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:developer_manual From e6d8f8b56aaa6f379e24a81973980ba344e7cbbb Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 12 Jul 2021 08:59:09 +0800 Subject: [PATCH 375/870] translating --- ...706 Edit PDFs on the Linux command line.md | 101 ------------------ ...706 Edit PDFs on the Linux command line.md | 100 +++++++++++++++++ 2 files changed, 100 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20210706 Edit PDFs on the Linux command line.md create mode 100644 translated/tech/20210706 Edit PDFs on the Linux command line.md diff --git a/sources/tech/20210706 Edit PDFs on the Linux command line.md b/sources/tech/20210706 Edit PDFs on the Linux command line.md deleted file mode 100644 index 5d9ead1807..0000000000 --- a/sources/tech/20210706 Edit PDFs on the Linux command line.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: subject: (Edit PDFs on the Linux command line) -[#]: via: (https://opensource.com/article/21/7/qpdf-command-line) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Edit PDFs on the Linux command line -====== -Use qpdf and poppler-utils to split, modify, and combine PDF files. -![Text editor on a browser, in blue][1] - -Many of the documents you receive come in PDF format. Sometimes those PDFs need to be manipulated. For example, pages might need to be removed or added, or you might need to sign or change a specific page. - -Whether good or bad, this is the reality we all live in. - -There are some fancy graphical user interface tools that let you edit PDFs, but I have always been most comfortable with the command line. Of the many command-line tools for this task, the ones I use when I want to modify a PDF are `qpdf` and `poppler-utils`. - -### Install - -On Linux, you can install `qpdf` and `poppler-utils` using your package manager (such as `apt` or `dnf`.) For example, on Fedora: - - -``` -`$ sudo dnf install qpdf poppler-utils` -``` - -On macOS, use [MacPorts][2] or [Homebrew][3]. On Windows, use [Chocolatey][4]. - -### qpdf - -The `qpdf` command can do a lot, but I mostly use it for: - - 1. Splitting a PDF into separate pages - 2. Concatenating, or combining, PDFs into one file - - - -To split a PDF into separate pages: - - -``` -`qpdf --split-pages original.pdf split.pdf` -``` - -This generates files like `split-01.pdf`, `split-02.pdf`, and so on. Each file is a single-page PDF file. - -Concatenating files is a little subtler: - - -``` -`qpdf --empty concatenated.pdf --pages split-*.pdf --` -``` - -This is what `qpdf` does by default. The `--empty` option tells qpdf to start with an empty file. The two dashes (`--`) at the end signals that there are no more files to process. This is a case where the parameters reflect an internal model, rather than what people use it for, but at least it runs and produces valid PDFs! - -### poppler-utils - -This package contains several utilities, but the one I use the most is [pdftoppm][5], which converts PDF files to portable pixmap (`ppm`) image files. I usually use it after I split pages with `qpdf` and need to convert a specific page to an image that I can modify. The `ppm` format is not well known, but the important thing about it is that most image manipulation methods, including [ImageMagick][6], [Pillow][7], and many other options, work with it. Most of these tools can save files back to PDF, too. - -### Workflow - -My usual workflow is: - - * Use `qpdf` to split the PDF into pages. - * Use `poppler-utils` to convert the pages that need to be changed into images. - * Modify the images as needed and save them to PDF. - * Use `qpdf` to concatenate the pages back into one PDF. - - - -### Other tools - -There are many great open source commands to deal with PDFs, whether you're [shrinking them][8], [creating them from text files][9], [converting documents][10], or trying your best to [avoid them altogether][11]. What are your favorite open source PDF utilities? Please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/qpdf-command-line - -作者:[Moshe Zadka][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) -[2]: https://opensource.com/article/20/11/macports -[3]: https://opensource.com/article/20/6/homebrew-mac -[4]: https://opensource.com/article/20/3/chocolatey -[5]: https://www.xpdfreader.com/pdftoppm-man.html -[6]: https://opensource.com/article/17/8/imagemagick -[7]: https://opensource.com/article/20/8/edit-images-python -[8]: https://opensource.com/article/20/8/reduce-pdf -[9]: https://opensource.com/article/20/5/pandoc-cheat-sheet -[10]: https://opensource.com/article/21/3/libreoffice-command-line -[11]: https://opensource.com/article/19/3/comic-book-archive-djvu diff --git a/translated/tech/20210706 Edit PDFs on the Linux command line.md b/translated/tech/20210706 Edit PDFs on the Linux command line.md new file mode 100644 index 0000000000..678ee4efd6 --- /dev/null +++ b/translated/tech/20210706 Edit PDFs on the Linux command line.md @@ -0,0 +1,100 @@ +[#]: subject: (Edit PDFs on the Linux command line) +[#]: via: (https://opensource.com/article/21/7/qpdf-command-line) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 命令行上编辑 PDF +====== +使用 qpdf 和 poppler-utils 来分割、修改和合并 PDF 文件。 +![Text editor on a browser, in blue][1] + +你收到的许多文件都是 PDF 格式的。有时这些 PDF 需要被处理。例如,可能需要删除或添加页面,或者你可能需要签署或修改一个特定的页面。 + +不管是好是坏,这就是我们所处的现实。 + +有一些花哨的图形用户界面工具可以让你编辑 PDF,但我一直对命令行感到最舒服。在这个任务的许多命令行工具中,当我想修改一个 PDF 时,我使用的是 `qpdf` 和 `poppler-utils`。 + +### 安装 + +在 Linux 上,你可以用你的包管理器(如 `apt` 或 `dnf`)来安装 `qpdf` 和 `poppler-utils`。比如在 Fedora 上: + +``` +`$ sudo dnf install qpdf poppler-utils` +``` + +在 macOS 上,使用 [MacPorts][2] 或 [Homebrew][3]。在 Windows 上,使用 [Chocolatey][4]。 + +### qpdf + +`qpdf` 命令可以做很多事情,但我主要用它来: + + 1. 将一个 PDF 分割成不同的页面 + 2. 将 PDF 文件合并成一个文件 + + + +要将一个 PDF 分割成不同的页面: + + +``` +`qpdf --split-pages original.pdf split.pdf` +``` + +这就会生成像 `split-01.pdf`、`split-02.pdf` 这样的文件。每个文件都是一个单页的 PDF 文件。 + +合并文件比较微妙: + + +``` +`qpdf --empty concatenated.pdf --pages split-*.pdf --` +``` + +这就是 `qpdf` 默认的做法。`--empty` 选项告诉 qpdf 从一个空文件开始。结尾处的两个破折号(`--`)表示没有更多的文件需要处理。这是一个参数反映内部模型的例子,而不是人们使用它的目的,但至少它能运行并产生有效的 PDF! + +### poppler-utils + +这个软件包包含几个工具,但我用得最多的是 [pdftoppm][5],它把 PDF 文件转换为可移植的像素图(`ppm`)文件。我通常在用 `qpdf`分割页面后使用它,并需要将特定页面转换为我可以修改的图像。`ppm` 格式并不为人所知,但重要的是大多数图像处理方法,包括 [ImageMagick][6]、[Pillow][7] 等,都可以使用它。这些工具中的大多数也可以将文件保存为 PDF。 + +### 工作流程 + +我通常的工作流程是: + + * 使用 `qpdf` 将 PDF 分割成若干页。 + * 使用 `poppler-utils` 将需要修改的页面转换为图像。 + * 根据需要修改图像,并将其保存为 PDF。 + * 使用 `qpdf` 将各页合并成一个 PDF。 + + + +### 其他工具 + +有许多很好的开源命令来处理 PDF,无论你是[缩小它们][8]、[从文本文件创建它们][9]、[转换文档][10],还是尽力[完全避免它们][11]。你最喜欢的开源 PDF 工具是什么?请在评论中分享它们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/qpdf-command-line + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://opensource.com/article/20/11/macports +[3]: https://opensource.com/article/20/6/homebrew-mac +[4]: https://opensource.com/article/20/3/chocolatey +[5]: https://www.xpdfreader.com/pdftoppm-man.html +[6]: https://opensource.com/article/17/8/imagemagick +[7]: https://opensource.com/article/20/8/edit-images-python +[8]: https://opensource.com/article/20/8/reduce-pdf +[9]: https://opensource.com/article/20/5/pandoc-cheat-sheet +[10]: https://opensource.com/article/21/3/libreoffice-command-line +[11]: https://opensource.com/article/19/3/comic-book-archive-djvu From 88f6eb6e7982560c94c0bf6ffb59e41a1af28d7c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 12 Jul 2021 09:02:49 +0800 Subject: [PATCH 376/870] translating --- ...0708 Encrypt and decrypt files with a passphrase on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md b/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md index b1f437299b..88bf0d7e8c 100644 --- a/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md +++ b/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/linux-age) [#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5f70afeab3260043ad326d739aec7c24a720e991 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Jul 2021 09:56:21 +0800 Subject: [PATCH 377/870] PRF @MjSeven --- ...709 How to Install Zlib on Ubuntu Linux.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md b/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md index e910a3ab44..3f4472970d 100644 --- a/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md +++ b/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md @@ -3,20 +3,22 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 如何在 Ubuntu Linux 上安装 Zlib ====== +![](https://img.linux.net.cn/data/attachment/album/202107/12/095552ndjee050i099j0j6.jpg) + [Zlib][1] 是一个用于数据压缩的开源库。 -作为使用者,你可能会遇到需要将 Zlib(或 zlib devel 包)作为另一个应用程序的依赖项的情况。 +作为使用者,你可能会遇到需要安装 zlib(或 zlib-devel 包)作为另一个应用程序的依赖项的情况。 -但问题来了,如果你尝试在 Ubuntu 上安装 Zlib,它会抛出 “unable to locate package zlib” 错误。 +但问题来了,如果你尝试在 Ubuntu 上安装 zlib,它会抛出 “unable to locate package zlib” 错误。 -```bash +``` sudo apt install zlib Reading package lists... Done Building dependency tree @@ -26,25 +28,25 @@ E: Unable to locate package zlib 为什么会看到这个 [Ubable to locate package 错误][2]呢?因为没有名为 zlib 的包。 -如果你 [使用 apt search 命令][3],你会发现有几个包可以让你安装:**zlib 1g 和 zlib 1g-dev**。当你知道这些后,只需一个 apt 命令就可以安装它们。 +如果你 [使用 apt search 命令][3],你会发现有几个包可以让你安装:zlib 1g 和 zlib 1g-dev。当你知道这些后,只需一个 `apt` 命令就可以安装它们。 ### 在基于 Ubuntu 的 Linux 发行版上安装 Zlib 打开终端,使用以下命令: -```bash +``` sudo apt install zlib1g ``` -_**请记住 g 前面的字母是 1(一),而不是小写的 L。很多人在输入命令时都会犯这个错误。**_ +请记住 `g` 前面的字母是数字 `1`,而不是小写的字母 `L`。很多人在输入命令时都会犯这个错误。 另一个包,zlib 1g-dev 是开发包。只有在你需要时才安装它,否则你应该使用 zlib 1g 包。 -```bash +``` sudo apt install zlib1g-dev ``` -你也可以[ Zlib 网站][1]下载源代码并安装它。但是,除非你有充分的理由,否则我不推荐使用源代码方式来安装 zlib。例如,如果你需要最新或特定版本的 zlib,但该版本在发行版的仓库中不可用。 +你也可以 [Zlib 网站][1] 下载源代码并安装它。但是,除非你有充分的理由,否则我不推荐使用源代码方式来安装 zlib。例如,如果你需要最新或特定版本的 zlib,但该版本在发行版的仓库中不可用。 有趣的是,像安装 zlib 这样看似很小的东西可能会变得很麻烦,有两个原因:一个是不同的包名;另一个是包含“隐藏”数字 1,它与小写 L 混淆了。 @@ -57,7 +59,7 @@ via: https://itsfoss.com/install-zlib-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2efeff291e969aeb4d75e840d7ef1b1c8272bc65 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Jul 2021 09:56:59 +0800 Subject: [PATCH 378/870] PUB @MjSeven https://linux.cn/article-13572-1.html --- .../20210709 How to Install Zlib on Ubuntu Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210709 How to Install Zlib on Ubuntu Linux.md (97%) diff --git a/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md b/published/20210709 How to Install Zlib on Ubuntu Linux.md similarity index 97% rename from translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md rename to published/20210709 How to Install Zlib on Ubuntu Linux.md index 3f4472970d..504121d831 100644 --- a/translated/tech/20210709 How to Install Zlib on Ubuntu Linux.md +++ b/published/20210709 How to Install Zlib on Ubuntu Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13572-1.html" 如何在 Ubuntu Linux 上安装 Zlib ====== From d5efdcbc3f0b704f7b33a103031823125a5c2172 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Jul 2021 10:50:25 +0800 Subject: [PATCH 379/870] PRF @HankChow --- ...ceive Gmail from the Linux command line.md | 73 +++++++++---------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/translated/tech/20210706 Send and receive Gmail from the Linux command line.md b/translated/tech/20210706 Send and receive Gmail from the Linux command line.md index f319be23e2..f9523c5c5b 100644 --- a/translated/tech/20210706 Send and receive Gmail from the Linux command line.md +++ b/translated/tech/20210706 Send and receive Gmail from the Linux command line.md @@ -3,28 +3,28 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 在 Linux 命令行中收发 Gmail 邮件 ====== -即使你用的是诸如 Gmail 的托管邮件服务,你也可以通过 Mutt 在终端里收发电子邮件。 -![woman on laptop sitting at the window][1] +> 即使你用的是诸如 Gmail 的托管邮件服务,你也可以通过 Mutt 在终端里收发电子邮件。 -我喜欢在 Linux 终端上读写电子邮件的便捷,因此我是 [Mutt][2] 这个轻量简洁的电子邮件客户端的忠实用户。对于电子邮件服务来说,不同的系统配置和网络接入并不会造成什么影响。这个客户端通常隐藏在我 Linux 终端的[某个标签页或者某个终端复用器的面板][3]上,需要用的时候随时可以调出来,不需要使用的时候放到后台,就不需要在桌面上一直放置一个电子邮件客户端的应用程序。 +![](https://img.linux.net.cn/data/attachment/album/202107/12/104952frwgx4oz4xrinbxl.jpg) -当今我们大多数人使用的都是托管电子邮件账号,在这个在这种使用场景中并不会与电子邮件协议发生过多的直接交互。而 Mutt(以及更早的 ELM)在创立之初实现的是对 `uucp` 的调用,以及对 `/var/mail` 的读取。当然 Mutt 也很与时俱进,随着各种流行的协议(如 POP、IMAP、LDAP)出现,它都实现了良好的支持。因此,即使我们使用的是 Gmail 这种邮件服务,也可以与 Mutt 无缝衔接。 +我喜欢在 Linux 终端上读写电子邮件的便捷,因此我是 [Mutt][2] 这个轻量简洁的电子邮件客户端的忠实用户。对于电子邮件服务来说,不同的系统配置和网络接入并不会造成什么影响。这个客户端通常隐藏在我 Linux 终端的 [某个标签页或者某个终端复用器的面板][3] 上,需要用的时候随时可以调出来,不需要使用的时候放到后台,就不需要在桌面上一直放置一个电子邮件客户端的应用程序。 -在大多数情况下,用户都不会拥有自己的电子邮件服务器,同时大部分用户都会选择 Gmail,因此下文会以 Mutt + Gmail 为例作介绍。如果你比较注重电子邮件隐私,不妨考虑 [ProtonMail][4] 或者 [Tutanota][5],它们都提供完全加密的电子邮件服务。其中 Tutanota 包含很多[开源组件][6],而 ProtonMail 则为付费用户提供 [IMAP 桥][7], 简化了在非浏览器环境下的邮件访问。尽管如此,很多公司、学校和组织都没有自己的电子邮件服务,而是使用 Gmail 提供的邮件服务,这样一来,大部分用户都会有一个 Gmail 邮箱。 +当今我们大多数人使用的都是托管电子邮件账号,在这种使用场景中并不会与电子邮件协议发生过多的直接交互。而 Mutt(以及更早的 ELM)是在更简单的时代创建的,那时候检查邮件只是对 `uucp` 的调用,以及对 `/var/mail` 的读取。当然 Mutt 也很与时俱进,随着各种流行的协议(如 POP、IMAP、LDAP)出现,它都实现了良好的支持。因此,即使我们使用的是 Gmail 这种邮件服务,也可以与 Mutt 无缝衔接。 -当然,如果你自己就[拥有电子邮件服务器][8],那么使用 Mutt 就更简单了。下面我们开始介绍。 +如今在大多数情况下,用户都不会拥有自己的电子邮件服务器,大部分用户都会选择 Gmail,因此下文会以 Mutt + Gmail 为例作介绍。如果你比较注重电子邮件隐私,不妨考虑 [ProtonMail][4] 或者 [Tutanota][5],它们都提供完全加密的电子邮件服务。其中 Tutanota 包含很多 [开源组件][6],而 ProtonMail 则为付费用户提供 [IMAP 桥接][7],简化了在非浏览器环境下的邮件访问。不过,很多公司、学校和组织都没有自己的电子邮件服务,而是使用 Gmail 提供的邮件服务,这样一来,大部分用户都会有一个 Gmail 邮箱。 + +当然,如果你自己就 [拥有电子邮件服务器][8],那么使用 Mutt 就更简单了。下面我们开始介绍。 ### 安装 Mutt -在 Linux 系统上,一般可以直接从发行版提供的软件库中安装 Mutt,另外需要在 home 目录中创建一个 `.mutt` 目录以存放配置文件: - +在 Linux 系统上,一般可以直接从发行版提供的软件库中安装 Mutt,另外需要在家目录中创建一个 `.mutt` 目录以存放配置文件: ``` $ sudo dnf install mutt @@ -33,26 +33,24 @@ $ mkdir ~/.mutt 在 MacOS 上,可以通过 [MacPorts][9] 或者 [Homebrew][10] 安装;在 Windows 上则可以使用 [Chocolatey][11] 安装。 -Mutt 是一个邮件用户代理Mail User Agent(MUA),因此它的作用是读取、编写以及向外部邮件池发送邮件,其它邮件应用或者邮件服务则仅仅是负责在用户和邮件服务器之间传递信息,尽管它们可以和 Mutt 进行协作,让我们看起来是邮件应用们实现了所有功能,但实际上并非如此。在弄懂了两者之间的区别之后,我们会对 Mutt 的配置更加清楚。 +Mutt 是一个邮件用户代理Mail User Agent(MUA),因此它的作用是读取、编写以及向外部邮件池发送邮件。向邮件服务器实际传输邮件是其它应用或邮件服务的工作,尽管它们可以和 Mutt 进行协作,让我们看起来是 Mutt 完成了所有功能,但实际上并非如此。在弄懂了两者之间的区别之后,我们会对 Mutt 的配置更加清楚。 -除了 Mutt 之外,我们还需要视乎进行通信的服务种类选择一些辅助应用程序。在本文中我使用的是 IMAP 服务,这可以让我本地的电子邮件副本与电子邮件服务提供商的电子邮件副本保持同步。如果你选择 POP 服务,配置的难度就更下一个台阶了,也无需依赖其它外部工具。我们需要OfflineIMAP 这个 Python 应用程序来实现 IMAP 的集成,这个应用程序可以在[它的 GitHub 存储库][12]获取。 +这也是为什么除了 Mutt 之外,我们还需要视乎进行通信的服务种类选择一些辅助应用程序。在本文中我使用的是 IMAP 服务,这可以让我本地的电子邮件副本与电子邮件服务提供商的远程邮件副本保持同步。如果你选择 POP 服务,配置的难度就更下一个台阶了,也无需依赖其它外部工具。我们需要 OfflineIMAP 这个 Python 应用程序来实现 IMAP 的集成,这个应用程序可以在 [它的 GitHub 存储库][12] 获取。 OfflineIMAP 目前仍然在从 Python 2 移植到 Python 3,目前需要手动安装,但以后你也可以通过 `python3 -m pip` 命令进行安装。 -OfflineIMAP 依赖于 `imaplib2` 库,这个库也在开发当中,所以我更喜欢手动安装。同样地,也是通过 Git 将代码库克隆到本地,进入目录后使用 `pip` 安装。 +OfflineIMAP 依赖于 `imaplib2` 库,这个库也在努力开发当中,所以我更喜欢手动安装。同样地,也是通过 Git 将代码库克隆到本地,进入目录后使用 `pip` 安装。 首先安装 `rfc6555` 依赖: - ``` -`$ python3 -m pip install --user rfc6555` +$ python3 -m pip install --user rfc6555 ``` 然后从源码安装 `imaplib2`: - ``` -$ git clone [git@github.com][13]:jazzband/imaplib2.git +$ git clone git@github.com:jazzband/imaplib2.git $ pushd imaplib2.git $ python3 -m pip install --upgrade --user . $ popd @@ -60,30 +58,27 @@ $ popd 最后从源码安装 OfflineIMAP: - ``` -$ git clone [git@github.com][13]:OfflineIMAP/offlineimap3.git +$ git clone git@github.com:OfflineIMAP/offlineimap3.git $ pushd offlineimap3.git $ python3 -m pip install --upgrade --user . $ popd ``` -如果你使用的是 Windows 上的 Cygwin,那么你还需要安装 [Portlocker][14]。 +如果你使用的是 Windows 上的 Cygwin,那么你还需要安装 [Portlocker][14]。 ### 配置 OfflineIMAP - OfflineIMAP 默认使用 `~/.offlineimaprc` 这个配置文件,在它的代码库中会有一个名为 `offlineimap.conf` 的配置模板,可以直接将其复制到 home 目录下: - +OfflineIMAP 默认使用 `~/.offlineimaprc` 这个配置文件,在它的代码库中会有一个名为 `offlineimap.conf` 的配置模板,可以直接将其移动到家目录下: ``` -`$ mv offlineimap3.git/offlineimap.conf ~/.offlineimaprc` +$ mv offlineimap3.git/offlineimap.conf ~/.offlineimaprc` ``` 你可以使用任何文本编辑器打开浏览这个配置文件,它的注释很完善,便于了解各个可用的配置项。 以下是我的 `.offlineimaprc` 配置文件,为了清晰起见,我把其中的注释去掉了。对于你来说其中有些配置项的值可能会略有不同,但或许会为你的配置带来一些启发: - ``` [general] ui = ttyui @@ -127,38 +122,37 @@ folderfilter = lambda folder: folder not in ['[Gmail]/Trash', ] ``` -配置文件里有两个可以替换的值,分别是 `%your-gmail-username%` 和 `%your-gmail-API-password%`。其中第一个值需要替换为 Gmail 用户名,也就是邮件地址中 `@gmail.com` 左边的部分。而第二个值则需要通过双因素身份验证(2FA)后从 Google 获取。 +配置文件里有两个可以替换的值,分别是 `%your-gmail-username%` 和 `%your-gmail-API-password%`。其中第一个值需要替换为 Gmail 用户名,也就是邮件地址中 `@gmail.com` 左边的部分。而第二个值则需要通过双因素身份验证(2FA)后从 Google 获取(即使你在查收邮件时不需要使用 2FA)。 ### 为 Gmail 设置双因素身份验证(2FA) Google 希望用户通过 Gmail 网站收发电子邮件,因此当你在 Gmail 网站以外操作电子邮件时,实际上是被 Google 作为“开发者”看待(尽管你没有进行任何开发工作)。也就是说,Google 会认为你正在创建一个应用程序。要获得开发者层面的应用程序密码,就必须设置双因素身份验证。完成了这个过程以后,就可以获得一个应用程序密码,Mutt 可以通过这个密码在浏览器以外的环境登录到你的电子邮箱中。 -为了安全起见,你还可以在 Google 的[账号安全][15]页面中添加一个用于找回的电子邮件地址。 +为了安全起见,你还可以在 Google 的 [账号安全][15] 页面中添加一个用于找回的电子邮件地址。 -在账号安全页面中,点击“两步验证”(2-step Verification)开始设置 2FA,设置过程中需要用到一部手机。 +在账号安全页面中,点击“两步验证2-step Verification”开始设置 2FA,设置过程中需要用到一部手机。 -激活 2FA 之后,账号安全页面中会出现“应用程序密码”(App Passwords)选项,点击就可以为 Mutt 创建一个新的应用程序密码。在 Google 生成密码之后,将其替换 `.offlineimaprc` 配置文件中的 `%your-gmail-API-password%` 值。 +激活 2FA 之后,账号安全页面中会出现“应用程序密码App Passwords”选项,点击就可以为 Mutt 创建一个新的应用程序密码。在 Google 生成密码之后,将其替换 `.offlineimaprc` 配置文件中的 `%your-gmail-API-password%` 值。 -直接将应用程序密码记录在 `.offlineimaprc` 文件中,这种以纯文本形式存储的做法有一定的风险。因为我的 home 目录是加密的,所以我长期以来都是这样做的。但出于安全考虑,我现在已经改为使用 GnuPG 加密应用程序密码,这部分内容不在本文的讨论范围,关于如何设置 GPG 密码集成,可以参考我的[另一篇文章][16]。 +直接将应用程序密码记录在 `.offlineimaprc` 文件中,这种以纯文本形式存储的做法有一定的风险。长期以来我都是这样做的,而且感觉良好,因为我的家目录是加密的。但出于安全考虑,我现在已经改为使用 GnuPG 加密应用程序密码,这部分内容不在本文的讨论范围,关于如何设置 GPG 密码集成,可以参考我的 [另一篇文章][16]。 ### 在 Gmail 启用 IMAP -在启用 IMAP 访问 Gmail 账户之后,你就可以不再打开 Gmail 网站了。 +在你永远告别 Gmail 网页界面之前,还有最后一件事:你必须启用 Gmail 账户的 IMAP 访问。 -在 Gmail 网站页面中,点击右上角的“cog”图标,选择“查看所有设置”(See all settings)。 在 Gmail 设置页面中,点击“POP/IMAP”标签页,并选中“启用 IMAP”(enable IMAP),然后保存设置。 +在 Gmail 网站页面中,点击右上角的“cog”图标,选择“查看所有设置See all settings”。在 Gmail 设置页面中,点击“POP/IMAP”标签页,并选中“启用 IMAPenable IMAP”,然后保存设置。 现在就可以在浏览器以外访问你的 Gmail 电子邮件了。 ### 配置 Mutt -Mutt 的配置过程相对简单。和 [.bashrc][17]、[.zshrc][18]、.emacs 这些配置文件一样,网络上有很多优秀的 .muttrc 配置文件可供参照。我自己的 .muttrc 配置文件则借鉴了 [Kyle Rankin][19]、[Paul Frields][20] 等人的配置项和想法。下面列出我的配置文件的一些要点: - +Mutt 的配置过程相对简单。和 [.bashrc][17]、[.zshrc][18]、`.emacs` 这些配置文件一样,网络上有很多优秀的 .muttrc 配置文件可供参照。我自己的 `.muttrc` 配置文件则借鉴了 [Kyle Rankin][19]、[Paul Frields][20] 等人的配置项和想法。下面列出我的配置文件的一些要点: ``` set ssl_starttls=yes set ssl_force_tls=yes -set from='[tux@example.com][21]' +set from='tux@example.com' set realname='Tux Example' set folder = imaps://imap.gmail.com/ @@ -203,21 +197,20 @@ mailboxes +INBOX \ set postponed = "+example.com/drafts" # navigation -macro index gi "<change-folder>=example.com/INBOX<enter>" "Go to inbox" -macro index gt "<change-folder>=example.com/sent" "View sent" +macro index gi "=example.com/INBOX" "Go to inbox" +macro index gt "=example.com/sent" "View sent" ``` 整个配置文件基本是开箱即用的,只需要将其中的 `Tux Example`和 `example.com` 替换为你的实际值,并将其保存为 `~/.mutt/muttrc` 就可以使用了。 ### 启动 Mutt -在启动 Mutt 之前,需要先启动 `offlineimap` 将远程邮件服务器上的邮件同步到本地。在首次启动的时候耗时可能会比较长,只需要让它默默运行直到同步完成就可以了。 +在启动 Mutt 之前,需要先启动 `offlineimap` 将远程邮件服务器上的邮件同步到本地。在首次启动的时候耗时可能会比较长,只需要让它整晚运行直到同步完成就可以了。 在同步完成后,启动 Mutt: - ``` -`$ mutt` +$ mutt ``` Mutt 会提示你打开用于管理电子邮件的目录权限,并展示收件箱的视图。 @@ -226,7 +219,7 @@ Mutt 会提示你打开用于管理电子邮件的目录权限,并展示收件 ### 学习使用 Mutt -在学习使用 Mutt 的过程中,你可以找到最符合你使用习惯的 .muttrc 配置。例如我的 .muttrc 配置文件集成了使用 Emacs 编写邮件、使用 LDAP 搜索联系人、使用 GnuPG 对邮件进行加解密、链接获取、HTML 视图等等一系列功能。你可以让 Mutt 做到任何你想让它做到的事情,你越探索,就能发现越多。 +在学习使用 Mutt 的过程中,你可以找到最符合你使用习惯的 `.muttrc` 配置。例如我的 `.muttrc` 配置文件集成了使用 Emacs 编写邮件、使用 LDAP 搜索联系人、使用 GnuPG 对邮件进行加解密、链接获取、HTML 视图等等一系列功能。你可以让 Mutt 做到任何你想让它做到的事情,你越探索,就能发现越多。 -------------------------------------------------------------------------------- @@ -235,7 +228,7 @@ via: https://opensource.com/article/21/7/gmail-linux-terminal 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9226b9ee3c0263bd42f7e71b5d0ba99ffe818c18 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Jul 2021 10:51:03 +0800 Subject: [PATCH 380/870] PUB @HankChow https://linux.cn/article-13573-1.html --- ...0706 Send and receive Gmail from the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210706 Send and receive Gmail from the Linux command line.md (99%) diff --git a/translated/tech/20210706 Send and receive Gmail from the Linux command line.md b/published/20210706 Send and receive Gmail from the Linux command line.md similarity index 99% rename from translated/tech/20210706 Send and receive Gmail from the Linux command line.md rename to published/20210706 Send and receive Gmail from the Linux command line.md index f9523c5c5b..13d2d546eb 100644 --- a/translated/tech/20210706 Send and receive Gmail from the Linux command line.md +++ b/published/20210706 Send and receive Gmail from the Linux command line.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13573-1.html) 在 Linux 命令行中收发 Gmail 邮件 ====== From 8af347ebcb699e7df812632d8efe0a120700c2eb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 17:12:19 +0800 Subject: [PATCH 381/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210712=20?= =?UTF-8?q?Use=20Docker=20Compose=20with=20Podman=20to=20Orchestrate=20Con?= =?UTF-8?q?tainers=20on=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210712 Use Docker Compose with Podman to Orchestrate Containers on Fedora.md --- ...man to Orchestrate Containers on Fedora.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20210712 Use Docker Compose with Podman to Orchestrate Containers on Fedora.md diff --git a/sources/tech/20210712 Use Docker Compose with Podman to Orchestrate Containers on Fedora.md b/sources/tech/20210712 Use Docker Compose with Podman to Orchestrate Containers on Fedora.md new file mode 100644 index 0000000000..f5c65324cf --- /dev/null +++ b/sources/tech/20210712 Use Docker Compose with Podman to Orchestrate Containers on Fedora.md @@ -0,0 +1,161 @@ +[#]: subject: (Use Docker Compose with Podman to Orchestrate Containers on Fedora) +[#]: via: (https://fedoramagazine.org/use-docker-compose-with-podman-to-orchestrate-containers-on-fedora/) +[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use Docker Compose with Podman to Orchestrate Containers on Fedora +====== + +![][1] + +Photo by [Jonas][2] on [Unsplash][3] + +Docker Compose is an open-source tool used by developers for orchestrating containers locally or in production. If you are new to containers, I suggest checking out the following links: + + * [Get Started with Docker][4] + * [A Practical Introduction to Container Terminology][5] + * [Using Pods with Podman on Fedora][6] + * [Podman with Capabilities on Fedora][7] + + + +Podman, a powerful alternative to Docker CLI, has attracted a lot of developers recently. However, Podman users faced a challenge. Docker Compose was expected to work with Docker daemon only. So, Podman users had to use other alternatives to Docker Compose like using [Podman Compose][8] that runs services defined in the Compose file inside a Podman pod. (To learn more about Podman Compose, check out my article [Manage Containers on Fedora with Podman Compose][9] on [Fedora Magazine][10].) Another method was manually running different containers of an application and then generating a Kubernetes file with + +podman generate + +to be later re-run with + +podman play + +. (To learn more about this method, check out this [Moving from docker-compose to Podman pods][11] on [Red Hat][12].) + +### Podman and Docker Compose + +Both of the Docker Compose alternatives mentioned previously have their limitations. At the least they need you to know a little bit more than Container and Docker basics.The good news is that Podman has added [support for Docker Compose][13] since version 3.0 so you can now run your traditional docker-compose.yml files with Podman backend. Podman does this by setting up a UNIX socket for + +docker-compose + +to interact with, similar to the Docker daemon. In this article I will show you how to use Docker Compose both with rootful and rootless Podman. + +### Required Software + +Install the following packages on your system to run Docker Compose with Podman: + + * podman: Tool for managing containers + * docker-compose: Tool for orchestrating containers + * podman-docker: Installs a script named docker that emulates docker CLI using Podman. Also links Docker CLI man pages and podman. + + + +Install the above packages using dnf: + +``` +sudo dnf install -y podman podman-docker docker-compose +``` + +### Setting Up Podman Socket + +Set up the Podman socket in order for Docker Compose to work: + +``` +sudo systemctl enable podman.socket +sudo systemctl start podman.socket +sudo systemctl status podman.socket +``` + +This sets up a Unix socket in to communicate with Docker Compose and symlinks it to /var/run/docker.sock. To test if you can communicate with the socket, run the following curl command: + +``` +sudo curl -H "Content-Type: application/json" --unix-socket /var/run/docker.sock http://localhost/_ping +``` + +If the output from the above command is OK, it means your setup was successful. + +### Running A Sample Project with Docker Compose + +Now, you can start orchestrating your project by going to the project folder and running + +sudo docker-compose up + +. As an example, I will be using a docker-compose.yml from a sample WordPress project I created as a demo for this article. You can find it . Clone the repository on your system and from within the directory, start docker-compose. + +``` +sudo docker-compose up +``` + +If everything goes well, you will see docker-compose bringing up the services defined in the compose YAML file. Access the new WordPress instance at after the containers are created. To stop the project, you can press Ctrl + C in the terminal where you executed _docker-compose up_. To remove the containers, execute + +``` +sudo docker-compose down +``` + +### Running Docker Compose with Rootless Podman + +The setup shown above uses Podman in root-ful mode. Notice the _sudo_ keyword preceding most of the commands used. Often you will not need to run your projects as root. So, having the option to run docker-compose as a regular user is pretty handy. As of [version 3.2.0][14], Podman supports Docker-Compose with rootless Podman. The setup, however, changes as follows: + +``` +systemctl --user enable podman.socket +systemctl --user start podman.socket +systemctl --user status podman.socket +export DOCKER_HOST=///run/user/$UID/podman/podman.sock +``` + +Note that when starting the podman socket as non-root user, a user-level socket will be created at _/run/user/$UID/podman/podman.sock_, where _$UID_ refers is the non-root user’s user ID. We need to set the DOCKER_HOST environment variable to that socket so that Docker Compose can talk to the correct socket. You can add the environment variable to your ~/.bash_profile to make it persistent across system reboots. In root-ful mode, the socket is created in _/run/podman/podman.sock_ which is symlinked to _/var/run/docker.sock_ (the default socket expected by the docker-compose binary). So, we didn’t need to set DOCKER_HOST variable then. + +Now, in rootless mode, we can simply run the command +``` + +``` + +docker-compose up +``` + +``` + +without “sudo” in the project root folder. This will bring up our WordPress site running on Docker Compose with Podman backend. + +![WordPress instance running with Docker Compose with Podman backend][15] + +### Further Reading: + + * [][13][][16][Running Podman and Docker Compose, Red Hat][13] + * [From Docker Compose to Kubernetes with Podman][17] + * [Convert docker-compose Services to Pods with Podman][18] + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-docker-compose-with-podman-to-orchestrate-containers-on-fedora/ + +作者:[Mehdi Haghgoo][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/powergame/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/docker-compose-w-podman-816x345.jpg +[2]: https://unsplash.com/@jonason_b?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/docker-container?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://docs.docker.com/get-started +[5]: https://developers.redhat.com/blog/2018/02/22/container-terminology-practical-introduction +[6]: https://fedoramagazine.org/podman-pods-fedora-containers/ +[7]: https://fedoramagazine.org/podman-with-capabilities-on-fedora/ +[8]: http://github.com/containers/podman-compose +[9]: https://fedoramagazine.org/manage-containers-with-podman-compose/ +[10]: https://fedoramagazine.org +[11]: https://www.redhat.com/sysadmin/compose-podman-pods +[12]: https://redhat.com +[13]: https://www.redhat.com/sysadmin/podman-docker-compose +[14]: https://github.com/containers/podman/releases/tag/v3.2.0 +[15]: https://fedoramagazine.org/wp-content/uploads/2021/06/Screenshot-from-2021-06-25-06-48-39.png +[16]: tmp.Svb0n6PVdg +[17]: https://www.redhat.com/sysadmin/compose-kubernetes-podman +[18]: https://balagetech.com/convert-docker-compose-services-to-pods/ From 9f14921a417c2b5042626528c6396c17e4c29b8f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 17:12:43 +0800 Subject: [PATCH 382/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210712=20?= =?UTF-8?q?Converseen=20for=20Batch=20Processing=20Images=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210712 Converseen for Batch Processing Images on Linux.md --- ...en for Batch Processing Images on Linux.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210712 Converseen for Batch Processing Images on Linux.md diff --git a/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md b/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md new file mode 100644 index 0000000000..f64ad01cef --- /dev/null +++ b/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md @@ -0,0 +1,99 @@ +[#]: subject: (Converseen for Batch Processing Images on Linux) +[#]: via: (https://itsfoss.com/converseen/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Converseen for Batch Processing Images on Linux +====== + +Converseen is a free and open source software for batch image conversion. With this tool, you can convert multiple images to another format, resize, change their aspect ratio, rotate or flip them all at once. + +This is a handy tool for someone like me who has to deal with multiple screenshots of different size but has to resize them all before uploading to the website. + +Batch conversion tools help a lot in such cases. This could be done in the Linux command line with the wonderful [ImageMagick][1] but a GUI tool is a lot easier to use here. Actually, Converseen uses ImageMagick underneath the Qt-based GUI. + +### Batch process images with Converseen + +You can use [Converseen][2] to convert, resize, rotate and flip multiple images with a mouse click. + +You have plenty of supporting options for the batch conversion. You can add additional images to your selection or remove some of them. You can choose to convert only a few of your selected images. + +While resizing the images, you can choose to keep the aspect ratio. Keep in mind that out of width and height, the one you changed/typed last is the one controlling the aspect ratio. So, if you want to resize keeping the same aspect ratio but according to the width, don’t touch the height field. + +![][3] + +You can also choose to save the converted images with different name in the same directory or some other location. You may also overwrite the existing images. + +You cannot add folder but you can select and add multiple images at once. + +You can convert the images to a number of formats like JPEG, JPG, TIFF, SVG and more. + +There is also an option to give the transparent background a certain color while changing the format. You can also set the quality of the compression level. + +![][4] + +Converseen says that it can also import PDF files and convert the entire PDF or part of it into images. However, it crashed in Ubuntu 21.04 each time I tried to convert a PDF file. + +### Install Converseen on Linux + +Converseen is a popular application. It is available in the repositories of most Linux distributions. + +You can search for it in your distribution’s software center: + +![][5] + +You may, of course, use your distribution’s package manager to install it via command line. + +On Debian and Ubuntu-based distributions, use: + +``` +sudo apt install converseen +``` + +On Fedora, use: + +``` +sudo dnf install converseen +``` + +On Arch and Manjaro, use: + +``` +sudo pacman -Sy converseen +``` + +Converseen is also available for Windows and FreeBSD. You can get the instructions on the download page of the project website. + +[Download Converseen][6] + +Its source code is [available][7] on the project’s GitHub repository. + +If you are looking for an even easier way to resize a single image, you can use this nifty trick and [resize and rotate images with right click context menu in Nautilus file manager][8]. + +Overall, Converseen is a useful GUI tool for batch image conversion. It’s not perfect but it works for the most part. Have you ever used Converseen or do you use a similar tool? How is your experience with it? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/converseen/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://imagemagick.org/index.php +[2]: https://converseen.fasterland.net/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-interface.png?resize=800%2C400&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-features-overview_copy.png?resize=800%2C497&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/install-converseen-linux.jpeg?resize=800%2C527&ssl=1 +[6]: https://converseen.fasterland.net/download/ +[7]: https://github.com/Faster3ck/Converseen +[8]: https://itsfoss.com/resize-images-with-right-click/ From 5e4ed7cbb7371210347c70c6e7cbd847739810eb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 17:13:05 +0800 Subject: [PATCH 383/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210712=20?= =?UTF-8?q?Set=20up=20temperature=20sensors=20in=20your=20home=20with=20a?= =?UTF-8?q?=20Raspberry=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210712 Set up temperature sensors in your home with a Raspberry Pi.md --- ...ensors in your home with a Raspberry Pi.md | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 sources/tech/20210712 Set up temperature sensors in your home with a Raspberry Pi.md diff --git a/sources/tech/20210712 Set up temperature sensors in your home with a Raspberry Pi.md b/sources/tech/20210712 Set up temperature sensors in your home with a Raspberry Pi.md new file mode 100644 index 0000000000..56e46b4630 --- /dev/null +++ b/sources/tech/20210712 Set up temperature sensors in your home with a Raspberry Pi.md @@ -0,0 +1,205 @@ +[#]: subject: (Set up temperature sensors in your home with a Raspberry Pi) +[#]: via: (https://opensource.com/article/21/7/temperature-sensors-pi) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Set up temperature sensors in your home with a Raspberry Pi +====== +Find out how hot your house is with a simple home Internet of Things +project. +![Orange home vintage thermostat][1] + +It's HOT! I suppose I can't complain too much about living in paradise, but when my wife and I moved to Hawaii last fall, I didn't really think too much about the weather. Don't get me wrong, the weather is lovely pretty much all the time, and we keep our windows open 24/7, but that means it is pretty warm in the house right now in the middle of summer. + +So, where does all this humble bragging intersect with open source? Well, we're planning to get a whole-house fan—one of those big ones that suck all the air out of your house and force it into the attic, pushing all the hot air out of the attic in the process. I am _sure_ this will make the house way cooler, but the geek in me wants to know just how much cooler. + +So today, I'm playing with temperature sensors, [Raspberry Pis][2], and [Python][3]. + +Play along at home! Nothing like a little #CitizenScience! + +![DHT22 sensor and Raspberry Pi Zero W][4] + + Charming little development environment, isn't it? (Chris Collins, [CC BY-SA 4.0][5]) + +Yes, OK, I could just buy a thermometer or two, check them each day, and see what happens. But why do that when you can totally overengineer a solution, automate the data collection, and graph it all over time, amirite? + +Here's what I need: + + * Raspberry Pi Zero W (or, really, any Raspberry Pi) + * DHT22 digital sensor + * SD card + + + +### Connect the DHT22 sensor to the Raspberry Pi + +You can find a bunch of inexpensive DHT22 temperature and humidity sensors with a quick web search. The DHT22 is a digital sensor, making it easy to interact with. If you purchase a raw sensor, you'll need a resistor and some soldering skills to get it working (check out Pi My Life Up's DHT22 article for [great instructions on working with the raw sensor][6]), but you can also purchase one with a small PCB that includes all that, which is what I did. + +The DHT22 with the PCB attached has three pins: a Positive pin (marked with **+**), a Data pin, and a Ground pin (marked with **-**). You can wire the DHT22 directly to the Raspberry Pi Zero W. I used Raspberry Pi Spy's [Raspberry Pi GPIO guide][7] to make sure I connected everything correctly. + +The Positive pin provides power from the Pi to the DHT22. The DHT22 runs on 3v-6v, so I selected one of the 5v pins on the Raspberry Pi to provide the power. I connected the Data pin on the DHT22 to one of the Raspberry Pi GPIO pins. I am using GPIO4 for this, but any would work; just make a note of the one you choose, as the Python code that reads the data from the sensor will need to know which pin to read from. Finally, I connected the Ground pin on the DHT22 to a ground pin on the Raspberry Pi header. + +This is how I wired it up: + + * DHT22 Positive pin <-> Raspberry Pi GPIO v5 pin (#2) + * DHT22 Data pin <-> Raspberry Pi GPIO4 pin (#7) + * DHT22 Ground pin <-> Raspberry Pi Group pin (#6) + + + +This diagram from Raspberry Pi Spy shows the pin layout for the Raspberry Pi Zero W (among others). + +![Raspberry Pi GPIO header diagram][8] + +(Copyright 2021, [Matt Hawkins][7]) + +### Install the DHT sensor software + +Before proceeding, make sure you have an operating system installed on the Raspberry Pi Zero W and can connect to it remotely or with a keyboard. If not, consult my article about [customizing different operating system images][9] for Raspberry Pi. I am using [Raspberry Pi OS Lite][10], released May 7, 2021, as the image for the Raspberry Pi Zero W. + +Once you've installed the operating system on an SD card and booted the Raspberry Pi from the card, there are only a couple of other software packages to install to interact with the DHT22. + +First, install the Python Preferred Installer Program (pip) with `apt-get`, and then use pip to install the [Adafruit DHT sensor library for Python][11] to interact with the DHT22 sensor. + + +``` +# Install pip3 +sudo apt-get install python3-pip + +# Install the Adafruit DHT sensor library +sudo pip3 install Adafruit_DHT +``` + +### Get sensor data with Python + +With the DHT libraries installed, you can connect to the sensor and retrieve temperature and humidity data. + +Create a file with: + + +``` +#!/usr/bin/env python3 + +import sys +import argparse +import time + +# This imports the Adafruit DHT software installed via pip +import Adafruit_DHT + +# Initialize the DHT22 sensor +SENSOR = Adafruit_DHT.DHT22 + +# GPIO4 on the Raspberry Pi +SENSOR_PIN = 4 + +def parse_args(): +    parser = argparse.ArgumentParser() +    parser.add_argument("-f", "--fahrenheit", help="output temperature in Fahrenheit", action="store_true") + +    return parser.parse_args() + +def celsius_to_fahrenheit(degrees_celsius): +        return (degrees_celsius * 9/5) + 32 + +def main(): +    args = parse_args() + +    while True: +        try: +            # Gather the humidity and temperature +            # data from the sensor; GPIO Pin 4 +            humidity, temperature = Adafruit_DHT.read_retry(SENSOR, SENSOR_PIN) + +        except RuntimeError as e: +            # GPIO access may require sudo permissions +            # Other RuntimeError exceptions may occur, but +            # are common.  Just try again. +            print(f"RuntimeError: {e}") +            print("GPIO Access may need sudo permissions.") + +            time.sleep(2.0) +            continue + +        if args.fahrenheit: +            print("Temp: {0:0.1f}*F, Humidity: {1:0.1f}%".format(celsius_to_fahrenheit(temperature), humidity)) +        else: +            print("Temp:{0:0.1f}*C, Humidity: {1:0.1f}%".format(temperature, humidity)) + +        time.sleep(2.0) + +if __name__ == "__main__": +    main() +``` + +The important bits here are initializing the sensor and setting the correct GPIO pin to use on the Raspberry Pi: + + +``` +# Initialize the DHT22 sensor +SENSOR = Adafruit_DHT.DHT22 + +# GPIO4 on the Raspberry Pi +SENSOR_PIN = 4 +``` + +Another important bit is reading the data from the sensor with the variables set above for the sensor and pin: + + +``` +# This connects to the sensor "SENSOR" +# Using the Raspberry Pi GPIO Pin 4, "SENSOR_PIN" +    humidity, temperature = Adafruit_DHT.read_retry(SENSOR, SENSOR_PIN) +``` + +Finally, run the script! You should end up with something like this: + +![Output of the sensor script][12] + +84 degrees and 50% humidity. Oof! Hot and humid in here! (Chris Collins, [CC BY-SA 4.0][5]) + +Success! + +### Where to go from here + +I have three of these DHT22 sensors and three Raspberry Pi Zero Ws connected to my WiFi. I've installed them into some small project boxes, hot-glued the sensors to the outside, and set them up in my living room, office, and bedroom. With this setup, I can collect sensor data from them whenever I want by SSHing into the Raspberry Pi and running this script. + +But why stop there? Manually SSHing into them each time is tedious and too much work. I can do better! + +In a future article, I'll explain how to set up this script to run automatically at startup with a [systemd service][13], set up a web server to display the data, and instrument this script to export data in a format that can be read by [Prometheus][14], a monitoring system and time series database. I use Prometheus at work to collect data about OpenShift/Kubernetes clusters, plot trends, and create alerts based on the data. Why not go totally overboard and do the same thing with temperature and humidity data at home? This way, I can get baseline data and then see how well the whole-house fan changes things! + +#CitizenScience! + +Jeff Geerling is a father concered with his kid's cold room and their sleep because of it. To... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/temperature-sensors-pi + +作者:[Chris Collins][a] +选题:[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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/home-thermostat.jpg?itok=wuV1XL7t (Orange home vintage thermostat) +[2]: https://www.raspberrypi.org/ +[3]: https://www.python.org/ +[4]: https://opensource.com/sites/default/files/uploads/dht22.png (DHT22 sensor and Raspberry Pi Zero W) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://pimylifeup.com/raspberry-pi-humidity-sensor-dht22/ +[7]: https://www.raspberrypi-spy.co.uk/2012/06/simple-guide-to-the-rpi-gpio-header-and-pins/ +[8]: https://opensource.com/sites/default/files/uploads/raspberry_pi_gpio_layout_model_b_plus.png (Raspberry Pi GPIO header diagram) +[9]: https://opensource.com/article/20/5/disk-image-raspberry-pi +[10]: https://www.raspberrypi.org/software/operating-systems/ +[11]: https://github.com/adafruit/Adafruit_Python_DHT +[12]: https://opensource.com/sites/default/files/uploads/temperature_sensor.png (Output of the sensor script) +[13]: https://www.freedesktop.org/software/systemd/man/systemd.service.html +[14]: https://prometheus.io/ From e34381e8042798fee2b96b350edddc8d8f6a440d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 17:13:20 +0800 Subject: [PATCH 384/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210712=20?= =?UTF-8?q?Reading=20and=20writing=20files=20with=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210712 Reading and writing files with Python.md --- ...2 Reading and writing files with Python.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/tech/20210712 Reading and writing files with Python.md diff --git a/sources/tech/20210712 Reading and writing files with Python.md b/sources/tech/20210712 Reading and writing files with Python.md new file mode 100644 index 0000000000..010cdfcb06 --- /dev/null +++ b/sources/tech/20210712 Reading and writing files with Python.md @@ -0,0 +1,139 @@ +[#]: subject: (Reading and writing files with Python) +[#]: via: (https://opensource.com/article/21/7/read-write-files-python) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Reading and writing files with Python +====== +Every programming language handles data files differently. Here's how +Python does it. +![Hands on a keyboard with a Python book ][1] + +Some data is meant to be temporary, stored in RAM while an application is running, and then forgotten. Some data, however, is meant to be persistent. It's stored on a hard drive for later use, and it's often the stuff that a user cares about the most. For programmers, it's very common to write code to read and write files, but every language handles this task a little differently. This article demonstrates how to handle data files with Python. + +### Install Python + +On Linux, you probably already have Python installed. If not, you can install it from your distribution's software repository. For instance, on CentOS Stream or RHEL: + + +``` +`$ sudo dnf install python3` +``` + +On macOS, you can install Python from [MacPorts][2] or [Homebrew][3]. On Windows, you can install Python from [Chocolatey][4]. + +Once you have Python installed, open your favorite text editor and get ready to code. + +### Writing data to a file with Python + +If you need to write data to a file, there are three steps to remember: + + 1. Open + 2. Write + 3. Close + + + +This is exactly the same sequence of steps you use when writing code, editing photos, or doing almost anything on a computer. First, you open the document you want to edit, then you make some edits, and then you close the document. + +In Python, that translates to this process: + + +``` +f = open('example.txt', 'w') +f.write('hello world') +f.close() +``` + +In this example, the first line opens a file in **write** mode. The file is represented as the variable `f`, which is an arbitrary choice. I use `f` because it seems to be common in Python code, but any valid variable name works just as well. + +There are different modes in which you can open a file: + + * **w** to write + * **r+** to read and write + * **a** to append only + + + +The second line of the example writes data to the file. The data written in this example is plain text, but you can write any kind of data. + +The final line closes the file. + +### Writing data using the 'with' syntax + +There's a shorter way to write data into a file, and this method can be useful for quick file interactions. It doesn't leave the file open, so you don't have to remember to call the **close()** function. Instead, it uses the **with** syntax: + + +``` +with open('example.txt', 'a') as f: +    f.write('hello open source') +``` + +### Reading data in from a file with Python + +If you (or your user, by way of your application) have placed data into a file, and your code needs to retrieve it, then you want to read a file. Similar to writing, the logic is: + + 1. Open + 2. Read + 3. Close + + + +Again, this logic flow mirrors what you already know from just using a computer (or a paperback book, for that matter). To read a document, you open it, read it, and then close it. In computer terms, "opening" a file means to load it into memory. + +In practice, a text file contains more than one line. For example, maybe your code needs to read a configuration file, saved game data, or the lyrics to your band's next song. Just as you don't read an entire physical book the very moment you open it, your code must parse a file it has loaded into memory. So, you probably need to iterate over the file's contents. + + +``` +f = open('example.tmp', 'r') + +for line in f: +    print(line) + +f.close() +``` + +In the first line of this example code, you open a file in **read** mode. The file is represented by the variable `f`, but just like when you open files for writing, the variable name is arbitrary. There's nothing special about `f`; it's just the shortest possible way to represent the word "file," so it tends to be used a lot by Python programmers. + +In the second line, you reserve `line`, which is yet another arbitrary variable name, to represent each line of `f`. This tells Python to iterate, line by line, over the file's contents and print each line to your output (in this case, the terminal or [IDLE][5]). + +### Reading a file using the 'with' syntax + +As with writing data, there's a shorter method of reading data from files using the **with** syntax. This doesn't require you to call the **call()** function, so it can be convenient for quick interactions. + + +``` +with open('example.txt', 'r') as f: +    for line in f: +        print(line) +``` + +### Files and Python + +There are more ways to write data to files using Python, and many ways to format text you write to files using [JSON, YAML, TOML][6], and more. There's also a very nice built-in method for creating and maintaining an [SQLite][7] database and many libraries to handle any number of file formats, including [graphics][8], audio, video, and more. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/read-write-files-python + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://opensource.com/article/20/11/macports +[3]: https://opensource.com/article/20/6/homebrew-mac +[4]: https://opensource.com/article/20/3/chocolatey +[5]: https://opensource.com/article/17/10/python-101#idle +[6]: https://opensource.com/article/21/6/parse-configuration-files-python +[7]: https://opensource.com/article/21/2/sqlite3-cheat-sheet +[8]: https://opensource.com/article/19/3/python-image-manipulation-tools From c2b86e20306182562760b5ccb7c034c46b855d5d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 17:13:41 +0800 Subject: [PATCH 385/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210712=20?= =?UTF-8?q?What=20is=20XML=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210712 What is XML.md --- sources/tech/20210712 What is XML.md | 136 +++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20210712 What is XML.md diff --git a/sources/tech/20210712 What is XML.md b/sources/tech/20210712 What is XML.md new file mode 100644 index 0000000000..c9f5f1a553 --- /dev/null +++ b/sources/tech/20210712 What is XML.md @@ -0,0 +1,136 @@ +[#]: subject: (What is XML?) +[#]: via: (https://opensource.com/article/21/7/what-xml) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What is XML? +====== +Get to know XML, a strict yet flexible markup language used for +everything from documentation to graphics. +![Computer screen with files or windows open][1] + +XML is a hierarchical markup language. It uses opening and closing tags to define data. It's used to store and exchange data, and because of its extreme flexibility, it's used for everything from [documentation][2] to [graphics][3]. + +Here's a sample XML document: + + +``` +<xml> +  <os> +   <linux> +    <distribution> +      <name>Fedora</name> +      <release>8</release> +      <codename>Werewolf</codename> +    </distribution> + +    <distribution> +      <name>Slackware</name> +      <release>12.1</release> +      <mascot> +        <official>Tux</official> +        <unofficial>Bob Dobbs</unofficial> +      </mascot> +    </distribution> +   </linux> +  </os>     +</xml> +``` + +Reading the sample XML, you might find there's an intuitive quality to the format. You can probably understand the data in this document whether you're familiar with the subject matter or not. This is partly because XML is considered verbose. It uses lots of tags, the tags can have long and descriptive names, and the data is ordered in a hierarchical manner that helps explain the data's relationships. You probably understand from this sample that the Fedora distribution and the Slackware distribution are two different and unrelated instances of Linux because each one is "contained" inside its own independent `` tag. + +XML is also extremely flexible. Unlike HTML, there's no predefined list of tags. You are free to create whatever data structure you need to represent. + +### Components of XML + +Data exists to be read, and when a computer "reads" data, the process is called _parsing_. Using the sample XML data again, here are the terms that most XML parsers consider significant. + + * **Document:** The `` tag opens a _document_, and the `` tag closes it. + * **Node:** The ``, ``, and `` are _nodes_. In parsing terminology, a node is a tag that contains other tags. + * **Element:** An entity such as `Fedora` and `Tux`, from the first `<` to the last `>` is an _element_. + * **Content:** The data between two element tags is considered _content_. In the first `` element, the string `Fedora` is the content. + + + +### XML schema + +Tags and tag inheritance in an XML document are known as _schema_. + +Some schemas are made up as you go (for example, the sample XML code in this article was purely improvised), while others are strictly defined by a standards group. For example, the Scalable Vector Graphics (SVG) schema is [defined by the W3C][4], while the [DocBook schema][5] is defined by Norman Walsh. + +A schema enforces consistency. The most basic schemas are usually also the most restrictive. In my example XML code, it wouldn't make sense to place a distribution name within the `` node because the implied schema of the document makes it clear that a mascot must be a "child" element of a distribution. + +### Data object model (DOM) + +Talking about XML would get confusing if you had to constantly describe tags and positions (e.g., "the name tag of the second distribution tag in the Linux part of the OS section"), so parsers use the concept of a Document Object Model (DOM) to represent XML data. The DOM places XML data into a sort of "family tree" structure, starting from the root element (in my sample XML, that's the `os` tag) and including each tag. + +![Document Object Model][6] + +(Seth Kenlon, [CC BY-SA 4.0][7]) + +This same XML data structure can be expressed as paths, just like files in a Linux system or the location of web pages on the internet. For instance, the path to the `` tag can be represented as `//os/linux/distribution/slackware/mascot`. + +The path to _both_ `` tags can be represented as `//os/linux/distribution`. Because there are two distribution nodes, a parser loads both nodes (and the contents of each) into an array that can be queried. + +### Strict XML + +XML is also known for being strict. This means that most applications are designed to intentionally fail when they encounter errors in XML. That may sound problematic, but it's one of the things developers appreciate most about XML because unpredictable things can happen when applications try to guess how to resolve an error. For example, back before HTML was well defined, most web browsers included a "quirks mode" so that when people tried to view poor HTML code, the web browser could load what the author _probably_ intended. The results were wildly unpredictable, especially when one browser guessed differently than another. + +XML disallows this by intentionally failing when there's an error. This lets the author fix errors until they produce valid XML. Because XML is well-defined, there are validator plugins for many applications and standalone commands like `xmllint` and `xmlstarlet` to help you locate errors early. + +### Transforming XML + +Because XML is often used as an interchange format, it's common to transform XML into some other data format or into some other XML schema. Classic examples include XSLTProc, xmlto, and [pandoc][8], but technically there are many other applications designed, at least in part, to convert XML. + +In fact, LibreOffice uses XML to layout its word processor and spreadsheet documents, so any time you export or [convert a file from LibreOffice][9], you're transforming XML. + +[Ebooks in the open source EPUB format][10] use XML, so any time you [convert a document into an EPUB][11] or from an EPUB, you're transforming XML. + +Inkscape, the vector-based illustration application, saves its files in SVG, which is an XML schema designed for graphics. Any time you export an image from Inkscape as a PNG file, you're transforming XML. + +The list could go on and on. XML is a data storage format, and it's designed to ensure that your data, whether it's points and lines on a canvas, nodes on a chart, or just words in a document, can be easily and accurately extracted, updated, and converted.  + +### Learning XML + +Writing XML is a lot like writing HTML. Thanks to the hard work of Jay Nick, [free and fun XML lessons are available online][3] that teach you how to create graphics with XML. + +In general, very few special tools are required to explore XML. Thanks to the close relationship between HTML and XML, you can [view XML using a web browser][12]. In addition, open source text editors like [QXmlEdit][13], [NetBeans][14], and [Kate][15] make typing and reading XML easy with helpful prompts, autocompletion, syntax verification, and more. + +### Choose XML + +XML may look like a lot of data at first, but it's not that much different than HTML (in fact, HTML has been [reimplemented as XML in the form of XHTML][16]). XML has the unique benefit that the components forming its structure also happen to be metadata providing information about what it's storing. A well-designed XML schema contains and describes your data, allowing a user to understand it at a glance and parse it quickly, and enabling developers to [parse it efficiently][17] with convenient programming libraries. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/what-xml + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://opensource.com/article/17/9/docbook +[3]: https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam +[4]: https://www.w3.org/TR/SVG11/ +[5]: http://docbook.org +[6]: https://opensource.com/sites/default/files/uploads/dom.jpg (Document Object Model) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/article/20/5/pandoc-cheat-sheet +[9]: https://opensource.com/article/21/3/libreoffice-command-line +[10]: https://opensource.com/education/15/11/ebook-open-formats +[11]: https://opensource.com/life/13/8/how-create-ebook-open-source-way +[12]: https://opensource.com/article/18/12/xml-browser +[13]: https://opensource.com/article/17/7/7-ways-handle-xml-qxmledit +[14]: https://opensource.com/article/20/12/netbeans +[15]: https://opensource.com/article/20/12/kate-text-editor +[16]: https://www.w3.org/TR/xhtml1/ +[17]: https://opensource.com/article/21/6/parsing-config-files-java From 478a45fb6b85fab5eeba6f2999b14e16bb5a51a9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:15:23 +0800 Subject: [PATCH 386/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210711=20?= =?UTF-8?q?Ubuntu=2021.10=20Impish=20Indri=20=E2=80=93=20New=20Features=20?= =?UTF-8?q?and=20Release=20Date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md --- ...h Indri - New Features and Release Date.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md diff --git a/sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md b/sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md new file mode 100644 index 0000000000..50c7bd5414 --- /dev/null +++ b/sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md @@ -0,0 +1,166 @@ +[#]: subject: (Ubuntu 21.10 Impish Indri – New Features and Release Date) +[#]: via: (https://www.debugpoint.com/2021/07/ubuntu-21-10/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Ubuntu 21.10 Impish Indri – New Features and Release Date +====== +Final release of 2021, Ubuntu 21.10 Impish Indri development is in +progress. In this post, we sum up the new features known so far and +planned release dates. +This post includes information about ongoing development. The information may change frequently, and this page is regularly updated until the final release. + +This page contains the following topics – + + * [Ubuntu 21.10 – Code name history][1] + * [New Features in desktop flavor][2] + * [Ubuntu Official flavor information][3] + * [Release schedule][4] + * [Daily-build .ISO download][5] + * [Canary build .ISO download][6] + + + +Before we list out the features, you should remember that, we are at a very early stage of the development considering October as of publishing this. And the final pieces may change as we move closer to the final release. + +Historically, October releases are somewhat quieter but impactful. They create the base for next LTS in every alternate year. So having said that, this is an important release due to many factors. + +### The Code Name + +Following the trend, Ubuntu 21.10 is code named “impish indri” as we are at “I” based names. The “Indri” refers to _“babakoto, is one of the largest living lemurs, with a head-and-body length of about 64–72 cm and a weight of between 6 to 9.5 kg. It has a black and white coat and maintains an upright posture when climbing or clinging” (from Wikipedia)_. Well, the final mascot is yet to be revealed. + +So, all the packages and repo is tagged with “impish” for this version of Ubuntu. + +Let’s take a look at other new features. + +### Ubuntu 21.10 New Features + +![Ubuntu 21.10 Desktop \(daily build\)][7] + + * Ubuntu 21.10 would feature **Linux Kernel 5.14**. This is currently in development and will be released before the feature freeze. + + + * If you are wondering of about GNOME, well yes, Ubuntu 21.10 features [GNOME 40 desktop][8] – but with a twist. The **GNOME 40** version brings some fundamental changes to GNOME desktop, which you are already aware of by now. But with the usual left fixed dock! So, the customized GNOME 40 with left fixed doc, eliminates the bottom dock of vanilla GNOME 40. + + + * So, initially it would feel a bit strange with have **left fixed dock** with horizontal workspaces, overview and scrolling. But it would be interesting to observe user reactions and feedback once it releases. + + + * Version wise, this release would feature **GNOME 40.3** (it’s due by July 2021). + + + * A brand **new Desktop Installer** which would replace the decade old Ubiquity. This is created in collaboration with Google in Flutter and gives a nice and easy way of installing Ubuntu. We covered more about this installer in detail when it was launched. You can read the coverage [here][9]. + + + +![New Installer – Ubuntu 21.10][10] + + * The new installer is still in Canary build and not arrived in daily build as of publishing this. And when I tested, it has many bugs which are simple ones. I hope they would be sorted out before final release. + + + * The default theme would be set to **Yaru Light**. As per the Ubuntu team, it is difficult to maintain a mixed theme with both and dark and light together. + + + * In the prior Ubuntu 21.04, the Wayland display server is made default. In this release, **NVIDIA** driver users also would be able to Wayland, hopefully. + + + * With the **wallpaper** competition is back, we expect a stunning default wallpaper with “Indri” mascot. Already there are beautiful wallpapers submitted by the community, and they look promising. + + + * The applications and packages sees their respective version upgrades in this release. Here’s a quick summary. + + + 1. Firefox 89 + 2. LibreOffice 7.1 (I am still hopeful whether [LibreOffice 7.2][11] is an option) + 3. Thunderbird 78.12 + + + +### Official Flavors + +The official Ubuntu desktop flavors would have their respective version upgrades. Here’s a quick update. + + * Xubuntu with Xfce 4.16 + * Ubuntu MATE with MATE 1.24 + * Kubuntu with KDE Plasma 5.22 (I don’t think Plasma 5.23 would be ready before BETA) + + + +### Ubuntu 21.10 Release Date + +Ubuntu 21.10 releases on October 14, 2021. Here is the schedule of this release. + + * **Feature Freeze**: August 19, 2021 + * **Beta Release**: September 23, 2021 + * **Final Releas**e: October 14, 2021 + + + +### Daily Build Downloads for Ubuntu 21.10 + +Default desktop image .ISO for daily build is available in below link. The following images are unstable so, do not use this as your serious work. Try for testing only. + +[download ubuntu 21.10 daily build – GNOME][12] + +#### Other flavors + +Ubuntu Flavor | Link for Daily build .iso image (64 bit) +---|--- +Ubuntu 21.10 Desktop (GNOME) | +Xubuntu 21.10 | +Ubuntu MATE 21.10 | +Ubuntu Kylin 21.10 | +Lubuntu 21.10 | +Kubuntu 21.10 | +Ubuntu Budgie 21.10 | + +### Untested Canary build + +The daily canary build can be downloaded from the below link. This is super unstable and did not pass automatic testing. So, unless absolutely necessary, do not use this .iso. + + + +### Closing Notes + +I am specifically interested on the new desktop installer. Because it gives a repair option and a brand-new way of installing Ubuntu. We know there are many powerful installers out there like Calamares – but it would be interesting to see Ubuntu’s new Flutter based app. And the adaptation of GNOME 40 is really a thing to observe with more users. + +I will keep this post updated with the latest info when available with details. + + * _[Official change log and schedule][13]_ + * _[Launchpad source][14]_ + + + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/07/ubuntu-21-10/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: tmp.Bd5zVlb4BJ#code-name +[2]: tmp.Bd5zVlb4BJ#new-features +[3]: tmp.Bd5zVlb4BJ#official-flavors +[4]: tmp.Bd5zVlb4BJ#release-schedule +[5]: tmp.Bd5zVlb4BJ#daily-build-download +[6]: tmp.Bd5zVlb4BJ#canary-build-download +[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Ubuntu-21.10-Desktop-daily-build-1024x535.jpeg +[8]: https://www.debugpoint.com/2021/03/gnome-40-release/ +[9]: https://www.debugpoint.com/2021/02/new-ubuntu-desktop-installer/ +[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/New-Installer-Ubuntu-21.10.jpeg +[11]: https://www.debugpoint.com/2021/05/libreoffice-7-2/ +[12]: https://cdimage.ubuntu.com/daily-live/current/ +[13]: https://discourse.ubuntu.com/t/impish-indri-release-schedule/18540 +[14]: https://launchpad.net/ubuntu/impish From 1cc423df5e40fd7f3938acd657426cab3c5c779b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:15:58 +0800 Subject: [PATCH 387/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210710=20?= =?UTF-8?q?Linux=20Mint=2020.2=20=E2=80=9CUma=E2=80=9D=20Released.=20This?= =?UTF-8?q?=20is=20What=E2=80=99s=20New?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md --- ...20.2 -Uma- Released. This is What-s New.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md diff --git a/sources/tech/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md b/sources/tech/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md new file mode 100644 index 0000000000..97e099f89f --- /dev/null +++ b/sources/tech/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md @@ -0,0 +1,119 @@ +[#]: subject: (Linux Mint 20.2 “Uma” Released. This is What’s New) +[#]: via: (https://www.debugpoint.com/2021/07/linux-mint-20-2-release-announcement/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux Mint 20.2 “Uma” Released. This is What’s New +====== +Linux Mint 20.2 Uma is now available for download and to upgrade. We +wrap up the release for you with download instructions.In +Brief:Details:Bulky +![Linux Mint 20.2 Cinnamon Desktop][1] + +The latest installment of Linux Mint is [announced][2]. This second installment of Linux Mint 20 series code-named “Uma” brings some cool features alongside the usual package and application updates. This release contains 6 month worth of updates since the release of Linux Mint 20.1. + +Here are the top new features. + +### Linux Mint 20.2 – What’s New + +Packages and Components summary in Linux Mint 20.2. + + * Based on Ubuntu 20.04.2 LTS + * Linux Kernel 5.4.0 + * Cinnamon Desktop 5.0.2 + * Xfce Desktop 4.16 + * MATE Desktop 1.24 + * Python 3.8.5 + * Firefox 89.0 + * LibreOffice 6.4.7.2 + * New XApp Bulky 1.3 + * Warpinator 1.2.2 + + + +#### Core + +The Linux Mint 20.x entire series is based on Ubuntu 20.04 LTS. That means, the Kernel version, packages remain aligned to the Ubuntu LTS version. Hence with this release, you get Linux Kernel 5.4 and other stable core updates. + +#### New App – Bulky + +![New Bulky App \(Image Credit – Mint\)][3] + +A new native application is introduced in the Uma release. Named “” – this desktop utility helps you to rename files and directories in batch. It has options like regular expression and other search features which help while remaining files and directories of similar patterns. It is primarily for MATE and Cinnamon flavor. The application is available as “File Renamer” in the application menu. + +#### Warpinator Updates + +Warpinator which is one of the best Linux Mint app used to transfer files across the Network (Wired and Wireless), brings more enhancement. In the next version, it gives you the ability to select the Network Interface which you want to use for file transfer. If you have both Wired and Wireless ethernet, you can select which one you want to use to share files to another device on the same selected network interface. + +[][4] + +SEE ALSO:   How to Upgrade to Linux Mint 20.2 from 20.1 + +Not only that, but it also brings compression settings which enable “3 times faster” transfer across devices – provided both the machine have the compression enabled. + +#### Nemo 5.0 + +![Search in File Contents in Nemo File Manager][5] + +The Cinnamon file manager Nemo version 5.0.1 brings file content search which is part of the Cinnamon 5.0 release. Today, Nemo only searches in the file and directory names for matching search criteria. With this enhancement, Nemo can search inside the file contents for a keyword. The team says that Regular expressions and recursive folder searches are also supported. This feature will be very useful for many users who use Linux Mint as a daily driver and work with many files as part of their workflow. + +#### Others + +“Nvidia-prime-applet 1.2.7 was backported recently. It contains a fix for a regression in ubuntu-drivers-common which made the applet disappear. + +It also contains support for computers with AMD/NVIDIA hybrids (i.e. systems with an integrated AMD GPU and a discrete NVIDIA GPU).” + +### Linux Mint 20.2 Download + +The .iso files can now be downloaded from the below torrents for respective desktop environment – Xfce, Cinnamon and MATE. + + * [Cinnamon – Torrent – Download][6] + * [MATE – Torrent – Download][7] + * [Xfce – Torrent – Download][8] + + + +If you are running [Linux Mint 20.1 Ulyssa][9], then wait for a day or two, you should get the updates via Linux Mint update manager. + +### Upgrade Steps + +The upgrade to Linux Mint 20.2 is pretty straight forward with a bit of caution. [Here is the detailed guide of the upgrade.][4] + +> [How to Upgrade to Linux Mint 20.2 from 20.1][4] + +Official Release notes are available in the below places. + + * + * + * + + + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/07/linux-mint-20-2-release-announcement/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Linux-Mint-20.2-Cinnamon-Desktop-1024x768.jpeg +[2]: https://blog.linuxmint.com/?p=4102 +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/New-Bulky-App-Image-Credit-Mint.png +[4]: https://www.debugpoint.com/2021/07/upgrade-linux-mint-20-2/ +[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Search-in-File-Contents-in-Nemo-File-Manager.jpg +[6]: https://linuxmint.com/torrents/linuxmint-20.2-cinnamon-64bit.iso.torrent +[7]: https://linuxmint.com/torrents/linuxmint-20.2-mate-64bit.iso.torrent +[8]: https://linuxmint.com/torrents/linuxmint-20.2-xfce-64bit.iso.torrent +[9]: https://www.debugpoint.com/2021/01/linux-mint-20-1-release-announcement/ From af858a64fc98902efc9e0858672612c9170bb440 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:16:15 +0800 Subject: [PATCH 388/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210706=20?= =?UTF-8?q?How=20to=20Install=20Fedora=2034=20Workstation=20[Step=20by=20S?= =?UTF-8?q?tep]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210706 How to Install Fedora 34 Workstation -Step by Step.md --- ...all Fedora 34 Workstation -Step by Step.md | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 sources/tech/20210706 How to Install Fedora 34 Workstation -Step by Step.md diff --git a/sources/tech/20210706 How to Install Fedora 34 Workstation -Step by Step.md b/sources/tech/20210706 How to Install Fedora 34 Workstation -Step by Step.md new file mode 100644 index 0000000000..5ea4a8a2d4 --- /dev/null +++ b/sources/tech/20210706 How to Install Fedora 34 Workstation -Step by Step.md @@ -0,0 +1,151 @@ +[#]: subject: (How to Install Fedora 34 Workstation [Step by Step]) +[#]: via: (https://www.debugpoint.com/2021/07/install-fedora-34-workstation/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Install Fedora 34 Workstation [Step by Step] +====== +In this absolute beginner’s guide, we explain the steps required to +install Fedora 34 workstation edition (GNOME desktop environment). +This page covers the following topics + + * [Fedora 34 Minimum system requirements][1] + * [Pre-Steps before installation][2] + * [Download and create LIVE USB][3] + * [Install Fedora 34][4] + + + +[Fedora][5] is a Linux based distribution which offers desktop and server flavors. It is a free and open-source Linux distribution sponsored by Red Hat and developed and contributed by the community. It works as an upstream distribution for Red Hat Enterprise Linux. Hence, with Fedora you get the latest Linux Kernel, packages with cutting edge features and applications. + +Fedora desktop edition offers almost all popular desktop environments. A quick list of desktop environment is below which has official Fedora flavor. + + * KDE Plasma + * GNOME + * Xfce + * LXDE + * LXQt + * i3 WM + * MATE + * Cinnamon (via repo) + + + +This is why it is very popular, and many users choose Fedora to Ubuntu because you get a perfect system with many packages pre-installed. Mostly experienced users prefer Fedora, but it is absolutely useful for beginner’s as well. If you are an Ubuntu user and want to jump the ship to Fedora, well, you may want to check out our [Ubuntu to Fedora migration guide][6]. + +The Fedora 34 which we are going to install in this post brings some interesting changes. Fedora 34 brings Linux Kernel 5.11, Zstd compression when btrfs is used, default sound daemon Pipewire, GNOME 40 desktop, KDE Plasma 5.21 and many Wayland related updates. For a detailed coverage, visit our [Fedora 34 topics][7] to learn more. + +### Fedora 34 workstation – System requirement + +This is the minimum system requirement for installing Fedora in general. + + * 2 GHz dual-core processor + * 4 GiB RAM (system memory) + * 20 GB of hard-drive space + * VGA capable of 1024×768 screen resolution + * Either a CD/DVD drive or a USB port for the installer media + * Internet access is not mandatory for installation + + + +### Pre-Step Before Installation + +Before you start the installation, make sure of the followings. + + * If you are installing in a physical system, make sure to decide which partition you want to install. + * If you are planning to dual boot with Windows or any other Linux Systems, then make sure you decide which partition to install. + * Take a backup of your personal data. + * Keep a LIVE USB with [Boot Repair][8] handy, in case something goes wrong. + + + +[][9] + +SEE ALSO:   How to Upgrade to Fedora 34 from Fedora 33 Workstation (GUI and CLI Method) + +### Download and prepare LIVE USB + +Download the Workstation edition from the below link. It contains the torrent of the .ISO file and also includes all other [Fedora 34 Spins][10] as well. + +[fedora torrents][11] + +After the download is complete, create a LIVE USB using any utility such as [Etcher][12]. Plug in the USB in your system, change BIOS settings to boot from it. + +### Install Fedora 34 – Steps + +1\. The LIVE Fedora installation system boot up to a LIVE desktop, that gives you options to install to a Physical medium. + +![Install to Hard Driver Option in LIVE Media][13] + +2\. In the next screen, select language and continue. Then click on the Installation destination to select which partition you would like to install. + +![Select Language][14] + +![Installation Destination Select][15] + +3\. In the installation destination screen, select the disk and choose Storage Configuration: Custom. And click Done at the top. + +![Select Disk][16] + +4\. In the partitioning screen, choose your partition sizes for root, and boot partitions. For example, keep /boot at around 1GB and rest you can assign to /root partition. + +5\. For Fedora 34, it is better to use btrfs for root partition for better performance. Do not forget to set the mount point as / in root partition. + +![root partition][17] + +![boot partition][18] + +6\. When you are satisfied with your new file system, click on Done. In the next screen, make sure to verify carefully the summary of changes that is going to happen to your disk. Because this will make changes to your system and can not be reverted. Click Accept changes once you are ready. + +![Summary of Changes][19] + +7\. Wait for the installation to complete. Once it is finished, click on Finish Installation and reboot the LIVE system. + +![Installation complete][20] + +So, that’s about it. If all goes well, after reboot, you should be greeted with Fedora 34 workstation edition desktop with GNOME 40. + +![Fedora 34 Desktop][21] + +I hope this basic guide to install Fedora 34 helps beginner’s or advanced users for their work. If you run into a problem, such as with dual boot, or any other installation error, let me know in the comment box below. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/07/install-fedora-34-workstation/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: tmp.cwqzC2PPCj#min-requirement +[2]: tmp.cwqzC2PPCj#pre-steps +[3]: tmp.cwqzC2PPCj#download-create-USB +[4]: tmp.cwqzC2PPCj#install-fedora-34 +[5]: https://getfedora.org/ +[6]: https://www.debugpoint.com/2021/04/migrate-to-fedora-from-ubuntu/ +[7]: https://www.debugpoint.com/tag/fedora-34 +[8]: https://sourceforge.net/p/boot-repair/home/Home/ +[9]: https://www.debugpoint.com/2021/04/upgrade-fedora-34-from-fedora-33/ +[10]: https://www.debugpoint.com/2021/04/fedora-34-desktop-spins/ +[11]: https://torrent.fedoraproject.org/ +[12]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ +[13]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Install-to-Hard-Driver-Option-in-LIVE-Media.jpeg +[14]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Select-Language.jpeg +[15]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Installation-Destination-Select.jpeg +[16]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Select-Disk.jpeg +[17]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/root-partition-1024x532.jpeg +[18]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/boot-partition.jpeg +[19]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Summary-of-Changes.jpeg +[20]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Installation-complete-1024x526.jpeg +[21]: https://www.debugpoint.com/blog/wp-content/uploads/2021/04/Fedora-34-Desktop--1024x529.jpg From c9bf3adabdb323857c21ff55af3b2332d0d6c774 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:18:27 +0800 Subject: [PATCH 389/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210626=20?= =?UTF-8?q?Windows=2011=20System=20Requirement=20is=20Turning=20Heads.=20T?= =?UTF-8?q?ime=20to=20migrate=20to=20Linux=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md --- ...Turning Heads. Time to migrate to Linux.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md diff --git a/sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md b/sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md new file mode 100644 index 0000000000..dab9dde3ec --- /dev/null +++ b/sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md @@ -0,0 +1,101 @@ +[#]: subject: (Windows 11 System Requirement is Turning Heads. Time to migrate to Linux?) +[#]: via: (https://www.debugpoint.com/2021/06/windows-11-system-requirement/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Windows 11 System Requirement is Turning Heads. Time to migrate to Linux? +====== +Microsoft announced Windows 11 at the official online event. Here’s in +this post we brief the Windows 11 system requirement and give you +thinking points on whether you should permanently migrate to Linux. +There are many debates and discussions going around after the announcement of Windows 11 from Microsoft. Many are “blown away” by the look and feel of the customization option that it brings, little they know that it might be “[inspired][1]” by other operating systems. + +![Windows 11 Desktop][2] + +Here’s a quick recap of visible features – + + * New Start Menu, Taskbar, and Search Bar + * New Animations are added while moving and dragging the windows. Even Opening a new window, closing, and minimize tap have different animation than earlier versions of Windows. + * Featured add to perform multitask with windows like split-screen, creating groups of various task windows, etc. + * Touch controls are improved significantly. + * New sounds are added in this version. After the release of Windows 10 in 2015, no significant changes were made in the sounds. But in Windows 11, you will see various new sound options. + * You will have access to dark mode also. + * Rounded Corners: Pointy corners will not be available in Windows 11. Corners of various bars will be made round. + * New icons are added which will make it more attractive than the earlier versions. + * Various new Widgets are added in this version. + * You can run Android apps via Windows 11 store + + + +### Windows 11 System Requirement + + * Processor – 1 gigahertz (GHz) or faster with 2 or more cores on a compatible 64-bit processor or System on a Chip (SoC) + * Memory – 4 GB RAM + * Storage – 64 GB or larger storage device + * System firmware – UEFI, Secure Boot capable + * TPM Trusted Platform Module (TPM) version 2.0 + * Graphics card DirectX 12 compatible graphics / WDDM 2.x +Display >9” with HD Resolution (720p) + * Internet connection Microsoft account and internet connectivity required for setup for Windows 11 Home + + + +Looking at the specification, you might have noticed a couple of interesting items. Windows 11 recommends your system should have TPM a.k.a Trusted Platform Module (TPM) version 2.0. Trusted Platform Module (TPM) technology is designed to provide hardware-based, security-related functions. A TPM chip is a secure crypto-processor that is designed to carry out cryptographic operations. The chip includes multiple physical security mechanisms to make it tamper-resistant, and malicious software is unable to tamper with the security functions of the TPM. + +And this is why Microsoft boasts about Windows 11 being more secure. + +Not all the hardware that is available today has a TPM chip. And worse is, many may force to buy new hardware as well. As a thumb rule, if you have bought any Laptop, Desktop 2017 onwards, you should be fine. + +[][1] + +SEE ALSO:   Windows 11 Look Inspired by KDE Plasma and GNOME? + +### Internet Required for set up? + +From an end-user perspective, this is not a good idea at all. This forces everyone to create a Microsoft account for the initial setup. Think about millions of users who probably buy Laptops for basic usage, and now they required to create an account, with OneDrive and other online “BS”. And you end up consuming more data, give away your data, and so on. + +This move is completely unnecessary from the Microsoft side. Internet connectivity should be optional and not mandatory for setting up your computer which you bought with a price. + +### Should you be moving to Linux? + +Yes, of course. Linux can run super-fast in all newer and older hardware. There are plenty of versions of the Linux operating system with a nice-looking desktop out there that you can easily install and use. You do not need to shell out additional money just to experience fancy Windows 11. + +Linux has many variants which cater to different people with a variety of tastes. You do not need to settle for only one look and feel and functionality. You have the freedom to choose. + +You do not need to buy expensive Antivirus which is recommended for Windows operating system. Linux doesn’t get a virus that easily as it is designed in a different way, and not that popular. So, you are protected on that front and save more money. + +Linux updates are much faster due to stability and the small size of updates. Hence you save money on your data plan as well. + +And, you save thousands of hours by not looking at this: + +![The Never ending wait which becomes part of your life][3] + +### Closing Notes + +Benchmarking a certain set of hardware as “old” is completely subjective in terms of software. You can easily run Debian, or Lubuntu in ten-year-old or more hardware for basic tasks. If someone tells you that your hardware is old, doesn’t make it so. Windows 11 may compel some users to think about their personal hardware strategy in the longer term. It is a market leader in the Desktop operating system and it is a business model for them and OEMs. Fair enough. But if you are a Windows user and reading this, I would recommend you to start experimenting with simple and friendly Linux distributions such as [Linux Mint][4], right now. So that you have options to choose from and have control over your spending in the longer run. + +Cheers. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/windows-11-system-requirement/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/06/windows-11-inspiration-linux-kde-plasma/ +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Windows-11-Desktop-1024x575.jpg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/The-Never-ending-wait-which-becomes-part-of-your-life.jpg +[4]: https://www.debugpoint.com/2021/02/cinnamon-arch-linux-install/ From 1ee0fe429c1018e47a8af7e84d8075068271f20e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:18:44 +0800 Subject: [PATCH 390/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210625=20?= =?UTF-8?q?How=20to=20Setup=20Internet=20in=20CentOS,=20RHEL,=20Rocky=20Li?= =?UTF-8?q?nux=20Minimal=20Install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md --- ...ntOS, RHEL, Rocky Linux Minimal Install.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md diff --git a/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md b/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md new file mode 100644 index 0000000000..81356bf87a --- /dev/null +++ b/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md @@ -0,0 +1,134 @@ +[#]: subject: (How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install) +[#]: via: (https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install +====== +Setting up the internet or network is super easy in minimal server +installations. In this guide, we will explain how you can setup internet +or network in CentOS, RHEL, Rocky Linux minimal install. +Once you install the minimal install of any server distributions, you would not have any GUI or desktop environment to set up your network or internet. Hence it is important to know how you can set up internet when you only have access to the terminal. The NetworkManager utility provides necessary tools armed with systemd services to get the job done. Here’s how. + +### Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install + + * After you have completed the installation, boot into the server terminal. Ideally, you should be prompted with a terminal. Login using root or admin account. + + + * Then first, try to check the state of the network interface and details using nmcli. The nmcli is a command-line tool for controlling the NetworkManager service. Use the following command to check. + + + +``` +nmcli device status +``` + +This would display the device name, status etc. + +![nmcli device status][1] + + * Run the tool `nmtui` to configure the network interface. The [nmtui][2] is part of the NetworkManager tool which gives you a nice UI to configure the network. This is part of the package NetworkManager-tui and should be installed by default when you have completed the installation of the minimal server. + + + +``` +nmtui +``` + + * Click on Edit a connection in the nmtui window. + + + +![nmtui – Select options][3] + + * Select the interface name + + + +![Select Interface to Edit][4] + + * In the Edit Connection window, choose Automatic for IPv4 and IPv6. And select Automatically Connect. Press ok once done. + + + +![nmtui – Edit Connection][5] + + * Restart the NetworkManager service via the [systemd systemctl][6] using the following command. + + + +``` +systemctl restart NetworkManager +``` + + * If all goes well, you should be connected to the network and internet in the minimal installation of CentOS, RHEL, Rocky Linux server. Provided your network has internet connectivity. You can use ping to verify whether it is working. + + + +![setup internet minimal server – CentOS Rocky Linux RHEL][7] + +### Additional Tip: Set up Static IP in minimal server + +When you set the network configuration as automatic, the interface dynamically assigns the IP when you connected to the internet. In some situations where you are setting up a local area network (LAN), you may want to assign static IP to your network interface. It’s super easy. + +Open the network configuration script for your network. Change the highlighted part for your own device. + +``` +vi /etc/sysconfig/network-scripts/ifcfg-ens3 +``` + +In the above file, add the IP address you desire with property IPADDR. Save the file. + +``` +IPADDR=192.168.0.55 +``` + +Add the gateway for your network in `/etc/sysconfig/network`. + +``` +NETWORKING=yes +HOSTNAME=debugpoint +GATEWAY=10.1.1.1 +``` + +Add any public DNS server in resolv.conf located at `/etc/resolv.conf`. + +nameserver 8.8.8.8 +nameserver 8.8.4.4 + +And restart the network service. + +``` +systemctl restart NetworkManager +``` + +This will complete the setup of the static IP. You can also check the IP details using `ip addr` command. + +I hope this guide helps you to set up the network, internet, and static IP in your minimal server. Let me know in the comment section, if you may have any questions. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmcli-device-status.jpg +[2]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmtui +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Select-options.jpg +[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Select-Interface-to-Edit.jpg +[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Edit-Connection.jpg +[6]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/ +[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/setup-internet-minimal-server-CentOS-Rocky-Linux-RHEL.jpg From 368fa42c17a639ff771e331dc7098f3bbe062a86 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:19:43 +0800 Subject: [PATCH 391/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210622=20?= =?UTF-8?q?How=20to=20Make=20LibreOffice=20Look=20Like=20Microsoft=20Offic?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210622 How to Make LibreOffice Look Like Microsoft Office.md --- ... LibreOffice Look Like Microsoft Office.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20210622 How to Make LibreOffice Look Like Microsoft Office.md diff --git a/sources/tech/20210622 How to Make LibreOffice Look Like Microsoft Office.md b/sources/tech/20210622 How to Make LibreOffice Look Like Microsoft Office.md new file mode 100644 index 0000000000..6a69332f61 --- /dev/null +++ b/sources/tech/20210622 How to Make LibreOffice Look Like Microsoft Office.md @@ -0,0 +1,134 @@ +[#]: subject: (How to Make LibreOffice Look Like Microsoft Office) +[#]: via: (https://www.debugpoint.com/2021/06/libreoffice-like-microsoft-office/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Make LibreOffice Look Like Microsoft Office +====== +We made an attempt to make the LibreOffice suite look like Microsoft +Office. Is it possible? Let’s find out. +[LibreOffice][1] is a free and open-source office productivity suite that provides you a complete collection of applications. It consists of a Word processor (Writer), a spreadsheet program (Calc), Presentation (Impress), and a drawing program (Draw). It also gives you a stand-alone database system LibreOffice Base while LibreOffice Math is a program that helps students, researchers to write formulas and equations. + +While, the widely used [Microsoft Office][2] is a paid office productivity suite that gives you excellent programs to perform almost all tasks related to study, office, and enterprise usage. + +Both of the programs are different but their objective is the same in terms of functionality. Due to its popularity, Microsoft office is used widely and well known to the users. However, there are many users who prefer the free LibreOffice for their work and activities. Adopting LibreOffice sometimes difficult compared to Microsoft Office – although most of the menu items, tools are the same. + +That said, if you can make LibreOffice look like Microsoft Office, then it is much easier for first-time users to adopt – mostly coming from Microsoft Office background. The look and feel play a big part in users’ minds including their muscle memory and familiarity of colors, menu items. + +Of course, you can not make it exactly like Microsoft Office because of different icons, fonts, etc. However, you can make it look up to a certain amount. + +### Make LibreOffice Look Like Microsoft Office + +_This guide is prepared in LibreOffice 7.2 (dev) version._ + +#### 1\. User Interface changes + +LibreOffice has a “Ribbon” style toolbar called Tabbed Bar. Although it comes with many options of the toolbar (see below). For this guide, I have used the Tabbed bar option. + + * Open LibreOffice and go to `Menu > View > User Interface`. + * Select `Tabbed` from the UI Section. + + + +![tabbed bar option][3] + + * Click on Apply to All. LibreOffice also provides an option to apply the toolbar type-specific to Writer or Calc. If you want a different toolbar type, you can choose that way. But I would recommend using the Apply to All to make it consistent. + + + * Now you should have the Microsoft Office-style Ribbon. Although they are not exactly the same, you get the feel of it. + + + +#### 2\. Microsoft Office Icons for LibreOffice + +The Icons in the toolbar play a big part in your workflow. LibreOffice provides some nice icons for your toolbar. The best ones are the – + + * Karasa Jaga + * Colibre + * Elementary + + + +For this guide, we will use [Office 2013 icon set][4] which is developed by an author. It is available in Devian Art. + + * Go to the below link and download the LibreOffice extension file (*.oxt). For the newer versions of LibreOffice, you need to use extension files to install icon sets. + + + +[download office 2013 icon sets for libreoffice][5] + + * After download, double click the .oxt file to open. Or, press CTRL+ALT+E to open the Extension Manager and select the downloaded .oxt file using the Add button. Close the window once done. + + + +![Import icon sets in Extension Manager][6] + + * Now go to `Tools > Options > View`. From the Icon style choose Office 2013. + + + * Change the icon size via `Icon Size > Notebookbar > Large`. If you feel the icons are small, you can change them. However, I feel to make it more Office-like, the large settings work better. + + + +![Change icons in Options][7] + +And, that’s it. Your LibreOffice installation should look like this. + +[][8] + +SEE ALSO:   LibreOffice 7.2 - New Features and Release Details + +![Making LibreOffice look like Microsoft Office in KDE Plasma][9] + +![Making LibreOffice look like Microsoft Office in Windows 10][10] + +![Making LibreOffice look like Microsoft Office in GNOME][11] + +Remember, if you are using Ubuntu, KDE Plasma, or any Linux distribution, the looks may be different. But in my opinion, it looks closer to Microsoft Office in KDE Plasma than GNOME. LibreOffice doesn’t look good in GTK based systems at the moment. + +In Windows, however, it looks better because it uses system font, color palette. + +These are some settings that you can use, however, you can play around with more customizations, icons, and themes as you wish. If you fancy dark mode in LibreOffice, you may want to read our tutorial – [how to enable dark mode in LibreOffice][12]. + +### Closing Notes + +Microsoft Office is undoubtedly the market leader in the Office productivity space. There is a reason for it, it comes with decades of development, and it’s not a free product. In fact, the latest Office 365 Home usage price is around ~7 USD per month for 3 to 4 devices. Which is a bit pricy if you ask me. + +Whereas LibreOffice is free and community developed headed by The Document Foundation. Hence, the development is slower and features arrive late. It is not trying to be Microsoft Office but gives millions of users, schools, non-profits, colleges, students an opportunity to work and learn using a free office suite. + +Hence, it is beneficial if it can mimic the basic look and feel to make it like Microsoft Office to increase LibreOffice adoption. And I hope this guide serves a little purpose in that direction. + +[_Link: Official Feature comparison between LibreOffice and Microsoft Office._][13] + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/libreoffice-like-microsoft-office/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: http://libreoffice.com +[2]: http://office.com +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/tabbed-bar-option.jpg +[4]: https://www.deviantart.com/charliecnr/art/Office-2013-theme-for-LibreOffice-512127527 +[5]: https://www.deviantart.com/users/outgoing?https://1drv.ms/u/s!ArgKmgFcmBYHhSQkPfyMZRnXX5LJ +[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Import-icon-sets-in-Extension-Manager.jpg +[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Change-icons-in-Options-1024x574.jpg +[8]: https://www.debugpoint.com/2021/05/libreoffice-7-2/ +[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-KDE-Plasma-1024x441.jpg +[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-Windows-10-1024x554.jpg +[11]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Making-LibreOffice-look-like-Microsoft-Office-in-GNOME-1024x498.jpg +[12]: https://www.debugpoint.com/2020/01/how-to-enable-dark-mode-libreoffice/ +[13]: https://wiki.documentfoundation.org/Feature_Comparison:_LibreOffice_-_Microsoft_Office From df36f687050b1488943008b85186706a82cf3e4b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:20:40 +0800 Subject: [PATCH 392/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210626=20?= =?UTF-8?q?Windows=2011=20Look=20Inspired=20by=20KDE=20Plasma=20and=20GNOM?= =?UTF-8?q?E=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md --- ...1 Look Inspired by KDE Plasma and GNOME.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md diff --git a/sources/tech/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md b/sources/tech/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md new file mode 100644 index 0000000000..da93cb9e73 --- /dev/null +++ b/sources/tech/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md @@ -0,0 +1,111 @@ +[#]: subject: (Windows 11 Look Inspired by KDE Plasma and GNOME?) +[#]: via: (https://www.debugpoint.com/2021/06/windows-11-inspiration-linux-kde-plasma/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Windows 11 Look Inspired by KDE Plasma and GNOME? +====== +The images of the upcoming Windows 11 Operating system from Microsoft +resemble a mixture of our beloved KDE Plasma and GNOME. How much they +are similar? We try to find out. +There’s a saying which I remember – ‘_Good artists copy. Great artists steal_‘. I don’t know the design team behind Windows 11, but it seems they are pretty good inspired by the Linux desktops. If you look at the Windows OS look over the years – from Windows XP to 7 to 10 – there is not much changed in terms of look and feel. Until now. + +Windows OS have typically 5 to 7 years of life iterations with a new release. If you think about the options of customization Windows gives you, that remained the same over the years. Even the overall desktop experience in terms of Start Menu position, width, color – all remained constant. + +But with the new look of Windows 11 – this is changing. Let me walk you through some of the screenshots I had a look at and how cunningly it is similar to the popular Linux [desktop environments][1] such as KDE Plasma and GNOME. + +### Windows 11 Look Inspired by KDE Plasma and GNOME? + +#### Start Menu and Taskbar + +The traditional Start Menu and Taskbar theme changed in Windows 11. The Start menu and Taskbar icons are at the center of the taskbar (default view). It also gives you the option to move the taskbar icons and Start menu to the left via settings. + +![Windows 11 – Start menu in light mode][2] + +The overall approach and default color with icons remind me of the KDE Plasma taskbar and Launcher. The icons are polished and centered gives you a feel of Adwaita icons of GNOME while the taskbar looks like from KDE Plasma. + +When you open the start menu, it gives you a different arrangement of the icons and options. Also, a search option at the top pops up when you start to type. + +Now, look at the newly designed KDE Plasma launcher. I know, the spacing, the size of the icons, and sharpness are not the same. But you can see how they look surprisingly similar. + +![KDE Plasma 5.22 Launcher in Light mode][3] + +If you are using GNOME or Xfce desktop – with a little tweak of the [Arc menu][4], you can actually have them look exactly similar. + +![Modified Arc Menu][5] + +#### Window Decorations + +Traditionally GNOME always had rounded corners for the standard window decorations. And in compared to that Windows always had sharp corners in windows – like forever until now. Well, with Windows 11, all the window decorations have rounded corners which looks good. The rounded corners concept is not a copyrighted design or new idea. Hence the question arises, why decide to go all rounded corner now? Is there any hidden purpose? + +![Rounded Corners in Windows Explorer and Nautilus][6] + +Oh, remember the application grid menu indicator in GNOME? The small dots tells you that how many pages of applications are there. It seems also to make its way to Windows 11 as well. + +![Dots in paging][7] + +#### Color Palette + +Windows always had a “blue” based theme or any blue variant over the years. Although use has options to change the accent color of the taskbar, start menu background, and window title bars. But with that option, the color palette seems drastically changed with light and dark mode combination to give a more polished and eye-candy look to the Windows desktop. Probably another avenue of inspiration of nice color palette of Ubuntu, KDE, and other flavors. + +[][8] + +SEE ALSO:   Windows 11 System Requirement is Turning Heads. Time to migrate to Linux? + +#### Dark Mode + +Windows 11 officially support dark mode/ or dark theme for the first time. Well, I will just leave it here with the below two screenshots. The left one is a dark mode of the Windows 11 start menu and the right one is the KDE Plasma with Breeze dark theme. + +![Comparison of Windows 11 Start Menu and KDE Plasma][9] + +#### New Desktop Widgets + +Inspiration never stops it seems. Remember KDE Plasma’s widgets? Well, it is not a new concept, but it lands in Windows 11. Here’s a screenshot of the new widgets drawer. You can add, remove and scroll items here. + +![Widgets menu][10] + +These are just some of the items which caught my eye. Maybe there are more “inspirations” that “inspired” Windows 11 looks. + +But the question is – why this is the perfect time to introduce all of these features and looks at once? + +### Closing Notes + +Honestly, when I first looked at them, it reminds me of KDE Plasma with Breeze theme in Dark mode. And with very few tweaks, you can make it look like Windows 11. That itself says about how they are similar in looks. + +If you look at the entire desktop operating system landscape – the only players are Windows, Linux Desktops, and macOS. And until now, they all had a distinct signature in their looks. For example, macOS has its own different look which stands out from everyone else. Until now, Windows also had the same – the usual Start menu with the blue theme, etc. But with these new changes, Windows gives users the most customization options and closer to the Linux Desktop looks. + +In my personal opinion, the Windows team should have come up with a different signature look than just being “inspired” by our beloved Linux Desktops. + +I am not sure what the future holds, but it seems the “E-E-E” is in the works with full force. + +Cheers. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/windows-11-inspiration-linux-kde-plasma/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/category/desktop-environment +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Windows-11-Start-menu-in-light-mode.jpg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/KDE-Plasma-5.22-Launcher-in-Light-mode.jpg +[4]: https://gitlab.com/LinxGem33/Arc-Menu +[5]: https://www.debugpoint.com/blog/wp-content/uploads/2020/12/gnomecustomize2020-2-1024x576.jpg +[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Rounded-Corners-in-Windows-Explorer-and-Nautilus-1024x716.jpg +[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Dots-in-paging-1024x468.jpg +[8]: https://www.debugpoint.com/2021/06/windows-11-system-requirement/ +[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Comparison-of-Windows-11-Start-Menu-and-KDE-Plasma-1024x505.jpg +[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Widgets-menu-1024x833.jpg From f61fcf9f9bad1823f985f4b9d99aee99fd59d347 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:21:41 +0800 Subject: [PATCH 393/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210614=20?= =?UTF-8?q?helloSystem=20=E2=80=93=20FreeBSD=20Based=20OS=20Brings=20anoth?= =?UTF-8?q?er=20Promising=20Release=200.5.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md --- ... Brings another Promising Release 0.5.0.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md diff --git a/sources/tech/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md b/sources/tech/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md new file mode 100644 index 0000000000..53022505b3 --- /dev/null +++ b/sources/tech/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md @@ -0,0 +1,95 @@ +[#]: subject: (helloSystem – FreeBSD Based OS Brings another Promising Release 0.5.0) +[#]: via: (https://www.debugpoint.com/2021/06/hellosystem-0-5-0-release/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +helloSystem – FreeBSD Based OS Brings another Promising Release 0.5.0 +====== +The helloSystem team brings another promising release with its latest +version 0.5.0. And gives hope to users as a free alternative to macOS. +![helloSystem 0.5.0][1] + +The helloSystem is a FreeBSD-based lightweight operating system designed from the ground up. The operating system with FreeBSD at its core provides a real “open” alternative to the macOS and its users. + +The ideas and principles mainly give FreeBSD users an alternative to the no-lock-down environment, unlike macOS. That means you get any application software you want in helloSystem, that too includes all Linux applications. Because FreeBSD already has a built-in layer to run Linux applications. And it is worth mentioning that you can keep using your older hardware with this operating system without fear of non-upgradable status. + +An impressive operating system, indeed. However, the operating system is fairly new, hence things are still being worked on. + +Let’s take a look at what’s new in the new helloSystem 0.5.0 release. + +### helloSystem 0.5.0 – What’s New + +This release is based on the stable FreeBSD 12.2 version. This release provides updates to wireless networking and much new specific hardware support. The primary window manager is Openbox 3.4 which is a bit older version right now. + +The main top panel Global system menu is now updated automatically when the system is modified with applications or directories. + +From the changelog, it is evident that the file manager Filer sees most of the updates in this release of updates in this point release. Here are the updates in Filer 0.10.0: + + * Initial spatial mode option for Filer (each folder opens in its own window) + * “Go to…” menu in Filer, Command+Shift+G + * Go up to the parent folder in Filer using Command+Up + * Get Info in Filer using Command+I + * Filer brings already-open windows to the front rather than opening multiple windows for the same folder + * Context menu in Filer for opening text files and folders as root + * Filer now shows volumes on the desktop + * Filer now shows the correct names for volumes (“volume labels”) + * Adjusted icon grid size in Filer + * Filer now shows volumes first in the sidebar + * Menus are now available if only the desktop is showing and no Filer windows are open Filer now shows alternating row colors in detail view + + + +Other updates include: + + * New app QHexEdit and Android File Transfer Utility is introduced. + * Updated initgfx, more GPUs such as the AMD Radeon HD 6630M/6650M/6750M/7670M/7690M (Whistler/Turks) family GPUs found in 2011 Macs might now be supported + * Double click on the title bar of any application to hide the main window and shows only the title bar. + * It is now possible to save (persist across reboots) custom keyboard preferences +Placeholder .app bundles (and thereby menu entries) are automatically created for applications installed with pkg + * Audio Volume can now be set from the global menu bar + + + +![Utilities][2] + +Most of the important application shortcut is added, but they are not installed by default with the .iso file. So you need to download and install what you need. This is good in the way that, the .iso size is reduced without all those apps. You just install later what you need. Most of the important ones are available in the menu as shortcuts such as LibreOffice, GIMP, etc. + +### Download + +The project is hosted on GitHub at the moment. You can download the 64-bit .iso file from the below link. + +[helloSystem 0.5.0][3] + +Once downloaded, you can either install it in a physical system or try it on a [virtual machine][4]. + +If you are planning to try it out in a physical system as a multi-boot, I would recommend you to be a little extra careful, there might be issues with UEFI. + +### Closing Notes + +This is one of the interesting FreeBSD OS that I am following very closely. A promising project indeed with a stable alternative to Linux and macOS. Request you to contribute to the project in any capacity in GitHub. + +Cheers. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/hellosystem-0-5-0-release/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/helloSystem-0.5.0-1024x578.jpg +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Utilities.jpg +[3]: https://github.com/helloSystem/ISO/releases/download/r0.5.0/hello-0.5.0_0E223-FreeBSD-12.2-amd64.iso +[4]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/ From cfb11522c7bf5c64af59fcd43864d8c9bd36735b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Jul 2021 18:22:09 +0800 Subject: [PATCH 394/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210612=20?= =?UTF-8?q?How=20to=20get=20KDE=20Plasma=205.22=20in=20Kubuntu=2021.04=20H?= =?UTF-8?q?irsute=20Hippo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md --- ...sma 5.22 in Kubuntu 21.04 Hirsute Hippo.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md diff --git a/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md b/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md new file mode 100644 index 0000000000..893e29c850 --- /dev/null +++ b/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md @@ -0,0 +1,134 @@ +[#]: subject: (How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo) +[#]: via: (https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo +====== +The KDE team enabled the backports PPA which you can use to install and +upgrade to KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo._This guide +outlines the following topics_ppa:kubuntu-ppa/backports +![Kubnutu 21.04 running with KDE Plasma 5.22][1] + +KDE team released the KDE Plasma 5.22 recently with a fair amount of enhancements, bug fixes along with updated KDE Framework and applications versions. This release brings several improvements such as Adaptive transparency in panels, user-friendly notification on file operation popups, package type display in Discover, various Wayland changes, and more. Check out more details about features [here][2]. + +If you are running Kubuntu 21.04 Hirsute Hippo Or, have a custom KDE Plasma installed in [Ubuntu 21.04 Hisrsute Hippo][3], you can upgrade to the latest version using the following steps. The current Hirsute Hippo series provides the prior versions of KDE Plasma 5.21.04 with KDE Framework 5.80. + +: + + 1. [How to install KDE Plasma 5.22 in Kubuntu 21.04][4] + 2. [How to install KDE Plasma 5.22 in Ubuntu 21.04 alongside GNOME][5] + 3. [Can I install KDE Plasma 5.22 in Ubuntu 20.04 LTS?][6] + 4. [How to Uninstall][7] + + + +### Install KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo – Steps + +Follow the below steps. + +If you want to use the graphical method, then add to the software sources in Discover and hit Update. + +Or, use the following terminal method for faster installation. + + * **Step 1**: Open a terminal and add below KDE Backports PPA. + + + +``` +sudo add-apt-repository ppa:kubuntu-ppa/backports +``` + + * **Step 2**: Then run the following to initiate a system upgrade. This will install the latest KDE Plasma 5.22 in your Hirsute Hippo system. + + + +``` +sudo apt update +sudo apt full-upgrade +``` + +![Upgrade to Plasma 5.22][8] + + * **Step 3**: Reboot after the update and you should be greeted with an updated KDE Plasma 5.22 desktop. + + + +The installation may take some time considering a complete version upgrade of the entire desktop environment. + +### Installing KDE Plasma 5.22 in Ubuntu 21.04 + +If you are running GNOME based default Ubuntu 21.04 Hirsute Hippo desktop, you can use this PPA to install the latest KDE Plasma. Here’s how. + +[][9] + +SEE ALSO:   Lubuntu 21.04 Hirsute Hippo - Artwork Contest is Here + +Open a terminal and add the PPA (like above steps). + +``` +sudo add-apt-repository ppa:kubuntu-ppa/backports +``` + +Then, refresh the packages. + +``` +sudo apt update +``` + +Then run the below to install the Kubuntu desktop. + +``` +sudo apt install kubuntu-desktop +``` + +This will install the KDE Plasma desktop alongside with GNOME in Ubuntu 21.04. + +### KDE Plasma 5.22 in Ubuntu 20.04 LTS + +Ubuntu 20.04 LTS edition has the earlier KDE Plasma 5.18, KDE Framework 5.68, KDE Applications 19.12.3. So, during its entire lifecycle, it would not receive the latest KDE Update. So, technically you can add the above PPA and install the KDE Plasma 5.22. But I would not recommend it due to incompatible packages, frameworks that may lead to an unstable system. + +So, it is recommended that you use either Kubuntu 21.04 with the above backports PPA Or, use KDE neon to experience the latest Plasma desktop. + +### Uninstallation of KDE Plasma 5.22 + +If you change your mind and want to go back to the stock version of the KDE Plasma, then install the ppa-purge and purge the PPA. This will downgrade packages and make the stock version available. + +``` +sudo apt install ppa-purge +sudo ppa-purge ppa:kubuntu-ppa/backports +sudo apt update +``` + +### Closing Notes + +I hope this quick guide helped you to install the latest KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo. This allows you experience the latest KDE technology coupled with KDE Framework and applications. However, you should be aware that not all the features should be made available in the backports PPA – only the selected features and bug fixes that pass regression and safe to use. That said, you can always install KDE Neon as a fresh system to enjoy the latest tech from KDE. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Kubutu-21.04-running-with-KDE-Plasma-5.22-1024x531.jpg +[2]: https://www.debugpoint.com/2021/06/kde-plasma-5-22-release/ +[3]: https://www.debugpoint.com/2021/04/ubuntu-21-04-hirsute-hippo-release/ +[4]: tmp.wazjcS11If#plasma-kubuntu-2104 +[5]: tmp.wazjcS11If#plasma-ubuntu-2104 +[6]: tmp.wazjcS11If#plasma-ubuntu-2004 +[7]: tmp.wazjcS11If#uninstall-stock-version +[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Upgrade-to-Plasma-5.22.jpg +[9]: https://www.debugpoint.com/2020/12/lubuntu-21-04-artwork/ From 12a4a6f56050a41e21cb406eec579123df813e8d Mon Sep 17 00:00:00 2001 From: YungeGuo Date: Mon, 12 Jul 2021 18:37:01 +0800 Subject: [PATCH 395/870] Update and rename sources/tech/20210628 Query your Linux operating system like a database.md to translated/tech/20210628 Query your Linux operating system like a database.md commit translation --- ... Linux operating system like a database.md | 343 ------------------ ... Linux operating system like a database.md | 330 +++++++++++++++++ 2 files changed, 330 insertions(+), 343 deletions(-) delete mode 100644 sources/tech/20210628 Query your Linux operating system like a database.md create mode 100644 translated/tech/20210628 Query your Linux operating system like a database.md diff --git a/sources/tech/20210628 Query your Linux operating system like a database.md b/sources/tech/20210628 Query your Linux operating system like a database.md deleted file mode 100644 index 176edd5733..0000000000 --- a/sources/tech/20210628 Query your Linux operating system like a database.md +++ /dev/null @@ -1,343 +0,0 @@ -[#]: subject: (Query your Linux operating system like a database) -[#]: via: (https://opensource.com/article/21/6/osquery-linux) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) -[#]: collector: (lujun9972) -[#]: translator: (YungeG) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Query your Linux operating system like a database -====== -Use database-style queries to get system information easily. -![Magnifying glass on code][1] - -Linux offers a lot of commands to help users gather information about their host operating system: listing files or directories to check attributes; querying to see what packages are installed, processes are running, and services start at boot; or learning about the system's hardware. - -Each command uses its own output format to list this information. You need to use tools like `grep`, `sed`, and `awk` to filter the results to find specific information. Also, a lot of this information changes frequently, leading to changes in the system's state. - -It would be helpful to view all of this information formatted like the output of a database SQL query. Imagine that you could query the output of the `ps` and `rpm` commands as if you were querying an SQL database table with similar names. - -Fortunately, there is a tool that does just that and much more: [Osquery][2] is an [open source][3] "SQL powered operating system instrumentation, monitoring, and analytics framework." - -Many applications that handle security, DevOps, compliance, and inventory management (to name a few) depend upon the core functionalities provided by Osquery at their heart. - -### Install Osquery - -Osquery is available for Linux, macOS, Windows, and FreeBSD. Install the latest version for your operating system by following its [installation instructions][4]. (I'll use version 4.7.0 in these examples.) - -After installation, verify it's working: - - -``` -$ rpm -qa | grep osquery -osquery-4.7.0-1.linux.x86_64 -$ -$ osqueryi --version -osqueryi version 4.7.0 -$ -``` - -### Osquery components - -Osquery has two main components: - - * **osqueri** is an interactive SQL query console. It is a standalone utility that does not need super-user privileges (unless you are querying tables that need that level of access). - * **osqueryd** is like a monitoring daemon for the host it is installed on. This daemon can schedule queries to execute at regular intervals to gather information from the infrastructure. - - - -You can run the osqueri utility without having the osqueryd daemon running. Another utility, **osqueryctl**, controls starting, stopping, and checking the status of the daemon. - - -``` -$ rpm -ql osquery-4.8.0-1.linux.x86_64 | grep bin -/usr/bin/osqueryctl -/usr/bin/osqueryd -/usr/bin/osqueryi -$ -``` - -### Use the osqueryi interactive prompt - -You interact with Osquery much like you would use an SQL database. In fact, osqueryi is a modified version of the SQLite shell. Running the `osqueryi` command drops you into an interactive shell where you can run commands specific to Osquery, which often start with a `.`: - - -``` -$ osqueryi -Using a virtual database. Need help, type '.help' -osquery> -``` - -To quit the interactive shell, run the `.quit` command to get back to the operating system's shell: - - -``` -osquery> -osquery> .quit -$ -``` - -### Find out what tables are available - -As mentioned, Osquery makes data available as the output of SQL queries. Information in databases is often saved in tables. But how can you query these tables if you don't know their names? Well, you can run the `.tables` command to list all the tables that you can query. If you are a long-time Linux user or a sysadmin, the table names will be familiar, as you have been using operating system commands to get this information: - - -``` -osquery> .tables -  => acpi_tables -  => apparmor_events -  => apparmor_profiles -  => apt_sources - -<< snip >> - -  => arp_cache -  => user_ssh_keys -  => users -  => yara -  => yara_events -  => ycloud_instance_metadata -  => yum_sources -osquery> -``` - -### Check the schema for individual tables - -Now that you know the table names, you can see what information each table provides. As an example, choose `processes`, since the `ps` command is used quite often to get this information. Run the `.schema` command followed by the table name to see what information is saved in this table. If you want to check the results, you could quickly run `ps -ef` or `ps aux` and compare the output with the contents of the table: - - -``` -osquery> .schema processes -CREATE TABLE processes(`pid` BIGINT, `name` TEXT, `path` TEXT, `cmdline` TEXT, `state` TEXT, `cwd` TEXT, `root` TEXT, `uid` BIGINT, `gid` BIGINT, `euid` BIGINT, `egid` BIGINT, `suid` BIGINT, `sgid` BIGINT, `on_disk` INTEGER, `wired_size` BIGINT, `resident_size` BIGINT, `total_size` BIGINT, `user_time` BIGINT, `system_time` BIGINT, `disk_bytes_read` BIGINT, `disk_bytes_written` BIGINT, `start_time` BIGINT, `parent` BIGINT, `pgroup` BIGINT, `threads` INTEGER, `nice` INTEGER, `is_elevated_token` INTEGER HIDDEN, `elapsed_time` BIGINT HIDDEN, `handle_count` BIGINT HIDDEN, `percent_processor_time` BIGINT HIDDEN, `upid` BIGINT HIDDEN, `uppid` BIGINT HIDDEN, `cpu_type` INTEGER HIDDEN, `cpu_subtype` INTEGER HIDDEN, `phys_footprint` BIGINT HIDDEN, PRIMARY KEY (`pid`)) WITHOUT ROWID; -osquery> -``` - -To drive home the point, use the following command to see the schema for the RPM packages and compare the information with `rpm -qa` and `rpm -qi` operating system commands: - - -``` -osquery> -osquery> .schema rpm_packages -CREATE TABLE rpm_packages(`name` TEXT, `version` TEXT, `release` TEXT, `source` TEXT, `size` BIGINT, `sha1` TEXT, `arch` TEXT, `epoch` INTEGER, `install_time` INTEGER, `vendor` TEXT, `package_group` TEXT, `pid_with_namespace` INTEGER HIDDEN, `mount_namespace_id` TEXT HIDDEN, PRIMARY KEY (`name`, `version`, `release`, `arch`, `epoch`, `pid_with_namespace`)) WITHOUT ROWID; -osquery> -``` - -You learn more in Osquery's [tables documentation][5]. - -### Use the PRAGMA command - -In case that schema information is too cryptic for you, there is another way to print the table information in a verbose, tabular format: the `PRAGMA` command. For example, I'll use `PRAGMA` to see information for the `rpm_packages` table in a nice format: - - -``` -`osquery> PRAGMA table_info(rpm_packages);` -``` - -One benefit of this tabular information is that you can focus on the field you want to query and see the type of information that it provides: - - -``` -osquery> PRAGMA table_info(users); -+-----+-------------+--------+---------+------------+----+ -| cid | name        | type   | notnull | dflt_value | pk | -+-----+-------------+--------+---------+------------+----+ -| 0   | uid         | BIGINT | 1       |            | 1  | -| 1   | gid         | BIGINT | 0       |            | 0  | -| 2   | uid_signed  | BIGINT | 0       |            | 0  | -| 3   | gid_signed  | BIGINT | 0       |            | 0  | -| 4   | username    | TEXT   | 1       |            | 2  | -| 5   | description | TEXT   | 0       |            | 0  | -| 6   | directory   | TEXT   | 0       |            | 0  | -| 7   | shell       | TEXT   | 0       |            | 0  | -| 8   | uuid        | TEXT   | 1       |            | 3  | -+-----+-------------+--------+---------+------------+----+ -osquery> -``` - -### Run your first query - -Now that you have all the required information from the table, the schema, and the items to query, run your first SQL query to view the information. The query below returns the users that are present on the system and each one's user ID, group ID, home directory, and default shell. Linux users could get this information by viewing the contents of the `/etc/passwd` file and doing some `grep`, `sed`, and `awk` magic. - - -``` -osquery> -osquery> select uid,gid,directory,shell,uuid FROM users LIMIT 7; -+-----+-----+----------------+----------------+------+ -| uid | gid | directory      | shell          | uuid | -+-----+-----+----------------+----------------+------+ -| 0   | 0   | /root          | /bin/bash      |      | -| 1   | 1   | /bin           | /sbin/nologin  |      | -| 2   | 2   | /sbin          | /sbin/nologin  |      | -| 3   | 4   | /var/adm       | /sbin/nologin  |      | -| 4   | 7   | /var/spool/lpd | /sbin/nologin  |      | -| 5   | 0   | /sbin          | /bin/sync      |      | -| 6   | 0   | /sbin          | /sbin/shutdown |      | -+-----+-----+----------------+----------------+------+ -osquery> -``` - -### Run queries without entering interactive mode - -What if you want to run a query without entering the osqueri interactive mode? This could be very useful if you are writing shell scripts around it. In this case, you could `echo` the SQL query and pipe it to osqueri right from the Bash shell: - - -``` -$ echo "select uid,gid,directory,shell,uuid FROM users LIMIT 7;" | osqueryi -+-----+-----+----------------+----------------+------+ -| uid | gid | directory      | shell          | uuid | -+-----+-----+----------------+----------------+------+ -| 0   | 0   | /root          | /bin/bash      |      | -| 1   | 1   | /bin           | /sbin/nologin  |      | -| 2   | 2   | /sbin          | /sbin/nologin  |      | -| 3   | 4   | /var/adm       | /sbin/nologin  |      | -| 4   | 7   | /var/spool/lpd | /sbin/nologin  |      | -| 5   | 0   | /sbin          | /bin/sync      |      | -| 6   | 0   | /sbin          | /sbin/shutdown |      | -+-----+-----+----------------+----------------+------+ -$ -``` - -### Learn what services start when booting up - -Osquery can also return all the services set to start at boot. For example, to query the `startup_items` table and get the name, status, and path of the first five services that run at startup: - - -``` -osquery> SELECT name,type,status,path FROM startup_items LIMIT 5; -  name = README -  type = Startup Item -status = enabled -  path = /etc/rc.d/init.d/README - -  name = anamon -  type = Startup Item -status = enabled -  path = /etc/rc.d/init.d/anamon - -  name = functions -  type = Startup Item -status = enabled -  path = /etc/rc.d/init.d/functions - -  name = osqueryd -  type = Startup Item -status = enabled -  path = /etc/rc.d/init.d/osqueryd - -  name = AT-SPI D-Bus Bus -  type = Startup Item -status = enabled -  path = /usr/libexec/at-spi-bus-launcher --launch-immediately -osquery> -``` - -### Look up ELF information for a binary - -Imagine you want to find out more details about the `ls` binary. Usually, you would do it with the `readelf -h` command followed by the `ls` command's path. You can query the `elf_info` table with Osquery and get the same information: - - -``` -osquery> SELECT * FROM elf_info WHERE path="/bin/ls"; -      class = 64 -        abi = sysv -abi_version = 0 -       type = dyn -    machine = 62 -    version = 1 -      entry = 24064 -      flags = 0 -       path = /bin/ls -osquery> -``` - -Now you have a taste of how to use osqueri to look for information of interest to you. However, this information is stored on a huge number of tables; one system I queried had 156 different tables, which can be overwhelming: - - -``` -$ echo ".tables" | osqueryi | wc -l -156 -$ -``` - -To make things easier, you can start with these tables to get information about your Linux system: - -**System information table** - - -``` -`osquery> select * from system_info;` -``` - -**System limit information** - - -``` -`osquery> select * from ulimit_info;` -``` - -**Files opened by various processes** - - -``` -`osquery> select * from process_open_files;` -``` - -**Open ports on a system** - - -``` -`osquery> select * from listening_ports;` -``` - -**Running processes information** - - -``` -`osquery> select * from processes;` -``` - -**Installed packages information** - - -``` -`osquery> select * from rpm_packages;` -``` - -**User login information** - - -``` -`osquery> select * from last;` -``` - -**System log information** - - -``` -`osquery> select * from syslog_events;` -``` - -### Learn more - -Osquery is a powerful tool that provides a lot of host information that can be used to solve various use cases. You can learn more about Osquery by [reading its documentation][6]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/osquery-linux - -作者:[Gaurav Kamathe][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/gkamathe -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code) -[2]: https://osquery.io/ -[3]: https://github.com/osquery/osquery -[4]: https://osquery.io/downloads/official -[5]: https://osquery.io/schema/4.8.0/ -[6]: https://osquery.readthedocs.io/en/latest/ diff --git a/translated/tech/20210628 Query your Linux operating system like a database.md b/translated/tech/20210628 Query your Linux operating system like a database.md new file mode 100644 index 0000000000..bb82eb1f6f --- /dev/null +++ b/translated/tech/20210628 Query your Linux operating system like a database.md @@ -0,0 +1,330 @@ +[#]: subject: (Query your Linux operating system like a database) +[#]: via: (https://opensource.com/article/21/6/osquery-linux) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: (YungeG) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +像查询数据库一样查询你的 Linux 操作系统 +====== + +使用数据库查询操作轻松获取系统信息。 +![Magnifying glass on code][1] + +Linux 提供了很多帮助用户收集主机操作系统信息的命令:列出文件或者目录的属性信息;查询安装的软件包、正在执行的命令、开机时启动的服务;或者了解系统的硬件。 + +每个命令使用自己的输出格式列出系统的信息。你需要使用 `grep`、`sed`、`awk` 这样的工具过滤命令输出的结果,以便找到特定的信息。此外,很多这样的信息会频繁变动,导致系统状态的改变。 + +将所有的信息格式化为一个数据库的 SQL 查询的输出进行查看将会十分有益 。想象一下,你能够像查询具有类似名称的 SQL 数据库表一样查询 `ps` 和 `rpm` 命令的输出。 + +幸运的是,有一个工具刚好实现了这个功能,而且功能更多:[Osquery][2] 是一个 [开源的][3] “SQL powered operating system instrumentation, monitoring, and analytics framework”。 + +许多处理安全、DevOps、合规性的应用,以及仓储管理管理 (仅举几例)在内部依赖 Osquery 提供的核心功能。 + +### 安装 Osquery +### Install Osquery + +Osquery 适用于 Linux,macOS,Windows,FreeBSD。按照[指南][4]为你的操作系统安装最新版本。(我会在下面的例子中使用 4.7.0 版本。) + + +安装完成后,确保 Osquery 可以工作: + +``` +$ rpm -qa | grep osquery +osquery-4.7.0-1.linux.x86_64 +$ +$ osqueryi --version +osqueryi version 4.7.0 +$ +``` + +### Osquery 组件 + +Osquery 有两个主要组件: + +* **osqueri** 是一个交互式的 SQL 查询控制台,可以独立运行,不需要超级用户权限(除非要查询的表格需要访问权限)。 +* **osqueryd** 像一个安装在主机的监控守护进程,可以定期调度查询操作执行,从底层架构收集信息。 + +可以在不运行 osqueryd 的情况下执行 osqueri 。另一个工具,**osqueryctl**,控制守护进程的启动,停止,并检查其状态。 + +``` +$ rpm -ql osquery-4.8.0-1.linux.x86_64 | grep bin +/usr/bin/osqueryctl +/usr/bin/osqueryd +/usr/bin/osqueryi +$ +``` + +### 使用 osqueryi 交互式命令提示符 + +你和 Osquery 的交互与使用 SQL 数据库十分相似。事实上,osqueryi 是 SQList shell 的一个修改版。执行 `osqueryi` 命令进入交互式命令提示符 ,就可以执行 Osquery 的命令,通常以 `.` 开始: + +``` +$ osqueryi +Using a virtual database. Need help, type '.help' +osquery> +``` + +要退出交互式命令提示符,执行 `.quit` 命令回到操作系统的命令提示符: + +``` +osquery> +osquery> .quit +$ +``` + +### 找出可用的表 + +如前所述,Osquery 像 SQL 查询一样输出数据,数据库中的信息通常保存在表中。但是如何在不知道表名的情况下查询这些表呢?你可以运行 `.tables` 命令列出所有可以查询的表。如果你是一个 Linux 长期用户或者一个系统管理员 ,就会对表名十分熟悉,因为你一直在使用操作系统命令获取同样的信息: + +``` +osquery> .tables + => acpi_tables + => apparmor_events + => apparmor_profiles + => apt_sources + +<< snip >> + + => arp_cache + => user_ssh_keys + => users + => yara + => yara_events + => ycloud_instance_metadata + => yum_sources +osquery> +``` + +### 检查各个表的模式 + +知道表名后,可以查看每个表提供的信息。既然 `ps` 命令经常用于获取进程信息,就以 `processes` 为例。执行 `.schema` 命令加上表名查看表中保存的信息。如果要验证命令返回的结果,可以快速执行 `ps -ef` 或 `ps aux`,对比命令的输出和表中的内容: + +``` +osquery> .schema processes +CREATE TABLE processes(`pid` BIGINT, `name` TEXT, `path` TEXT, `cmdline` TEXT, `state` TEXT, `cwd` TEXT, `root` TEXT, `uid` BIGINT, `gid` BIGINT, `euid` BIGINT, `egid` BIGINT, `suid` BIGINT, `sgid` BIGINT, `on_disk` INTEGER, `wired_size` BIGINT, `resident_size` BIGINT, `total_size` BIGINT, `user_time` BIGINT, `system_time` BIGINT, `disk_bytes_read` BIGINT, `disk_bytes_written` BIGINT, `start_time` BIGINT, `parent` BIGINT, `pgroup` BIGINT, `threads` INTEGER, `nice` INTEGER, `is_elevated_token` INTEGER HIDDEN, `elapsed_time` BIGINT HIDDEN, `handle_count` BIGINT HIDDEN, `percent_processor_time` BIGINT HIDDEN, `upid` BIGINT HIDDEN, `uppid` BIGINT HIDDEN, `cpu_type` INTEGER HIDDEN, `cpu_subtype` INTEGER HIDDEN, `phys_footprint` BIGINT HIDDEN, PRIMARY KEY (`pid`)) WITHOUT ROWID; +osquery> +``` + +要进一步确认这一点,使用下面的命令查看 RPM 包的结构信息,然后与操作系统命令 `rpm -qa` 和 `rpm -qi` 的输出比较: + +``` +osquery> +osquery> .schema rpm_packages +CREATE TABLE rpm_packages(`name` TEXT, `version` TEXT, `release` TEXT, `source` TEXT, `size` BIGINT, `sha1` TEXT, `arch` TEXT, `epoch` INTEGER, `install_time` INTEGER, `vendor` TEXT, `package_group` TEXT, `pid_with_namespace` INTEGER HIDDEN, `mount_namespace_id` TEXT HIDDEN, PRIMARY KEY (`name`, `version`, `release`, `arch`, `epoch`, `pid_with_namespace`)) WITHOUT ROWID; +osquery> +``` + +从 Osquery 的[表格文档][5]获取更多信息。 + +### 使用 PRAGMA 命令 + +为了防止模式信息对你来说太难看懂,还有另一种途径能够以详细的表格格式打印表中的信息:`PRAGMA` 命令。例如,我想通过 `PRAGMA` 用一种易于理解的格式查看 `rpm_packages` 表的信息: + +``` +`osquery> PRAGMA table_info(rpm_packages);` +``` + +这种表格式信息的一个好处是你可以关注想要查询的字段,查看命令提供的类型信息: + +``` +osquery> PRAGMA table_info(users); ++-----+-------------+--------+---------+------------+----+ +| cid | name | type | notnull | dflt_value | pk | ++-----+-------------+--------+---------+------------+----+ +| 0 | uid | BIGINT | 1 | | 1 | +| 1 | gid | BIGINT | 0 | | 0 | +| 2 | uid_signed | BIGINT | 0 | | 0 | +| 3 | gid_signed | BIGINT | 0 | | 0 | +| 4 | username | TEXT | 1 | | 2 | +| 5 | description | TEXT | 0 | | 0 | +| 6 | directory | TEXT | 0 | | 0 | +| 7 | shell | TEXT | 0 | | 0 | +| 8 | uuid | TEXT | 1 | | 3 | ++-----+-------------+--------+---------+------------+----+ +osquery> +``` + +### 进行你的第一次查询 + +在你从表、模式、条目中获取到所有进行查询所需要的信息后,进行你的第一次 SQL 查询查看其中的信息。下面的查询返回系统中的用户和每个用户的用户 ID、组 ID、主目录和默认的命令行解释器。Linux 用户通过查看 `/etc/passwd` 文件的内容并执行 `grep`、`sed`、`awk` 命令获取同样的信息。 + +``` +osquery> +osquery> select uid,gid,directory,shell,uuid FROM users LIMIT 7; ++-----+-----+----------------+----------------+------+ +| uid | gid | directory | shell | uuid | ++-----+-----+----------------+----------------+------+ +| 0 | 0 | /root | /bin/bash | | +| 1 | 1 | /bin | /sbin/nologin | | +| 2 | 2 | /sbin | /sbin/nologin | | +| 3 | 4 | /var/adm | /sbin/nologin | | +| 4 | 7 | /var/spool/lpd | /sbin/nologin | | +| 5 | 0 | /sbin | /bin/sync | | +| 6 | 0 | /sbin | /sbin/shutdown | | ++-----+-----+----------------+----------------+------+ +osquery> +``` + +### 不进入交互模式的查询 + +如果你想要在不进入 osqueri 交互模式的情况下进行查询,该怎么办?要用查询操作写命令行解释器脚本,这种方式可能十分有用。这种情况下,可以直接从 Bash 解释器 `echo` SQL 查询,通过管道输出到 osqueri : + +``` +$ echo "select uid,gid,directory,shell,uuid FROM users LIMIT 7;" | osqueryi ++-----+-----+----------------+----------------+------+ +| uid | gid | directory | shell | uuid | ++-----+-----+----------------+----------------+------+ +| 0 | 0 | /root | /bin/bash | | +| 1 | 1 | /bin | /sbin/nologin | | +| 2 | 2 | /sbin | /sbin/nologin | | +| 3 | 4 | /var/adm | /sbin/nologin | | +| 4 | 7 | /var/spool/lpd | /sbin/nologin | | +| 5 | 0 | /sbin | /bin/sync | | +| 6 | 0 | /sbin | /sbin/shutdown | | ++-----+-----+----------------+----------------+------+ +$ +``` + +### 获悉系统启动时开始的服务 + +Osquery 还可以列出系统启动时开始的所有服务。例如,可以查询 `startup_items` 表获取启动时开始的前五项服务的名称、状态和路径: + +``` +osquery> SELECT name,type,status,path FROM startup_items LIMIT 5; + name = README + type = Startup Item +status = enabled + path = /etc/rc.d/init.d/README + + name = anamon + type = Startup Item +status = enabled + path = /etc/rc.d/init.d/anamon + + name = functions + type = Startup Item +status = enabled + path = /etc/rc.d/init.d/functions + + name = osqueryd + type = Startup Item +status = enabled + path = /etc/rc.d/init.d/osqueryd + + name = AT-SPI D-Bus Bus + type = Startup Item +status = enabled + path = /usr/libexec/at-spi-bus-launcher --launch-immediately +osquery> +``` + +### 查阅二进制文件的 ELF 信息 + +假如你想要弄清 `ls` 二进制文件的更多细节,通常会通过 `readelf -h` 命令,加上 `ls` 命令的路径。查询 Osquery 的 `elf_info` 表你可以得到同样的信息: + +``` +osquery> SELECT * FROM elf_info WHERE path="/bin/ls"; + class = 64 + abi = sysv +abi_version = 0 + type = dyn + machine = 62 + version = 1 + entry = 24064 + flags = 0 + path = /bin/ls +osquery> +``` + +现在你应该初步了解如何使用 osqueri 查询自己想要的信息。然而,这些信息保存在数量巨大的表中;我查询过的一个系统中,有 156 个不同的表,这个数字可能是十分惊人的: + +``` +$ echo ".tables" | osqueryi | wc -l +156 +$ +``` + +要让事情变得更容易,可以从这些表开始获取你的 Linux 系统的信息: + +**System information table** + + +``` +`osquery> select * from system_info;` +``` + +**System limit information** + + +``` +`osquery> select * from ulimit_info;` +``` + +**Files opened by various processes** + + +``` +`osquery> select * from process_open_files;` +``` + +**Open ports on a system** + + +``` +`osquery> select * from listening_ports;` +``` + +**Running processes information** + + +``` +`osquery> select * from processes;` +``` + +**Installed packages information** + + +``` +`osquery> select * from rpm_packages;` +``` + +**User login information** + + +``` +`osquery> select * from last;` +``` + +**System log information** + + +``` +`osquery> select * from syslog_events;` +``` + +### 了解更多 + +Osquery 是一个强大的工具,提供了许多可以用于解决各种使用案例的主机信息。你可以阅读[文档][6]了解更多 Osquery 的信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/osquery-linux + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/YungeG) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code) +[2]: https://osquery.io/ +[3]: https://github.com/osquery/osquery +[4]: https://osquery.io/downloads/official +[5]: https://osquery.io/schema/4.8.0/ +[6]: https://osquery.readthedocs.io/en/latest/ From 26f250cc4ec2994956ce37ee4a1509784c745528 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 12 Jul 2021 21:12:35 +0800 Subject: [PATCH 396/870] Rename sources/tech/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md to sources/news/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md --- ...m - FreeBSD Based OS Brings another Promising Release 0.5.0.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md (100%) diff --git a/sources/tech/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md b/sources/news/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md similarity index 100% rename from sources/tech/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md rename to sources/news/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md From e97e24a38c7236dc3904c8b4a8e6aaadbd4196c8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 12 Jul 2021 21:22:12 +0800 Subject: [PATCH 397/870] Rename sources/tech/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md to sources/news/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md --- ...20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md (100%) diff --git a/sources/tech/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md b/sources/news/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md similarity index 100% rename from sources/tech/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md rename to sources/news/20210710 Linux Mint 20.2 -Uma- Released. This is What-s New.md From d916ac1a2b05ec9a51e6f9f538f08c1328d4951d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Jul 2021 23:00:30 +0800 Subject: [PATCH 398/870] PRF @zepoch --- ...rce to keep your brain busy this summer.md | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md b/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md index c9f52841e7..38cf9a8ad9 100644 --- a/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md +++ b/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md @@ -3,73 +3,74 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "zepoch" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -让你的大脑在这个夏天保持忙碌的7个开源指南 +让你的大脑在这个夏天保持忙碌的 7 本开源指南 ====== -下载我们的免费指南之一:开发一个基于Python的电子游戏,使用开源工具来让你的生活井井有条,完成家庭自动化项目,或尝试你的树莓派家用实验室。 -![One chair on a sandy beach][1] +> 下载我们的免费指南之一:开发一个基于 Python 的电子游戏;使用开源工具来让你的生活井井有条;完成家庭自动化项目;或尝试你的树莓派家用实验室。 + +![](https://img.linux.net.cn/data/attachment/album/202107/12/225953hynu3qud32s1jn1z.jpg) + +(LCTT 译注:opensource.com 的免费电子书需要免费注册一个用户才能下载。) ### 开启一个新的树莓派项目 -近十年来,树莓派一直俘获着开源爱好者的心和手。你可以用树莓派做无数的项目,无论是[监控你的花园][2],[设置家长监控][3](尤其是在那些漫长的夏天),甚至从你自己的后院[跟踪飞机][4]。如果这些很酷的项目激起了你的兴趣,但你的树莓派仍在积灰,那么你需要下载我们的指南来推动你开始。在你知道它之前,你需要学习[如何管理他们][5],因为你将与很多树莓派一起工作! +近十年来,树莓派一直俘获着开源爱好者的心和手。你可以用树莓派做无数的项目,无论是 [监控你的花园][2]、[设置家长监控][3](尤其是在那些漫长的夏天),甚至从你自己的后院 [跟踪飞机][4]。如果这些很酷的项目激起了你的兴趣,但你的树莓派仍在吃灰,那么你需要下载我们的指南来促使你开始行动。在你知道它之前,你需要学习 [如何管理它们][5],因为你将与很多树莓派一起工作! -**下载:[如何开始你的树莓派工作][6]** +**下载:《[如何开始使用你的树莓派][6]》** ### 设计你的开源智能家庭 一个聪明且有用的方式去使用树莓派的方式是去设计你的智能家庭。使用家庭助手或其他的开源工具,你的家可以按你自己的设置进行自动化而无需借助第三方平台。作者 [Steve Ovens][7] 用这本家庭自动化集锦的手写电子书来指导你的每一步工作。 -**下载:[使用开源工具实现家庭自动化的实用指南][7]** +**下载:《[使用开源工具实现家庭自动化的实用指南][7]》** ### 将事情梳理地井井有条 -可能你并没做好准备使得你的家庭完全自动化,但是你可能会对梳理你的思维有兴趣。为什么不从你的 to-do 列表开始呢?在贡献者 [Kevin Sonney][8] 的生产力指导下,你将会熟悉六个开源工具的使用从而帮你把事情安排得井井有条。一旦你使用了他的教程,你就会感到事情井井有条,在这个夏天终于有时间放松了。 +可能你并没做好准备使得你的家庭完全自动化,但是你可能会对梳理你的思维有兴趣。为什么不从你的 to-do 列表开始呢?在贡献者 [Kevin Sonney][8] 的生产力指导下,你将会熟悉六个开源工具的使用,从而帮你把事情安排得井井有条。一旦你完成了他的教程,你就会感到事情井井有条,在这个夏天终于有时间放松了。 -**下载:[六个可以将事情梳理地井井有条的开源工具][9]** +**下载:《[六个可以将事情梳理地井井有条的开源工具][9]》** ### 学习如何写代码 电脑无处不在。能吐槽一下很多编程语言对初学者不是很友好吗? -有许多为初学者设计的编程语言。Bash 是 Linux 和 Macos 终端中使用的相同的脚本语言,如果你新开始写代码,Bash 将会是一个伟大的开始。你可以进行[交互式学习][10],之后下载我们的电子书以了解更多。 +有许多为初学者设计的编程语言。Bash 是 Linux 和 macOS 终端中使用的相同的脚本语言,如果你新开始写代码,Bash 将会是一个伟大的开始。你可以以 [互动的方式学习它][10],之后下载我们的电子书以了解更多。 -**下载:[Bash 编程指南][11]** +**下载:《[Bash 编程指南][11]》** ### 用 Python 写一个游戏 -另一个初学者喜欢的编程语言是 Python。它不仅受到仅仅学习编码的中小学生的欢迎,还被专业程序员用来做[网站开发][12],[视频编辑][13]以及[云端自动化][14]。无论你最终的目标是什么,开始 Python 的一个有趣的方式是编写一个自己游戏。 +另一个初学者喜欢的编程语言是 Python。它不仅受到仅仅学习编码的中小学生的欢迎,还被专业程序员用来做 [网站开发][12]、[视频编辑][13] 以及 [云端自动化][14]。无论你最终的目标是什么,开始学习 Python 的一个有趣的方式是编写一个自己的游戏。 -**下载:[Python 游戏开发指南][15]** +**下载:《[Python 游戏开发指南][15]》** ### 发现使用 Jpuyter 的巧妙方法 -为了让Python互动且易于共享,Jupyter 项目提供了基于 Web 的发展环境。您可以在"笔记本"文件中写代码,然后将其发送给其他用户,以便他们轻松复制和可视化您所做的。它是代码、文档和演示文稿的完美组合,而且非常灵活。下载 Moshe Zadka 的多方面指南了解更多关于 Jupyter。 +为了让 Python 具有交互性且易于分享,Jupyter 项目提供了基于 Web 的发展环境。你可以在“笔记本”文件中写代码,然后将其发送给其他用户,以便他们轻松复制和可视化你所做的。它是代码、文档和演示文稿的完美组合,而且非常灵活。下载 Moshe Zadka 的多方面指南了解更多关于 Jupyter。 -**下载:[使用 Jupyer 的六种惊艳方式][16]** +**下载:《[使用 Jupyer 的六种惊艳方式][16]》** ### 在你的家庭实验室里尝试 Kubernetes -现在,您已经在你的树莓派上安装了 Linux,已经登录,已设置新用户并[配置 sudo][17] 使得能够进入管理员模式,你正在[运行所有你需要的服务][18] 。之后呢? +现在,你已经在你的树莓派上安装了 Linux,已经登录,已设置新用户并 [配置了 sudo][17] 使得能够进入管理员模式,你正在 [运行所有你需要的服务][18] 。之后呢? -如果您对 Linux 和服务器管理感到满意,您下一步可能是云服务。可以读一下 Chris Collins 的电子书,从你的家庭实验室的舒适中了解所有关于容器,吊舱和集群的信息。 +如果你对 Linux 和服务器管理感到满意,你的下一步可能是云服务。可以读一下 Chris Collins 的电子书,从你的家庭实验室的舒适中了解所有关于容器,吊舱和集群的信息。 -**下载: [在你的树莓派家庭实验室上运行 Kubernetes][19]** +**下载: 《[在你的树莓派家庭实验室上运行 Kubernetes][19]》** ### 福利:书籍列表 只工作不休息是不健康的。夏天(或任何季节,它是在你的世界的一部分)假期是为了休息,没有什么比坐在门廊或海滩上读一本好书更休闲人心的。下面是一些最近列出的书,以激发一些想法: - * [8 本供开源技术专家读的书 (2021)][20] + * [8 本供开源技术专家读的书(2021)][20] * [十几本适合所有年龄段的书][21] * [8 本提升领导力的书籍][22] * [6 本必读的云架构书籍][23] - * 我们的第一个[2010年至今的书籍列表][24] - - + * 我们的第一份 [2010 年的书籍列表][24] -------------------------------------------------------------------------------- @@ -78,7 +79,7 @@ via: https://opensource.com/article/21/7/open-source-guides 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4d98e58ea974beb3e49d4a864d1dcc31764fb4fa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Jul 2021 23:01:11 +0800 Subject: [PATCH 399/870] PUB @zepoch https://linux.cn/article-13575-1.html --- ...s about open source to keep your brain busy this summer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210704 7 guides about open source to keep your brain busy this summer.md (98%) diff --git a/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md b/published/20210704 7 guides about open source to keep your brain busy this summer.md similarity index 98% rename from translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md rename to published/20210704 7 guides about open source to keep your brain busy this summer.md index 38cf9a8ad9..16cf08fc77 100644 --- a/translated/tech/20210704 7 guides about open source to keep your brain busy this summer.md +++ b/published/20210704 7 guides about open source to keep your brain busy this summer.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13575-1.html" 让你的大脑在这个夏天保持忙碌的 7 本开源指南 ====== From f35e27f48fb2d396bf7e03c7f7507ceff4a8a400 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Jul 2021 23:25:22 +0800 Subject: [PATCH 400/870] PRF @geekpi --- ...se JSON configuration files with Groovy.md | 83 ++++++++----------- 1 file changed, 33 insertions(+), 50 deletions(-) diff --git a/translated/tech/20210630 Parse JSON configuration files with Groovy.md b/translated/tech/20210630 Parse JSON configuration files with Groovy.md index 58e018ca68..ad0d25d4d5 100644 --- a/translated/tech/20210630 Parse JSON configuration files with Groovy.md +++ b/translated/tech/20210630 Parse JSON configuration files with Groovy.md @@ -3,24 +3,26 @@ [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) +[#]: reviewer: (wxy) +[#]: publisher: () [#]: url: ( ) 用 Groovy 解析 JSON 配置文件 ====== -抛开关于是否使用 JSON 作为配置格式的争论,只需学习如何用 Groovy 来解析它。 -![Looking back with binoculars][1] + +> 抛开关于是否使用 JSON 作为配置格式的争论,只需学习如何用 Groovy 来解析它。 + +![](https://img.linux.net.cn/data/attachment/album/202107/12/232406vpp4qrv6ee5a3erz.jpg) 应用程序通常包括某种类型的默认或“开箱即用”的状态或配置,以及某种让用户根据自己的需要定制配置的方式。 -例如,[LibreOffice Writer][2] 通过其菜单栏上的**工具>选项**,可以访问诸如用户数据、字体、语言设置等(更多)东西。一些应用程序(如 LibreOffice)提供了一个点选式的用户界面来管理这些设置。有些,像 [Tracker][3](GNOME 的任务,用于索引文件),使用 XML 文件。还有一些,特别是基于 JavaScript 的应用,使用 JSON,尽管它有许多人抗议(例如,[这位作者][4]和[这位其他作者][5])。 +例如,[LibreOffice Writer][2] 通过其菜单栏上的**工具 > 选项**,可以访问诸如用户数据、字体、语言设置等(以及更多的)设置。一些应用程序(如 LibreOffice)提供了一个点选式的用户界面来管理这些设置。有些,像 [Tracker][3](GNOME 的“任务”,用于索引文件)使用 XML 文件。还有一些,特别是基于 JavaScript 的应用,使用 JSON,尽管它有许多人抗议(例如,[这位作者][4] 和 [这位其他作者][5])。 -在这篇文章中,我将回避关于是否使用 JSON 作为配置文件格式的争论,并解释如何使用 [Groovy 编程语言][6]来解析这类信息。Groovy 以 Java 为基础,但有一套不同的设计重点,使 Groovy 感觉更像 Python。 +在这篇文章中,我将回避关于是否使用 JSON 作为配置文件格式的争论,并解释如何使用 [Groovy 编程语言][6] 来解析这类信息。Groovy 以 Java 为基础,但有一套不同的设计重点,使 Groovy 感觉更像 Python。 ### 安装 Groovy -由于 Groovy 是基于 Java 的,它也需要安装 Java。你可能会在你的 Linux 发行版的软件库中找到最近的、合适的 Java 和 Groovy 版本。或者,你可以按照其网站上的[说明][7]安装 Groovy。 Linux 用户的一个不错的选择是 [SDKMan][8],你可以使用它来获取 Java、Groovy 和许多其他相关工具的多个版本。 对于本文,我将使用我的发行版的 OpenJDK11 和 SDKMan 的 Groovy 3.0.7。 +由于 Groovy 是基于 Java 的,它也需要安装 Java。你可能会在你的 Linux 发行版的软件库中找到最近的、合适的 Java 和 Groovy 版本。或者,你可以按照其网站上的 [说明][7] 安装 Groovy。 Linux 用户的一个不错的选择是 [SDKMan][8],你可以使用它来获取 Java、Groovy 和许多其他相关工具的多个版本。 对于本文,我将使用我的发行版的 OpenJDK11 和 SDKMan 的 Groovy 3.0.7。 ### 演示的 JSON 配置文件 @@ -45,9 +47,9 @@ "drupal8": { "account_name": "root", "account_pass": "root", - "account_mail": "[box@example.com][10]", + "account_mail": "box@example.com", "site_name": "Drupal 8", - "site_mail": "[box@example.com][10]", + "site_mail": "box@example.com", "vhost": { "document_root": "drupal8", "url": "drupal8.dev", @@ -57,9 +59,9 @@ "drupal7": { "account_name": "root", "account_pass": "root", - "account_mail": "[box@example.com][10]", + "account_mail": "box@example.com", "site_name": "Drupal 7", - "site_mail": "[box@example.com][10]", + "site_mail": "box@example.com", "vhost": { "document_root": "drupal7", "url": "drupal7.dev", @@ -73,16 +75,14 @@ 这是一个漂亮的、复杂的 JSON 文件,有几层结构,如: - ``` -`<>.vdd.sites.drupal8.account_name` +<>.vdd.sites.drupal8.account_name ``` 和一些列表,如: - ``` -`<>.vm.synced_folders` +<>.vm.synced_folders ``` 这里,`<>` 代表未命名的顶层。让我们看看 Groovy 是如何处理的。 @@ -106,18 +106,16 @@ println "config = $config" 在终端的命令行上运行这个程序: - ``` $ groovy config1.groovy -config = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +config = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:box@example.com, site_name:Drupal 8, site_mail:box@example.com, vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:box@example.com, site_name:Drupal 7, site_mail:box@example.com, vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] $ ``` -输出显示了一个有两个键的顶层 map:`vm` 和 `vdd`。每个键都引用了它自己的值的 map。注意 `forwarded_ports` 键所引用的空列表。 +输出显示了一个有两个键的顶层映射:`vm` 和 `vdd`。每个键都引用了它自己的值的映射。注意 `forwarded_ports` 键所引用的空列表。 这很容易,但它所做的只是把东西打印出来。你是如何获得各种组件的呢?下面是另一个程序,显示如何访问存储在 `config.vm.ip` 的值: - ``` import groovy.json.JsonSlurper @@ -130,7 +128,6 @@ println "config.vm.ip = ${config.vm.ip}" 运行它: - ``` $ groovy config2.groovy config.vm.ip = 192.168.44.44 @@ -139,32 +136,26 @@ $ 是的,这也很容易。 这利用了 Groovy 速记,这意味着: - ``` -`config.vm.ip` +config.vm.ip ``` 在 Groovy 中等同于: - ``` -`config['vm']['ip']` +config['vm']['ip'] ``` -当 `config `和 `config.vm` 都是 `Map` 的实例,并且都等同于: - +当 `config` 和 `config.vm` 都是 `Map` 的实例,并且都等同于在 Java 中的: ``` -`config.get("vm").get("ip")` +config.get("vm").get("ip") ``` -在 Java 中。 - 仅仅是处理 JSON 就这么多了。如果你想有一个标准的配置并让用户覆盖它呢?在这种情况下,你可能想在程序中硬编码一个 JSON 配置,然后读取用户配置并覆盖任何标准配置的设置。 假设上面的配置是标准的,而用户只想覆盖其中的一点,只想覆盖 `vm` 结构中的 `ip` 和 `memory` 值,并把它放在 `userConfig.json` 文件中: - ``` { "vm": { @@ -181,9 +172,8 @@ import groovy.json.JsonSlurper def jsonSlurper = new JsonSlurper() -// 使用parseText()来解析一个字符串,而不是从文件中读取。 +// 使用 parseText() 来解析一个字符串,而不是从文件中读取。 // 这给了我们一个“标准配置” - def standardConfig = jsonSlurper.parseText(""" { "vm": { @@ -203,9 +193,9 @@ def standardConfig = jsonSlurper.parseText(""" "drupal8": { "account_name": "root", "account_pass": "root", - "account_mail": "[box@example.com][10]", + "account_mail": "box@example.com", "site_name": "Drupal 8", - "site_mail": "[box@example.com][10]", + "site_mail": "box@example.com", "vhost": { "document_root": "drupal8", "url": "drupal8.dev", @@ -215,9 +205,9 @@ def standardConfig = jsonSlurper.parseText(""" "drupal7": { "account_name": "root", "account_pass": "root", - "account_mail": "[box@example.com][10]", + "account_mail": "box@example.com", "site_name": "Drupal 7", - "site_mail": "[box@example.com][10]", + "site_mail": "box@example.com", "vhost": { "document_root": "drupal7", "url": "drupal7.dev", @@ -230,19 +220,15 @@ def standardConfig = jsonSlurper.parseText(""" """) // 打印标准配置 - println "standardConfig = $standardConfig" //读入并解析用户配置信息 - def userConfig = jsonSlurper.parse(new File('userConfig.json')) // 打印出用户配置信息 - println "userConfig = $userConfig" // 一个将用户配置与标准配置合并的函数 - def mergeMaps(Map input, Map merge) { merge.each { k, v -> if (v instanceof Map) @@ -252,9 +238,7 @@ def mergeMaps(Map input, Map merge) { } } -// 合并配置并打印出修改后的 -// 标准配置 - +// 合并配置并打印出修改后的标准配置 mergeMaps(standardConfig, userConfig) println "modified standardConfig $standardConfig" @@ -262,24 +246,23 @@ println "modified standardConfig $standardConfig" 以下列方式运行: - ``` $ groovy config3.groovy -standardConfig = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +standardConfig = [vm:[ip:192.168.44.44, memory:1024, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:box@example.com, site_name:Drupal 8, site_mail:box@example.com, vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:box@example.com, site_name:Drupal 7, site_mail:box@example.com, vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] userConfig = [vm:[ip:201.201.201.201, memory:4096]] -modified standardConfig [vm:[ip:201.201.201.201, memory:4096, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 8, site_mail:[box@example.com][10], vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:[box@example.com][10], site_name:Drupal 7, site_mail:[box@example.com][10], vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] +modified standardConfig [vm:[ip:201.201.201.201, memory:4096, synced_folders:[[host_path:data/, guest_path:/var/www, type:default]], forwarded_ports:[]], vdd:[sites:[drupal8:[account_name:root, account_pass:root, account_mail:box@example.com, site_name:Drupal 8, site_mail:box@example.com, vhost:[document_root:drupal8, url:drupal8.dev, alias:[www.drupal8.dev]]], drupal7:[account_name:root, account_pass:root, account_mail:box@example.com, site_name:Drupal 7, site_mail:box@example.com, vhost:[document_root:drupal7, url:drupal7.dev, alias:[www.drupal7.dev]]]]]] $ ``` 以 `modified standardConfig` 开头的一行显示,`vm.ip` and `vm.memory` 的值被覆盖了。 -眼尖的读者会注意到,我没有检查畸形的 JSON,也没有仔细确保用户的配置是有意义的(不创建新字段,提供合理的值,等等)。所以用这个递归方法来合并两个 map 在现实中可能并不那么实用。 +眼尖的读者会注意到,我没有检查畸形的 JSON,也没有仔细确保用户的配置是有意义的(不创建新字段,提供合理的值,等等)。所以用这个递归方法来合并两个映射在现实中可能并不那么实用。 -好吧,我必须为家庭作业留下_一些_东西,不是吗? +好吧,我必须为家庭作业留下 _一些_ 东西,不是吗? ### Groovy 资源 -Apache Groovy 网站有很多很棒的[文档][11]。另一个很棒的 Groovy 资源是 [Mr. Haki][12]。学习 Groovy 的一个非常好的理由是继续学习 [Grails][13],它是一个非常高效的全栈网络框架,建立在 Hibernate、Spring Boot 和 Micronaut 等优秀组件之上。 +Apache Groovy 网站有很多很棒的 [文档][11]。另一个很棒的 Groovy 资源是 [Mr. Haki][12]。学习 Groovy 的一个非常好的理由是继续学习 [Grails][13],它是一个非常高效的全栈 Web 框架,建立在 Hibernate、Spring Boot 和 Micronaut 等优秀组件之上。 -------------------------------------------------------------------------------- @@ -288,7 +271,7 @@ via: https://opensource.com/article/21/6/groovy-parse-json 作者:[Chris Hermansen][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2697d20ef0d58a7d2ec7411ebf3851aee3ee74cf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Jul 2021 23:25:46 +0800 Subject: [PATCH 401/870] PUB @geekpi https://linux.cn/article-13576-1.html --- .../20210630 Parse JSON configuration files with Groovy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210630 Parse JSON configuration files with Groovy.md (99%) diff --git a/translated/tech/20210630 Parse JSON configuration files with Groovy.md b/published/20210630 Parse JSON configuration files with Groovy.md similarity index 99% rename from translated/tech/20210630 Parse JSON configuration files with Groovy.md rename to published/20210630 Parse JSON configuration files with Groovy.md index ad0d25d4d5..8ba9dc0556 100644 --- a/translated/tech/20210630 Parse JSON configuration files with Groovy.md +++ b/published/20210630 Parse JSON configuration files with Groovy.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: () -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13576-1.html) 用 Groovy 解析 JSON 配置文件 ====== From 6a9da228c3188b2c727175ddceacfa6d2ace9e8f Mon Sep 17 00:00:00 2001 From: SilentDawn Date: Mon, 12 Jul 2021 23:27:56 +0800 Subject: [PATCH 402/870] Update 20180619 Systemd Services- Monitoring Files and Directories.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译 --- ...180619 Systemd Services- Monitoring Files and Directories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md b/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md index 601132a33f..81e9aa5958 100644 --- a/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md +++ b/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md @@ -137,7 +137,7 @@ via: https://www.linux.com/blog/learn/intro-to-linux/2018/6/systemd-services-mon 作者:[Paul Brown][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[silentdawn-zz](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 38b9279a25155e073342ecf539560a5aa6772b8e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Jul 2021 05:03:38 +0800 Subject: [PATCH 403/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210712=20?= =?UTF-8?q?Box64=20Emulator=20Released=20for=20Arm64=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md --- ...Box64 Emulator Released for Arm64 Linux.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md diff --git a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md new file mode 100644 index 0000000000..2676c713d5 --- /dev/null +++ b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md @@ -0,0 +1,66 @@ +[#]: subject: (Box64 Emulator Released for Arm64 Linux) +[#]: via: (https://news.itsfoss.com/box64-emulator-released/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Box64 Emulator Released for Arm64 Linux +====== + +[Box86][1], the popular x86 emulator, has just received a huge upgrade. This comes in the form of [Box64][2], the ARM64 equivalent. + +If you did not know, Box64_86 lets you run 64-bit or 32-bit Linux programs on ARM systems. In other words, it makes it possible for you to access desktop Linux programs on your Raspberry Pi or [Raspberry Pi alternatives][3]. + +Fortunately, now we have Box86 and Box64 to the rescue no matter what type of ARM system you’ve got. + +### What is Box64? + +![][4] + +You may have heard about Apple’s Rosetta 2, a translation layer that allows apps designed for older Macs to run on the new M1-powered Macs. Box64 is something similar that allows apps designed for x86 to run on ARM Linux devices. + +It manages to do this all while being 100% open-source, free, and surprisingly fast, thanks to its Dynarec module. This improves speed by re-compiling the program for ARM, meaning that it runs the same as any other ARM-supported app. + +However, even if Box64 is unable to recompile the app, it can still run it using on-the-fly emulation, with impressive results here too. + +Many Raspberry Pi users will be familiar with Box86, a similar program that has been around for about a year now. The biggest difference is that Box86 is only compatible with Arm32, while Box64 is only compatible with Arm64. + +So that’s Box64, the awesome compatibility layer that allows users to run x86_64 apps on your ARM-based PCs. + +### Wrapping Up + +If you were to ask me what I think about Box64, I would say it’s an absolute game changer. Between the incredible performance and massive potential, this compatibility layer is sure to play a huge role in the future ARM-based Linux PCs. + +Check out its [GitHub page][5] if you are curious to know how it works, and how you can get started with it. + +With that, I’ll leave you now to dive into and test for yourself. + +_What do you think of Box64? Let me know down in the comments below!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/box64-emulator-released/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: http://github.com/ptitseb/box86 +[2]: http://github.com/ptitseb/box64 +[3]: https://itsfoss.com/raspberry-pi-alternatives/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIxOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://github.com/ptitseb/box64 From c42f426a8c9cef8f8d84624bb18428dd99bd80d6 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Tue, 13 Jul 2021 07:17:53 +0800 Subject: [PATCH 404/870] Update 20210712 What is XML.md --- sources/tech/20210712 What is XML.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210712 What is XML.md b/sources/tech/20210712 What is XML.md index c9f5f1a553..206ba23edd 100644 --- a/sources/tech/20210712 What is XML.md +++ b/sources/tech/20210712 What is XML.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/what-xml) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0977c282cb71e8b8b6e32a5881321e7f31bd6872 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 13 Jul 2021 08:38:32 +0800 Subject: [PATCH 405/870] trsnalted --- ...ate passwords on the Linux command line.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) rename {sources => translated}/tech/20210707 Generate passwords on the Linux command line.md (66%) diff --git a/sources/tech/20210707 Generate passwords on the Linux command line.md b/translated/tech/20210707 Generate passwords on the Linux command line.md similarity index 66% rename from sources/tech/20210707 Generate passwords on the Linux command line.md rename to translated/tech/20210707 Generate passwords on the Linux command line.md index f92cebad11..3dd19e01a8 100644 --- a/sources/tech/20210707 Generate passwords on the Linux command line.md +++ b/translated/tech/20210707 Generate passwords on the Linux command line.md @@ -7,33 +7,33 @@ [#]: publisher: ( ) [#]: url: ( ) -Generate passwords on the Linux command line +在 Linux 命令行上生成密码 ====== -Create passwords that meet specific criteria on the command line. +在命令行上创建符合特定条件的密码。 ![Password lock][1] -Most websites and applications ask users to create accounts with secure passwords so that they can provide tailored user experiences. While this tips the odds in favor of website developers, it certainly doesn't make life easier for users. +大多数网站和应用都要求用户创建带有安全密码的账户,以便他们能够提供量身定做的用户体验。虽然这对网站开发者有利,但肯定不会让用户的生活更轻松。 -Sometimes the rules for creating passwords are so strict that it's hard to get a good and allowable combination. It would be much easier to have a tool that generates secure passwords that meet whatever rules the website or application requires. +有时,创建密码的规则是如此严格,以至于很难得到一个好的和允许的组合。如果有一个工具可以生成符合网站或应用程序要求的任何规则的安全密码,那就容易多了。 -This is where pwgen comes into play. According to its [man page][2], "the pwgen program generates passwords which are designed to be easily memorized by humans, while being as secure as possible." It returns multiple password options that meet the criteria you provide so that you can select the one that you prefer (and might be more likely to remember). +这就是 pwgen 发挥作用的地方。根据它的[手册页][2]:“pwgen 生成的密码在设计上很容易被人类记住,同时又尽可能的安全。” 它返回多个符合你所提供的标准的密码选项,这样你就可以选择一个你喜欢的(而且可能更容易记住)。 -### Install pwgen +### 安装 pwgen -On Linux, you can install pwgen using your package manager. For instance, on Fedora: +在 Linux 上,你可以用你的包管理器安装 pwgen。例如,在 Fedora 上: ``` `$ sudo dnf install pwgen` ``` -On macOS, use [MacPorts][3] or [Homebrew][4]. On Windows, use [Chocolatey][5]. +在 macOS 上,使用 [MacPorts][3] 或 [Homebrew][4]。在 Windows 上,使用 [Chocolatey][5]。 -### Generate passwords with pwgen +### 用 pwgen 生成密码 -There are several ways to pass arguments to pwgen to generate passwords, depending on what parameters you need. Here are some examples; consult the man page for more options. +有几种方法可以向 pwgen 传递参数来生成密码,这取决于你需要哪些参数。这里有一些例子。更多的选项请查阅手册页。 -If you need a secure, hard-to-remember password of a specific length, run `pwgen --secure` (or `-s` for short) followed by the character length you need: +如果你需要一个安全的、难以记忆的特定长度的密码,请运行 `pwgen --secure`(或缩写 `-s`),后面跟上你需要的字符长度: ``` @@ -52,7 +52,7 @@ j6XkmdB3LBfqZf5mbL3GndliG PpZbeXfWOFCpNARyXt1FWPAb8 OLQS2HFuqkiSg56sdxNsg5vaJ gLmYUTp0XZJWvIVbA5rFvBT54 LEm6QVeTMinc056DC9c4V55cV ipV45Ewj704365byKhY8zn766 ``` -Run `pwgen –symbols` (or `-y` for short) followed by the desired character length to generate a password that has special characters: +运行 `pwgen -symbols`(或缩写 `-y`),再加上所需的字符长度,生成一个有特殊字符的密码: ``` @@ -71,7 +71,7 @@ aec#ii6Chophu3aigh*ai#le4 looleihoog:uo4Su"thiediec eeTh{o7Eechah7eeJ2uCeish! oi3jaiphoof$aiy;ieriexeiP Thozool3aipi|cahfu0Ha~e1e az/u8iel2Jaeph2vooshai9Wi ``` -Run `pwgen --capitalize` (or `-c` for short) followed by the character length to generate a password with at least one capital letter: +运行 `pwgen --capitalize`(或缩写 `-c`),后面跟上字符长度,生成至少有一个大写字母的密码: ``` @@ -91,9 +91,9 @@ thung2pheiy2tooBeenuN8ia3 foh0oge1athei0oowieZen0ai iexei0io1vohsieThuCoy5ogi tohHe3uu2eXieheeQuoh7eit8 aiMieCeizeivu1ooch8aih0sh Riojei2yoah0AiWeiRoMieQu0 ``` -### Make it easy +### 让它变得简单 -Good, randomized passwords are hard to invent, especially because the human brain tends to prefer patterns. Make password generation easier on yourself by using pwgen. With a good [open source password manager][6], you can benefit from passwords that are hard to guess but easy to use from start to finish. +、好的随机密码是很难发明的,特别是因为人类的大脑倾向于选择模式。通过使用 pwgen,使密码的生成对你来说更容易。有了一个好的[开源密码管理器][6],你可以从难以猜测但从头到尾都容易使用的密码中获益。 -------------------------------------------------------------------------------- @@ -101,7 +101,7 @@ via: https://opensource.com/article/21/7/generate-passwords-pwgen 作者:[Sumantro Mukherjee][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f572d4b90c2032461388de7b3e6e217d8b42bb22 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 13 Jul 2021 08:40:41 +0800 Subject: [PATCH 406/870] translating --- ...tup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md b/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md index 81356bf87a..13b58a7a5a 100644 --- a/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md +++ b/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md @@ -2,7 +2,7 @@ [#]: via: (https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/) [#]: author: (Arindam https://www.debugpoint.com/author/admin1/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 811db097d2312cb50799f1fe56217cfffe4ea245 Mon Sep 17 00:00:00 2001 From: SamMa Date: Tue, 13 Jul 2021 14:28:31 +0800 Subject: [PATCH 407/870] Update 20210707 Generate passwords on the Linux command line.md --- ...ate passwords on the Linux command line.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210707 Generate passwords on the Linux command line.md b/translated/tech/20210707 Generate passwords on the Linux command line.md index 3dd19e01a8..58f0d4dbd3 100644 --- a/translated/tech/20210707 Generate passwords on the Linux command line.md +++ b/translated/tech/20210707 Generate passwords on the Linux command line.md @@ -3,24 +3,24 @@ [#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (turbokernel) [#]: publisher: ( ) [#]: url: ( ) -在 Linux 命令行上生成密码 +在 Linux 命令行中生成密码 ====== -在命令行上创建符合特定条件的密码。 +在命令行上创建符合特定规范的密码。 ![Password lock][1] -大多数网站和应用都要求用户创建带有安全密码的账户,以便他们能够提供量身定做的用户体验。虽然这对网站开发者有利,但肯定不会让用户的生活更轻松。 +大多数网站或应用都要求用户创建带有安全密码的账户,以便他们能够迎合用户体验。虽然这有利网站开发者,但肯定不会让用户的生活更轻松。 -有时,创建密码的规则是如此严格,以至于很难得到一个好的和允许的组合。如果有一个工具可以生成符合网站或应用程序要求的任何规则的安全密码,那就容易多了。 +有时,创建密码的规则是如此严格,以至于难以生成一个强壮且合规的组合。如果有一个工具可以生成符合网站或应用程序要求的任何规则的安全密码,那就容易多了。 -这就是 pwgen 发挥作用的地方。根据它的[手册页][2]:“pwgen 生成的密码在设计上很容易被人类记住,同时又尽可能的安全。” 它返回多个符合你所提供的标准的密码选项,这样你就可以选择一个你喜欢的(而且可能更容易记住)。 +这就是 pwgen 的用武之地。根据它的[手册页][2]:“pwgen 生成的密码在设计上很容易被人类记住,同时又尽可能的安全。” 它返回多个符合你所提供的规则的密码选项,这样你就可以选择一个你喜欢的(而且可能更容易记住)。 ### 安装 pwgen -在 Linux 上,你可以用你的包管理器安装 pwgen。例如,在 Fedora 上: +在 Linux 上,你可以通过包管理器安装 pwgen。例如,在 Fedora 上: ``` @@ -29,11 +29,11 @@ 在 macOS 上,使用 [MacPorts][3] 或 [Homebrew][4]。在 Windows 上,使用 [Chocolatey][5]。 -### 用 pwgen 生成密码 +### 使用 pwgen 生成密码 -有几种方法可以向 pwgen 传递参数来生成密码,这取决于你需要哪些参数。这里有一些例子。更多的选项请查阅手册页。 +有几种方式可以通过向 pwgen 传递参数来生成密码,这取决于你所需的参数。这里有一些例子。更多的参数选项请查阅手册页。 -如果你需要一个安全的、难以记忆的特定长度的密码,请运行 `pwgen --secure`(或缩写 `-s`),后面跟上你需要的字符长度: +如果你需要一个安全的、难以记忆的特定长度的密码,请运行 `pwgen --secure`(或简写 `-s`),后面跟上你所需的密码长度: ``` @@ -52,7 +52,7 @@ j6XkmdB3LBfqZf5mbL3GndliG PpZbeXfWOFCpNARyXt1FWPAb8 OLQS2HFuqkiSg56sdxNsg5vaJ gLmYUTp0XZJWvIVbA5rFvBT54 LEm6QVeTMinc056DC9c4V55cV ipV45Ewj704365byKhY8zn766 ``` -运行 `pwgen -symbols`(或缩写 `-y`),再加上所需的字符长度,生成一个有特殊字符的密码: +运行 `pwgen -symbols`(或简写 `-y`),再加上所需的密码长度,生成包含特殊字符的密码: ``` @@ -71,7 +71,7 @@ aec#ii6Chophu3aigh*ai#le4 looleihoog:uo4Su"thiediec eeTh{o7Eechah7eeJ2uCeish! oi3jaiphoof$aiy;ieriexeiP Thozool3aipi|cahfu0Ha~e1e az/u8iel2Jaeph2vooshai9Wi ``` -运行 `pwgen --capitalize`(或缩写 `-c`),后面跟上字符长度,生成至少有一个大写字母的密码: +运行 `pwgen --capitalize`(或缩写 `-c`),后面跟上密码长度,生成包含大写字母的密码: ``` @@ -93,7 +93,7 @@ tohHe3uu2eXieheeQuoh7eit8 aiMieCeizeivu1ooch8aih0sh Riojei2yoah0AiWeiRoMieQu0 ### 让它变得简单 -、好的随机密码是很难发明的,特别是因为人类的大脑倾向于选择模式。通过使用 pwgen,使密码的生成对你来说更容易。有了一个好的[开源密码管理器][6],你可以从难以猜测但从头到尾都容易使用的密码中获益。 +由于人脑更倾向于选择模式,所以强壮随机密码难以生成。通过使用 pwgen,你可以轻松生成密码。借助于优秀的[开源密码管理器][6],你可以完全从易于使用但难以猜测的密码中获益。 -------------------------------------------------------------------------------- @@ -102,7 +102,7 @@ via: https://opensource.com/article/21/7/generate-passwords-pwgen 作者:[Sumantro Mukherjee][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 41c86b361c398529690b486377efe66d35e2aa2a Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Tue, 13 Jul 2021 23:42:43 +0800 Subject: [PATCH 408/870] Update 20210703 Can Windows 11 Influence Linux Distributions.md --- .../20210703 Can Windows 11 Influence Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md b/sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md index 2dd1083400..e49a166957 100644 --- a/sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md +++ b/sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/can-windows-11-influence-linux/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zz-air) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -100,7 +100,7 @@ via: https://news.itsfoss.com/can-windows-11-influence-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zz-air](https://github.com/zz-air) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 52c7018f40be32ddeb883bb5886037b9094e7011 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 14 Jul 2021 05:03:23 +0800 Subject: [PATCH 409/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210713=20?= =?UTF-8?q?Use=20VS=20Code=20to=20develop=20in=20containers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210713 Use VS Code to develop in containers.md --- ...13 Use VS Code to develop in containers.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20210713 Use VS Code to develop in containers.md diff --git a/sources/tech/20210713 Use VS Code to develop in containers.md b/sources/tech/20210713 Use VS Code to develop in containers.md new file mode 100644 index 0000000000..d2248aa19d --- /dev/null +++ b/sources/tech/20210713 Use VS Code to develop in containers.md @@ -0,0 +1,138 @@ +[#]: subject: (Use VS Code to develop in containers) +[#]: via: (https://opensource.com/article/21/7/vs-code-remote-containers-podman) +[#]: author: (Brant Evans https://opensource.com/users/branic) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use VS Code to develop in containers +====== +Create consistency to avoid problems when you have multiple developers +working on the same project. +![Women programming][1] + +Coding and testing inconsistencies are a risk when you have multiple developers with different development environments working on a project. [Visual Studio Code][2] (VS Code) is an integrated development environment (IDE) that can help minimize these issues. It can be combined with containers to provide separate development environments for each application alongside a consistent development environment. + +VS Code's [Remote - Containers extension][3] enables you to define a container, use that definition to build a container, and develop inside the container. This container definition can be checked into the source code repository along with the application code, which allows all developers to use the same definition to build and develop within a container. + +By default, the Remote - Containers extension uses Docker to build and run the container, but it is easy to use [Podman][4] for container runtimes, and it enables using [rootless containers][5]. + +This article walks you through the setup to develop inside a rootless container using Podman with VS Code and the Remote - Containers extension. + +### Initial configuration + +Before continuing, ensure your Red Hat Enterprise Linux (RHEL) or Fedora workstation is updated with the latest errata and that VS Code and the Remote - Containers extension are installed. (See the [VS Code website][2] for more information on installing.) + +Next, install Podman and its supporting packages with a simple `dnf install` command: + + +``` +`$ sudo dnf install -y podman` +``` + +After you install Podman, configure VS Code to use the Podman executable (instead of Docker) for interacting with the container. Within VS Code, navigate to **File > Preferences > Settings** and click the **>** icon next to **Extensions**. In the dropdown menu that appears, select **Remote - Containers**, and scroll down to find the **Remote > Containers: Docker Path** option. In the text box, replace docker with **podman**. + +![Enter "podman" in the text box][6] + +(Brant Evans, [CC BY-SA 4.0][7]) + +Now that the configurations are done, create and open a new folder or an existing folder for the project in VS Code. + +### Define the container + +This tutorial uses the example of creating a container for Python 3 development. + +The Remote - Containers extension can add the necessary basic configuration files to the project folder. To add these files, open the Command Pallet by entering **Ctrl+Shift+P** on your keyboard, search for **Remote-Containers: Add Development Container Configuration Files**, and select it. + +![Remote-Containers: Add Development Container Configuration Files][8] + +(Brant Evans, [CC BY-SA 4.0][7]) + +In the next pop-up, define the type of development environment you want to set up. For this example configuration, search for the **Python 3** definition and select it. + +![Select Python 3 definition][9] + +(Brant Evans, [CC BY-SA 4.0][7]) + +Next, select the version of Python that will be used in the container. Select the **3 (default)** option to use the latest version. + +![Select the 3 \(default\) option][10] + +(Brant Evans, [CC BY-SA 4.0][7]) + +The Python configuration can also install Node.js, but for this example, **uncheck Install Node.js** and click OK. + +![Uncheck "Install Node.js"][11] + +(Brant Evans, [CC BY-SA 4.0][7]) + +It will create a `.devcontainer` folder containing files named `devcontainer.json` and `Dockerfile`. VS Code automatically opens the `devcontainer.json` file so that you can customize it. + +### Enable rootless containers + +In addition to the obvious security benefits, one of the other reasons to run a container as rootless is that all the files created in the project folder will be owned by the correct user ID (UID) outside the container. To run the development container as a rootless container, modify the `devcontainer.json` file by adding the following lines to the end of it: + + +``` +"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z", +"workspaceFolder": "/workspace", + +"runArgs": ["--userns=keep-id"], +"containerUser": "vscode" +``` + +These options tell VS Code to mount the Workspace with the proper SELinux context, create a user namespace that maps your UID and GID to the same values inside the container, and use `vscode` as your username inside the container. The `devcontainer.json` file should look like this (don't forget the commas at the end of the lines, as indicated): + +![Updated devcontainer.json file][12] + +(Brant Evans, [CC BY-SA 4.0][7]) + +Now that you've set up the container configuration, you can build the container and open the workspace inside it. Reopen the Command Palette (with **Ctrl+Shift+P**), and search for **Remote-Containers: Rebuild and Reopen in Container**. Click on it, and VS Code will start to build the container. Now is a great time to take a break (and get your favorite beverage), as building the container may take several minutes. + +![Building the container][13] + +(Brant Evans, [CC BY-SA 4.0][7]) + +Once the container build completes, the project will open inside the container. Files created or edited within the container will be reflected in the filesystem outside the container with the proper user permissions applied to the files. Now, you can proceed with development within the container. VS Code can even bring your SSH keys and Git configuration into the container so that committing code will work just like it does when editing outside the container. + +### Next steps + +Now that you've completed the basic setup and configuration, you can further enhance the configuration's usefulness. For example: + + * Modify the Dockerfile to install additional software (e.g., required Python modules). + * Use a customized container image. For example, if you're doing Ansible development, you could use Quay.io's [Ansible Toolset][14]. (Be sure to add the `vscode` user to the container image via the Dockerfile.) + * Commit the files in the `.devcontainer` directory to the source code repository so that other developers can take advantage of the container definition for their development efforts. + + + +Developing inside a container helps prevent conflicts between different projects by keeping the dependencies and code for each separate. You can use Podman to run containers in a rootless environment that increases security. By combining VS Code, the Remote - Containers extension, and Podman, you can easily set up a consistent environment for multiple developers, decrease setup time, and reduce bugs from differences in development environments in a secure fashion. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/vs-code-remote-containers-podman + +作者:[Brant Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/branic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G (Women programming) +[2]: https://code.visualstudio.com/ +[3]: https://code.visualstudio.com/docs/remote/containers +[4]: https://podman.io/ +[5]: https://www.redhat.com/sysadmin/rootless-podman-makes-sense +[6]: https://opensource.com/sites/default/files/uploads/vscode-remote_podman.png (Enter "podman" in the text box) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/adddevelopmentcontainerconfigurationfiles.png (Remote-Containers: Add Development Container Configuration Files) +[9]: https://opensource.com/sites/default/files/uploads/python3.png (Select Python 3 definition) +[10]: https://opensource.com/sites/default/files/uploads/python3default.png (Select the 3 (default) option) +[11]: https://opensource.com/sites/default/files/uploads/unchecknodejs.png (Uncheck "Install Node.js") +[12]: https://opensource.com/sites/default/files/uploads/newdevcontainerjson.png (Updated devcontainer.json file) +[13]: https://opensource.com/sites/default/files/uploads/buildingcontainer.png (Building the container) +[14]: https://quay.io/repository/ansible/toolset From 9fc6e0a876e17966ef08b037f2eaa998f52233ca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 14 Jul 2021 05:03:43 +0800 Subject: [PATCH 410/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210713=20?= =?UTF-8?q?Use=20XMLStarlet=20to=20parse=20XML=20in=20your=20the=20Linux?= =?UTF-8?q?=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md --- ...to parse XML in your the Linux terminal.md | 239 ++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md diff --git a/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md b/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md new file mode 100644 index 0000000000..00f07458ee --- /dev/null +++ b/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md @@ -0,0 +1,239 @@ +[#]: subject: (Use XMLStarlet to parse XML in your the Linux terminal) +[#]: via: (https://opensource.com/article/21/7/parse-xml-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use XMLStarlet to parse XML in your the Linux terminal +====== +Become an XML star with XMLStarlet, an XML toolkit for your terminal. +![Penguin with green background][1] + +Learning to parse XML is often considered a complex venture, but it doesn't have to be. [XML is highly and strictly structured][2], so it's relatively predictable. There are also lots of tools out there to help make the job manageable. + +One of my favorite XML utilities is [XMLStarlet][3], an XML toolkit for your terminal. With XMLStarlet, you can validate, parse, edit, format, and transform XML data. XMLStarlet is a relatively minimal command, but navigating XML is full of potential, so this article demonstrates how to use it to query XML data. + +### Install + +XMLStarlet is installed by default on CentOS, Fedora, and many other modern Linux distributions, so just open a terminal and type `xmlstarlet` to access it. If XMLStarlet isn't already installed, your operating system offers to install it for you. + +Alternately, you can install the `xmlstarlet` command from your package manager: + + +``` +`$ sudo dnf install xmlstarlet` +``` + +On macOS, use [MacPorts][4] or [Homebrew][5]. On Windows, use [Chocolatey][6]. + +Should all else fail, you can install it manually from the [source code on Sourceforge][7]. + +### Parsing XML with XMLStarlet + +There are many tools designed to help parse and transform XML data, including software libraries that let you [write your own parser][8] and complex commands like `fop` and `xsltproc`. Sometimes you don't need to process XML data, though; you just need a convenient way to extract important data from, update, or just validate it. For spontaneous XML interactions, I use `xmlstarlet`, a classic "Swiss Army knife"-style application that does the most common XML tasks. You can see what it has to offer by running the command along with the `--help` option: + + +``` +$ xmlstarlet --help +Usage: xmlstarlet [<options>] <command> [<cmd-options>] +where <command> is one of: +  ed    (or edit)      - Edit/Update XML document(s) +  sel   (or select)    - Select data or query XML document(s) (XPATH, etc) +  tr    (or transform) - Transform XML document(s) using XSLT +  val   (or validate)  - Validate XML document(s) (well-formed/DTD/XSD/RelaxNG) +  fo    (or format)    - Format XML document(s) +  el    (or elements)  - Display element structure of XML document +  c14n  (or canonic)   - XML canonicalization +  ls    (or list)      - List directory as XML +[...] +``` + +You can get further help by appending `--help` to the end of any of these subcommands: + + +``` +$ xmlstarlet sel --help +  -Q or --quiet             - do not write anything to standard output. +  -C or --comp              - display generated XSLT +  -R or --root              - print root element <xsl-select> +  -T or --text              - output is text (default is XML) +  -I or --indent            - indent output +[...] +``` + +#### Selecting data with sel + +You can view the data in XML with the `xmlstarlet select` (`sel` for short) command. Here's a simple XML document: + + +``` +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<xml> +  <os> +   <linux> +    <distribution> +      <name>Fedora</name> +      <release>7</release> +      <codename>Moonshine</codename> +      <spins> +        <name>Live</name> +        <name>Fedora</name> +        <name>Everything</name> +      </spins> +    </distribution> + +    <distribution> +      <name>Fedora Core</name> +      <release>6</release> +      <codename>Zod</codename> +      <spins></spins> +    </distribution> +   </linux> +  </os>     +</xml> +``` + +When looking for data in an XML file, your first task is to focus on the node you want to explore. If you know the path to the node, specify the full path with the `--value-of` option. The earlier in the [Document Object Model][9] (DOM) tree you start to explore, the more information you see: + + +``` +$ xmlstarlet select --template \ +\--value-of /xml/os/linux/distribution \ +\--nl myfile.xml +      Fedora +      7 +      Moonshine +      +        Live +        Fedora +        Everything      +      +      Fedora Core +      6 +      Zod +``` + +The `--nl` stands for "new line," and it inserts copious amounts of whitespace to ensure your terminal prompt gets a new line after your results are in. I've removed some of the excess space in the sample output. + +Narrow your focus by descending further into the DOM tree: + + +``` +$ xmlstarlet select --template \ +\--value-of /xml/os/linux/distribution/name \ +\--nl myfile.xml +Fedora +Fedora Core +``` + +#### Conditional selects + +One of the most powerful tools for navigating and parsing XML is called XPath. It governs the syntax used in XML searches and invokes functions from XML libraries. XMLStarlet understands XPath expressions, so you can make your selection conditional with an XPath function. XPath features a wealth of functions, and it's [documented in detail by W3C][10], but I find [Mozilla's XPath documentation][11] more concise. + +You can use square brackets as a test function, comparing the contents of an element to some value. Here's a test for the value of the `` element, which returns the release number associated only with a specific match. + +Imagine for a moment that the sample XML file contains all Fedora releases beginning with 1. To view all release numbers associated with the old name "Fedora Core" (the project dropped "Core" from the name from release 7 onward): + + +``` +$ xmlstarlet sel --template \ +\--value-of '/xml/os/linux/distribution[name = "Fedora Core"]/release' \ +\--nl myfile.xml +6 +5 +4 +3 +2 +1 +``` + +You could view all codenames for those releases, too, by changing the `--value-of` path to `/xml/os/linux/distribution[name = "Fedora Core"]/codename`. + +### Matching paths and getting values + +An advantage of viewing XML tags as nodes is that once you find the node, you can think of it as your current "directory" of data. It's not really a directory, at least not in the filesystem sense, but it is a collection of data that you can query. To help you keep your destination and the data "inside" it separate, XMLStarlet differentiates between what you're trying to match with the `--match` option and the value of the data you want with a `--value-of` option. + +Suppose you know that the `` node contains several elements. That makes it your destination. Once you're there, you can use `--value-of` to specify which element you want a value for. To look at all elements, use a dot (`.`) to represent your current location: + + +``` +$ xmlstarlet sel --template \ +\--match '/xml/os/linux/distribution/spin' \ +\--value-of '.' --nl myfile.xml \ +Live +Fedora +Everything +``` + +As with navigating the DOM, you can use XPath expressions to limit the scope of what data is returned. In this example, I use the `last()` function to retrieve just the last element in the `spin` node: + + +``` +$ xmlstarlet select --template \ +\--match '/xml/os/linux/distribution/spin' \ +\--value-of '*[last()]' --nl myfile.xml +Everything +``` + +In this example, I use the `position()` function to select a specific element in the `spin` node: + + +``` +$ xmlstarlet select --template \ +\--match '/xml/os/linux/distribution/spin' \ +\--value-of '*[position() = 2]' --nl myfile.xml +Fedora +``` + +The `--match` and `--value-of` options can overlap, so it's up to you how you want to use them together. These two expressions, in the case of the sample XML, do the same thing: + + +``` +$ xmlstarlet select  --template \ +\--match '/xml/os/linux/distribution/spin' \ +\--value-of '.' \ +\--nl myfile.xml +Live +Fedora +Everything      + +$ xmlstarlet select --template \ +\--match '/xml/os/linux/distribution' \ +\--value-of 'spin' \ +\--nl myfile.xml +Live +Fedora +Everything +``` + +### Getting comfortable with XML + +XML can seem over-verbose and unwieldy at times, but the tools built to interact with it consistently surprise me. If you're looking to take advantage of XML, then XMLStarlet could be a good entry point. The next time you're about to open an XML file to look at structured data, try using XMLStarlet and see if you can query that data instead. The more comfortable you get with XML, the better it can serve you as a robust and flexible data format. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/parse-xml-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background) +[2]: https://opensource.com/article/21/6/what-xml +[3]: https://en.wikipedia.org/wiki/XMLStarlet +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey +[7]: http://xmlstar.sourceforge.net +[8]: https://opensource.com/article/21/6/parsing-config-files-java +[9]: https://opensource.com/article/21/6/what-xml#dom +[10]: https://www.w3.org/TR/1999/REC-xpath-19991116 +[11]: https://developer.mozilla.org/en-US/docs/Web/XPath/Functions From eedd67f9ed5ecd7fdc07022abd0924ca14e418c5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 14 Jul 2021 08:47:31 +0800 Subject: [PATCH 411/870] translated --- ...ecrypt files with a passphrase on Linux.md | 119 ------------------ ...ecrypt files with a passphrase on Linux.md | 118 +++++++++++++++++ 2 files changed, 118 insertions(+), 119 deletions(-) delete mode 100644 sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md create mode 100644 translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md diff --git a/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md b/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md deleted file mode 100644 index 88bf0d7e8c..0000000000 --- a/sources/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: subject: (Encrypt and decrypt files with a passphrase on Linux) -[#]: via: (https://opensource.com/article/21/7/linux-age) -[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Encrypt and decrypt files with a passphrase on Linux -====== -Age is a simple, easy-to-use tool that allows you to encrypt and decrypt -files with a single passphrase. -![Scissors cutting open access to files][1] - -Encryption and security for protecting files and sensitive documents have long been a concern for users. Even as more and more of our data is housed on websites and cloud services, protected by user accounts with ever-more secure and challenging passwords, there's still great value in being able to store sensitive data on our own filesystems, especially when we can encrypt that data quickly and easily. - -[Age][2] allows you to do this. It is a small, easy-to-use tool that allows you to encrypt a file with a single passphrase and decrypt it as required. - -### Install age - -Age is available to [install][3] from most Linux repositories. - -To install it on Fedora: - - -``` -`$ sudo dnf install age -y` -``` - -On macOS, use [MacPorts][4] or [Homebrew][5]. On Windows, use [Chocolatey][6]. - -### Encrypting and decrypting files with age - -Age can encrypt and decrypt files with either a public key or a passphrase set by the user. - -#### Using age with a public key - -First, generate a public key and write the output to a `key.txt` file: - - -``` -$ age-keygen -o key.txt -Public key: age16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 -``` - -### Encrypt with a public key - -To encrypt a file with your public key: - - -``` -`$ touch mypasswds.txt | age -r ageage16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 > mypass.tar.gz.age` -``` - -In this example, the file `mypasswds.txt` is encrypted with the public key I generated and put inside an encrypted file called `mypass.tar.gz.age`. - -### Decrypt with a public key - -To decrypt the information you've protected, use the `age` command and the `--decrypt` option: - - -``` -`$ age --decrypt -i key.txt -o mypass.tar.gz mypass.tar.gz.age` -``` - -In this example, age uses the key stored in `key.text` and decrypts the file I created in the previous step. - -### Encrypt with a passphrase - -Encrypting a file without a public key is known as symmetrical encryption. It allows a user to set the passphrase to encrypt and decrypt a file. To do so: - - -``` -$ age --passphrase --output mypasswd-encrypted.txt mypasswd.txt -Enter passphrase (leave empty to autogenerate a secure one):   -Confirm passphrase: -``` - -In this example, age prompts you for a passphrase, which it uses to encrypt the input file `mypasswd.txt` and render the file `mypasswd-encrypted.txt` in return. - -### Decrypt with a passphrase - -To decrypt a file encrypted with a passphrase, use the `age` command with the `--decrypt` option: - - -``` -`$ age --decrypt --output passwd-decrypt.txt mypasswd-encrypted.txt` -``` - -In this example, age prompts you for the passphrase, then decrypts the contents of the `mypasswd-encrypted.txt` file into `passwd-decrypt.txt`, as long as you provide the passphrase that matches the one set during encryption. - -### Don't lose your keys - -Whether you're using passphrase encryption or public-key encryption, you _must not_ lose the credentials for your encrypted data. By design, a file encrypted with age cannot be decrypted without the key used to encrypt it. So back up your public key, and remember those passphrases! - -### Easy encryption at last - -Age is a really robust tool. I like to encrypt my sensitive files, especially tax records and other archival data, into a `.tz` file for later access. Age is user-friendly and makes it very easy to get started with encryption on the go. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/linux-age - -作者:[Sumantro Mukherjee][a] -选题:[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/sumantro -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files) -[2]: https://github.com/FiloSottile/age -[3]: https://github.com/FiloSottile/age#installation -[4]: https://opensource.com/article/20/11/macports -[5]: https://opensource.com/article/20/6/homebrew-mac -[6]: https://opensource.com/article/20/3/chocolatey diff --git a/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md b/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md new file mode 100644 index 0000000000..21deea9522 --- /dev/null +++ b/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md @@ -0,0 +1,118 @@ +[#]: subject: (Encrypt and decrypt files with a passphrase on Linux) +[#]: via: (https://opensource.com/article/21/7/linux-age) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 上用密码加密和解密文件 +====== +age 是一个简单的、易于使用的工具,允许你用一个密码来加密和解密文件。 +![Scissors cutting open access to files][1] + +长期以来,保护文件和敏感文档的加密和安全一直是用户关心的问题。即使我们越来越多的数据被存放在网站和云服务上,并由带有越来越安全和具有挑战性的密码的用户账户来保护,但能够在我们自己的文件系统中存储敏感数据仍有很大的价值,特别是当我们能够快速和容易地加密这些数据时。 + +[age][2] 能让你这样做。它是一个小型的、易于使用的工具,允许你用一个密码加密一个文件,并根据需要解密。 + +### 安装 age + +age 可以在大多数 Linux 软件库中[安装][3]。 + +要在 Fedora 上安装它: + + +``` +`$ sudo dnf install age -y` +``` + +在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。在 Windows 上,使用 [Chocolatey][6]。 + +### 用 age 加密和解密文件 + +age 可以用公钥或用户设置的密码来加密和解密文件。 + +#### 在 age 中使用公钥 + +首先,生成一个公钥并写入 `key.txt` 文件: + + +``` +$ age-keygen -o key.txt +Public key: age16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 +``` + +### 使用公钥加密 + +要用你的公钥加密一个文件: + + +``` +`$ touch mypasswds.txt | age -r ageage16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 > mypass.tar.gz.age` +``` + +在这个例子中,文件 `mypasswds.txt` 被我生成的公钥加密,放在一个叫做 `mypass.tar.gz.age` 的加密文件中。 + +### 用公钥解密 + +要解密你所保护的信息,使用 `age` 命令和 `--decrypt` 选项: + + +``` +`$ age --decrypt -i key.txt -o mypass.tar.gz mypass.tar.gz.age` +``` + +在这个例子中,age 使用存储在 `key.text` 中的密钥,并解密了我在上一步创建的文件。 + +### 使用密码加密 + +在没有公开密钥的情况下对文件进行加密被称为对称加密。它允许用户设置密码来加密和解密一个文件。要做到这一点: + + +``` +$ age --passphrase --output mypasswd-encrypted.txt mypasswd.txt +Enter passphrase (leave empty to autogenerate a secure one): +Confirm passphrase: +``` + +在这个例子中,age 提示你输入一个密码,它用这个密码对输入文件 `mypasswd.txt` 进行加密,并生成文件 `mypasswd-encrypted.txt`。 + +### 使用密码解密 + +要解密一个用密码加密的文件,可以使用 `age` 命令和 `--decrypt` 选项: + + +``` +`$ age --decrypt --output passwd-decrypt.txt mypasswd-encrypted.txt` +``` + +在这个例子中,age 提示你输入密码,然后将 `mypasswd-encrypted.txt` 文件的内容解密为 `passwd-decrypt.txt`,只要你提供的密码与加密时设置的密码一致。 + +### 不要丢失你的密钥 + +无论你是使用密码加密还是公钥加密,你都_不能_丢失加密数据的凭证。根据设计,如果没有用于加密的密钥,用 age 加密的文件是不能被解密的。所以,请备份你的公钥,并记住这些密码! + +### 轻松实现加密 + +age 是一个真正强大的工具。我喜欢把我的敏感文件,特别是税务记录和其他档案数据,加密到 `.tz` 文件中,以便以后访问。age 是用户友好的,使其非常容易随时加密。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/linux-age + +作者:[Sumantro Mukherjee][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/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files) +[2]: https://github.com/FiloSottile/age +[3]: https://github.com/FiloSottile/age#installation +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey From 3c7af1f8f8b49df1441d1a996134bc23f8248d76 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 14 Jul 2021 08:52:29 +0800 Subject: [PATCH 412/870] translating --- .../20210712 Converseen for Batch Processing Images on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md b/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md index f64ad01cef..e0f56a47b7 100644 --- a/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md +++ b/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/converseen/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 17df7454bb5e632ae8907b6310206d531d43662d Mon Sep 17 00:00:00 2001 From: Steven Ding <1139274654@qq.com> Date: Wed, 14 Jul 2021 09:11:46 +0800 Subject: [PATCH 413/870] Update 20200528 9 open source JavaScript frameworks for front-end web development.md stevending is translating (subject: (9 open source JavaScript frameworks for front-end web development)) --- ...source JavaScript frameworks for front-end web development.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20200528 9 open source JavaScript frameworks for front-end web development.md b/sources/tech/20200528 9 open source JavaScript frameworks for front-end web development.md index 7a029d71fd..e585379bbb 100644 --- a/sources/tech/20200528 9 open source JavaScript frameworks for front-end web development.md +++ b/sources/tech/20200528 9 open source JavaScript frameworks for front-end web development.md @@ -1,3 +1,4 @@ +stevending is translating [#]: collector: (lujun9972) [#]: translator: ( ) [#]: reviewer: ( ) From dbb6fd32693e21661d4cc8886052ee2b3fdf672e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Jul 2021 09:59:01 +0800 Subject: [PATCH 414/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @YungeG 感谢您,完成了第一篇翻译贡献! --- ... Linux operating system like a database.md | 147 ++++++++---------- 1 file changed, 69 insertions(+), 78 deletions(-) diff --git a/translated/tech/20210628 Query your Linux operating system like a database.md b/translated/tech/20210628 Query your Linux operating system like a database.md index bb82eb1f6f..ec4be9eaa8 100644 --- a/translated/tech/20210628 Query your Linux operating system like a database.md +++ b/translated/tech/20210628 Query your Linux operating system like a database.md @@ -3,31 +3,30 @@ [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) [#]: translator: (YungeG) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -像查询数据库一样查询你的 Linux 操作系统 +像查询数据库一样查询你的 Linux 操作系统信息 ====== -使用数据库查询操作轻松获取系统信息。 -![Magnifying glass on code][1] +> 使用数据库查询操作轻松获取系统信息。 + +![](https://img.linux.net.cn/data/attachment/album/202107/14/095820zywm2m2tzz5otfh5.jpg) Linux 提供了很多帮助用户收集主机操作系统信息的命令:列出文件或者目录的属性信息;查询安装的软件包、正在执行的命令、开机时启动的服务;或者了解系统的硬件。 每个命令使用自己的输出格式列出系统的信息。你需要使用 `grep`、`sed`、`awk` 这样的工具过滤命令输出的结果,以便找到特定的信息。此外,很多这样的信息会频繁变动,导致系统状态的改变。 -将所有的信息格式化为一个数据库的 SQL 查询的输出进行查看将会十分有益 。想象一下,你能够像查询具有类似名称的 SQL 数据库表一样查询 `ps` 和 `rpm` 命令的输出。 +将所有的信息格式化为一个数据库的 SQL 查询的输出进行查看将会十分有益。想象一下,你能够像查询具有类似名称的 SQL 数据库表一样查询 `ps` 和 `rpm` 命令的输出。 -幸运的是,有一个工具刚好实现了这个功能,而且功能更多:[Osquery][2] 是一个 [开源的][3] “SQL powered operating system instrumentation, monitoring, and analytics framework”。 +幸运的是,有一个工具刚好实现了这个功能,而且功能更多:[Osquery][2] 是一个 [开源的][3] “由 SQL 驱动的操作系统仪表、监控和分析框架”。 -许多处理安全、DevOps、合规性的应用,以及仓储管理管理 (仅举几例)在内部依赖 Osquery 提供的核心功能。 +许多处理安全、DevOps、合规性的应用,以及仓储管理管理(仅举几例)在内部依赖 Osquery 提供的核心功能。 ### 安装 Osquery -### Install Osquery - -Osquery 适用于 Linux,macOS,Windows,FreeBSD。按照[指南][4]为你的操作系统安装最新版本。(我会在下面的例子中使用 4.7.0 版本。) +Osquery 适用于 Linux、macOS、Windows、FreeBSD。请按照 [指南][4] 为你的操作系统安装最新版本。(我会在下面的例子中使用 4.7.0 版本。) 安装完成后,确保 Osquery 可以工作: @@ -44,10 +43,10 @@ $ Osquery 有两个主要组件: -* **osqueri** 是一个交互式的 SQL 查询控制台,可以独立运行,不需要超级用户权限(除非要查询的表格需要访问权限)。 -* **osqueryd** 像一个安装在主机的监控守护进程,可以定期调度查询操作执行,从底层架构收集信息。 +* `osqueri` 是一个交互式的 SQL 查询控制台,可以独立运行,不需要超级用户权限(除非要查询的表格需要访问权限)。 +* `osqueryd` 像一个安装在主机的监控守护进程,可以定期调度查询操作执行,从底层架构收集信息。 -可以在不运行 osqueryd 的情况下执行 osqueri 。另一个工具,**osqueryctl**,控制守护进程的启动,停止,并检查其状态。 +可以在不运行 `osqueryd` 的情况下执行 `osqueri`。另一个工具,`osqueryctl`,控制守护进程的启动、停止,并检查其状态。 ``` $ rpm -ql osquery-4.8.0-1.linux.x86_64 | grep bin @@ -59,19 +58,19 @@ $ ### 使用 osqueryi 交互式命令提示符 -你和 Osquery 的交互与使用 SQL 数据库十分相似。事实上,osqueryi 是 SQList shell 的一个修改版。执行 `osqueryi` 命令进入交互式命令提示符 ,就可以执行 Osquery 的命令,通常以 `.` 开始: +你和 Osquery 的交互与使用 SQL 数据库十分相似。事实上,`osqueryi` 是 SQList shell 的一个修改版。执行 `osqueryi` 命令进入交互式命令提示符 ,就可以执行 Osquery 的命令,通常以 `.` 开始: ``` $ osqueryi Using a virtual database. Need help, type '.help' -osquery> +osquery> ``` 要退出交互式命令提示符,执行 `.quit` 命令回到操作系统的命令提示符: ``` -osquery> -osquery> .quit +osquery> +osquery> .quit $ ``` @@ -80,22 +79,22 @@ $ 如前所述,Osquery 像 SQL 查询一样输出数据,数据库中的信息通常保存在表中。但是如何在不知道表名的情况下查询这些表呢?你可以运行 `.tables` 命令列出所有可以查询的表。如果你是一个 Linux 长期用户或者一个系统管理员 ,就会对表名十分熟悉,因为你一直在使用操作系统命令获取同样的信息: ``` -osquery> .tables - => acpi_tables - => apparmor_events - => apparmor_profiles - => apt_sources +osquery> .tables + => acpi_tables + => apparmor_events + => apparmor_profiles + => apt_sources -<< snip >> +<<裁剪>> - => arp_cache - => user_ssh_keys - => users - => yara - => yara_events - => ycloud_instance_metadata - => yum_sources -osquery> + => arp_cache + => user_ssh_keys + => users + => yara + => yara_events + => ycloud_instance_metadata + => yum_sources +osquery> ``` ### 检查各个表的模式 @@ -103,34 +102,34 @@ osquery> 知道表名后,可以查看每个表提供的信息。既然 `ps` 命令经常用于获取进程信息,就以 `processes` 为例。执行 `.schema` 命令加上表名查看表中保存的信息。如果要验证命令返回的结果,可以快速执行 `ps -ef` 或 `ps aux`,对比命令的输出和表中的内容: ``` -osquery> .schema processes +osquery> .schema processes CREATE TABLE processes(`pid` BIGINT, `name` TEXT, `path` TEXT, `cmdline` TEXT, `state` TEXT, `cwd` TEXT, `root` TEXT, `uid` BIGINT, `gid` BIGINT, `euid` BIGINT, `egid` BIGINT, `suid` BIGINT, `sgid` BIGINT, `on_disk` INTEGER, `wired_size` BIGINT, `resident_size` BIGINT, `total_size` BIGINT, `user_time` BIGINT, `system_time` BIGINT, `disk_bytes_read` BIGINT, `disk_bytes_written` BIGINT, `start_time` BIGINT, `parent` BIGINT, `pgroup` BIGINT, `threads` INTEGER, `nice` INTEGER, `is_elevated_token` INTEGER HIDDEN, `elapsed_time` BIGINT HIDDEN, `handle_count` BIGINT HIDDEN, `percent_processor_time` BIGINT HIDDEN, `upid` BIGINT HIDDEN, `uppid` BIGINT HIDDEN, `cpu_type` INTEGER HIDDEN, `cpu_subtype` INTEGER HIDDEN, `phys_footprint` BIGINT HIDDEN, PRIMARY KEY (`pid`)) WITHOUT ROWID; -osquery> +osquery> ``` -要进一步确认这一点,使用下面的命令查看 RPM 包的结构信息,然后与操作系统命令 `rpm -qa` 和 `rpm -qi` 的输出比较: +要进一步确认,可以使用下面的命令查看 RPM 包的结构信息,然后与操作系统命令 `rpm -qa` 和 `rpm -qi` 的输出比较: ``` -osquery> -osquery> .schema rpm_packages +osquery> +osquery> .schema rpm_packages CREATE TABLE rpm_packages(`name` TEXT, `version` TEXT, `release` TEXT, `source` TEXT, `size` BIGINT, `sha1` TEXT, `arch` TEXT, `epoch` INTEGER, `install_time` INTEGER, `vendor` TEXT, `package_group` TEXT, `pid_with_namespace` INTEGER HIDDEN, `mount_namespace_id` TEXT HIDDEN, PRIMARY KEY (`name`, `version`, `release`, `arch`, `epoch`, `pid_with_namespace`)) WITHOUT ROWID; -osquery> +osquery> ``` -从 Osquery 的[表格文档][5]获取更多信息。 +从 Osquery 的 [表格文档][5] 获取更多信息。 ### 使用 PRAGMA 命令 -为了防止模式信息对你来说太难看懂,还有另一种途径能够以详细的表格格式打印表中的信息:`PRAGMA` 命令。例如,我想通过 `PRAGMA` 用一种易于理解的格式查看 `rpm_packages` 表的信息: +或许模式信息对你来说太难看懂,还有另一种途径能够以详细的表格格式打印表中的信息:`PRAGMA` 命令。例如,我想通过 `PRAGMA` 用一种易于理解的格式查看 `rpm_packages` 表的信息: ``` -`osquery> PRAGMA table_info(rpm_packages);` +osquery> PRAGMA table_info(rpm_packages); ``` 这种表格式信息的一个好处是你可以关注想要查询的字段,查看命令提供的类型信息: ``` -osquery> PRAGMA table_info(users); +osquery> PRAGMA table_info(users); +-----+-------------+--------+---------+------------+----+ | cid | name | type | notnull | dflt_value | pk | +-----+-------------+--------+---------+------------+----+ @@ -144,7 +143,7 @@ osquery> PRAGMA table_info(users); | 7 | shell | TEXT | 0 | | 0 | | 8 | uuid | TEXT | 1 | | 3 | +-----+-------------+--------+---------+------------+----+ -osquery> +osquery> ``` ### 进行你的第一次查询 @@ -152,8 +151,8 @@ osquery> 在你从表、模式、条目中获取到所有进行查询所需要的信息后,进行你的第一次 SQL 查询查看其中的信息。下面的查询返回系统中的用户和每个用户的用户 ID、组 ID、主目录和默认的命令行解释器。Linux 用户通过查看 `/etc/passwd` 文件的内容并执行 `grep`、`sed`、`awk` 命令获取同样的信息。 ``` -osquery> -osquery> select uid,gid,directory,shell,uuid FROM users LIMIT 7; +osquery> +osquery> select uid,gid,directory,shell,uuid FROM users LIMIT 7; +-----+-----+----------------+----------------+------+ | uid | gid | directory | shell | uuid | +-----+-----+----------------+----------------+------+ @@ -165,12 +164,12 @@ osquery> select uid,gid,directory,shell,uuid FROM users LIMIT 7; | 5 | 0 | /sbin | /bin/sync | | | 6 | 0 | /sbin | /sbin/shutdown | | +-----+-----+----------------+----------------+------+ -osquery> +osquery> ``` ### 不进入交互模式的查询 -如果你想要在不进入 osqueri 交互模式的情况下进行查询,该怎么办?要用查询操作写命令行解释器脚本,这种方式可能十分有用。这种情况下,可以直接从 Bash 解释器 `echo` SQL 查询,通过管道输出到 osqueri : +如果你想要在不进入 `osqueri` 交互模式的情况下进行查询,该怎么办?要用查询操作写命令行解释器脚本,这种方式可能十分有用。这种情况下,可以直接从 Bash 解释器 `echo` SQL 查询,通过管道输出到 `osqueri` : ``` $ echo "select uid,gid,directory,shell,uuid FROM users LIMIT 7;" | osqueryi @@ -193,7 +192,7 @@ $ Osquery 还可以列出系统启动时开始的所有服务。例如,可以查询 `startup_items` 表获取启动时开始的前五项服务的名称、状态和路径: ``` -osquery> SELECT name,type,status,path FROM startup_items LIMIT 5; +osquery> SELECT name,type,status,path FROM startup_items LIMIT 5; name = README type = Startup Item status = enabled @@ -218,7 +217,7 @@ status = enabled type = Startup Item status = enabled path = /usr/libexec/at-spi-bus-launcher --launch-immediately -osquery> +osquery> ``` ### 查阅二进制文件的 ELF 信息 @@ -226,7 +225,7 @@ osquery> 假如你想要弄清 `ls` 二进制文件的更多细节,通常会通过 `readelf -h` 命令,加上 `ls` 命令的路径。查询 Osquery 的 `elf_info` 表你可以得到同样的信息: ``` -osquery> SELECT * FROM elf_info WHERE path="/bin/ls"; +osquery> SELECT * FROM elf_info WHERE path="/bin/ls"; class = 64 abi = sysv abi_version = 0 @@ -236,10 +235,10 @@ abi_version = 0 entry = 24064 flags = 0 path = /bin/ls -osquery> +osquery> ``` -现在你应该初步了解如何使用 osqueri 查询自己想要的信息。然而,这些信息保存在数量巨大的表中;我查询过的一个系统中,有 156 个不同的表,这个数字可能是十分惊人的: +现在你应该初步了解如何使用 `osqueri` 查询自己想要的信息。然而,这些信息保存在数量巨大的表中;我查询过的一个系统中,有 156 个不同的表,这个数字可能是十分惊人的: ``` $ echo ".tables" | osqueryi | wc -l @@ -249,65 +248,57 @@ $ 要让事情变得更容易,可以从这些表开始获取你的 Linux 系统的信息: -**System information table** - +**系统信息表:** ``` -`osquery> select * from system_info;` +osquery> select * from system_info; ``` -**System limit information** - +**系统限制信息:** ``` -`osquery> select * from ulimit_info;` +osquery> select * from ulimit_info; ``` -**Files opened by various processes** - +**由各种进程打开的文件:** ``` -`osquery> select * from process_open_files;` +osquery> select * from process_open_files; ``` -**Open ports on a system** - +**系统上开放的端口:** ``` -`osquery> select * from listening_ports;` +osquery> select * from listening_ports; ``` -**Running processes information** - +**运行中的进程信息:** ``` -`osquery> select * from processes;` +osquery> select * from processes; ``` -**Installed packages information** - +**已安装的包信息:** ``` -`osquery> select * from rpm_packages;` +osquery> select * from rpm_packages; ``` -**User login information** - +**用户登录信息:** ``` -`osquery> select * from last;` +osquery> select * from last; ``` -**System log information** - +**系统日志信息:** ``` -`osquery> select * from syslog_events;` +osquery> select * from syslog_events; ``` ### 了解更多 -Osquery 是一个强大的工具,提供了许多可以用于解决各种使用案例的主机信息。你可以阅读[文档][6]了解更多 Osquery 的信息。 +Osquery 是一个强大的工具,提供了许多可以用于解决各种使用案例的主机信息。你可以阅读 [文档][6] 了解更多 Osquery 的信息。 -------------------------------------------------------------------------------- @@ -315,8 +306,8 @@ via: https://opensource.com/article/21/6/osquery-linux 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/YungeG) -校对:[校对者ID](https://github.com/校对者ID) +译者:[YungeG](https://github.com/YungeG) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8dd22d12f69cc4d362cf325788efcf1eeb45c6f7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Jul 2021 10:00:16 +0800 Subject: [PATCH 415/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @YungeG 本文首发地址:https://linux.cn/article-13578-1.html 你的 LCTT 专页地址:https://linux.cn/lctt/YungeG --- ...10628 Query your Linux operating system like a database.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210628 Query your Linux operating system like a database.md (99%) diff --git a/translated/tech/20210628 Query your Linux operating system like a database.md b/published/20210628 Query your Linux operating system like a database.md similarity index 99% rename from translated/tech/20210628 Query your Linux operating system like a database.md rename to published/20210628 Query your Linux operating system like a database.md index ec4be9eaa8..d587e4f86c 100644 --- a/translated/tech/20210628 Query your Linux operating system like a database.md +++ b/published/20210628 Query your Linux operating system like a database.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (YungeG) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13578-1.html) 像查询数据库一样查询你的 Linux 操作系统信息 ====== From 6f50ce52822f95c21de8ae348ffd919d78cd24ee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Jul 2021 10:16:40 +0800 Subject: [PATCH 416/870] PUB @geekpi https://linux.cn/article-13579-1.html --- ...ible passwords using this Python module.md | 40 ++++++++----------- 1 file changed, 17 insertions(+), 23 deletions(-) rename {translated/tech => published}/20210705 Enter invisible passwords using this Python module.md (73%) diff --git a/translated/tech/20210705 Enter invisible passwords using this Python module.md b/published/20210705 Enter invisible passwords using this Python module.md similarity index 73% rename from translated/tech/20210705 Enter invisible passwords using this Python module.md rename to published/20210705 Enter invisible passwords using this Python module.md index fb3c1ae7d0..530a0ac62f 100644 --- a/translated/tech/20210705 Enter invisible passwords using this Python module.md +++ b/published/20210705 Enter invisible passwords using this Python module.md @@ -3,29 +3,30 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13579-1.html) 使用这个 Python 模块输入不可见的密码 ====== -用 GPG 和 Python 的 getpass 模块给你的密码多一层安全保障。 -![Password lock][1] -密码对程序员来说尤其成问题。你不应该在不加密的情况下存储它们,而且你也不应该在用户输入密码的时候透露出输入的内容。当我决定要提高我的笔记本电脑的安全性时,这对我来说变得特别重要。我对我的家目录进行了加密,但当我登录后,任何以纯文本形式存储在配置文件中的密码都有可能暴露在偷窥者面前。 +> 用 GPG 和 Python 的 getpass 模块给你的密码多一层安全保障。 -具体来说,我使用一个名为 [Mutt][2] 的应用作为我的电子邮件客户端。它可以让我在我的 Linux 终端中阅读和撰写电子邮件,但通常它希望在其配置文件中有一个密码。我限制了我的 Mutt 配置文件的权限,以便只有我可以看到它,但我是我的笔记本电脑的唯一用户,所以我并不真的担心经过认证的用户会无意中看到我的配置文件。相反,我想保护自己不至于心不在焉地把我的配置发布到网上,无论是为了吹嘘还是为了版本控制,我的密码都暴露了。此外,虽然我不希望我的系统上有不受欢迎的客人,但我确实想确保入侵者不能通过对我的配置上运行 `cat` 就获得我的密码。 +![](https://img.linux.net.cn/data/attachment/album/202107/14/101543fy6up6imco65mi68.jpg) + +密码对程序员来说尤其重要。你不应该在不加密的情况下存储它们,而且你也不应该在用户输入密码的时候显示出输入的内容。当我决定要提高我的笔记本电脑的安全性时,这对我来说变得特别重要。我对我的家目录进行了加密,但当我登录后,任何以纯文本形式存储在配置文件中的密码都有可能暴露在偷窥者面前。 + +具体来说,我使用一个名为 [Mutt][2] 的应用作为我的电子邮件客户端。它可以让我在我的 Linux 终端中阅读和撰写电子邮件,但通常它希望在其配置文件中有一个密码。我限制了我的 Mutt 配置文件的权限,以便只有我可以看到它,我是我的笔记本电脑的唯一用户,所以我并不真的担心经过认证的用户会无意中看到我的配置文件。相反,我想保护自己,无论是为了吹嘘还是为了版本控制,不至于心不在焉地把我的配置发布到网上,把我的密码暴露了。此外,虽然我不希望我的系统上有不受欢迎的客人,但我确实想确保入侵者不能通过对我的配置上运行 `cat` 就获得我的密码。 ### Python GnuPG Python 模块 `python-gnupg` 是 `gpg` 应用的一个 Python 封装。该模块的名字是 `python-gnupg`,你不要把它和一个叫做 `gnupg` 的模块混淆。 -[GnuPG][3](GPG) 是 Linux 的默认加密系统,我从 2009 年左右开始使用它。我对它感到很舒服,对它的安全性有很高的信任。 +[GnuPG][3](GPG) 是 Linux 的默认加密系统,我从 2009 年左右开始使用它。我对它很熟悉,对它的安全性有很高的信任。 我决定将我的密码输入 Mutt 的最好方法是将我的密码存储在一个加密的 GPG 文件中,创建一个提示我的 GPG 密码来解锁这个加密文件,然后将密码交给 Mutt(实际上是交给 `offlineimap` 命令,我用它来同步我的笔记本和电子邮件服务器)。 -[用 Python 获取用户输入][4]是非常容易的。对 `input` 进行调用,无论用户输入什么,都会被存储为一个变量: - +[用 Python 获取用户输入][4] 是非常容易的。对 `input` 进行调用,无论用户输入什么,都会被存储为一个变量: ``` print("Enter password: ") @@ -36,7 +37,6 @@ print("You entered: ", myinput) 我的问题是,当我根据密码提示在终端上输入密码时,我所输入的所有内容对任何从我肩膀上看过去或滚动我的终端历史的人来说都是可见的: - ``` $ ./test.py Enter password: my-Complex-Passphrase @@ -48,15 +48,12 @@ Enter password: my-Complex-Passphrase 你可以用 [pip][5] 安装这两个模块: - ``` -$ python -m pip install --user \ -python-gnupg getpass4 +$ python -m pip install --user python-gnupg getpass4 ``` 下面是我的 Python 脚本,用于创建密码提示: - ``` #!/usr/bin/env python # by Seth Kenlon @@ -92,7 +89,6 @@ if __name__ == "__main__": 要查看脚本的运行情况,你首先必须创建一个加密文件(我假设你已经设置了 GPG): - ``` $ echo "hello world" > pass $ gpg --encrypt pass @@ -102,14 +98,13 @@ $ rm pass 现在运行 Python 脚本: - ``` $ python ~/.mutt/password_prompt.py Enter your GPG password: hello world ``` -当你输入时没有任何显示,但只要你正确输入 GPG 口令,你就会看到测试信息。 +当你输入时没有任何显示,但只要你正确输入 GPG 口令,你就会看到该测试信息。 ### 将密码提示符与 offlineimap 整合起来 @@ -117,15 +112,14 @@ hello world 首先,添加一行引用 Python 文件的内容: - ``` -`pythonfile = ~/.mutt/password_prompt.py` +pythonfile = ~/.mutt/password_prompt.py ``` 然后将 `.offlineimaprc`中的 `remotepasseval` 行改为调用 `password_prompt.py`中的 `get_api_pass()` 函数: ``` -`remotepasseval = get_api_pass()` +remotepasseval = get_api_pass() ``` 配置文件中不再有密码! @@ -134,7 +128,7 @@ hello world 在你的个人电脑上考虑安全问题有时会让人觉得很偏执。你的 SSH 配置是否真的需要限制为 600?隐藏在名为 `.mutt` 的无关紧要的电子邮件密码真的重要吗?也许不重要。 -然而,知道我没有把敏感数据悄悄地藏在我的配置文件里,使我更容易把文件提交到公共 Git 仓库,把片段复制和粘贴到支持论坛,并以实际的、已知的好的配置文件的形式分享我的知识。仅就这一点而言,安全性的提高使我的生活更加轻松。而且有这么多好的 Python 模块可以提供帮助,这很容易实现。 +然而,知道我没有把敏感数据悄悄地藏在我的配置文件里,使我更容易把文件提交到公共 Git 仓库,把片段复制和粘贴到支持论坛,并以真实好用的配置文件的形式分享我的知识。仅就这一点而言,安全性的提高使我的生活更加轻松。而且有这么多好的 Python 模块可以提供帮助,这很容易实现。 -------------------------------------------------------------------------------- @@ -143,7 +137,7 @@ via: https://opensource.com/article/21/7/invisible-passwords-python 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d77e396baf623966756294f62aaf5889bb7af806 Mon Sep 17 00:00:00 2001 From: Shiboi77 <87035635+Shiboi77@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:56:12 +0800 Subject: [PATCH 417/870] Update 20210529 My family-s Linux story.md --- sources/talk/20210529 My family-s Linux story.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210529 My family-s Linux story.md b/sources/talk/20210529 My family-s Linux story.md index 33bfdbffde..32febedaca 100644 --- a/sources/talk/20210529 My family-s Linux story.md +++ b/sources/talk/20210529 My family-s Linux story.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/my-linux-story) [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Shiboi77) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -28,7 +28,7 @@ via: https://opensource.com/article/21/5/my-linux-story 作者:[Chris Hermansen][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Shiboi77](https://github.com/Shiboi77) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c036fd61b912c16859ed4b91d62c04ff4085a4cf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Jul 2021 05:03:54 +0800 Subject: [PATCH 418/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210714=20?= =?UTF-8?q?Getting=20Started=20with=20Podman=20on=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210714 Getting Started with Podman on Fedora.md --- ...4 Getting Started with Podman on Fedora.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20210714 Getting Started with Podman on Fedora.md diff --git a/sources/tech/20210714 Getting Started with Podman on Fedora.md b/sources/tech/20210714 Getting Started with Podman on Fedora.md new file mode 100644 index 0000000000..ca3b5f92a7 --- /dev/null +++ b/sources/tech/20210714 Getting Started with Podman on Fedora.md @@ -0,0 +1,160 @@ +[#]: subject: (Getting Started with Podman on Fedora) +[#]: via: (https://fedoramagazine.org/getting-started-with-podman-in-fedora/) +[#]: author: (Yazan Monshed https://fedoramagazine.org/author/yazanalmonshed/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Getting Started with Podman on Fedora +====== + +![][1] + +Podman logo from the Podman project + +[Podman][2] is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System. In this article, we will introduce podman and how to use it with a small application build using nodejs. The app will be very simple and clean. + +### Install Podman + +Podman command is the same as [docker][3] just type in your terminal **alias docker=podman** if you have docker already installed + +Podman is installed by default in Fedora. But if you don’t have it for any reason, you can install it using the following command: + +``` +sudo dnf install podman +``` + +For fedora [silverblue][4] users, podman is already installed in your OS. + +After installation, run the hello world image to ensure everything is working: + +``` +podman pull hello-world +podman run hello-world +``` + +If everything is working well you will see the following output in your terminal: + +``` +Hello from Docker! +This message shows that your installation appears to be working correctly. + To generate this message, Docker took the following steps: + 1.The Docker client contacted the Docker daemon. + 2.The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) + 3.The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. + 4.The Docker daemon streamed that output to the Docker client, which sent it to your terminal. + To try something more ambitious, you can run an Ubuntu container with: + $ docker run -it ubuntu bash + Share images, automate workflows, and more with a free Docker ID: + https://hub.docker.com/ + For more examples and ideas, visit: + https://docs.docker.com/get-started/ +``` + +### Simple Nodejs App + +First, we will create a folder **webapp** , type the following command in your terminal + +``` +mkdir webapp && cd webapp +``` + +Now create the file ****_package.json_ This file includes all the dependencies that the project needs to work well. Copy the following code inside the file _package.json ._ + +``` +{ + "dependencies": { + "express": "*" + }, + "scripts": { + "start": "node index.js" + } +} +``` + +Create the file _index.js_ and add the following code there: + +``` +const express = require('express') + +const app = express(); + +app.get('/', (req, res)=> { + res.send("Hello World!") +}); +app.listen(8081, () => { + console.log("Listing on port 8080"); +}); +``` + +You can download source code from [here][5]. + +### Create Dockerfile + +First of all, create a file called _Dockerfile_ and make sure the first character is a capital, NOT lower case, then add the following code there: + +``` +FROM node:alpine +WORKDIR usr/app +COPY ./ ./ +RUN npm install +CMD ["npm", "start"] +``` + +Be sure you are inside the folder _webapp_ then show the image and then type the following command: + +``` +podman build . +``` + +Make sure to add the **dot**. The image is created on your machine and you can show it using the following command: + +``` +podman images +``` + +The last step is to run the image inside a container by typing the following command: + +``` +podman run -p 8080:8080 +``` + +Now open your browser in _localhost:8080_ and you will see that your app works. + +### Stopping and Remove Container + +To exit from the container use _CTRL-C._ You can remove the container by using the container id. Get the id and stop the container using these commands: + +``` +podman ps -a +podman stop +``` + +You can delete the images from your machine by using the following command: + +``` +podman rmi +``` + +Read more about podman and how it works on the [official website][2] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/getting-started-with-podman-in-fedora/ + +作者:[Yazan Monshed][a] +选题:[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/yazanalmonshed/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/06/Get_Started_w_Podman_on_Fedora-816x345.jpg +[2]: https://podman.io/ +[3]: https://www.docker.com/ +[4]: https://silverblue.fedoraproject.org/ +[5]: https://github.com/YazanALMonshed/webapp From 1fb9062a6b7742e5dc1024ca5a824693efe3d031 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Jul 2021 05:04:07 +0800 Subject: [PATCH 419/870] add done: 20210714 Getting Started with Podman on Fedora.md --- sources/tech/20210715 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210715 .md diff --git a/sources/tech/20210715 .md b/sources/tech/20210715 .md new file mode 100644 index 0000000000..e58f297503 --- /dev/null +++ b/sources/tech/20210715 .md @@ -0,0 +1,25 @@ +[#]: subject: () +[#]: via: (https://www.2daygeek.com/linux-tee-command-examples/) +[#]: author: ( ) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-tee-command-examples/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From 3698bb31554e8994262c9a698eaa7870dee619dc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Jul 2021 05:04:25 +0800 Subject: [PATCH 420/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210715=20?= =?UTF-8?q?Linux=20for=20Education:=20Best=20Distributions=20for=20Kids,?= =?UTF-8?q?=20Teachers=20&=20Schools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210715 Linux for Education- Best Distributions for Kids, Teachers - Schools.md --- ...tributions for Kids, Teachers - Schools.md | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 sources/tech/20210715 Linux for Education- Best Distributions for Kids, Teachers - Schools.md diff --git a/sources/tech/20210715 Linux for Education- Best Distributions for Kids, Teachers - Schools.md b/sources/tech/20210715 Linux for Education- Best Distributions for Kids, Teachers - Schools.md new file mode 100644 index 0000000000..c0799f7647 --- /dev/null +++ b/sources/tech/20210715 Linux for Education- Best Distributions for Kids, Teachers - Schools.md @@ -0,0 +1,197 @@ +[#]: subject: (Linux for Education: Best Distributions for Kids, Teachers & Schools) +[#]: via: (https://itsfoss.com/educational-linux-distros/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux for Education: Best Distributions for Kids, Teachers & Schools +====== + +Can kids use Linux distributions? And is it suitable for school use? + +Well, that depends on what are your options and what you choose to go with. No matter whether you want something for a kid or the school teacher, there are options available. + +Hence, to give you a head start, we have curated a list of [best Linux distributions][1] tailored for education. + +### Best Linux Distribution for Kids + +For a kid, a distribution has to offer a user-friendly UI minus the advanced functionalities. + +You may argue that it can be done with any mainstream, [beginner-friendly distro like Ubuntu][2], Mint or Zorin. You are right, but if a distribution comes with [essential tools][3] baked in and makes it easy to use, kids will quickly learn to use it and have fun. + +#### 1\. Endless OS + +![Image Credits: Distrowatch][4] + +Endless OS is a popular option to go for as a Linux distro tailored for education. + +It is based on Debian and uses GNOME desktop environment. Even though it restricts usage of its OS on more than five hundred computers in a year, it is free to download. + +The user interface is easy to use and looks attractive for installation in a modern PC. You get variety of applications pre-installed. Hence, this comes handy for computers with no internet access. + +[Endless OS][5] + +#### 2\. Ubermix + +![][6] + +Ubermix is an Ubuntu-based Linux distribution that aims to reduce the complexity by tweaking the user interface, getting rid of unnecessary apps, and adding essential tools/apps for education. + +It also offers a way to easily recover from a system issue in case there is a problem. An optional parental control feature is present for content filtering and [screen time controls][7], which is indeed useful. + +Ubermix is actively maintained and provides plenty of instructions for installation and troubleshooting on its official website. + +[ubermix][8] + +#### 3\. Kano OS (for Raspberry Pi) + +![][9] + +Kano is a computing kit tailored for educating children from 6 to 14 years. It’s like a premium version of Raspberry Pi with plenty of DIY and coding activities for the young ones. + +Preview | Product | Price | +---|---|---|--- +![Kano Computer Kit – A Computer Anyone Can Make][10] ![Kano Computer Kit – A Computer Anyone Can Make][10] | [Kano Computer Kit – A Computer Anyone Can Make][11] | $345.00[][12] | [Buy on Amazon][13] + +Kano also has Debian based [operating system for Raspberry Pi][14]. You don’t need to have Kano kit for this purpose. You can use it on your Raspberry Pi. + +It aims to provide the benefits of it—curated for education when coupled with their computer kits. Ranging from coding apps to games, there should be something for everyone. + +You will also find useful parental control settings to limit/tweak the experience for your kid. For additional help, the [official help resources][15] will come in handy as well. + +[Kano OS][16] + +#### 4\. AcademiX GNU/Linux + +![][17] + +Yet another distribution based on Debian focused for learning. + +Not just for primary-level education, but the programs included in the operating system should be useful for university students as well. It also includes virtual interactive labs and virtual microscope. + +**While it makes learning easy with the utilities pre-installed, teachers can also use it to create content and publish.** + +So, it can be an all-in-one choice for a lot of potential learners and teachers in school. + +[AcademiX][18] + +#### 5\. Sugar (makes any distro kids friendly) + +![][19] + +Sugar is not a full-fledged OS but a learning platform (environment) that can be installed on top of any Linux distro to set it up for learning. + +Not just to help your kid learn with an easy-to-use interface, it also helps collaborating, sharing, and learning pre-installed software tools. + +It is also available for Raspberry Pi computers. And a [Flatpak package][20] lets you easily install some of its activities in any Linux distribution. + +[Sugar][21] + +#### 6\. Li-f-e + +Linux for education (Li-f-e) was originally a project by OpenSUSE and this is a continuation of that. + +Even though it is not backed by OpenSUSE now (I couldn’t find any references), it could be a useful option for kids and schools. + +This is based on Ubuntu MATE and offers several built-in applications as per some of the textbooks. It does not offer anything extraordinary but more like Ubuntu for education, which is actively maintained at the time of writing this. + +[Li-f-e][22] + +### Best Linux Distribution for Schools + +The ones I mentioned so far were tailored to be used by children for their education and learning. But education has two parts: students and teachers. + +This is why this list is divided into two parts. This second part lists some options that can be a good fit for school administrators, management, and teachers. + +Of course, you can always use Linux Mint, elementary OS, or Ubuntu if you want to utilize a stable and reliable Linux desktop OS to manage your school (or) content creation. However, there are some choices that are customized for the purpose. + +#### 1\. Debian Edu/Skolelinux + +![Image Credits: Distrowatch][23] + +Skolelinux is a Debian-based distribution that comes packed with several applications and networking services fit for students and teachers in school. + +It is also known as Debian Edu. You get the ability to opt for offline installation by downloading the required ISO or the base system with online installation for the rest. + +Even though kids can use it after setup, it requires a bit of learning curve to configure and maintain. Hence, this is more inclined towards school administrators or teachers than kids. + +[Skolelinux][24] + +#### 2\. Linux Schools (Karoshi Server) + +A Linux distribution with the perks of Ubuntu LTS built for school servers. If you want to setup a server and monitor/control a network of connected servers, Linux Schools (or Karoshi Server) is a good fit. + +It lets you administer a network of servers using a web interface. You do not need in-depth knowledge about Linux system administration to utilize it. + +[Linux Schools][25] + +#### 3\. Escuelas Linux + +![][26] + +[Escuelas Linux][27] is based on Bodhi Linux. It comes baked in with several applications fit for educational environments. + +It has custom tools for resetting the distro in the post-installed state in seconds. There is also options to reinstate users. Apart from that, it comes with applications for distributing educational material within the network, screen broadcasting, mirroring, remote command execution, message sending, screen locking and muting sound to the students’s computers. + +Considering it is based on Bodhi Linux, which is one of the [best lightweight Linux distros][28], this can be a good pick for older systems. + +You also get an added developer pack, which is optional to install, if you need advanced tools like NetBeans, Git, Android Studio. + +[Escuelas Linux][29] + +In addition to these options, there is also [EduBOSS][30], an education version of BOSS Linux which is tailored for Indian schools, if that is relevant to you. + +### Wrapping Up + +While there are 100s of Linux distribution, only a handful exist that are specially crafted for education. + +It is a good thing that there some viable options for students, teachers, and school administration. + +After all, Linux can be used everywhere and by anyone. Am I right? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/educational-linux-distros/ + +作者:[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/best-linux-beginners/ +[3]: https://itsfoss.com/essential-linux-applications/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/endless-os-distrowatch.png?resize=800%2C500&ssl=1 +[5]: https://endlessos.com/home/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/ubermix-4-official.png?resize=800%2C452&ssl=1 +[7]: https://itsfoss.com/activitywatch/ +[8]: https://ubermix.org/download.html +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/kano-os.png?resize=800%2C570&ssl=1 +[10]: https://i1.wp.com/m.media-amazon.com/images/I/41-VaIktpgL._SL160_.jpg?ssl=1 +[11]: https://www.amazon.com/dp/B073VTCS66?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Kano Computer Kit – A Computer Anyone Can Make) +[12]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[13]: https://www.amazon.com/dp/B073VTCS66?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) +[14]: https://itsfoss.com/raspberry-pi-os/ +[15]: https://help.kano.me/hc/en-us/sections/360001083699-Kano-OS +[16]: https://kano.me/row/downloadable +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/academix-edu.png?resize=800%2C450&ssl=1 +[18]: https://academixproject.com/en/home/ +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/sugarlabs.jpg?resize=992%2C744&ssl=1 +[20]: https://itsfoss.com/what-is-flatpak/ +[21]: https://www.sugarlabs.org +[22]: https://sourceforge.net/projects/cyberorg-home/files/Li-f-e/ +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/skolelinux.png?resize=800%2C450&ssl=1 +[24]: http://www.skolelinux.org +[25]: https://www.linuxschools.com/forum/index-main.php +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/escuelas-linux.jpg?resize=800%2C450&ssl=1 +[27]: https://itsfoss.com/escuelas-linux/ +[28]: https://itsfoss.com/lightweight-linux-beginners/ +[29]: https://escuelaslinux.sourceforge.io/english/index.html +[30]: https://bosslinux.in/eduboss From bdc500895620ad34d28f8575ce7587339256d56f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Jul 2021 05:04:49 +0800 Subject: [PATCH 421/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210714=20?= =?UTF-8?q?5=20Rust=20tools=20worth=20trying=20on=20the=20Linux=20command?= =?UTF-8?q?=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210714 5 Rust tools worth trying on the Linux command line.md --- ... worth trying on the Linux command line.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20210714 5 Rust tools worth trying on the Linux command line.md diff --git a/sources/tech/20210714 5 Rust tools worth trying on the Linux command line.md b/sources/tech/20210714 5 Rust tools worth trying on the Linux command line.md new file mode 100644 index 0000000000..b723dc42df --- /dev/null +++ b/sources/tech/20210714 5 Rust tools worth trying on the Linux command line.md @@ -0,0 +1,143 @@ +[#]: subject: (5 Rust tools worth trying on the Linux command line) +[#]: via: (https://opensource.com/article/21/7/rust-tools-linux) +[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 Rust tools worth trying on the Linux command line +====== +Try some new commands for common tasks. +![Terminal command prompt on orange background][1] + +Linux inherited a lot from Unix, which has been around for a half-century. This means most of the tools you use in your Linux terminal probably either have a very long history or were written to emulate those historical commands. It's a point of pride in the POSIX world that tools don't _need_ constant reinvention. In fact, there's a subset of Linux users today who could run a version of Linux from [before they were born][2] without having to learn anything new. It's tried, true, and reliable. + +That doesn't mean there hasn't been evolution, though. All the commands Linux users know and love have been improved over the years. Some have even been replaced entirely and are so common now that few people still care to remember the old ones. Can you imagine Linux without SSH? Well, believe it or not, the `ssh` command replaced one called `rsh`. + +I'm often on the lookout for new commands because I'm always intrigued by the possibility of getting things done more efficiently. If there's a better, faster, or more robust command out there for doing a common task, I want to know about it. And while there's equal opportunity for any language to invent new Linux commands, Rust developers have been delivering an impressive collection of useful general-purpose utilities. + +### Replace man with tealdeer + +Tealdeer provides the `tldr` command, which displays an abbreviated, no-nonsense summary of how a command is used. It's not that manual and info pages aren't useful, because they are, but sometimes they can be a little verbose and a little obtuse. Tealdeer keeps its hints clear and concise, with examples of how to use the command you're struggling to recall. + + +``` +$ tldr tar + +  Archiving utility. +  Often combined with a compression method, such as gzip or bzip2. +  More information: <[https://www.gnu.org/software/tar\>][3]. + +  [c]reate an archive and write it to a [f]ile: + +      tar cf target.tar file1 file2 file3 + +  [c]reate a g[z]ipped archive and write it to a [f]ile: + +      tar czf target.tar.gz file1 file2 file3 + +  [c]reate a g[z]ipped archive from a directory using relative paths: + +      tar czf target.tar.gz --directory=path/to/directory . +[...] +``` + +Read the full article [about tldr][4]. + +### Replace du with dust + +The `du` command gives feedback about disk usage. It's a relatively simple task; likewise, the command is pretty simple, too. The `dust` command is `du` written in Rust, and it uses color-coding and bar graphs for users who prefer added visual context. + + +``` +$ dust + 5.7M   ┌── exa                                   │                                   ██ │   2% + 5.9M   ├── tokei                                 │                                   ██ │   2% + 6.1M   ├── dust                                  │                                   ██ │   2% + 6.2M   ├── tldr                                  │                                   ██ │   2% + 9.4M   ├── fd                                    │                                   ██ │   4% + 2.9M   │ ┌── exa                                 │                                 ░░░█ │   1% +  15M   │ ├── rustdoc                             │                                 ░███ │   6% +  18M   ├─┴ bin                                   │                                 ████ │   7% +  27M   ├── rg                                    │                               ██████ │  11% + 1.3M   │     ┌── libz-sys-1.1.3.crate            │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   0% + 1.4M   │     ├── libgit2-sys-0.12.19+1.1.0.crate │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   1% + 4.5M   │   ┌─┴ github.com-1ecc6299db9ec823       │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   2% + 4.5M   │ ┌─┴ cache                               │  ░░░░░░░░░░░░░░░░░░░░░░░░ +[...] +``` + +Read the full article [about dust][5]. + +### Replace find with fd + +The `find` command is a useful tool for finding files on your computer, but its syntax can be difficult to master. Not only are there a lot of options, but the order of those options can be significant, depending on what you're doing. Some people have [written scripts][6] to abstract the task away from the command. Other people just write a new tool altogether, like `fd`. + +Syntax doesn't get any easier than this: + + +``` +$ fd example +Documents/example.txt +Documents/example-java +Downloads/example.com/index.html +``` + +Read the full article [about fd][7]. + +### Replace ls with exa + +You might not think that the `ls` command would have much room for improvement. But `exa` proves that even the most mundane utility can benefit from small adjustments. For instance, why not have a list command with built-in Git awareness? Why not get extra metadata in your file lists?  + +Read the full [article about exa][8]. + +### Try Tokei + +Unlike the other tools on this list, the `tokei` utility doesn't replace one command, but it does demonstrate how the Linux terminal is—as always—an environment very much in constant growth. The terminal may contain lots of legacy commands, but there are new and exciting commands surfacing all the time. + +When I'm looking at a project in my local file system, and I need to know what languages it contains, I rely on a tool like Tokei. It's a program that displays statistics about a codebase, with wide support for 150 programming languages. I don't need to remember what languages have been used, or how many lines of code there are, or how many blanks or spaces or comments are there. It's a complete code-analysis tool, making my entry into and navigation of the code easy. + + +``` +$ tokei ~/exa/src ~/Work/wildfly/jaxrs +================== +Language   Files Lines Code Comments Blank +Java        46    6135  4324  945     632 +XML         23    5211  4839  473     224 +\--------------------------------- +Rust +Markdown +\----------------------------------- +Total +``` + +Read the full [article about tokei][9]. + +### Find your favorite + +Open source users never have to settle for just a small set of commands, or even just one version of a command. Find the commands you love, whether they're new ideas for emerging workflows, or reimplementations of old tools, or timeless classics that are just as good today as they were decades ago. Find the commands that make your life better and enjoy! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/rust-tools-linux + +作者:[Sudeshna Sur][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sudeshna-sur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://opensource.com/article/16/12/yearbook-linux-test-driving-distros +[3]: https://www.gnu.org/software/tar\> +[4]: https://opensource.com/article/21/6/tealdeer +[5]: https://opensource.com/article/21/6/dust +[6]: https://opensource.com/article/20/2/find-file-script +[7]: https://opensource.com/article/21/6/fd +[8]: https://opensource.com/article/21/3/replace-ls-exa +[9]: https://opensource.com/article/21/6/tokei From 03db0d23d5255a37d4a69eefeb7c59efd317d475 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Jul 2021 05:05:04 +0800 Subject: [PATCH 422/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210714=20?= =?UTF-8?q?How=20different=20programming=20languages=20read=20and=20write?= =?UTF-8?q?=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210714 How different programming languages read and write data.md --- ...ogramming languages read and write data.md | 284 ++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 sources/tech/20210714 How different programming languages read and write data.md diff --git a/sources/tech/20210714 How different programming languages read and write data.md b/sources/tech/20210714 How different programming languages read and write data.md new file mode 100644 index 0000000000..4bcc61a96a --- /dev/null +++ b/sources/tech/20210714 How different programming languages read and write data.md @@ -0,0 +1,284 @@ +[#]: subject: (How different programming languages read and write data) +[#]: via: (https://opensource.com/article/21/7/programming-read-write) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How different programming languages read and write data +====== +Every programming language has a unique way of accomplishing a task; +that's why there are so many languages to choose from. +![Code going into a computer.][1] + +In his article _[How different programming languages do the same thing][2]_, Jim Hall demonstrates how 13 different languages accomplish the same exact task with different syntax. The lesson is that programming languages tend to have many similarities, and once you know one programming language, you can learn another by figuring its syntax and structure. + +In the same spirit, Jim's article compares how different programming languages read and write data. Whether that data comes from a configuration file or from a file a user creates, processing data on a storage device is a common task for coders. It's not practical to cover all programming languages in this way, but a recent Opensource.com series provides insight into different approaches taken by these coding languages: + + * [C][3] + * [C++][4] + * [Java][5] + * [Groovy][6] + * [Lua][7] + * [Bash][8] + * [Python][9] + + + +### Reading and writing data + +The process of reading and writing data with a computer is similar to how you read and write data in real life. To access data in a book, you first open it, then you read words or you write new words into the book, and then you close the book. + +When your code needs to read data from a file, you provide your code with a file location, and then the computer brings that data into its RAM and parses it from there. Similarly, when your code needs to write data to a file, the computer places new data into the system's in-memory write buffer and synchronizes it to the file on the storage device. + +Here's some pseudo-code for these operations: + + 1. Load a file in memory. + 2. Read the file's contents, or write data to the file. + 3. Close the file. + + + +### Reading data from a file + +You can see three trends in how the languages in the Opensource.com series read files. + +#### C + +In C, opening a file can involve retrieving a single character (up to the `EOF` designator, signaling the end of the file) or a block of data, depending on your requirements and approach. It can feel like a mostly manual process, depending on your goal, but the general process is exactly what the other languages mimic. + + +``` +FILE *infile; +int ch; + +infile = [fopen][10](argv[1], "r"); +  +do { +  ch = [fgetc][11](infile); +  if (ch != EOF) { +    [printf][12]("%c", ch); +  } + } while (ch != EOF); + +[fclose][13](infile); +``` + +You can also choose to load some portion of a file into the system buffer and then work out of the buffer. + + +``` +FILE *infile; +char buffer[300]; +  +infile = [fopen][10](argv[1], "r"); + +while (![feof][14](infile)) { +  size_t buffer_length; +  buffer_length = [fread][15](buffer, sizeof(char), 300, infile); +} + +[printf][12]("%s", buffer); +[fclose][13](infile); +``` + +#### C++ + +C++ simplifies a few steps, allowing you to parse data as strings. + + +``` +std::string sFilename = "example.txt"; + +std::ifstream fileSource(sFilename); +std::string buffer; + +while (fileSource >> buffer) { +  std::cout << buffer << std::endl; +} +``` + +#### Java + +Java and Groovy are similar to C++. They use a class called `Scanner` to set up a data object or stream containing the contents of the file of your choice. You can "scan" through the file by tokens (byte, line, integer, and many others). + + +``` +[File][16] myFile = new [File][16]("example.txt"); + +Scanner myScanner = new Scanner(myFile); +  while (myScanner.hasNextLine()) { +    [String][17] line = myScanner.nextLine(); +    [System][18].out.println(line); +  } + +myScanner.close(); +``` + +#### Groovy + + +``` +def myFile = new [File][16]('example.txt') + +def myScanner = new Scanner(myFile) +  while (myScanner.hasNextLine()) { +    def line = myScanner.nextLine() +    println(line) +  } + +myScanner.close() +``` + +#### Lua + +Lua and Python abstract the process further. You don't have to consciously create a data stream; you just assign a variable to the results of an `open` function and then parse the contents of the variable. It's quick, minimal, and easy. + + +``` +myFile = io.open('example.txt', 'r') + +lines = myFile:read("*all") +print(lines) + +myFile:close() +``` + +#### Python + + +``` +f = open('example.tmp', 'r') + +for line in f: +    print(line) + +f.close() +``` + +### Writing data to a file + +In terms of code, writing is the inverse of reading. As such, the process for writing data to a file is basically the same as reading data from a file, except using different functions. + +#### C + +In C, you can write a character to a file with the `fputc` function. + + +``` +`fputc(ch, outfile);` +``` + +Alternately, you can write data to the buffer with `fwrite`. + + +``` +`fwrite(buffer, sizeof(char), buffer_length, outfile);` +``` + +#### C++ + +Because C++ uses the `ifstream` library to open a buffer for data, you can write data to the buffer, as with C (except with C++ libraries). + + +``` +`std::cout << buffer << std::endl;` +``` + +#### Java + +In Java, you can use the `FileWriter` class to create a data object that you can write data to. It works a lot like the `Scanner` class, except going the other way. + + +``` +[FileWriter][19] myFileWriter = new [FileWriter][19]("example.txt", true); +myFileWriter.write("Hello world\n"); +myFileWriter.close(); +``` + +#### Groovy + +Similarly, Groovy uses `FileWriter` but with a slightly "groovier" syntax. + + +``` +new [FileWriter][19]("example.txt", true).with { +  write("Hello world\n") +  flush() +} +``` + +#### Lua + +Lua and Python are similar, both using functions called `open` to load a file, `write` to put data into it, and `close` to close the file. + + +``` +myFile = io.open('example.txt', 'a') +io.output(myFile) +io.write("hello world\n") +io.close(myFile) +``` + +#### Python + + +``` +myFile = open('example.txt', 'w') +myFile.write('hello world') +myFile.close() +``` + +### File modes + +Many languages specify a "mode" when opening files. Modes vary, but this is common notation: + + * **w** to write + * **r** to read + * **r+** to read and write + * **a** to append only + + + +Some languages, such as Java and Groovy, let you determine the mode based on which class you use to load the file. + +Whichever way your programming language determines a file's mode, it's up to you to ensure that you're _appending_ data—unless you intend to overwrite a file with new data. Programming languages don't have built-in prompts to warn you against data loss, the way file choosers do. + +### New language and old tricks + +Every programming language has a unique way of accomplishing a task; that's why there are so many languages to choose from. You can and should choose the language that works best for you. But once you understand the basic constructs of programming, you can also feel free to try out different languages, without fear of not knowing how to accomplish basic tasks. More often than not, the pathways to a goal are similar, so they're easy to learn as long as you keep the basic concepts in mind. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/programming-read-write + +作者:[Alan Smithee][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) +[2]: https://opensource.com/article/21/4/compare-programming-languages +[3]: https://opensource.com/article/21/3/file-io-c +[4]: https://opensource.com/article/21/3/ccc-input-output +[5]: https://opensource.com/article/21/3/io-java +[6]: https://opensource.com/article/21/4/groovy-io +[7]: https://opensource.com/article/21/3/lua-files +[8]: https://opensource.com/article/21/3/input-output-bash +[9]: https://opensource.com/article/21/6/reading-and-writing-files-python +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html +[14]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html +[15]: http://www.opengroup.org/onlinepubs/009695399/functions/fread.html +[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file +[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter From 571056099189aef3a21d138a68556d2e686c8d40 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 15 Jul 2021 08:51:17 +0800 Subject: [PATCH 423/870] translated --- ...ntOS, RHEL, Rocky Linux Minimal Install.md | 134 ------------------ ...ntOS, RHEL, Rocky Linux Minimal Install.md | 133 +++++++++++++++++ 2 files changed, 133 insertions(+), 134 deletions(-) delete mode 100644 sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md create mode 100644 translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md diff --git a/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md b/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md deleted file mode 100644 index 13b58a7a5a..0000000000 --- a/sources/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: (How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install) -[#]: via: (https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/) -[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install -====== -Setting up the internet or network is super easy in minimal server -installations. In this guide, we will explain how you can setup internet -or network in CentOS, RHEL, Rocky Linux minimal install. -Once you install the minimal install of any server distributions, you would not have any GUI or desktop environment to set up your network or internet. Hence it is important to know how you can set up internet when you only have access to the terminal. The NetworkManager utility provides necessary tools armed with systemd services to get the job done. Here’s how. - -### Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install - - * After you have completed the installation, boot into the server terminal. Ideally, you should be prompted with a terminal. Login using root or admin account. - - - * Then first, try to check the state of the network interface and details using nmcli. The nmcli is a command-line tool for controlling the NetworkManager service. Use the following command to check. - - - -``` -nmcli device status -``` - -This would display the device name, status etc. - -![nmcli device status][1] - - * Run the tool `nmtui` to configure the network interface. The [nmtui][2] is part of the NetworkManager tool which gives you a nice UI to configure the network. This is part of the package NetworkManager-tui and should be installed by default when you have completed the installation of the minimal server. - - - -``` -nmtui -``` - - * Click on Edit a connection in the nmtui window. - - - -![nmtui – Select options][3] - - * Select the interface name - - - -![Select Interface to Edit][4] - - * In the Edit Connection window, choose Automatic for IPv4 and IPv6. And select Automatically Connect. Press ok once done. - - - -![nmtui – Edit Connection][5] - - * Restart the NetworkManager service via the [systemd systemctl][6] using the following command. - - - -``` -systemctl restart NetworkManager -``` - - * If all goes well, you should be connected to the network and internet in the minimal installation of CentOS, RHEL, Rocky Linux server. Provided your network has internet connectivity. You can use ping to verify whether it is working. - - - -![setup internet minimal server – CentOS Rocky Linux RHEL][7] - -### Additional Tip: Set up Static IP in minimal server - -When you set the network configuration as automatic, the interface dynamically assigns the IP when you connected to the internet. In some situations where you are setting up a local area network (LAN), you may want to assign static IP to your network interface. It’s super easy. - -Open the network configuration script for your network. Change the highlighted part for your own device. - -``` -vi /etc/sysconfig/network-scripts/ifcfg-ens3 -``` - -In the above file, add the IP address you desire with property IPADDR. Save the file. - -``` -IPADDR=192.168.0.55 -``` - -Add the gateway for your network in `/etc/sysconfig/network`. - -``` -NETWORKING=yes -HOSTNAME=debugpoint -GATEWAY=10.1.1.1 -``` - -Add any public DNS server in resolv.conf located at `/etc/resolv.conf`. - -nameserver 8.8.8.8 -nameserver 8.8.4.4 - -And restart the network service. - -``` -systemctl restart NetworkManager -``` - -This will complete the setup of the static IP. You can also check the IP details using `ip addr` command. - -I hope this guide helps you to set up the network, internet, and static IP in your minimal server. Let me know in the comment section, if you may have any questions. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmcli-device-status.jpg -[2]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmtui -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Select-options.jpg -[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Select-Interface-to-Edit.jpg -[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Edit-Connection.jpg -[6]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/ -[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/setup-internet-minimal-server-CentOS-Rocky-Linux-RHEL.jpg diff --git a/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md b/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md new file mode 100644 index 0000000000..27586d5ee5 --- /dev/null +++ b/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md @@ -0,0 +1,133 @@ +[#]: subject: (How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install) +[#]: via: (https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网 +====== +在最小安装的服务器中,设置互联网或网络是非常容易的。在本指南中,我们将解释如何在 CentOS、RHEL、Rocky Linux 最小安装中设置互联网或网络。 + +当你安装了任何服务器发行版的最小安装,你就没有任何 GUI 或桌面环境来设置你的网络或互联网。因此,当你只能使用终端时,知道如何设置互联网是很重要的。NetworkManager 工具提供了必要的工具和 systemd 服务来完成这项工作。以下是具体方法。 + +### 在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网 + + * 完成安装后,启动服务器终端。理想情况下,你应该会看到提示。使用 root 或 admin 账户登录。 + + + * 然后,首先尝试使用 nmcli 检查网络接口的状态和细节。nmcli 是一个控制 NetworkManager 服务的命令行工具。使用以下命令进行检查。 + + + +``` +nmcli device status +``` + +这将显示设备名称、状态等。 + +![nmcli device status][1] + + * 运行工具 `nmtui` 来配置网络接口。[nmtui][2] 是 NetworkManager 工具的一部分,它为你提供了一个漂亮的用户界面来配置网络。这是 NetworkManager-tui 包的一部分,当你完成最小服务器的安装后,它应该默认安装。 + + + +``` +nmtui +``` + + * 在 nmtui 窗口中点击编辑一个连接。 + + + +![nmtui – Select options][3] + + * 选择接口名称 + + + +![Select Interface to Edit][4] + + * 在编辑连接窗口,为 IPv4 和 IPv6 选择自动。并选择自动连接。完成后按 OK。 + + + +![nmtui – Edit Connection][5] + + * 使用下面的命令,通过 [systemd systemctl][6] 重新启动 NetworkManager 服务。 + + + +``` +systemctl restart NetworkManager +``` + + * 如果一切顺利,你应该在 CentOS、RHEL、Rocky Linux 服务器的最小安装中连接到网络和互联网。前提是你的网络有互联网连接。你可以用 ping 来验证它是否正常。 + + + +![setup internet minimal server – CentOS Rocky Linux RHEL][7] + +### 额外技巧:在最小服务器中设置静态 IP + +当你把网络配置设置为自动,当你连接到互联网时,接口会动态地分配 IP。在某些情况下,当你建立一个局域网 (LAN) 时,你可能想给你的网络接口分配静态 IP。这超级简单。 + +打开你的网络的网络配置脚本。根据你的设备修改高亮部分。 + +``` +vi /etc/sysconfig/network-scripts/ifcfg-ens3 +``` + +在上面的文件中,用 IPADDR 属性添加你想要的 IP 地址。保存该文件。 + +``` +IPADDR=192.168.0.55 +``` + +在 `/etc/sysconfig/network` 中为你的网络添加网关。 + +``` +NETWORKING=yes +HOSTNAME=debugpoint +GATEWAY=10.1.1.1 +``` + +在位于 `/etc/resolv.conf` 的 resolv.conf 中添加任意公共 DNS 服务器。 + +nameserver 8.8.8.8 +nameserver 8.8.4.4 + +并重新启动网络服务。 + +``` +systemctl restart NetworkManager +``` + +这样就完成了静态 IP 的设置。你也可以使用 `ip addr` 命令检查 IP 的详细信息。 + +我希望这个指南能帮助你在你的最小服务器中设置网络、互联网和静态 IP。如果你有任何问题,请在评论区告诉我。 + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmcli-device-status.jpg +[2]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmtui +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Select-options.jpg +[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Select-Interface-to-Edit.jpg +[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Edit-Connection.jpg +[6]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/ +[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/setup-internet-minimal-server-CentOS-Rocky-Linux-RHEL.jpg From feb277dafb10c63d3ac077dc058353d2df1ddacb Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 15 Jul 2021 08:54:37 +0800 Subject: [PATCH 424/870] translated --- ...How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md b/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md index 893e29c850..270853db00 100644 --- a/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md +++ b/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md @@ -2,7 +2,7 @@ [#]: via: (https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/) [#]: author: (Arindam https://www.debugpoint.com/author/admin1/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c0226a4447dced5b4b8d203c6e6e2afae58fd17b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 15 Jul 2021 09:10:34 +0800 Subject: [PATCH 425/870] Delete 20210715 .md --- sources/tech/20210715 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210715 .md diff --git a/sources/tech/20210715 .md b/sources/tech/20210715 .md deleted file mode 100644 index e58f297503..0000000000 --- a/sources/tech/20210715 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: () -[#]: via: (https://www.2daygeek.com/linux-tee-command-examples/) -[#]: author: ( ) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/linux-tee-command-examples/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 From b6e0efda28a65e3ac332269927dc8c3642c271e7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Jul 2021 09:33:12 +0800 Subject: [PATCH 426/870] PRF @geekpi --- ...706 Edit PDFs on the Linux command line.md | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210706 Edit PDFs on the Linux command line.md b/translated/tech/20210706 Edit PDFs on the Linux command line.md index 678ee4efd6..3b32489d33 100644 --- a/translated/tech/20210706 Edit PDFs on the Linux command line.md +++ b/translated/tech/20210706 Edit PDFs on the Linux command line.md @@ -3,16 +3,18 @@ [#]: author: (Moshe Zadka https://opensource.com/users/moshez) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 在 Linux 命令行上编辑 PDF ====== -使用 qpdf 和 poppler-utils 来分割、修改和合并 PDF 文件。 -![Text editor on a browser, in blue][1] -你收到的许多文件都是 PDF 格式的。有时这些 PDF 需要被处理。例如,可能需要删除或添加页面,或者你可能需要签署或修改一个特定的页面。 +> 使用 qpdf 和 poppler-utils 来分割、修改和合并 PDF 文件。 + +![](https://img.linux.net.cn/data/attachment/album/202107/15/093249xh6dmg846py8bgbc.jpg) + +你收到的许多文件都是 PDF 格式的。有时这些 PDF 需要进行处理。例如,可能需要删除或添加页面,或者你可能需要签署或修改一个特定的页面。 不管是好是坏,这就是我们所处的现实。 @@ -23,7 +25,7 @@ 在 Linux 上,你可以用你的包管理器(如 `apt` 或 `dnf`)来安装 `qpdf` 和 `poppler-utils`。比如在 Fedora 上: ``` -`$ sudo dnf install qpdf poppler-utils` +$ sudo dnf install qpdf poppler-utils ``` 在 macOS 上,使用 [MacPorts][2] 或 [Homebrew][3]。在 Windows 上,使用 [Chocolatey][4]。 @@ -33,31 +35,27 @@ `qpdf` 命令可以做很多事情,但我主要用它来: 1. 将一个 PDF 分割成不同的页面 - 2. 将 PDF 文件合并成一个文件 - - + 2. 将多个 PDF 文件合并成一个文件 要将一个 PDF 分割成不同的页面: - ``` -`qpdf --split-pages original.pdf split.pdf` +qpdf --split-pages original.pdf split.pdf ``` 这就会生成像 `split-01.pdf`、`split-02.pdf` 这样的文件。每个文件都是一个单页的 PDF 文件。 合并文件比较微妙: - ``` -`qpdf --empty concatenated.pdf --pages split-*.pdf --` +qpdf --empty concatenated.pdf --pages split-*.pdf -- ``` 这就是 `qpdf` 默认的做法。`--empty` 选项告诉 qpdf 从一个空文件开始。结尾处的两个破折号(`--`)表示没有更多的文件需要处理。这是一个参数反映内部模型的例子,而不是人们使用它的目的,但至少它能运行并产生有效的 PDF! ### poppler-utils -这个软件包包含几个工具,但我用得最多的是 [pdftoppm][5],它把 PDF 文件转换为可移植的像素图(`ppm`)文件。我通常在用 `qpdf`分割页面后使用它,并需要将特定页面转换为我可以修改的图像。`ppm` 格式并不为人所知,但重要的是大多数图像处理方法,包括 [ImageMagick][6]、[Pillow][7] 等,都可以使用它。这些工具中的大多数也可以将文件保存为 PDF。 +这个软件包包含几个工具,但我用得最多的是 [pdftoppm][5],它把 PDF 文件转换为可移植的像素图(`ppm`)文件。我通常在用 `qpdf` 分割页面后使用它,并需要将特定页面转换为我可以修改的图像。`ppm` 格式并不为人所知,但重要的是大多数图像处理方法,包括 [ImageMagick][6]、[Pillow][7] 等,都可以使用它。这些工具中的大多数也可以将文件保存为 PDF。 ### 工作流程 @@ -68,11 +66,9 @@ * 根据需要修改图像,并将其保存为 PDF。 * 使用 `qpdf` 将各页合并成一个 PDF。 - - ### 其他工具 -有许多很好的开源命令来处理 PDF,无论你是[缩小它们][8]、[从文本文件创建它们][9]、[转换文档][10],还是尽力[完全避免它们][11]。你最喜欢的开源 PDF 工具是什么?请在评论中分享它们。 +有许多很好的开源命令来处理 PDF,无论你是 [缩小它们][8]、[从文本文件创建它们][9]、[转换文档][10],还是尽量 [完全避免它们][11]。你最喜欢的开源 PDF 工具是什么?请在评论中分享它们。 -------------------------------------------------------------------------------- @@ -81,7 +77,7 @@ via: https://opensource.com/article/21/7/qpdf-command-line 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 91f331312474094e6dc2fbac63de9f40fa03a627 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Jul 2021 09:33:49 +0800 Subject: [PATCH 427/870] PRF&PUB --- .../20210706 Edit PDFs on the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210706 Edit PDFs on the Linux command line.md (98%) diff --git a/translated/tech/20210706 Edit PDFs on the Linux command line.md b/published/20210706 Edit PDFs on the Linux command line.md similarity index 98% rename from translated/tech/20210706 Edit PDFs on the Linux command line.md rename to published/20210706 Edit PDFs on the Linux command line.md index 3b32489d33..d0b985bf79 100644 --- a/translated/tech/20210706 Edit PDFs on the Linux command line.md +++ b/published/20210706 Edit PDFs on the Linux command line.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13581-1.html) 在 Linux 命令行上编辑 PDF ====== From 3b2ff6a695408aa319200266cef9dedb8789423b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Jul 2021 09:48:32 +0800 Subject: [PATCH 428/870] PRF&PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi @turbokernel 感谢参与校对 https://linux.cn/article-13582-1.html --- ...ate passwords on the Linux command line.md | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) rename {translated/tech => published}/20210707 Generate passwords on the Linux command line.md (74%) diff --git a/translated/tech/20210707 Generate passwords on the Linux command line.md b/published/20210707 Generate passwords on the Linux command line.md similarity index 74% rename from translated/tech/20210707 Generate passwords on the Linux command line.md rename to published/20210707 Generate passwords on the Linux command line.md index 58f0d4dbd3..492c39b954 100644 --- a/translated/tech/20210707 Generate passwords on the Linux command line.md +++ b/published/20210707 Generate passwords on the Linux command line.md @@ -4,38 +4,38 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (turbokernel) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13582-1.html) 在 Linux 命令行中生成密码 ====== -在命令行上创建符合特定规范的密码。 -![Password lock][1] -大多数网站或应用都要求用户创建带有安全密码的账户,以便他们能够迎合用户体验。虽然这有利网站开发者,但肯定不会让用户的生活更轻松。 +> 在命令行上创建符合特定规范的密码。 + +![](https://img.linux.net.cn/data/attachment/album/202107/15/094657l4l494c0080u2ca4.jpg) + +大多数网站或应用都要求用户创建带有安全密码的账户,以便他们能够迎合用户体验。虽然这有利于网站开发者,但肯定不会让用户的生活更轻松。 有时,创建密码的规则是如此严格,以至于难以生成一个强壮且合规的组合。如果有一个工具可以生成符合网站或应用程序要求的任何规则的安全密码,那就容易多了。 -这就是 pwgen 的用武之地。根据它的[手册页][2]:“pwgen 生成的密码在设计上很容易被人类记住,同时又尽可能的安全。” 它返回多个符合你所提供的规则的密码选项,这样你就可以选择一个你喜欢的(而且可能更容易记住)。 +这就是 `pwgen` 的用武之地。根据它的 [手册页][2]:“pwgen 生成的密码是为了让人容易记住,同时又尽可能的安全。” 它返回符合你所提供的规则的多个密码选项,这样你就可以选择一个你喜欢的(而且可能更容易记住)。 ### 安装 pwgen -在 Linux 上,你可以通过包管理器安装 pwgen。例如,在 Fedora 上: - +在 Linux 上,你可以通过包管理器安装 `pwgen`。例如,在 Fedora 上: ``` -`$ sudo dnf install pwgen` +$ sudo dnf install pwgen ``` -在 macOS 上,使用 [MacPorts][3] 或 [Homebrew][4]。在 Windows 上,使用 [Chocolatey][5]。 +在 macOS 上,可以使用 [MacPorts][3] 或 [Homebrew][4]。在 Windows 上,可以使用 [Chocolatey][5]。 ### 使用 pwgen 生成密码 -有几种方式可以通过向 pwgen 传递参数来生成密码,这取决于你所需的参数。这里有一些例子。更多的参数选项请查阅手册页。 +有几种方式可以通过向 `pwgen` 传递参数来生成密码,这取决于你所需的参数。这里有一些例子。更多的参数选项请查阅手册页。 如果你需要一个安全的、难以记忆的特定长度的密码,请运行 `pwgen --secure`(或简写 `-s`),后面跟上你所需的密码长度: - ``` $ pwgen -s 25 pnFBg9jB8AlKL3feOuS2ZwMGb xlmDRoaLssduXTdGV6jkQhUGY O3IUB3CH7ry2kD4ZrSoODzWez @@ -54,25 +54,23 @@ gLmYUTp0XZJWvIVbA5rFvBT54 LEm6QVeTMinc056DC9c4V55cV ipV45Ewj704365byKhY8zn766 运行 `pwgen -symbols`(或简写 `-y`),再加上所需的密码长度,生成包含特殊字符的密码: - ``` $ pwgen -y 25 Osh0chahxe0won9aech4ese?v pemoh2ohm9aim;iu4Eiy"ah0y Taiqu;o2aeSh+o4aedoagait3 Vei;phoh5owai5jui+t|ei3ot teu!w7mahxoh0Po7ohph8Iez6 quie#phooCeu2lohm5shaPaer -eTh5AechaexieToh9ez5eeZ;e nuloh1ico0Nool:eG<aiv`ah, Heeghuo8ahzii1Iep~ie_ch7p +eTh5AechaexieToh9ez5eeZ;e nuloh1ico0Nool:eGaig@ae9No OVahh2OhNgahtu8iethaR@i7o ouFai8ahP@eil4Ieh5le5ipu5 eeT4tahW0ieng9fe?i5auM3ie seet0ohc4aiJei]koiGha2zu% iuh@oh4eix0Vuphi?o,hei9me loh0Aeph=eix(ohghe6chee3z ahgh2eifiew8dahG_aeph8woo oe!B4iasaeHo`ungie3taekoh -cei!c<ung&u,shee6eir7Eigo va6phou8ooYuoquohghi-n6Qu eeph4ni\chi2shohg3Die1hia +cei!c Date: Thu, 15 Jul 2021 14:00:02 +0800 Subject: [PATCH 429/870] apply for translating 'sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md' --- ...07 An advanced guide to NLP analysis with Python and NLTK.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md index 2f6c16a085..802560422a 100644 --- a/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md +++ b/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tanloong) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e95bf91c6f7d399c065a0b28ae3e044889154c43 Mon Sep 17 00:00:00 2001 From: lcf33 Date: Thu, 15 Jul 2021 15:43:33 +0800 Subject: [PATCH 430/870] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E8=AF=B7=20?= =?UTF-8?q?Linux=20Mint=2020.2=20is=20Now=20Available=20With=20New=20Featu?= =?UTF-8?q?res=20and=20Tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ux Mint 20.2 is Now Available With New Features and Tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md b/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md index acc1bb5c56..d7af8412af 100644 --- a/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md +++ b/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/linux-mint-20-2-release/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lcf33) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 08ba0ee142e7a29909fb7f043673de5813aa99db Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Thu, 15 Jul 2021 17:03:25 +0800 Subject: [PATCH 431/870] Update 20210708 Write good examples by starting with real code.md --- ...ood examples by starting with real code.md | 76 +++++++++---------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/sources/tech/20210708 Write good examples by starting with real code.md b/sources/tech/20210708 Write good examples by starting with real code.md index e3ac4f7d7e..cb38d95fad 100644 --- a/sources/tech/20210708 Write good examples by starting with real code.md +++ b/sources/tech/20210708 Write good examples by starting with real code.md @@ -1,85 +1,83 @@ -[#]: subject: (Write good examples by starting with real code) -[#]: via: (https://jvns.ca/blog/2021/07/08/writing-great-examples/) -[#]: author: (Julia Evans https://jvns.ca/) -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Write good examples by starting with real code" +[#]: via: "https://jvns.ca/blog/2021/07/08/writing-great-examples/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " -Write good examples by starting with real code +从实际代码开始编写好的示例 ====== -When I write about programming, I spend a lot of time trying to come up with good examples. I haven’t seen a lot written about how to make examples, so here’s a little bit about my approach to writing examples! +当我写关于编程的事情时,我花费了大量时间在生产好的示例上。我从未见过有人写过关于如何写出好的示例,所以我就写了一下如何写出一份好的示例。 -The basic idea here is to start with real code that you wrote and then remove irrelevant details to make it into a self-contained example instead of coming up with examples out of thin air. +最基础的就是你真的去写代码,然后删除不相关的细节,使其成为一个自成一体的例子,而不是无中生有地想出一些例子。 -I’ll talk about two kinds of examples: realistic examples and suprising examples. +我将会谈论两种示例:实例和令人惊讶的例子 -### good examples are realistic +### 好的示例是真实的 -To see why examples should be realistic, let’s first talk about an unrealistic example! Let’s say we’re trying to explain Python lambdas (which is just the first concept I thought of). You could give this example, of using `map` and a lambda to double a set of numbers. +为了说明为什么好的案例应该是真实的,我们就先讨论一个不真实的案例。假设我们在试图解释 Python 的 lambda 函数(这只是我想到的第一个概念)。你可以举一个例子,使用 `map` 和 lambda 来让一组数字变为原先的两倍。 ``` numbers = [1, 2, 3, 4] squares = map(lambda x: x * x, numbers) ``` -I think this example is unrealistic for a couple of reasons: +我觉得这个示例是不真实的,有两方面的原因: - * squaring a set of numbers isn’t something you’re super likely to do in a real program unless it’s for Project Euler or something (there are LOTS of operations on lists that are a lot more likely) - * This usage of `map` is not idiomatic Python, even if you were doing this I would write `[x*x for x in numbers]` instead + * 将一组数字作平方运算不是你想要在真正的程序中完成的事,除非是项目 Euler 或某种东西(也有很多其它的更有可能的操作系统) + * `map` 在 Python 中并不是很常用,即便是做这个我也更愿意写 `[x*x for x in numbers]` - - -A more realistic example of Python lambdas is using them with `sort`, like this; +一个更加真实的 Python lambdas 的示例是使用 `sort` 函数,就像这样: ``` children = [{"name": "ashwin", "age": 12}, {"name": "radhika", "age": 3}] sorted_children = sorted(children, key=lambda x: x['age']) ``` -But this example is still pretty contrived (why exactly do we need to sort these children by age?). So how do we actually make realistic examples? +但是这个示例是被精心设计的(为什么我们需要按照年龄对这些孩子进行排序呢?)。所以我们如何来做一个真实的示例呢? -### how to make your examples realistic: look at actual code you wrote +### 如何让你的示例真实起来:看你写实际代码 -I think the easiest way to make realistic examples is, instead of pulling an example out of thin air (like I did with that `children` example), instead just start by looking at real code! +我认为最简单的来生成一个例子的方法就是,不是凭空出现一个例子(就像我用那个`儿童`的例子),而只是从看真正的代码开始! -For example, if I grep a bunch of Python code I wrote for `sort.+key`, I find LOTS of real examples of me sorting a list by some criterion, like: +举一个例子吧,如果我要用 `sort.+key` 来编写一串 Python 代码,我会发现很多我按某个标准对列表进行排序的真实例子,例如: * `tasks.sort(key=lambda task: task['completed_time'])` * `emails = reversed(sorted(emails, key=lambda x:x['receivedAt']))` * `sorted_keysizes = sorted(scores.keys(), key=scores.get)` * `shows = sorted(dates[date], key=lambda x: x['time']['performanceTime'])` +在这里很容易看到一个规律——这些大都是按时间排序的!因此,您可以明白如何轻松地将按时间排序的某些对象(电子邮件、事件等)的简单实例放在一起。 +### 现实的例子有助于"推销"你试图解释的概念 -It’s pretty easy to see a pattern here – a lot of these are sorting by time! So you can see how you could easily put together a simple realistic example of sorting some objects (emails, events, etc) by time. +当我试图去解释一个想法(就好比 Python Lambdas)的时候,我通常也会试图说服读者,说这是值得学习的想法。Python lambdas 是如此的有用!当我去试图说服某个人 lambdas 是很好用的时候,让他想象一下 lambdas 如何帮助他们完成一项他们将要去做的任务或是以及一项他们以前做过的任务,对说服他会很有帮助。 -### realistic examples help “sell” the concept you’re trying to explain - -When I’m trying to explain an idea (like Python lambdas), I’m usually also trying to convince the reader that it’s worth learning! Python lambdas are super useful! And to convince someone that lambdas are useful, it really helps to show someone how lambdas could help them do a task that they could actually imagine themselves doing, and ideally a task that they’ve done before. - -### distilling down examples from real code can take a long time +### 从真实代码中提炼出示例可能需要很长时间 The example I just gave of explaining how to use `sort` with `lambda` is pretty simple and it didn’t take me a long time to come up with, but turning real code into a standalone example can take a really long time! -For example, I was thinking of including an example of some weird CSS behaviour in this post to illustrate how it’s fun to create examples with weird or surprising behaviour. I spent 2 hours taking a real problem I had this week, making sure I understood what was actually happening with the CSS, and making it into a minimal example. +我给出的解释如何使用 `lambda` 和 `sort` 函数的例子是十分简单的,它并不需要花费我很长时间来想出来,但是将真实的代码化为一个独立的示例则是会需要花费很长的时间 -In the end it “just” took [5 lines of HTML and a tiny bit of CSS][1] to demonstrate the problem and it doesn’t really look like it took hours to write. But originally it was hundreds of lines of JS/CSS/JavaScript, and it takes time to untangle all that and come up with something small that gets at the heart of the issue! +举个例子,我想在这篇文章中融入一些奇怪的 CSS 行为的例子来说明创造一个怪异或令人惊讶的案例是十分有趣的。我花费了两个小时来解决我这周遇到的一个实际的问题,确保我理解 CSS 的实际情况,并将其变成一个迷你的示例。 -But I think it’s worth it to take the time to make examples really clear and minimal – if hundreds of people are reading your example, you’re saving them all so much time! +最后,它“仅仅”用了[五行 HTML 和一点点的 CSS][1] 来说明了这个问题,看起来并不想是我花费了好多小时写出来的。但是最初它却是几百行的 JS/CSS/JavaScript,它需要花费很长时间来将所有的代码化为核心的很少的代码。 -### that’s all for now! +但我认为花点时间把示例讲得非常简单明了是值得的——如果有成百上千的人在读你的示例,你就节省了他们这么多时间! -I think there’s a lot more to say about examples – for instance I think there are a few different types of useful examples, like: +### 就这么多了! - * examples that are surprising to the reader, which are more about changing someone’s mental model than providing code to use directly - * examples that are easy to copy and paste to use as a starting point +我觉得关于示例还有更多可以去讲的——我觉得还有几个不同类型的有用示例,例如 + + * 可以更多的改变人的思维而不是直接提供使用的代码的让读者感到惊喜的示例 + * 易于复制粘贴以用作起点的示例 -but maybe I’ll write about that another day :) +也许有一天我还会再写一些呢? :) -------------------------------------------------------------------------------- @@ -87,7 +85,7 @@ via: https://jvns.ca/blog/2021/07/08/writing-great-examples/ 作者:[Julia Evans][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zepoch](https://github.com/zepoch) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d80468b2025fb5612f1e0fbcbeb138df81e5ba7b Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Thu, 15 Jul 2021 17:05:31 +0800 Subject: [PATCH 432/870] Rename sources/tech/20210708 Write good examples by starting with real code.md to translated/tech/20210708 Write good examples by starting with real code.md --- .../20210708 Write good examples by starting with real code.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210708 Write good examples by starting with real code.md (100%) diff --git a/sources/tech/20210708 Write good examples by starting with real code.md b/translated/tech/20210708 Write good examples by starting with real code.md similarity index 100% rename from sources/tech/20210708 Write good examples by starting with real code.md rename to translated/tech/20210708 Write good examples by starting with real code.md From 849af282e2cb9cc22b853851daf8065f119cc020 Mon Sep 17 00:00:00 2001 From: lcf33 Date: Thu, 15 Jul 2021 17:26:48 +0800 Subject: [PATCH 433/870] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=20Linux=20M?= =?UTF-8?q?int=2020.2=20is=20Now=20Available=20With=20New=20Features=20and?= =?UTF-8?q?=20Tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w Available With New Features and Tools.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md diff --git a/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md b/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md new file mode 100644 index 0000000000..2e1adbd47e --- /dev/null +++ b/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md @@ -0,0 +1,91 @@ +[#]: subject: (Linux Mint 20.2 is Now Available With New Features and Tools) +[#]: via: (https://news.itsfoss.com/linux-mint-20-2-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (lcf33) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +包含新功能和工具的Linux Mint 20.2 已经发布。 +====== + +几周前,Linux Mint 20.2 beta版[发布][1]了。现在,Linux Mint 20.2 最终稳定版也发布了。 + +这个版本是基于Ubuntu 20.04 的LTS(长期支持版本),支持2025年截止。 + +来看下这个版本有什么新特性,以及如何获取它。 + +### Linux Mint 20.2: 有什么新特性? + +这个版本主要两点是增加了更新通知。该功能鼓励用户更新系统,以确保安全性。 + +该功能不像[Windows系统那样强制更新][2],但它会留意你多久没有更新系统,检查系统运行时间,然后提醒你更新。 +![][3] + +更棒的是,你可以配置更新通知。 + +其他主要升级还有:桌面环境**Cinnamon 5**,新的**批量改名工具**Bulky,**用Sticky Notes取代GNote**作为默认笔记应用。 +![][4] + +批量文件改名工具可以在所有桌面版本,但不包括Xfce。因为Xfce默认文件管理器(Thunar)已经有该功能(批量文件改名)。 + +Cinnamon 5不是很让人激动,不过有一些内在性能改进,并增加了限制内存使用的选项。 +![][5] + +Sticky Notes 是用GTK 3开发的,支持HiDPI,并提供了更多的功能。同时,与系统托盘整合得更好。 +![][6] + +### 其他改进 + +在网络上共享文件的[Warpinator应用程序][7]得到了一些升级,变得更有用。 + +其他桌面环境的升级包括Xfce 4.16和MATE 1.24。除此之外,你还会发现一些细微的UI改进和错误修复。 + +特别是解决了NVIDIA显卡**对混合图形的支持**的问题,这对笔记本电脑用户来说是个好消息。 + +要了解更多变更详情,你可以参考任一桌面版本的[官方公告][8]。 + +### 下载或升级至Linux Mint 20.2 + +你可以直接在官方网站[下载页面][9]找到稳定版本。 +[Download Linux Mint 20.2][9] + +如果已经安装了Linux Mint 20 或者 20.1。你可以先检查所有可用更新,然后更新管理器会收到更新。 + +接下来,确保你做了备份(如果你想的话,可以使用timeshift工具),然后从**编辑**菜单种静茹更新管理器的系统升级选项,如下所示。 +![][10] + +当你单击后,屏幕上会出现升级的提示。你也可以通过[官方升级说明][11]获得进一步帮助。 + +_你完成升级了吗?你对最新版本有什么看法?欢迎在下面的平路种分享你的想法。_ + +#### 大型科技网站It's FOSS需要你,获得数百万收入 + +如果你喜欢我们It's FOSS网站,请考虑捐款支持我们的独立出版物。您的支持将帮助我们继续出版专注于桌面Linux和开源软件的内容。 + +我不感兴趣。 +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-mint-20-2-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/lcf33) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-mint-20-2-beta-release/ +[2]: https://news.itsfoss.com/linux-mint-updates-notice/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2MCIgd2lkdGg9IjQ5NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9IjU3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://news.itsfoss.com/warpinator-android-app/ +[8]: https://blog.linuxmint.com/?p=4102 +[9]: https://linuxmint.com/download.php +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2MCIgd2lkdGg9IjUzMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[11]: https://blog.linuxmint.com/?p=4111 From fd04bbcd9471b20dfd6bc1dac0d42f6cdbd2994d Mon Sep 17 00:00:00 2001 From: lcf33 Date: Thu, 15 Jul 2021 17:52:13 +0800 Subject: [PATCH 434/870] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?Linux=20Mint=2020.2=20is=20Now=20Available=20With=20New=20Featu?= =?UTF-8?q?res=20and=20Tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w Available With New Features and Tools.md | 98 ------------------- 1 file changed, 98 deletions(-) delete mode 100644 sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md diff --git a/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md b/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md deleted file mode 100644 index d7af8412af..0000000000 --- a/sources/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: subject: (Linux Mint 20.2 is Now Available With New Features and Tools) -[#]: via: (https://news.itsfoss.com/linux-mint-20-2-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (lcf33) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Linux Mint 20.2 is Now Available With New Features and Tools -====== - -Linux Mint 20.2 beta [arrived][1] a few weeks ago. And now, the final stable release for Linux Mint 20.2 is here. - -This release is an LTS upgrade based on Ubuntu 20.04 that is supported until 2025. - -Let us take a quick look at what’s new with this release and how do you get it. - -### Linux Mint 20.2: What’s New? - -The key highlight of this release is the addition of update notification, which should encourage more users to keep their systems up-to-date to ensure best security. - -It will [not force updates like Windows][2], but it will keep an eye out for how long you don’t apply updates, check system’s uptime, and then prompt you with an update reminder notification. - -![][3] - -You also get to configure the update notifications, which is great. - -Other major upgrades include **Cinnamon 5** desktop environment, a new bulk **file renaming tool** (Bulky), and **Sticky Notes replacing GNote** as the default note application. - -![][4] - -The file renaming tool is available for all the desktop editions, excluding Xfce, because its default file manager (Thunar) already supports the feature. - -Cinnamon 5 is not exactly exciting, but there are some under-the-hood improvements to its performance and nice little option to limit its RAM usage. - -![][5] - -And Sticky Notes is developed in GTK 3, supports HiDPI and offers more features, along with better integration with the system tray. - -![][6] - -### Other Improvements - -[Warpinator app][7] to share files across a network has received some upgrades making it more useful. - -Other desktop environment upgrades include Xfce 4.16 and MATE 1.24. In addition to that, you will find certain subtle UI improvements and several bug fixes. - -Especially addressing issues with NVIDIA graphics, along with the **support for hybrid graphics**, great news for Laptop users! - -To know more about some of the detailed changes, you can refer to the [official announcement][8] for one of the desktop editions. - -### Download or Upgrade to Linux Mint 20.2 - -You can find the stable releases directly from the official website’s [download page][9]. - -[Download Linux Mint 20.2][9] - -If you have Linux Mint 20 or 20.1 installed, you can choose to first apply all the available updates and then an update to your Update Manager. - -Next, make sure that you have a backup (use timeshift if you want) and then head to the Update Manager’s System Upgrade option from the **Edit** menu as shown below. - -![][10] - -When you click on it, you will be greeted with the on-screen instructions to go ahead with the upgrade. You may also refer to the [official upgrade instructions][11] for further help. - -_Have you upgraded yet? What do you think about the latest release? Feel free to share your thoughts in the comments down below._ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/linux-mint-20-2-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/linux-mint-20-2-beta-release/ -[2]: https://news.itsfoss.com/linux-mint-updates-notice/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2MCIgd2lkdGg9IjQ5NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9IjU3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://news.itsfoss.com/warpinator-android-app/ -[8]: https://blog.linuxmint.com/?p=4102 -[9]: https://linuxmint.com/download.php -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2MCIgd2lkdGg9IjUzMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[11]: https://blog.linuxmint.com/?p=4111 From 8fb59aa23f073dcf475985740c92794d4bae9f10 Mon Sep 17 00:00:00 2001 From: SamMa Date: Thu, 15 Jul 2021 22:06:01 +0800 Subject: [PATCH 435/870] Update 20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md --- ...ntOS, RHEL, Rocky Linux Minimal Install.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md b/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md index 27586d5ee5..2a1c1ff6f9 100644 --- a/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md +++ b/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md @@ -3,19 +3,19 @@ [#]: author: (Arindam https://www.debugpoint.com/author/admin1/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (turbokernel) [#]: publisher: ( ) [#]: url: ( ) 如何在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网 ====== -在最小安装的服务器中,设置互联网或网络是非常容易的。在本指南中,我们将解释如何在 CentOS、RHEL、Rocky Linux 最小安装中设置互联网或网络。 +在最小化服务器安装中,设置互联网或网络是非常容易的。在本指南中,我们将解释如何在 CentOS、RHEL、Rocky Linux 最小安装中设置互联网或网络。 -当你安装了任何服务器发行版的最小安装,你就没有任何 GUI 或桌面环境来设置你的网络或互联网。因此,当你只能使用终端时,知道如何设置互联网是很重要的。NetworkManager 工具提供了必要的工具和 systemd 服务来完成这项工作。以下是具体方法。 +当你初次完成最小化任何服务器发行版安装时,你没有任何图形界面或桌面环境用于设置你的网络或互联网。因此,当你只能使用终端时,了解如何设置联网是很重要的。NetworkManager 以及 systemd 服务为完成这项工作提供了必要的工具。以下是具体使用方法。 ### 在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网 - * 完成安装后,启动服务器终端。理想情况下,你应该会看到提示。使用 root 或 admin 账户登录。 + * 完成安装后,启动服务器终端。理想情况下,你应该会看到提示符。使用 root 或 admin 账户登录。 * 然后,首先尝试使用 nmcli 检查网络接口的状态和细节。nmcli 是一个控制 NetworkManager 服务的命令行工具。使用以下命令进行检查。 @@ -30,7 +30,7 @@ nmcli device status ![nmcli device status][1] - * 运行工具 `nmtui` 来配置网络接口。[nmtui][2] 是 NetworkManager 工具的一部分,它为你提供了一个漂亮的用户界面来配置网络。这是 NetworkManager-tui 包的一部分,当你完成最小服务器的安装后,它应该默认安装。 + * 运行工具 `nmtui` 来配置网络接口。[nmtui][2] 是 NetworkManager 工具的一部分,它为你提供了一个漂亮的用户界面来配置网络。这是 NetworkManager-tui 包的一部分,当你完成最小服务器的安装时它应该默认安装。 @@ -44,7 +44,7 @@ nmtui ![nmtui – Select options][3] - * 选择接口名称 + * 选择网口名称 @@ -56,7 +56,7 @@ nmtui ![nmtui – Edit Connection][5] - * 使用下面的命令,通过 [systemd systemctl][6] 重新启动 NetworkManager 服务。 + * 通过使用如下 [systemd systemctl][6] 命令,重新启动 NetworkManager 服务。 @@ -64,15 +64,15 @@ nmtui systemctl restart NetworkManager ``` - * 如果一切顺利,你应该在 CentOS、RHEL、Rocky Linux 服务器的最小安装中连接到网络和互联网。前提是你的网络有互联网连接。你可以用 ping 来验证它是否正常。 + * 如果一切顺利,你应该在 CentOS、RHEL、Rocky Linux 服务器的最小化安装中连接到网络和互联网。前提是你的网络有互联网连接。你可以用 ping 来验证它是否正常。 ![setup internet minimal server – CentOS Rocky Linux RHEL][7] -### 额外技巧:在最小服务器中设置静态 IP +### 额外技巧:在最小化服务器中设置静态 IP -当你把网络配置设置为自动,当你连接到互联网时,接口会动态地分配 IP。在某些情况下,当你建立一个局域网 (LAN) 时,你可能想给你的网络接口分配静态 IP。这超级简单。 +当你把网络配置设置为自动,当你连接到互联网时,网口会动态地分配 IP。在某些情况下,当你建立一个局域网 (LAN) 时,你可能想给你的网口分配静态 IP。这超级简单。 打开你的网络的网络配置脚本。根据你的设备修改高亮部分。 @@ -94,7 +94,7 @@ HOSTNAME=debugpoint GATEWAY=10.1.1.1 ``` -在位于 `/etc/resolv.conf` 的 resolv.conf 中添加任意公共 DNS 服务器。 +在 `/etc/resolv.conf` 的 resolv.conf 中添加任意公共 DNS 服务器。 nameserver 8.8.8.8 nameserver 8.8.4.4 @@ -105,9 +105,9 @@ nameserver 8.8.4.4 systemctl restart NetworkManager ``` -这样就完成了静态 IP 的设置。你也可以使用 `ip addr` 命令检查 IP 的详细信息。 +这样就完成了静态 IP 的设置。你也可以使用 `ip addr` 命令检查详细的 IP 信息。 -我希望这个指南能帮助你在你的最小服务器中设置网络、互联网和静态 IP。如果你有任何问题,请在评论区告诉我。 +我希望这个指南能帮助你在你的最小化服务器中设置网络、互联网和静态 IP。如果你有任何问题,请在评论区告诉我。 * * * @@ -118,7 +118,7 @@ via: https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/ 作者:[Arindam][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[校对者ID](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 182a87cde569c58ad2d59385d0146cbfc1833aea Mon Sep 17 00:00:00 2001 From: SamMa Date: Thu, 15 Jul 2021 22:25:16 +0800 Subject: [PATCH 436/870] Update 20210708 Encrypt and decrypt files with a passphrase on Linux.md --- ...ecrypt files with a passphrase on Linux.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md b/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md index 21deea9522..f8473cea6d 100644 --- a/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md +++ b/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md @@ -3,7 +3,7 @@ [#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (turbokernel) [#]: publisher: ( ) [#]: url: ( ) @@ -12,26 +12,26 @@ age 是一个简单的、易于使用的工具,允许你用一个密码来加密和解密文件。 ![Scissors cutting open access to files][1] -长期以来,保护文件和敏感文档的加密和安全一直是用户关心的问题。即使我们越来越多的数据被存放在网站和云服务上,并由带有越来越安全和具有挑战性的密码的用户账户来保护,但能够在我们自己的文件系统中存储敏感数据仍有很大的价值,特别是当我们能够快速和容易地加密这些数据时。 +文件的保护和敏感文档的安全加密是用户长期以来关心的问题。即使越来越多的数据被存放在网站和云服务上,并由带有越来越安全和高强度密码的用户账户来保护,但我们能够在自己的文件系统中存储敏感数据仍有很大的价值,特别是我们能够快速和容易地加密这些数据时。 -[age][2] 能让你这样做。它是一个小型的、易于使用的工具,允许你用一个密码加密一个文件,并根据需要解密。 +[age][2] 能帮你这样做。它是一个小型且易于使用的工具,允许你用一个密码加密一个文件,并根据需要解密。 ### 安装 age -age 可以在大多数 Linux 软件库中[安装][3]。 +age 可以在众多 Linux 软件库中[安装][3]。 -要在 Fedora 上安装它: +在 Fedora 上安装它: ``` `$ sudo dnf install age -y` ``` -在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。在 Windows 上,使用 [Chocolatey][6]。 +在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5] 来安装。在 Windows 上,使用 [Chocolatey][6] 来安装。 ### 用 age 加密和解密文件 -age 可以用公钥或用户设置的密码来加密和解密文件。 +age 可以用公钥或用户自定义密码来加密和解密文件。 #### 在 age 中使用公钥 @@ -52,22 +52,22 @@ Public key: age16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 `$ touch mypasswds.txt | age -r ageage16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 > mypass.tar.gz.age` ``` -在这个例子中,文件 `mypasswds.txt` 被我生成的公钥加密,放在一个叫做 `mypass.tar.gz.age` 的加密文件中。 +在这个例子中,文件 `mypasswds.txt` 被我使用生成的公钥加密,放保存在名为 `mypass.tar.gz.age` 的加密文件中。 ### 用公钥解密 -要解密你所保护的信息,使用 `age` 命令和 `--decrypt` 选项: +如需解密加密文件,使用 `age` 命令和 `--decrypt` 选项: ``` `$ age --decrypt -i key.txt -o mypass.tar.gz mypass.tar.gz.age` ``` -在这个例子中,age 使用存储在 `key.text` 中的密钥,并解密了我在上一步创建的文件。 +在这个例子中,age 使用存储在 `key.text` 中的密钥,并解密了我在上一步创建的加密文件。 ### 使用密码加密 -在没有公开密钥的情况下对文件进行加密被称为对称加密。它允许用户设置密码来加密和解密一个文件。要做到这一点: +不使用公钥的情况下对文件进行加密被称为对称加密。它允许用户设置密码来加密和解密一个文件。要做到这一点: ``` @@ -76,22 +76,22 @@ Enter passphrase (leave empty to autogenerate a secure one): Confirm passphrase: ``` -在这个例子中,age 提示你输入一个密码,它用这个密码对输入文件 `mypasswd.txt` 进行加密,并生成文件 `mypasswd-encrypted.txt`。 +在这个例子中,age 提示你输入一个密码,它将通过这个密码对输入文件 `mypasswd.txt` 进行加密,并生成加密文件 `mypasswd-encrypted.txt`。 ### 使用密码解密 -要解密一个用密码加密的文件,可以使用 `age` 命令和 `--decrypt` 选项: +如需将用密码加密的文件解密,可以使用 `age` 命令和 `--decrypt` 选项: ``` `$ age --decrypt --output passwd-decrypt.txt mypasswd-encrypted.txt` ``` -在这个例子中,age 提示你输入密码,然后将 `mypasswd-encrypted.txt` 文件的内容解密为 `passwd-decrypt.txt`,只要你提供的密码与加密时设置的密码一致。 +在这个例子中,age 提示你输入密码,只要你提供的密码与加密时设置的密码一致,age 随后将 `mypasswd-encrypted.txt` 加密文件的内容解密为 `passwd-decrypt.txt`。 ### 不要丢失你的密钥 -无论你是使用密码加密还是公钥加密,你都_不能_丢失加密数据的凭证。根据设计,如果没有用于加密的密钥,用 age 加密的文件是不能被解密的。所以,请备份你的公钥,并记住这些密码! +无论你是使用密码加密还是公钥加密,你都_不能_丢失加密数据的凭证。根据设计,如果没有用于加密的密钥,通过 age 加密的文件是不能被解密的。所以,请备份你的公钥,并记住这些密码! ### 轻松实现加密 @@ -104,7 +104,7 @@ via: https://opensource.com/article/21/7/linux-age 作者:[Sumantro Mukherjee][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[校对者ID](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d8a0935527fe799efa2eaf7def8f6292b7e4a4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E9=BE=99?= <2638000368@qq.com> Date: Fri, 16 Jul 2021 01:27:19 +0800 Subject: [PATCH 437/870] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E5=B9=B6=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87=20'An=20advanced?= =?UTF-8?q?=20guide=20to=20NLP=20analysis=20with=20Python=20and=20NLTK'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...de to NLP analysis with Python and NLTK.md | 542 ----------------- ...de to NLP analysis with Python and NLTK.md | 572 ++++++++++++++++++ 2 files changed, 572 insertions(+), 542 deletions(-) delete mode 100644 sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md create mode 100644 translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md diff --git a/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md deleted file mode 100644 index 802560422a..0000000000 --- a/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md +++ /dev/null @@ -1,542 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tanloong) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (An advanced guide to NLP analysis with Python and NLTK) -[#]: via: (https://opensource.com/article/20/8/nlp-python-nltk) -[#]: author: (Girish Managoli https://opensource.com/users/gammay) - -An advanced guide to NLP analysis with Python and NLTK -====== -Get deeper into the foundational concepts behind natural language -processing. -![Brain on a computer screen][1] - -In my [previous article][2], I introduced natural language processing (NLP) and the Natural Language Toolkit ([NLTK][3]), the NLP toolkit created at the University of Pennsylvania. I demonstrated how to parse text and define stopwords in Python and introduced the concept of a corpus, a dataset of text that aids in text processing with out-of-the-box data. In this article, I'll continue utilizing datasets to compare and analyze natural language. - -The fundamental building blocks covered in this article are: - - * WordNet and synsets - * Similarity comparison - * Tree and treebank - * Named entity recognition - - - -### WordNet and synsets - -[WordNet][4] is a large lexical database corpus in NLTK. WordNet maintains cognitive synonyms (commonly called synsets) of words correlated by nouns, verbs, adjectives, adverbs, synonyms, antonyms, and more. - -WordNet is a very useful tool for text analysis. It is available for many languages (Chinese, English, Japanese, Russian, Spanish, and more), under many licenses (ranging from open source to commercial). The first WordNet was created by Princeton University for English under an MIT-like license. - -A word is typically associated with multiple synsets based on its meanings and parts of speech. Each synset usually provides these attributes: - -**Attribute** | **Definition** | **Example** ----|---|--- -Name | Name of the synset | Example: The word "code" has five synsets with names `code.n.01`, `code.n.02`, `code.n.03`, `code.v.01`, `code.v.02` -POS | Part of speech of the word for this synset | The word "code" has three synsets in noun form and two in verb form -Definition | Definition of the word (in POS) | One of the definitions of "code" in verb form is: "(computer science) the symbolic arrangement of data or instructions in a computer program" -Examples | Examples of word's use | One of the examples of "code": "We should encode the message for security reasons" -Lemmas | Other word synsets this word+POC is related to (not strictly synonyms, but can be considered so); lemmas are related to other lemmas, not to words directly | Lemmas of `code.v.02` (as in "convert ordinary language into code") are `code.v.02.encipher`, `code.v.02.cipher`, `code.v.02.cypher`, `code.v.02.encrypt`, `code.v.02.inscribe`, `code.v.02.write_in_code` -Antonyms | Opposites | Antonym of lemma `encode.v.01.encode` is `decode.v.01.decode` -Hypernym | A broad category that other words fall under | A hypernym of `code.v.01` (as in "Code the pieces with numbers so that you can identify them later") is `tag.v.01` -Meronym | A word that is part of (or subordinate to) a broad category | A meronym of "computer" is "chip" -Holonym | The relationship between a parent word and its subordinate parts | A hyponym of "window" is "computer screen" - -There are several other attributes, which you can find in the `nltk/corpus/reader/wordnet.py` source file in `/Lib/site-packages`. - -Some code may help this make more sense. - -This helper function: - - -``` -def synset_info(synset): -    print("Name", synset.name()) -    print("POS:", synset.pos()) -    print("Definition:", synset.definition()) -    print("Examples:", synset.examples()) -    print("Lemmas:", synset.lemmas()) -    print("Antonyms:", [lemma.antonyms() for lemma in synset.lemmas() if len(lemma.antonyms()) > 0]) -    print("Hypernyms:", synset.hypernyms()) -    print("Instance Hypernyms:", synset.instance_hypernyms()) -    print("Part Holonyms:", synset.part_holonyms()) -    print("Part Meronyms:", synset.part_meronyms()) -    print() - -[/code] [code]`synsets = wordnet.synsets('code')` -``` - -shows this: - - -``` -5 synsets: -Name code.n.01 -POS: n -Definition: a set of rules or principles or laws (especially written ones) -Examples: [] -Lemmas: [Lemma('code.n.01.code'), Lemma('code.n.01.codification')] -Antonyms: [] -Hypernyms: [Synset('written_communication.n.01')] -Instance Hpernyms: [] -Part Holonyms: [] -Part Meronyms: [] - -... - -Name code.n.03 -POS: n -Definition: (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions -Examples: [] -Lemmas: [Lemma('code.n.03.code'), Lemma('code.n.03.computer_code')] -Antonyms: [] -Hypernyms: [Synset('coding_system.n.01')] -Instance Hpernyms: [] -Part Holonyms: [] -Part Meronyms: [] - -... - -Name code.v.02 -POS: v -Definition: convert ordinary language into code -Examples: ['We should encode the message for security reasons'] -Lemmas: [Lemma('code.v.02.code'), Lemma('code.v.02.encipher'), Lemma('code.v.02.cipher'), Lemma('code.v.02.cypher'), Lemma('code.v.02.encrypt'), Lemma('code.v.02.inscribe'), Lemma('code.v.02.write_in_code')] -Antonyms: [] -Hypernyms: [Synset('encode.v.01')] -Instance Hpernyms: [] -Part Holonyms: [] -Part Meronyms: [] -``` - -Synsets and lemmas follow a tree structure you can visualize: - - -``` -def hypernyms(synset): -    return synset.hypernyms() - -synsets = wordnet.synsets('soccer') -for synset in synsets: -    print(synset.name() + " tree:") -    pprint(synset.tree(rel=hypernyms)) -    print() - -[/code] [code] - -code.n.01 tree: -[Synset('code.n.01'), - [Synset('written_communication.n.01'), -   ... - -code.n.02 tree: -[Synset('code.n.02'), - [Synset('coding_system.n.01'), -   ... - -code.n.03 tree: -[Synset('code.n.03'), -   ... - -code.v.01 tree: -[Synset('code.v.01'), - [Synset('tag.v.01'), -   ... - -code.v.02 tree: -[Synset('code.v.02'), - [Synset('encode.v.01'), -   ... -``` - -WordNet does not cover all words and their information (there are about 170,000 words in English today and about 155,000 in the latest version of WordNet), but it's a good starting point. After you learn the concepts of this building block, if you find it inadequate for your needs, you can migrate to another. Or, you can build your own WordNet! - -#### Try it yourself - -Using the Python libraries, download Wikipedia's page on [open source][5] and list the synsets and lemmas of all the words. - -### Similarity comparison - -Similarity comparison is a building block that identifies similarities between two pieces of text. It has many applications in search engines, chatbots, and more. - -For example, are the words "football" and "soccer" related? - - -``` -syn1 = wordnet.synsets('football') -syn2 = wordnet.synsets('soccer') - -# A word may have multiple synsets, so need to compare each synset of word1 with synset of word2 -for s1 in syn1: -    for s2 in syn2: -        print("Path similarity of: ") -        print(s1, '(', s1.pos(), ')', '[', s1.definition(), ']') -        print(s2, '(', s2.pos(), ')', '[', s2.definition(), ']') -        print("   is", s1.path_similarity(s2)) -        print() - -[/code] [code] - -Path similarity of: -Synset('football.n.01') ( n ) [ any of various games played with a ball (round or oval) in which two teams try to kick or carry or propel the ball into each other's goal ] -Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] -   is 0.5 - -Path similarity of: -Synset('football.n.02') ( n ) [ the inflated oblong ball used in playing American football ] -Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] -   is 0.05 -``` - -The highest path similarity score of the words is 0.5, indicating they are closely related. - -What about "code" and "bug"? Similarity scores for these words used in computer science are: - - -``` -Path similarity of: -Synset('code.n.01') ( n ) [ a set of rules or principles or laws (especially written ones) ] -Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] -   is 0.1111111111111111 -... -Path similarity of: -Synset('code.n.02') ( n ) [ a coding system used for transmitting messages requiring brevity or secrecy ] -Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] -   is 0.09090909090909091 -... -Path similarity of: -Synset('code.n.03') ( n ) [ (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions ] -Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] -   is 0.09090909090909091 -``` - -These are the highest similarity scores, which indicates they are related. - -NLTK provides several similarity scorers, such as: - - * path_similarity - * lch_similarity - * wup_similarity - * res_similarity - * jcn_similarity - * lin_similarity - - - -See the Similarity section of the [WordNet Interface][6] page to determine the appropriate one for your application. - -#### Try it yourself - -Using Python libraries, start from the Wikipedia [Category: Lists of computer terms][7] page and prepare a list of terminologies, then see how the words correlate. - -### Tree and treebank - -With NLTK, you can represent a text's structure in tree form to help with text analysis. - -Here is an example: - -A simple text pre-processed and part-of-speech (POS)-tagged: - - -``` -import nltk - -text = "I love open source" -# Tokenize to words -words = nltk.tokenize.word_tokenize(text) -# POS tag the words -words_tagged = nltk.pos_tag(words) -``` - -You must define a grammar to convert the text to a tree structure. This example uses a simple grammar based on the [Penn Treebank tags][8]. - - -``` -# A simple grammar to create tree -grammar = "NP: {<JJ><NN>}" -``` - -Next, use the grammar to create a tree: - - -``` -# Create tree -parser = nltk.RegexpParser(grammar) -tree = parser.parse(words_tagged) -pprint(tree) -``` - -This produces: - - -``` -`Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])])` -``` - -You can see it better graphically. - - -``` -`tree.draw()` -``` - -![NLTK Tree][9] - -(Girish Managoli, [CC BY-SA 4.0][10]) - -This structure helps explain the text's meaning correctly. As an example, identify the [subject][11] in this text: - - -``` -subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"] -def subject(sentence_tree): -    for tagged_word in sentence_tree: -        # A crude logic for this case -  first word with these tags is considered subject -        if tagged_word[1] in subject_tags: -            return tagged_word[0] - -print("Subject:", subject(tree)) -``` - -It shows "I" is the subject: - - -``` -`Subject: I` -``` - -This is a basic text analysis building block that is applicable to larger applications. For example, when a user says, "Book a flight for my mom, Jane, to NY from London on January 1st," a chatbot using this block can interpret the request as: - -**Action**: Book -**What**: Flight -**Traveler**: Jane -**From**: London -**To**: New York -**Date**: 1 Jan (of the next year) - -A treebank refers to a corpus with pre-tagged trees. Open source, conditional free-for-use, and commercial treebanks are available for many languages. The most commonly used one for English is Penn Treebank, extracted from the _Wall Street Journal_, a subset of which is included in NLTK. Some ways of using a treebank: - - -``` -words = nltk.corpus.treebank.words() -print(len(words), "words:") -print(words) - -tagged_sents = nltk.corpus.treebank.tagged_sents() -print(len(tagged_sents), "sentences:") -print(tagged_sents) - -[/code] [code] - -100676 words: -['Pierre', 'Vinken', ',', '61', 'years', 'old', ',', ...] -3914 sentences: -[[('Pierre', 'NNP'), ('Vinken', 'NNP'), (',', ','), ('61', 'CD'), ('years', 'NNS'), ('old', 'JJ'), (',', ','), ('will', 'MD'), ('join', 'VB'), ('the', 'DT'), ('board', 'NN'), ('as', 'IN'), ('a', 'DT'), ('nonexecutive', 'JJ'), ('director', 'NN'), ...] -``` - -See tags in a sentence: - - -``` -sent0 = tagged_sents[0] -pprint(sent0) - -[/code] [code] - -[('Pierre', 'NNP'), - ('Vinken', 'NNP'), - (',', ','), - ('61', 'CD'), - ('years', 'NNS'), -... -``` - -Create a grammar to convert this to a tree: - - -``` -grammar = ''' -    Subject: {<NNP><NNP>} -    SubjectInfo: {<CD><NNS><JJ>} -    Action: {<MD><VB>} -    Object: {<DT><NN>} -    Stopwords: {<IN><DT>} -    ObjectInfo: {<JJ><NN>} -    When: {<NNP><CD>} -''' -parser = nltk.RegexpParser(grammar) -tree = parser.parse(sent0) -print(tree) - -[/code] [code] - -(S -  (Subject Pierre/NNP Vinken/NNP) -  ,/, -  (SubjectInfo 61/CD years/NNS old/JJ) -  ,/, -  (Action will/MD join/VB) -  (Object the/DT board/NN) -  as/IN -  a/DT -  (ObjectInfo nonexecutive/JJ director/NN) -  (Subject Nov./NNP) -  29/CD -  ./.) -``` - -See it graphically: - - -``` -`tree.draw()` -``` - -![NLP Treebank image][12] - -(Girish Managoli, [CC BY-SA 4.0][10]) - -The concept of trees and treebanks is a powerful building block for text analysis. - -#### Try it yourself - -Using the Python libraries, download Wikipedia's page on [open source][5] and represent the text in a presentable view. - -### Named entity recognition - -Text, whether spoken or written, contains important data. One of text processing's primary goals is extracting this key data. This is needed in almost all applications, such as an airline chatbot that books tickets or a question-answering bot. NLTK provides a named entity recognition feature for this. - -Here's a code example: - - -``` -`sentence = 'Peterson first suggested the name "open source" at Palo Alto, California'` -``` - -See if name and place are recognized in this sentence. Pre-process as usual: - - -``` -import nltk - -words = nltk.word_tokenize(sentence) -pos_tagged = nltk.pos_tag(words) -``` - -Run the named-entity tagger: - - -``` -ne_tagged = nltk.ne_chunk(pos_tagged) -print("NE tagged text:") -print(ne_tagged) -print() - -[/code] [code] - -NE tagged text: -(S -  (PERSON Peterson/NNP) -  first/RB -  suggested/VBD -  the/DT -  name/NN -  ``/`` -  open/JJ -  source/NN -  ''/'' -  at/IN -  (FACILITY Palo/NNP Alto/NNP) -  ,/, -  (GPE California/NNP)) -``` - -Name tags were added; extract only the named entities from this tree: - - -``` -print("Recognized named entities:") -for ne in ne_tagged: -    if hasattr(ne, "label"): -        print(ne.label(), ne[0:]) - -[/code] [code] - -Recognized named entities: -PERSON [('Peterson', 'NNP')] -FACILITY [('Palo', 'NNP'), ('Alto', 'NNP')] -GPE [('California', 'NNP')] -``` - -See it graphically: - - -``` -`ne_tagged.draw()` -``` - -![NLTK Treebank tree][13] - -(Girish Managoli, [CC BY-SA 4.0][10]) - -NLTK's built-in named-entity tagger, using PENN's [Automatic Content Extraction][14] (ACE) program, detects common entities such as ORGANIZATION, PERSON, LOCATION, FACILITY, and GPE (geopolitical entity). - -NLTK can use other taggers, such as the [Stanford Named Entity Recognizer][15]. This trained tagger is built in Java, but NLTK provides an interface to work with it (See [nltk.parse.stanford][16] or [nltk.tag.stanford][17]). - -#### Try it yourself - -Using the Python libraries, download Wikipedia's page on [open source][5] and identify people who had an influence on open source and where and when they contributed. - -### Advanced exercise - -If you're ready for it, try building this superstructure using the building blocks discussed in these articles. - -Using Python libraries, download Wikipedia's [Category: Computer science page][18] and: - - * Identify the most-occurring unigrams, bigrams, and trigrams and publish it as a list of keywords or technologies that students and engineers need to be aware of in this domain. - * Show the names, technologies, dates, and places that matter in this field graphically. This can be a nice infographic. - * Create a search engine. Does your search engine perform better than Wikipedia's search? - - - -### What's next? - -NLP is a quintessential pillar in application building. NLTK is a classic, rich, and powerful kit that provides the bricks and mortar to build practically appealing, purposeful applications for the real world. - -In this series of articles, I explained what NLP makes possible using NLTK as an example. NLP and NLTK have a lot more to offer. This series is an inception point to help get you started. - -If your needs grow beyond NLTK's capabilities, you could train new models or add capabilities to it. New NLP libraries that build on NLTK are coming up, and machine learning is being used extensively in language processing. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/8/nlp-python-nltk - -作者:[Girish Managoli][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/gammay -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen) -[2]: https://opensource.com/article/20/8/intro-python-nltk -[3]: http://www.nltk.org/ -[4]: https://en.wikipedia.org/wiki/WordNet -[5]: https://en.wikipedia.org/wiki/Open_source -[6]: https://www.nltk.org/howto/wordnet.html -[7]: https://en.wikipedia.org/wiki/Category:Lists_of_computer_terms -[8]: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html -[9]: https://opensource.com/sites/default/files/uploads/nltk-tree.jpg (NLTK Tree) -[10]: https://creativecommons.org/licenses/by-sa/4.0/ -[11]: https://en.wikipedia.org/wiki/Subject_(grammar) -[12]: https://opensource.com/sites/default/files/uploads/nltk-treebank.jpg (NLP Treebank image) -[13]: https://opensource.com/sites/default/files/uploads/nltk-treebank-2a.jpg (NLTK Treebank tree) -[14]: https://www.ldc.upenn.edu/collaborations/past-projects/ace -[15]: https://nlp.stanford.edu/software/CRF-NER.html -[16]: https://www.nltk.org/_modules/nltk/parse/stanford.html -[17]: https://www.nltk.org/_modules/nltk/tag/stanford.html -[18]: https://en.wikipedia.org/wiki/Category:Computer_science diff --git a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md new file mode 100644 index 0000000000..eef477a2c1 --- /dev/null +++ b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md @@ -0,0 +1,572 @@ +[#]: collector: (lujun9972) +[#]: translator: (tanloong) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An advanced guide to NLP analysis with Python and NLTK) +[#]: via: (https://opensource.com/article/20/8/nlp-python-nltk) +[#]: author: (Girish Managoli https://opensource.com/users/gammay) + +用 Python 和 NLTK 进行 NLP 分析的高级教程 +====== +进一步学习自然语言处理的基本概念 +![Brain on a computer screen][1] + +在[之前的文章][2]里,我介绍了自然语言处理NLP和宾夕法尼亚大学研发的自然语言处理工具包 ([NLTK][3])。我演示了用 Python 解析文本和定义停用词的方法,并介绍了语料库的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。 + +这篇文章主要包括以下部分: + + * 词网WordNet同义词集synset + * 相似度比较Similarity comparison + * Tree树库treebank + * 命名实体识别Named entity recognition + + +### WordNet 和同义词集synsets + +[WordNet][4] 是 NLTK 里的一个大型词典数据库。WordNet 包含各单词的诸多认知同义词cognitive synonyms (一个认知同义词cognitive synonyms常被称作 synset)。 + +WordNet 是文本分析的一个很有用的工具。它有面向多种语言的版本 (汉语、英语、日语、俄语和西班牙语等),也使用多种许可证 (从开源许可证到商业许可证都有)。初代版本的 WordNet 由普林斯顿大学研发,面向英语,使用类 MIT 许可证MIT-like license。 + +因为一个词可能有多个意义或多个词性,所以可能与多个 synset 相关联。每个 synset 通常提供下列属性: + +|**属性** | **定义** | **例子**| +|---|---|---| +|名称Name| 此 synset 的名称 | 单词 code 有 5 个 synset,名称分别是 `code.n.01`、 `code.n.02`、 `code.n.03`、`code.v.01` 和 `code.v.02`| +|词性POS| 此 synset 的词性 | 单词 code 有 3 个名词词性的 synset 和 2 个动词词性的 synset| +|定义Definition| 该词作对应词性时的定义 | 动词 code 的一个定义是: (计算机科学computer science)数据或计算机程序指令的象征性排列symbolic arrangement| +|例子Examples| 使用该词的例子 | code 一词的例子:为了安全,我们应该给信息编码。We should encode the message for security reasons| +|词元Lemmas| 与该词向关联的其他 synset (包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元lemma直接与其他词元lemma连关联,而不是直接与单词words/rt>相关联| `code.v.02` 的词元lemma是`code.v.02.encipher`、`code.v.02.cipher`、`code.v.02.cypher`、`code.v.02.encrypt`、`code.v.02.inscribe` 和 `code.v.02.write_in_code`| +|反义词Antonyms| 意思相反的词 | 词元lemma`encode.v.01.encode` 的反义词antonym是 `decode.v.01.decode`| +|上义词Hypernym|该词所属的一个范畴更大的词 | `code.v.01` 的一个上义词hypernym是 `tag.v.01`| +|分项词Meronym| 属于该词组成部分的词 | 计算机computer的一个分项词meronym芯片chip| +|总项词Holonym| 该词作为组成部分所属的词 | window的一个总项词holonym电脑屏幕computer screen| + +synset 还有一些其他属性,在 `<你的 Python 安装路径>/Lib/site-packages` 下的 `nltk/corpus/reader/wordnet.py`,你可以找到它们。 + +下面的代码或许可以帮助理解。 + +这个函数: + + +``` +from nltk.corpus import wordnet + + +def synset_info(synset): + print("Name", synset.name()) + print("POS:", synset.pos()) + print("Definition:", synset.definition()) + print("Examples:", synset.examples()) + print("Lemmas:", synset.lemmas()) + print("Antonyms:", [lemma.antonyms() for lemma in synset.lemmas() if len(lemma.antonyms()) > 0]) + print("Hypernyms:", synset.hypernyms()) + print("Instance Hypernyms:", synset.instance_hypernyms()) + print("Part Holonyms:", synset.part_holonyms()) + print("Part Meronyms:", synset.part_meronyms()) + print() + + +synsets = wordnet.synsets('code') +print(len(synsets), "synsets:") +for synset in synsets: + synset_info(synset) +``` + +将会显示: + + +``` +5 synsets: +Name code.n.01 +POS: n +Definition: a set of rules or principles or laws (especially written ones) +Examples: [] +Lemmas: [Lemma('code.n.01.code'), Lemma('code.n.01.codification')] +Antonyms: [] +Hypernyms: [Synset('written_communication.n.01')] +Instance Hpernyms: [] +Part Holonyms: [] +Part Meronyms: [] + +... + +Name code.n.03 +POS: n +Definition: (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions +Examples: [] +Lemmas: [Lemma('code.n.03.code'), Lemma('code.n.03.computer_code')] +Antonyms: [] +Hypernyms: [Synset('coding_system.n.01')] +Instance Hpernyms: [] +Part Holonyms: [] +Part Meronyms: [] + +... + +Name code.v.02 +POS: v +Definition: convert ordinary language into code +Examples: ['We should encode the message for security reasons'] +Lemmas: [Lemma('code.v.02.code'), Lemma('code.v.02.encipher'), Lemma('code.v.02.cipher'), Lemma('code.v.02.cypher'), Lemma('code.v.02.encrypt'), Lemma('code.v.02.inscribe'), Lemma('code.v.02.write_in_code')] +Antonyms: [] +Hypernyms: [Synset('encode.v.01')] +Instance Hpernyms: [] +Part Holonyms: [] +Part Meronyms: [] +``` + +同义词集synsets词元lemma在 WordNet 里是按照树状结构组织起来的,下面的代码会给出直观的展现: + +``` +def hypernyms(synset): +    return synset.hypernyms() + +synsets = wordnet.synsets('soccer') +for synset in synsets: +    print(synset.name() + " tree:") +    pprint(synset.tree(rel=hypernyms)) +    print() + +[/code] [code] + +code.n.01 tree: +[Synset('code.n.01'), + [Synset('written_communication.n.01'), +   ... + +code.n.02 tree: +[Synset('code.n.02'), + [Synset('coding_system.n.01'), +   ... + +code.n.03 tree: +[Synset('code.n.03'), +   ... + +code.v.01 tree: +[Synset('code.v.01'), + [Synset('tag.v.01'), +   ... + +code.v.02 tree: +[Synset('code.v.02'), + [Synset('encode.v.01'), +   ... +``` + +WordNet 并没有涵盖所有的单词和其信息 (现今英语有约 17,0000 个单词,最新版的 WordNet 涵盖了约 15,5000 个),但它开了个好头。掌握了 WordNet 的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的“词网”WordNet! + +#### 自主尝试 + +使用 Python 库,下载维基百科的 [open source][5] 页面,并列出该页面所有单词的同义词集synsets 词元lemmas。 + +### 相似度比较 + +相似度比较的目的是识别出两篇文本的相似度,在搜索引擎、聊天机器人等方面有很多应用。 + +比如,相似度比较可以识别 football 和 soccer 是否有相似性。 + +``` +syn1 = wordnet.synsets('football') +syn2 = wordnet.synsets('soccer') + +# A word may have multiple synsets, so need to compare each synset of word1 with synset of word2 +# 一个单词可能有多个 synset,需要把 word1 的每个 synset 和 word2 的每个 synset 分别比较 +for s1 in syn1: +    for s2 in syn2: +        print("Path similarity of: ") +        print(s1, '(', s1.pos(), ')', '[', s1.definition(), ']') +        print(s2, '(', s2.pos(), ')', '[', s2.definition(), ']') +        print("   is", s1.path_similarity(s2)) +        print() + +[/code] [code] + +Path similarity of: +Synset('football.n.01') ( n ) [ any of various games played with a ball (round or oval) in which two teams try to kick or carry or propel the ball into each other's goal ] +Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] +   is 0.5 + +Path similarity of: +Synset('football.n.02') ( n ) [ the inflated oblong ball used in playing American football ] +Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] +   is 0.05 +``` + +两个词各个 synset 之间路径相似度path similarity最大的是 0.5,表明它们关联性很大 (路径相似度指两个词的意义在上下义关系的词汇分类结构hypernym/hypnoym taxonomy中的最短距离)。 + +那么 code 和 bug 呢?这两个计算机领域的词的相似度是: + +``` +Path similarity of: +Synset('code.n.01') ( n ) [ a set of rules or principles or laws (especially written ones) ] +Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] +   is 0.1111111111111111 +... +Path similarity of: +Synset('code.n.02') ( n ) [ a coding system used for transmitting messages requiring brevity or secrecy ] +Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] +   is 0.09090909090909091 +... +Path similarity of: +Synset('code.n.03') ( n ) [ (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions ] +Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] +   is 0.09090909090909091 +``` + +这些是这两个词各 synset 之间路径相似度path similarity的最大值,这些值表明两个词是有关联性的。 + +NLTK 提供多种相似度计分器similarity scorers,比如: + + * path_similarity + * lch_similarity + * wup_similarity + * res_similarity + * jcn_similarity + * lin_similarity + +要进一步了解这个相似度计分器similarity scorers,请查看 [WordNet Interface][6] 的 Similarity 部分。 + +#### 自主尝试 + +使用 Python 库,从维基百科的 [Category: Lists of computer terms][7] 生成一个术语列表,然后计算各术语之间的相似度。 + +### tree树库treebank + +使用 NLTK,你可以把文本表示成树状结构以便进行分析。 + +这里有一个例子: + +这是一份简短的文本,对其做预处理和词性标注: + + +``` +import nltk + +text = "I love open source" +# Tokenize to words +words = nltk.tokenize.word_tokenize(text) +# POS tag the words +words_tagged = nltk.pos_tag(words) +``` + +要把文本转换成树状结构,你必须定义一个语法grammar 。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。 + + +``` +# A simple grammar to create tree +grammar = "NP: {<JJ><NN>}" +``` + +``` +# A simple grammar to create tree +grammar = "NP: {}" +``` + +Next, use the grammar to create a tree: +然后用这个语法grammar创建一颗tree: + + +``` +# Create tree +parser = nltk.RegexpParser(grammar) +tree = parser.parse(words_tagged) +pprint(tree) +``` + +运行上面的代码,将得到: + + +``` +Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])]) +``` + +你也可以图形化地显示结果。 + +``` +tree.draw() +``` + +![NLTK Tree][9] + +(Girish Managoli, [CC BY-SA 4.0][10]) + +这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的主语 ([subject][11]): + + +``` +subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"] +def subject(sentence_tree): +    for tagged_word in sentence_tree: +        # A crude logic for this case -  first word with these tags is considered subject +        if tagged_word[1] in subject_tags: +            return tagged_word[0] + +print("Subject:", subject(tree)) +``` + +结果显示主语是 I: + +``` +Subject: I +``` + +这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票,1 月 1 号伦敦飞纽约的“,机器人可以用这种分析方法解读这个指令: + +**动作**: 预订 +**动作的对象**: 机票 +**乘客**: Jane +**出发地**: 伦敦 +**目的地**: 纽约 +**日期**: (明年) 1 月 1 号 + +树库treebank指由许多预先标注好的tree构成的语料库。现在已经有面向多种语言的树库,既有开源的,也有限定条件下才能免费使用的,以及商用的。其中使用最广泛的是面向英语的宾州树库。宾州树库取材于 _华尔街日报_ Wall Street Journal。NLTK 也包含了宾州树库作为一个子语料库。下面是一些使用树库treebank的方法: + +``` +words = nltk.corpus.treebank.words() +print(len(words), "words:") +print(words) + +tagged_sents = nltk.corpus.treebank.tagged_sents() +print(len(tagged_sents), "sentences:") +print(tagged_sents) + +[/code] [code] + +100676 words: +['Pierre', 'Vinken', ',', '61', 'years', 'old', ',', ...] +3914 sentences: +[[('Pierre', 'NNP'), ('Vinken', 'NNP'), (',', ','), ('61', 'CD'), ('years', 'NNS'), ('old', 'JJ'), (',', ','), ('will', 'MD'), ('join', 'VB'), ('the', 'DT'), ('board', 'NN'), ('as', 'IN'), ('a', 'DT'), ('nonexecutive', 'JJ'), ('director', 'NN'), ...] +``` + +查看一个句子里的各个标签tags: + +``` +sent0 = tagged_sents[0] +pprint(sent0) + +[/code] [code] + +[('Pierre', 'NNP'), + ('Vinken', 'NNP'), + (',', ','), + ('61', 'CD'), + ('years', 'NNS'), +... +``` + +定义一个语法grammar来把这个句子转换成树状结构: + +``` +grammar = ''' +    Subject: {<NNP><NNP>} +    SubjectInfo: {<CD><NNS><JJ>} +    Action: {<MD><VB>} +    Object: {<DT><NN>} +    Stopwords: {<IN><DT>} +    ObjectInfo: {<JJ><NN>} +    When: {<NNP><CD>} +''' +parser = nltk.RegexpParser(grammar) +tree = parser.parse(sent0) +print(tree) + +[/code] [code] + +(S +  (Subject Pierre/NNP Vinken/NNP) +  ,/, +  (SubjectInfo 61/CD years/NNS old/JJ) +  ,/, +  (Action will/MD join/VB) +  (Object the/DT board/NN) +  as/IN +  a/DT +  (ObjectInfo nonexecutive/JJ director/NN) +  (Subject Nov./NNP) +  29/CD +  ./.) +``` + +``` +grammar = ''' +    Subject: {<NNP><NNP>} +    SubjectInfo: {<CD><NNS><JJ>} +    Action: {<MD><VB>} +    Object: {<DT><NN>} +    Stopwords: {<IN><DT>} +    ObjectInfo: {<JJ><NN>} +    When: {<NNP><CD>} +''' +parser = nltk.RegexpParser(grammar) +tree = parser.parse(sent0) +print(tree) + +[/code] [code] + +(S +  (Subject Pierre/NNP Vinken/NNP) +  ,/, +  (SubjectInfo 61/CD years/NNS old/JJ) +  ,/, +  (Action will/MD join/VB) +  (Object the/DT board/NN) +  as/IN +  a/DT +  (ObjectInfo nonexecutive/JJ director/NN) +  (Subject Nov./NNP) +  29/CD +  ./.) +``` + + +图形化地显示: + + +``` +tree.draw() +``` + +![NLP Treebank image][12] + +(Girish Managoli, [CC BY-SA 4.0][10]) + +trees树库treebanks的概念是文本分析的一个强大的组成部分。 + +#### 自主尝试 + +使用 Python 库,下载维基百科的 [open source][5] 页面,将得到的文本以图形化的树状结构展现出来。 + +### 命名实体识别Named entity recognition + +无论口语还是书面语都包含着重要数据。文本处理的主要目标之一,就是提取出关键数据。几乎所有应用场景所需要提取关键数据,比如航空公司的订票机器人或者问答机器人。 NLTK 为此提供了一个命名实体识别named entity recognition的功能。 + +这里有一个代码示例: + + +``` +`sentence = 'Peterson first suggested the name "open source" at Palo Alto, California'` +``` + +验证这个句子里的人名name地名place有没有被识别出来。照例先预处理: + +``` +import nltk + +words = nltk.word_tokenize(sentence) +pos_tagged = nltk.pos_tag(words) +``` + +运行命名实体标注器named-entity tagger: + +``` +ne_tagged = nltk.ne_chunk(pos_tagged) +print("NE tagged text:") +print(ne_tagged) +print() + +[/code] [code] + +NE tagged text: +(S +  (PERSON Peterson/NNP) +  first/RB +  suggested/VBD +  the/DT +  name/NN +  ``/`` +  open/JJ +  source/NN +  ''/'' +  at/IN +  (FACILITY Palo/NNP Alto/NNP) +  ,/, +  (GPE California/NNP)) +``` + +上面的结果里,命名实体被识别出来并做了标注;只提取这个tree里的命名实体: + +``` +print("Recognized named entities:") +for ne in ne_tagged: +    if hasattr(ne, "label"): +        print(ne.label(), ne[0:]) + +[/code] [code] + +Recognized named entities: +PERSON [('Peterson', 'NNP')] +FACILITY [('Palo', 'NNP'), ('Alto', 'NNP')] +GPE [('California', 'NNP')] +``` + +图形化地显示: + +``` +ne_tagged.draw() +``` + +![NLTK Treebank tree][13] + +(Girish Managoli, [CC BY-SA 4.0][10]) + +NLTK 内置的命名实体标注器named-entity tagger,使用的是宾州法尼亚大学的 [Automatic Content Extraction][14] (ACE) 程序。 该标注器能够识别组织机构ORGANIZATION、人名PERSON、地名LOCATION、设施FACILITY地缘政治实体geopolitical entity等常见实体entites。 + +NLTK 也可以使用其他标注器tagger,比如 [Stanford Named Entity Recognizer][15]. 这个经过训练的标注器用 Java 写成,但 NLTK 提供了一个使用它的接口 (详情请查看 [nltk.parse.stanford][16] 或 [nltk.tag.stanford][17])。 + +#### 自主尝试 + +使用 Python 库,下载维基百科的 [open source][5] 页面,并识别出对开源open source有影响力的人的名字,以及他们为开源open source做贡献的时间和地点。 + +### 高级实践 + +如果你准备好了,尝试用这篇文章以及此前的文章介绍的知识构建一个超级结构superstructure。 + +使用 Python 库,下载维基百科的 [Category: Computer science page][18],然后: + + + * 找出其中频率最高的单词unigrams、二元搭配bigrams三元搭配trigrams,将它们作为一个关键词keywords列表或者技术techonologies列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。 + * 图形化地显示这个领域里重要的人名、技术、日期和地点。这会是一份很棒的信息图。 + * 构建一个搜索引擎search engine。你的搜索引擎search engine性能能够超过维基百科吗? + + +### 接下来可以做什么? + +自然语言处理NLP应用构建application building的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。 + +在这个系列的文章里,我用 NLTK 作为例子,展示了自然语言处理可以做什么。自然语言处理和 NLTK 还有太多东西值得探索,这个系列的文章只是帮助你探索它们的切入点。 + +如果你的需求慢慢增长到 NLTK 已经满足不了了,你可以训练新的模型或者向 NLTK 添加新的功能。基于 NLTK 构建的新的自然语言处理库NLP libraries正在不断涌现,机器学习也正被深度用于自然语言处理。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/8/nlp-python-nltk + +作者:[Girish Managoli][a] +选题:[lujun9972][b] +译者:[tanloong](https://github.com/tanloong) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gammay +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen) +[2]: https://opensource.com/article/20/8/intro-python-nltk +[3]: http://www.nltk.org/ +[4]: https://en.wikipedia.org/wiki/WordNet +[5]: https://en.wikipedia.org/wiki/Open_source +[6]: https://www.nltk.org/howto/wordnet.html +[7]: https://en.wikipedia.org/wiki/Category:Lists_of_computer_terms +[8]: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html +[9]: https://opensource.com/sites/default/files/uploads/nltk-tree.jpg (NLTK Tree) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://en.wikipedia.org/wiki/Subject_(grammar) +[12]: https://opensource.com/sites/default/files/uploads/nltk-treebank.jpg (NLP Treebank image) +[13]: https://opensource.com/sites/default/files/uploads/nltk-treebank-2a.jpg (NLTK Treebank tree) +[14]: https://www.ldc.upenn.edu/collaborations/past-projects/ace +[15]: https://nlp.stanford.edu/software/CRF-NER.html +[16]: https://www.nltk.org/_modules/nltk/parse/stanford.html +[17]: https://www.nltk.org/_modules/nltk/tag/stanford.html +[18]: https://en.wikipedia.org/wiki/Category:Computer_science From ce26b4278185c730932a43f79231ce0ce7044770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E9=BE=99?= <2638000368@qq.com> Date: Fri, 16 Jul 2021 01:27:19 +0800 Subject: [PATCH 438/870] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E5=B9=B6=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87=20'An=20advanced?= =?UTF-8?q?=20guide=20to=20NLP=20analysis=20with=20Python=20and=20NLTK'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...de to NLP analysis with Python and NLTK.md | 542 ------------------ ...de to NLP analysis with Python and NLTK.md | 535 +++++++++++++++++ 2 files changed, 535 insertions(+), 542 deletions(-) delete mode 100644 sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md create mode 100644 translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md diff --git a/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md deleted file mode 100644 index 802560422a..0000000000 --- a/sources/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md +++ /dev/null @@ -1,542 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tanloong) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (An advanced guide to NLP analysis with Python and NLTK) -[#]: via: (https://opensource.com/article/20/8/nlp-python-nltk) -[#]: author: (Girish Managoli https://opensource.com/users/gammay) - -An advanced guide to NLP analysis with Python and NLTK -====== -Get deeper into the foundational concepts behind natural language -processing. -![Brain on a computer screen][1] - -In my [previous article][2], I introduced natural language processing (NLP) and the Natural Language Toolkit ([NLTK][3]), the NLP toolkit created at the University of Pennsylvania. I demonstrated how to parse text and define stopwords in Python and introduced the concept of a corpus, a dataset of text that aids in text processing with out-of-the-box data. In this article, I'll continue utilizing datasets to compare and analyze natural language. - -The fundamental building blocks covered in this article are: - - * WordNet and synsets - * Similarity comparison - * Tree and treebank - * Named entity recognition - - - -### WordNet and synsets - -[WordNet][4] is a large lexical database corpus in NLTK. WordNet maintains cognitive synonyms (commonly called synsets) of words correlated by nouns, verbs, adjectives, adverbs, synonyms, antonyms, and more. - -WordNet is a very useful tool for text analysis. It is available for many languages (Chinese, English, Japanese, Russian, Spanish, and more), under many licenses (ranging from open source to commercial). The first WordNet was created by Princeton University for English under an MIT-like license. - -A word is typically associated with multiple synsets based on its meanings and parts of speech. Each synset usually provides these attributes: - -**Attribute** | **Definition** | **Example** ----|---|--- -Name | Name of the synset | Example: The word "code" has five synsets with names `code.n.01`, `code.n.02`, `code.n.03`, `code.v.01`, `code.v.02` -POS | Part of speech of the word for this synset | The word "code" has three synsets in noun form and two in verb form -Definition | Definition of the word (in POS) | One of the definitions of "code" in verb form is: "(computer science) the symbolic arrangement of data or instructions in a computer program" -Examples | Examples of word's use | One of the examples of "code": "We should encode the message for security reasons" -Lemmas | Other word synsets this word+POC is related to (not strictly synonyms, but can be considered so); lemmas are related to other lemmas, not to words directly | Lemmas of `code.v.02` (as in "convert ordinary language into code") are `code.v.02.encipher`, `code.v.02.cipher`, `code.v.02.cypher`, `code.v.02.encrypt`, `code.v.02.inscribe`, `code.v.02.write_in_code` -Antonyms | Opposites | Antonym of lemma `encode.v.01.encode` is `decode.v.01.decode` -Hypernym | A broad category that other words fall under | A hypernym of `code.v.01` (as in "Code the pieces with numbers so that you can identify them later") is `tag.v.01` -Meronym | A word that is part of (or subordinate to) a broad category | A meronym of "computer" is "chip" -Holonym | The relationship between a parent word and its subordinate parts | A hyponym of "window" is "computer screen" - -There are several other attributes, which you can find in the `nltk/corpus/reader/wordnet.py` source file in `/Lib/site-packages`. - -Some code may help this make more sense. - -This helper function: - - -``` -def synset_info(synset): -    print("Name", synset.name()) -    print("POS:", synset.pos()) -    print("Definition:", synset.definition()) -    print("Examples:", synset.examples()) -    print("Lemmas:", synset.lemmas()) -    print("Antonyms:", [lemma.antonyms() for lemma in synset.lemmas() if len(lemma.antonyms()) > 0]) -    print("Hypernyms:", synset.hypernyms()) -    print("Instance Hypernyms:", synset.instance_hypernyms()) -    print("Part Holonyms:", synset.part_holonyms()) -    print("Part Meronyms:", synset.part_meronyms()) -    print() - -[/code] [code]`synsets = wordnet.synsets('code')` -``` - -shows this: - - -``` -5 synsets: -Name code.n.01 -POS: n -Definition: a set of rules or principles or laws (especially written ones) -Examples: [] -Lemmas: [Lemma('code.n.01.code'), Lemma('code.n.01.codification')] -Antonyms: [] -Hypernyms: [Synset('written_communication.n.01')] -Instance Hpernyms: [] -Part Holonyms: [] -Part Meronyms: [] - -... - -Name code.n.03 -POS: n -Definition: (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions -Examples: [] -Lemmas: [Lemma('code.n.03.code'), Lemma('code.n.03.computer_code')] -Antonyms: [] -Hypernyms: [Synset('coding_system.n.01')] -Instance Hpernyms: [] -Part Holonyms: [] -Part Meronyms: [] - -... - -Name code.v.02 -POS: v -Definition: convert ordinary language into code -Examples: ['We should encode the message for security reasons'] -Lemmas: [Lemma('code.v.02.code'), Lemma('code.v.02.encipher'), Lemma('code.v.02.cipher'), Lemma('code.v.02.cypher'), Lemma('code.v.02.encrypt'), Lemma('code.v.02.inscribe'), Lemma('code.v.02.write_in_code')] -Antonyms: [] -Hypernyms: [Synset('encode.v.01')] -Instance Hpernyms: [] -Part Holonyms: [] -Part Meronyms: [] -``` - -Synsets and lemmas follow a tree structure you can visualize: - - -``` -def hypernyms(synset): -    return synset.hypernyms() - -synsets = wordnet.synsets('soccer') -for synset in synsets: -    print(synset.name() + " tree:") -    pprint(synset.tree(rel=hypernyms)) -    print() - -[/code] [code] - -code.n.01 tree: -[Synset('code.n.01'), - [Synset('written_communication.n.01'), -   ... - -code.n.02 tree: -[Synset('code.n.02'), - [Synset('coding_system.n.01'), -   ... - -code.n.03 tree: -[Synset('code.n.03'), -   ... - -code.v.01 tree: -[Synset('code.v.01'), - [Synset('tag.v.01'), -   ... - -code.v.02 tree: -[Synset('code.v.02'), - [Synset('encode.v.01'), -   ... -``` - -WordNet does not cover all words and their information (there are about 170,000 words in English today and about 155,000 in the latest version of WordNet), but it's a good starting point. After you learn the concepts of this building block, if you find it inadequate for your needs, you can migrate to another. Or, you can build your own WordNet! - -#### Try it yourself - -Using the Python libraries, download Wikipedia's page on [open source][5] and list the synsets and lemmas of all the words. - -### Similarity comparison - -Similarity comparison is a building block that identifies similarities between two pieces of text. It has many applications in search engines, chatbots, and more. - -For example, are the words "football" and "soccer" related? - - -``` -syn1 = wordnet.synsets('football') -syn2 = wordnet.synsets('soccer') - -# A word may have multiple synsets, so need to compare each synset of word1 with synset of word2 -for s1 in syn1: -    for s2 in syn2: -        print("Path similarity of: ") -        print(s1, '(', s1.pos(), ')', '[', s1.definition(), ']') -        print(s2, '(', s2.pos(), ')', '[', s2.definition(), ']') -        print("   is", s1.path_similarity(s2)) -        print() - -[/code] [code] - -Path similarity of: -Synset('football.n.01') ( n ) [ any of various games played with a ball (round or oval) in which two teams try to kick or carry or propel the ball into each other's goal ] -Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] -   is 0.5 - -Path similarity of: -Synset('football.n.02') ( n ) [ the inflated oblong ball used in playing American football ] -Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] -   is 0.05 -``` - -The highest path similarity score of the words is 0.5, indicating they are closely related. - -What about "code" and "bug"? Similarity scores for these words used in computer science are: - - -``` -Path similarity of: -Synset('code.n.01') ( n ) [ a set of rules or principles or laws (especially written ones) ] -Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] -   is 0.1111111111111111 -... -Path similarity of: -Synset('code.n.02') ( n ) [ a coding system used for transmitting messages requiring brevity or secrecy ] -Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] -   is 0.09090909090909091 -... -Path similarity of: -Synset('code.n.03') ( n ) [ (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions ] -Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] -   is 0.09090909090909091 -``` - -These are the highest similarity scores, which indicates they are related. - -NLTK provides several similarity scorers, such as: - - * path_similarity - * lch_similarity - * wup_similarity - * res_similarity - * jcn_similarity - * lin_similarity - - - -See the Similarity section of the [WordNet Interface][6] page to determine the appropriate one for your application. - -#### Try it yourself - -Using Python libraries, start from the Wikipedia [Category: Lists of computer terms][7] page and prepare a list of terminologies, then see how the words correlate. - -### Tree and treebank - -With NLTK, you can represent a text's structure in tree form to help with text analysis. - -Here is an example: - -A simple text pre-processed and part-of-speech (POS)-tagged: - - -``` -import nltk - -text = "I love open source" -# Tokenize to words -words = nltk.tokenize.word_tokenize(text) -# POS tag the words -words_tagged = nltk.pos_tag(words) -``` - -You must define a grammar to convert the text to a tree structure. This example uses a simple grammar based on the [Penn Treebank tags][8]. - - -``` -# A simple grammar to create tree -grammar = "NP: {<JJ><NN>}" -``` - -Next, use the grammar to create a tree: - - -``` -# Create tree -parser = nltk.RegexpParser(grammar) -tree = parser.parse(words_tagged) -pprint(tree) -``` - -This produces: - - -``` -`Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])])` -``` - -You can see it better graphically. - - -``` -`tree.draw()` -``` - -![NLTK Tree][9] - -(Girish Managoli, [CC BY-SA 4.0][10]) - -This structure helps explain the text's meaning correctly. As an example, identify the [subject][11] in this text: - - -``` -subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"] -def subject(sentence_tree): -    for tagged_word in sentence_tree: -        # A crude logic for this case -  first word with these tags is considered subject -        if tagged_word[1] in subject_tags: -            return tagged_word[0] - -print("Subject:", subject(tree)) -``` - -It shows "I" is the subject: - - -``` -`Subject: I` -``` - -This is a basic text analysis building block that is applicable to larger applications. For example, when a user says, "Book a flight for my mom, Jane, to NY from London on January 1st," a chatbot using this block can interpret the request as: - -**Action**: Book -**What**: Flight -**Traveler**: Jane -**From**: London -**To**: New York -**Date**: 1 Jan (of the next year) - -A treebank refers to a corpus with pre-tagged trees. Open source, conditional free-for-use, and commercial treebanks are available for many languages. The most commonly used one for English is Penn Treebank, extracted from the _Wall Street Journal_, a subset of which is included in NLTK. Some ways of using a treebank: - - -``` -words = nltk.corpus.treebank.words() -print(len(words), "words:") -print(words) - -tagged_sents = nltk.corpus.treebank.tagged_sents() -print(len(tagged_sents), "sentences:") -print(tagged_sents) - -[/code] [code] - -100676 words: -['Pierre', 'Vinken', ',', '61', 'years', 'old', ',', ...] -3914 sentences: -[[('Pierre', 'NNP'), ('Vinken', 'NNP'), (',', ','), ('61', 'CD'), ('years', 'NNS'), ('old', 'JJ'), (',', ','), ('will', 'MD'), ('join', 'VB'), ('the', 'DT'), ('board', 'NN'), ('as', 'IN'), ('a', 'DT'), ('nonexecutive', 'JJ'), ('director', 'NN'), ...] -``` - -See tags in a sentence: - - -``` -sent0 = tagged_sents[0] -pprint(sent0) - -[/code] [code] - -[('Pierre', 'NNP'), - ('Vinken', 'NNP'), - (',', ','), - ('61', 'CD'), - ('years', 'NNS'), -... -``` - -Create a grammar to convert this to a tree: - - -``` -grammar = ''' -    Subject: {<NNP><NNP>} -    SubjectInfo: {<CD><NNS><JJ>} -    Action: {<MD><VB>} -    Object: {<DT><NN>} -    Stopwords: {<IN><DT>} -    ObjectInfo: {<JJ><NN>} -    When: {<NNP><CD>} -''' -parser = nltk.RegexpParser(grammar) -tree = parser.parse(sent0) -print(tree) - -[/code] [code] - -(S -  (Subject Pierre/NNP Vinken/NNP) -  ,/, -  (SubjectInfo 61/CD years/NNS old/JJ) -  ,/, -  (Action will/MD join/VB) -  (Object the/DT board/NN) -  as/IN -  a/DT -  (ObjectInfo nonexecutive/JJ director/NN) -  (Subject Nov./NNP) -  29/CD -  ./.) -``` - -See it graphically: - - -``` -`tree.draw()` -``` - -![NLP Treebank image][12] - -(Girish Managoli, [CC BY-SA 4.0][10]) - -The concept of trees and treebanks is a powerful building block for text analysis. - -#### Try it yourself - -Using the Python libraries, download Wikipedia's page on [open source][5] and represent the text in a presentable view. - -### Named entity recognition - -Text, whether spoken or written, contains important data. One of text processing's primary goals is extracting this key data. This is needed in almost all applications, such as an airline chatbot that books tickets or a question-answering bot. NLTK provides a named entity recognition feature for this. - -Here's a code example: - - -``` -`sentence = 'Peterson first suggested the name "open source" at Palo Alto, California'` -``` - -See if name and place are recognized in this sentence. Pre-process as usual: - - -``` -import nltk - -words = nltk.word_tokenize(sentence) -pos_tagged = nltk.pos_tag(words) -``` - -Run the named-entity tagger: - - -``` -ne_tagged = nltk.ne_chunk(pos_tagged) -print("NE tagged text:") -print(ne_tagged) -print() - -[/code] [code] - -NE tagged text: -(S -  (PERSON Peterson/NNP) -  first/RB -  suggested/VBD -  the/DT -  name/NN -  ``/`` -  open/JJ -  source/NN -  ''/'' -  at/IN -  (FACILITY Palo/NNP Alto/NNP) -  ,/, -  (GPE California/NNP)) -``` - -Name tags were added; extract only the named entities from this tree: - - -``` -print("Recognized named entities:") -for ne in ne_tagged: -    if hasattr(ne, "label"): -        print(ne.label(), ne[0:]) - -[/code] [code] - -Recognized named entities: -PERSON [('Peterson', 'NNP')] -FACILITY [('Palo', 'NNP'), ('Alto', 'NNP')] -GPE [('California', 'NNP')] -``` - -See it graphically: - - -``` -`ne_tagged.draw()` -``` - -![NLTK Treebank tree][13] - -(Girish Managoli, [CC BY-SA 4.0][10]) - -NLTK's built-in named-entity tagger, using PENN's [Automatic Content Extraction][14] (ACE) program, detects common entities such as ORGANIZATION, PERSON, LOCATION, FACILITY, and GPE (geopolitical entity). - -NLTK can use other taggers, such as the [Stanford Named Entity Recognizer][15]. This trained tagger is built in Java, but NLTK provides an interface to work with it (See [nltk.parse.stanford][16] or [nltk.tag.stanford][17]). - -#### Try it yourself - -Using the Python libraries, download Wikipedia's page on [open source][5] and identify people who had an influence on open source and where and when they contributed. - -### Advanced exercise - -If you're ready for it, try building this superstructure using the building blocks discussed in these articles. - -Using Python libraries, download Wikipedia's [Category: Computer science page][18] and: - - * Identify the most-occurring unigrams, bigrams, and trigrams and publish it as a list of keywords or technologies that students and engineers need to be aware of in this domain. - * Show the names, technologies, dates, and places that matter in this field graphically. This can be a nice infographic. - * Create a search engine. Does your search engine perform better than Wikipedia's search? - - - -### What's next? - -NLP is a quintessential pillar in application building. NLTK is a classic, rich, and powerful kit that provides the bricks and mortar to build practically appealing, purposeful applications for the real world. - -In this series of articles, I explained what NLP makes possible using NLTK as an example. NLP and NLTK have a lot more to offer. This series is an inception point to help get you started. - -If your needs grow beyond NLTK's capabilities, you could train new models or add capabilities to it. New NLP libraries that build on NLTK are coming up, and machine learning is being used extensively in language processing. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/8/nlp-python-nltk - -作者:[Girish Managoli][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/gammay -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen) -[2]: https://opensource.com/article/20/8/intro-python-nltk -[3]: http://www.nltk.org/ -[4]: https://en.wikipedia.org/wiki/WordNet -[5]: https://en.wikipedia.org/wiki/Open_source -[6]: https://www.nltk.org/howto/wordnet.html -[7]: https://en.wikipedia.org/wiki/Category:Lists_of_computer_terms -[8]: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html -[9]: https://opensource.com/sites/default/files/uploads/nltk-tree.jpg (NLTK Tree) -[10]: https://creativecommons.org/licenses/by-sa/4.0/ -[11]: https://en.wikipedia.org/wiki/Subject_(grammar) -[12]: https://opensource.com/sites/default/files/uploads/nltk-treebank.jpg (NLP Treebank image) -[13]: https://opensource.com/sites/default/files/uploads/nltk-treebank-2a.jpg (NLTK Treebank tree) -[14]: https://www.ldc.upenn.edu/collaborations/past-projects/ace -[15]: https://nlp.stanford.edu/software/CRF-NER.html -[16]: https://www.nltk.org/_modules/nltk/parse/stanford.html -[17]: https://www.nltk.org/_modules/nltk/tag/stanford.html -[18]: https://en.wikipedia.org/wiki/Category:Computer_science diff --git a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md new file mode 100644 index 0000000000..98fd5f48f5 --- /dev/null +++ b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md @@ -0,0 +1,535 @@ +[#]: collector: (lujun9972) +[#]: translator: (tanloong) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An advanced guide to NLP analysis with Python and NLTK) +[#]: via: (https://opensource.com/article/20/8/nlp-python-nltk) +[#]: author: (Girish Managoli https://opensource.com/users/gammay) + +用 Python 和 NLTK 进行 NLP 分析的高级教程 +====== +进一步学习自然语言处理的基本概念 +![Brain on a computer screen][1] + +在[之前的文章][2]里,我介绍了自然语言处理NLP和宾夕法尼亚大学研发的自然语言处理工具包 ([NLTK][3])。我演示了用 Python 解析文本和定义停用词的方法,并介绍了语料库的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。 + +这篇文章主要包括以下部分: + + * 词网WordNet同义词集synset + * 相似度比较Similarity comparison + * Tree树库treebank + * 命名实体识别Named entity recognition + + +### WordNet 和同义词集synsets + +[WordNet][4] 是 NLTK 里的一个大型词典数据库。WordNet 包含各单词的诸多认知同义词cognitive synonyms (一个认知同义词cognitive synonyms常被称作 synset)。 + +WordNet 是文本分析的一个很有用的工具。它有面向多种语言的版本 (汉语、英语、日语、俄语和西班牙语等),也使用多种许可证 (从开源许可证到商业许可证都有)。初代版本的 WordNet 由普林斯顿大学研发,面向英语,使用类 MIT 许可证MIT-like license。 + +因为一个词可能有多个意义或多个词性,所以可能与多个 synset 相关联。每个 synset 通常提供下列属性: + +|**属性** | **定义** | **例子**| +|---|---|---| +|名称Name| 此 synset 的名称 | 单词 code 有 5 个 synset,名称分别是 `code.n.01`、 `code.n.02`、 `code.n.03`、`code.v.01` 和 `code.v.02`| +|词性POS| 此 synset 的词性 | 单词 code 有 3 个名词词性的 synset 和 2 个动词词性的 synset| +|定义Definition| 该词作对应词性时的定义 | 动词 code 的一个定义是: (计算机科学computer science)数据或计算机程序指令的象征性排列symbolic arrangement| +|例子Examples| 使用该词的例子 | code 一词的例子:为了安全,我们应该给信息编码。We should encode the message for security reasons| +|词元Lemmas| 与该词向关联的其他 synset (包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元lemma直接与其他词元lemma连关联,而不是直接与单词words/rt>相关联| `code.v.02` 的词元lemma是`code.v.02.encipher`、`code.v.02.cipher`、`code.v.02.cypher`、`code.v.02.encrypt`、`code.v.02.inscribe` 和 `code.v.02.write_in_code`| +|反义词Antonyms| 意思相反的词 | 词元lemma`encode.v.01.encode` 的反义词antonym是 `decode.v.01.decode`| +|上义词Hypernym|该词所属的一个范畴更大的词 | `code.v.01` 的一个上义词hypernym是 `tag.v.01`| +|分项词Meronym| 属于该词组成部分的词 | 计算机computer的一个分项词meronym芯片chip| +|总项词Holonym| 该词作为组成部分所属的词 | window的一个总项词holonym电脑屏幕computer screen| + +synset 还有一些其他属性,在 `<你的 Python 安装路径>/Lib/site-packages` 下的 `nltk/corpus/reader/wordnet.py`,你可以找到它们。 + +下面的代码或许可以帮助理解。 + +这个函数: + + +``` +from nltk.corpus import wordnet + + +def synset_info(synset): + print("Name", synset.name()) + print("POS:", synset.pos()) + print("Definition:", synset.definition()) + print("Examples:", synset.examples()) + print("Lemmas:", synset.lemmas()) + print("Antonyms:", [lemma.antonyms() for lemma in synset.lemmas() if len(lemma.antonyms()) > 0]) + print("Hypernyms:", synset.hypernyms()) + print("Instance Hypernyms:", synset.instance_hypernyms()) + print("Part Holonyms:", synset.part_holonyms()) + print("Part Meronyms:", synset.part_meronyms()) + print() + + +synsets = wordnet.synsets('code') +print(len(synsets), "synsets:") +for synset in synsets: + synset_info(synset) +``` + +将会显示: + + +``` +5 synsets: +Name code.n.01 +POS: n +Definition: a set of rules or principles or laws (especially written ones) +Examples: [] +Lemmas: [Lemma('code.n.01.code'), Lemma('code.n.01.codification')] +Antonyms: [] +Hypernyms: [Synset('written_communication.n.01')] +Instance Hpernyms: [] +Part Holonyms: [] +Part Meronyms: [] + +... + +Name code.n.03 +POS: n +Definition: (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions +Examples: [] +Lemmas: [Lemma('code.n.03.code'), Lemma('code.n.03.computer_code')] +Antonyms: [] +Hypernyms: [Synset('coding_system.n.01')] +Instance Hpernyms: [] +Part Holonyms: [] +Part Meronyms: [] + +... + +Name code.v.02 +POS: v +Definition: convert ordinary language into code +Examples: ['We should encode the message for security reasons'] +Lemmas: [Lemma('code.v.02.code'), Lemma('code.v.02.encipher'), Lemma('code.v.02.cipher'), Lemma('code.v.02.cypher'), Lemma('code.v.02.encrypt'), Lemma('code.v.02.inscribe'), Lemma('code.v.02.write_in_code')] +Antonyms: [] +Hypernyms: [Synset('encode.v.01')] +Instance Hpernyms: [] +Part Holonyms: [] +Part Meronyms: [] +``` + +同义词集synsets词元lemma在 WordNet 里是按照树状结构组织起来的,下面的代码会给出直观的展现: + +``` +def hypernyms(synset): +    return synset.hypernyms() + +synsets = wordnet.synsets('soccer') +for synset in synsets: +    print(synset.name() + " tree:") +    pprint(synset.tree(rel=hypernyms)) +    print() + +[/code] [code] + +code.n.01 tree: +[Synset('code.n.01'), + [Synset('written_communication.n.01'), +   ... + +code.n.02 tree: +[Synset('code.n.02'), + [Synset('coding_system.n.01'), +   ... + +code.n.03 tree: +[Synset('code.n.03'), +   ... + +code.v.01 tree: +[Synset('code.v.01'), + [Synset('tag.v.01'), +   ... + +code.v.02 tree: +[Synset('code.v.02'), + [Synset('encode.v.01'), +   ... +``` + +WordNet 并没有涵盖所有的单词和其信息 (现今英语有约 17,0000 个单词,最新版的 WordNet 涵盖了约 15,5000 个),但它开了个好头。掌握了 WordNet 的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的“词网”WordNet! + +#### 自主尝试 + +使用 Python 库,下载维基百科的 [open source][5] 页面,并列出该页面所有单词的同义词集synsets 词元lemmas。 + +### 相似度比较 + +相似度比较的目的是识别出两篇文本的相似度,在搜索引擎、聊天机器人等方面有很多应用。 + +比如,相似度比较可以识别 football 和 soccer 是否有相似性。 + +``` +syn1 = wordnet.synsets('football') +syn2 = wordnet.synsets('soccer') + +# A word may have multiple synsets, so need to compare each synset of word1 with synset of word2 +# 一个单词可能有多个 synset,需要把 word1 的每个 synset 和 word2 的每个 synset 分别比较 +for s1 in syn1: +    for s2 in syn2: +        print("Path similarity of: ") +        print(s1, '(', s1.pos(), ')', '[', s1.definition(), ']') +        print(s2, '(', s2.pos(), ')', '[', s2.definition(), ']') +        print("   is", s1.path_similarity(s2)) +        print() + +[/code] [code] + +Path similarity of: +Synset('football.n.01') ( n ) [ any of various games played with a ball (round or oval) in which two teams try to kick or carry or propel the ball into each other's goal ] +Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] +   is 0.5 + +Path similarity of: +Synset('football.n.02') ( n ) [ the inflated oblong ball used in playing American football ] +Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] +   is 0.05 +``` + +两个词各个 synset 之间路径相似度path similarity最大的是 0.5,表明它们关联性很大 (路径相似度指两个词的意义在上下义关系的词汇分类结构hypernym/hypnoym taxonomy中的最短距离)。 + +那么 code 和 bug 呢?这两个计算机领域的词的相似度是: + +``` +Path similarity of: +Synset('code.n.01') ( n ) [ a set of rules or principles or laws (especially written ones) ] +Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] +   is 0.1111111111111111 +... +Path similarity of: +Synset('code.n.02') ( n ) [ a coding system used for transmitting messages requiring brevity or secrecy ] +Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] +   is 0.09090909090909091 +... +Path similarity of: +Synset('code.n.03') ( n ) [ (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions ] +Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ] +   is 0.09090909090909091 +``` + +这些是这两个词各 synset 之间路径相似度path similarity的最大值,这些值表明两个词是有关联性的。 + +NLTK 提供多种相似度计分器similarity scorers,比如: + + * path_similarity + * lch_similarity + * wup_similarity + * res_similarity + * jcn_similarity + * lin_similarity + +要进一步了解这个相似度计分器similarity scorers,请查看 [WordNet Interface][6] 的 Similarity 部分。 + +#### 自主尝试 + +使用 Python 库,从维基百科的 [Category: Lists of computer terms][7] 生成一个术语列表,然后计算各术语之间的相似度。 + +### tree树库treebank + +使用 NLTK,你可以把文本表示成树状结构以便进行分析。 + +这里有一个例子: + +这是一份简短的文本,对其做预处理和词性标注: + + +``` +import nltk + +text = "I love open source" +# Tokenize to words +words = nltk.tokenize.word_tokenize(text) +# POS tag the words +words_tagged = nltk.pos_tag(words) +``` + +要把文本转换成树状结构,你必须定义一个语法grammar 。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。 + + +``` +# A simple grammar to create tree +grammar = "NP: {<JJ><NN>}" +``` + +Next, use the grammar to create a tree: +然后用这个语法grammar创建一颗tree: + + +``` +# Create tree +parser = nltk.RegexpParser(grammar) +tree = parser.parse(words_tagged) +pprint(tree) +``` + +运行上面的代码,将得到: + + +``` +Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])]) +``` + +你也可以图形化地显示结果。 + +``` +tree.draw() +``` + +![NLTK Tree][9] + +(Girish Managoli, [CC BY-SA 4.0][10]) + +这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的主语 ([subject][11]): + + +``` +subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"] +def subject(sentence_tree): +    for tagged_word in sentence_tree: +        # A crude logic for this case -  first word with these tags is considered subject +        if tagged_word[1] in subject_tags: +            return tagged_word[0] + +print("Subject:", subject(tree)) +``` + +结果显示主语是 I: + +``` +Subject: I +``` + +这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票,1 月 1 号伦敦飞纽约的“,机器人可以用这种分析方法解读这个指令: + +**动作**: 预订 +**动作的对象**: 机票 +**乘客**: Jane +**出发地**: 伦敦 +**目的地**: 纽约 +**日期**: (明年) 1 月 1 号 + +树库treebank指由许多预先标注好的tree构成的语料库。现在已经有面向多种语言的树库,既有开源的,也有限定条件下才能免费使用的,以及商用的。其中使用最广泛的是面向英语的宾州树库。宾州树库取材于 _华尔街日报_ Wall Street Journal。NLTK 也包含了宾州树库作为一个子语料库。下面是一些使用树库treebank的方法: + +``` +words = nltk.corpus.treebank.words() +print(len(words), "words:") +print(words) + +tagged_sents = nltk.corpus.treebank.tagged_sents() +print(len(tagged_sents), "sentences:") +print(tagged_sents) + +[/code] [code] + +100676 words: +['Pierre', 'Vinken', ',', '61', 'years', 'old', ',', ...] +3914 sentences: +[[('Pierre', 'NNP'), ('Vinken', 'NNP'), (',', ','), ('61', 'CD'), ('years', 'NNS'), ('old', 'JJ'), (',', ','), ('will', 'MD'), ('join', 'VB'), ('the', 'DT'), ('board', 'NN'), ('as', 'IN'), ('a', 'DT'), ('nonexecutive', 'JJ'), ('director', 'NN'), ...] +``` + +查看一个句子里的各个标签tags: + +``` +sent0 = tagged_sents[0] +pprint(sent0) + +[/code] [code] + +[('Pierre', 'NNP'), + ('Vinken', 'NNP'), + (',', ','), + ('61', 'CD'), + ('years', 'NNS'), +... +``` + +定义一个语法grammar来把这个句子转换成树状结构: + +``` +grammar = ''' +    Subject: {<NNP><NNP>} +    SubjectInfo: {<CD><NNS><JJ>} +    Action: {<MD><VB>} +    Object: {<DT><NN>} +    Stopwords: {<IN><DT>} +    ObjectInfo: {<JJ><NN>} +    When: {<NNP><CD>} +''' +parser = nltk.RegexpParser(grammar) +tree = parser.parse(sent0) +print(tree) + +[/code] [code] + +(S +  (Subject Pierre/NNP Vinken/NNP) +  ,/, +  (SubjectInfo 61/CD years/NNS old/JJ) +  ,/, +  (Action will/MD join/VB) +  (Object the/DT board/NN) +  as/IN +  a/DT +  (ObjectInfo nonexecutive/JJ director/NN) +  (Subject Nov./NNP) +  29/CD +  ./.) +``` + +图形化地显示: + + +``` +tree.draw() +``` + +![NLP Treebank image][12] + +(Girish Managoli, [CC BY-SA 4.0][10]) + +trees树库treebanks的概念是文本分析的一个强大的组成部分。 + +#### 自主尝试 + +使用 Python 库,下载维基百科的 [open source][5] 页面,将得到的文本以图形化的树状结构展现出来。 + +### 命名实体识别Named entity recognition + +无论口语还是书面语都包含着重要数据。文本处理的主要目标之一,就是提取出关键数据。几乎所有应用场景所需要提取关键数据,比如航空公司的订票机器人或者问答机器人。 NLTK 为此提供了一个命名实体识别named entity recognition的功能。 + +这里有一个代码示例: + + +``` +`sentence = 'Peterson first suggested the name "open source" at Palo Alto, California'` +``` + +验证这个句子里的人名name地名place有没有被识别出来。照例先预处理: + +``` +import nltk + +words = nltk.word_tokenize(sentence) +pos_tagged = nltk.pos_tag(words) +``` + +运行命名实体标注器named-entity tagger: + +``` +ne_tagged = nltk.ne_chunk(pos_tagged) +print("NE tagged text:") +print(ne_tagged) +print() + +[/code] [code] + +NE tagged text: +(S +  (PERSON Peterson/NNP) +  first/RB +  suggested/VBD +  the/DT +  name/NN +  ``/`` +  open/JJ +  source/NN +  ''/'' +  at/IN +  (FACILITY Palo/NNP Alto/NNP) +  ,/, +  (GPE California/NNP)) +``` + +上面的结果里,命名实体被识别出来并做了标注;只提取这个tree里的命名实体: + +``` +print("Recognized named entities:") +for ne in ne_tagged: +    if hasattr(ne, "label"): +        print(ne.label(), ne[0:]) + +[/code] [code] + +Recognized named entities: +PERSON [('Peterson', 'NNP')] +FACILITY [('Palo', 'NNP'), ('Alto', 'NNP')] +GPE [('California', 'NNP')] +``` + +图形化地显示: + +``` +ne_tagged.draw() +``` + +![NLTK Treebank tree][13] + +(Girish Managoli, [CC BY-SA 4.0][10]) + +NLTK 内置的命名实体标注器named-entity tagger,使用的是宾州法尼亚大学的 [Automatic Content Extraction][14] (ACE) 程序。 该标注器能够识别组织机构ORGANIZATION、人名PERSON、地名LOCATION、设施FACILITY地缘政治实体geopolitical entity等常见实体entites。 + +NLTK 也可以使用其他标注器tagger,比如 [Stanford Named Entity Recognizer][15]. 这个经过训练的标注器用 Java 写成,但 NLTK 提供了一个使用它的接口 (详情请查看 [nltk.parse.stanford][16] 或 [nltk.tag.stanford][17])。 + +#### 自主尝试 + +使用 Python 库,下载维基百科的 [open source][5] 页面,并识别出对开源open source有影响力的人的名字,以及他们为开源open source做贡献的时间和地点。 + +### 高级实践 + +如果你准备好了,尝试用这篇文章以及此前的文章介绍的知识构建一个超级结构superstructure。 + +使用 Python 库,下载维基百科的 [Category: Computer science page][18],然后: + + + * 找出其中频率最高的单词unigrams、二元搭配bigrams三元搭配trigrams,将它们作为一个关键词keywords列表或者技术techonologies列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。 + * 图形化地显示这个领域里重要的人名、技术、日期和地点。这会是一份很棒的信息图。 + * 构建一个搜索引擎search engine。你的搜索引擎search engine性能能够超过维基百科吗? + + +### 接下来可以做什么? + +自然语言处理NLP应用构建application building的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。 + +在这个系列的文章里,我用 NLTK 作为例子,展示了自然语言处理可以做什么。自然语言处理和 NLTK 还有太多东西值得探索,这个系列的文章只是帮助你探索它们的切入点。 + +如果你的需求慢慢增长到 NLTK 已经满足不了了,你可以训练新的模型或者向 NLTK 添加新的功能。基于 NLTK 构建的新的自然语言处理库NLP libraries正在不断涌现,机器学习也正被深度用于自然语言处理。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/8/nlp-python-nltk + +作者:[Girish Managoli][a] +选题:[lujun9972][b] +译者:[tanloong](https://github.com/tanloong) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gammay +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen) +[2]: https://opensource.com/article/20/8/intro-python-nltk +[3]: http://www.nltk.org/ +[4]: https://en.wikipedia.org/wiki/WordNet +[5]: https://en.wikipedia.org/wiki/Open_source +[6]: https://www.nltk.org/howto/wordnet.html +[7]: https://en.wikipedia.org/wiki/Category:Lists_of_computer_terms +[8]: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html +[9]: https://opensource.com/sites/default/files/uploads/nltk-tree.jpg (NLTK Tree) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://en.wikipedia.org/wiki/Subject_(grammar) +[12]: https://opensource.com/sites/default/files/uploads/nltk-treebank.jpg (NLP Treebank image) +[13]: https://opensource.com/sites/default/files/uploads/nltk-treebank-2a.jpg (NLTK Treebank tree) +[14]: https://www.ldc.upenn.edu/collaborations/past-projects/ace +[15]: https://nlp.stanford.edu/software/CRF-NER.html +[16]: https://www.nltk.org/_modules/nltk/parse/stanford.html +[17]: https://www.nltk.org/_modules/nltk/tag/stanford.html +[18]: https://en.wikipedia.org/wiki/Category:Computer_science From 05a5878f07c9a6f8556d53bdfd6820912e1c0f4d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 16 Jul 2021 08:30:41 +0800 Subject: [PATCH 439/870] translated --- ...en for Batch Processing Images on Linux.md | 99 ------------------- ...en for Batch Processing Images on Linux.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20210712 Converseen for Batch Processing Images on Linux.md create mode 100644 translated/tech/20210712 Converseen for Batch Processing Images on Linux.md diff --git a/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md b/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md deleted file mode 100644 index e0f56a47b7..0000000000 --- a/sources/tech/20210712 Converseen for Batch Processing Images on Linux.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: (Converseen for Batch Processing Images on Linux) -[#]: via: (https://itsfoss.com/converseen/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Converseen for Batch Processing Images on Linux -====== - -Converseen is a free and open source software for batch image conversion. With this tool, you can convert multiple images to another format, resize, change their aspect ratio, rotate or flip them all at once. - -This is a handy tool for someone like me who has to deal with multiple screenshots of different size but has to resize them all before uploading to the website. - -Batch conversion tools help a lot in such cases. This could be done in the Linux command line with the wonderful [ImageMagick][1] but a GUI tool is a lot easier to use here. Actually, Converseen uses ImageMagick underneath the Qt-based GUI. - -### Batch process images with Converseen - -You can use [Converseen][2] to convert, resize, rotate and flip multiple images with a mouse click. - -You have plenty of supporting options for the batch conversion. You can add additional images to your selection or remove some of them. You can choose to convert only a few of your selected images. - -While resizing the images, you can choose to keep the aspect ratio. Keep in mind that out of width and height, the one you changed/typed last is the one controlling the aspect ratio. So, if you want to resize keeping the same aspect ratio but according to the width, don’t touch the height field. - -![][3] - -You can also choose to save the converted images with different name in the same directory or some other location. You may also overwrite the existing images. - -You cannot add folder but you can select and add multiple images at once. - -You can convert the images to a number of formats like JPEG, JPG, TIFF, SVG and more. - -There is also an option to give the transparent background a certain color while changing the format. You can also set the quality of the compression level. - -![][4] - -Converseen says that it can also import PDF files and convert the entire PDF or part of it into images. However, it crashed in Ubuntu 21.04 each time I tried to convert a PDF file. - -### Install Converseen on Linux - -Converseen is a popular application. It is available in the repositories of most Linux distributions. - -You can search for it in your distribution’s software center: - -![][5] - -You may, of course, use your distribution’s package manager to install it via command line. - -On Debian and Ubuntu-based distributions, use: - -``` -sudo apt install converseen -``` - -On Fedora, use: - -``` -sudo dnf install converseen -``` - -On Arch and Manjaro, use: - -``` -sudo pacman -Sy converseen -``` - -Converseen is also available for Windows and FreeBSD. You can get the instructions on the download page of the project website. - -[Download Converseen][6] - -Its source code is [available][7] on the project’s GitHub repository. - -If you are looking for an even easier way to resize a single image, you can use this nifty trick and [resize and rotate images with right click context menu in Nautilus file manager][8]. - -Overall, Converseen is a useful GUI tool for batch image conversion. It’s not perfect but it works for the most part. Have you ever used Converseen or do you use a similar tool? How is your experience with it? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/converseen/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://imagemagick.org/index.php -[2]: https://converseen.fasterland.net/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-interface.png?resize=800%2C400&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-features-overview_copy.png?resize=800%2C497&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/install-converseen-linux.jpeg?resize=800%2C527&ssl=1 -[6]: https://converseen.fasterland.net/download/ -[7]: https://github.com/Faster3ck/Converseen -[8]: https://itsfoss.com/resize-images-with-right-click/ diff --git a/translated/tech/20210712 Converseen for Batch Processing Images on Linux.md b/translated/tech/20210712 Converseen for Batch Processing Images on Linux.md new file mode 100644 index 0000000000..bb65ad6498 --- /dev/null +++ b/translated/tech/20210712 Converseen for Batch Processing Images on Linux.md @@ -0,0 +1,99 @@ +[#]: subject: (Converseen for Batch Processing Images on Linux) +[#]: via: (https://itsfoss.com/converseen/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 上批量处理图像的 Converseen +====== + +Converseen 是一个免费的开源软件,用于批量图像转换。有了这个工具,你可以一次将多张图片转换成另一种格式,调整大小,改变它们的长宽比,旋转或翻转它们。 + +对于像我这样的人来说,这是一个很方便的工具,我必须处理多个不同大小的截图,但在上传到网站之前必须调整它们的大小。 + +批量转换工具在这种情况下有很大的帮助。这可以在 Linux 命令行中用不错的 [ImageMagick][1] 来完成,但在这里使用 GUI 工具要容易得多。实际上,Converseen 在基于 Qt 的图形用户界面下使用 ImageMagick。 + +### 用 Converseen 批量处理图像 + +你可以用 [Converseen][2] 通过鼠标点击来转换、调整大小、旋转和翻转多个图像。 + +你有很多支持批量转换的选项。你可以在你的选择中添加更多的图片,或者删除其中的一些。你可以选择只转换你选择的几张图片。 + +在调整图像大小时,你可以选择保持长宽比。请记住,在宽度和高度中,你最后改变/输入的那个是控制长宽比的那个。所以,如果你想在保持长宽比的情况下调整大小,但要根据宽度来调整,不要修改高度栏。 + +![][3] + +你也可以选择将转换后的图像以不同的名称保存在同一目录或其他位置。你也可以覆盖现有的图像。 + +你不能添加文件夹,但你可以一次选择并添加多个图像。 + +你可以将图像转换为多种格式,如 JPEG、JPG、TIFF、SVG 等。 + +在改变格式的同时,还有一个选项可以给透明背景以某种颜色。你还可以设置压缩级别的质量。 + +![][4] + +Converseen 还可以导入 PDF 文件,并将整个 PDF 或其中的一部分转换为图像。然而,在 Ubuntu 21.04 中,每次我试图转换一个 PDF 文件时,它就会崩溃。 + +### 在 Linux 上安装 Converseen + +Converseen 是一个流行的应用。它在大多数 Linux 发行版仓库中都有。 + +你可以在你的发行版的软件中心搜索到它: + +![][5] + +当然,你也可以使用你的发行版的包管理器通过命令行来安装它。 + +在基于 Debian 和 Ubuntu 的发行版上,使用: + +``` +sudo apt install converseen +``` + +在 Fedora 上,使用: + +``` +sudo dnf install converseen +``` + +在 Arch 和 Manjaro 上,使用: + +``` +sudo pacman -Sy converseen +``` + +Converseen 也可用于 Windows 和 FreeBSD。你可以在项目网站的下载页面获得相关说明。 + +[下载 Converseen][6] + +它的源码可在 GitHub 仓库[获取][7]。 + +如果你正在寻找一个更简单的方法来调整一张图片的大小,你可以使用这个巧妙的技巧,[在 Nautilus 文件管理器中用右键菜单调整图片大小和旋转图片][8]。 + +总的来说,Converseen 是一个有用的用于批量图像转换的 GUI 工具。它并不完美,但在大多数情况下是有用的。你曾经使用过 Converseen 或者你使用类似的工具吗?你对它的体验如何? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/converseen/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://imagemagick.org/index.php +[2]: https://converseen.fasterland.net/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-interface.png?resize=800%2C400&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-features-overview_copy.png?resize=800%2C497&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/install-converseen-linux.jpeg?resize=800%2C527&ssl=1 +[6]: https://converseen.fasterland.net/download/ +[7]: https://github.com/Faster3ck/Converseen +[8]: https://itsfoss.com/resize-images-with-right-click/ From 6d6d08c92d124eb24955e740b8d266bdb78a0ac7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 16 Jul 2021 08:33:18 +0800 Subject: [PATCH 440/870] translating --- sources/tech/20210714 Getting Started with Podman on Fedora.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210714 Getting Started with Podman on Fedora.md b/sources/tech/20210714 Getting Started with Podman on Fedora.md index ca3b5f92a7..852e1368cd 100644 --- a/sources/tech/20210714 Getting Started with Podman on Fedora.md +++ b/sources/tech/20210714 Getting Started with Podman on Fedora.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/getting-started-with-podman-in-fedora/) [#]: author: (Yazan Monshed https://fedoramagazine.org/author/yazanalmonshed/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 302a668f84985d07024ef8a092cb528d0eb91775 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Fri, 16 Jul 2021 08:49:29 +0800 Subject: [PATCH 441/870] Zz air patch 1 (#22564) * Update 20210703 Can Windows 11 Influence Linux Distributions.md * Update 20210703 Can Windows 11 Influence Linux Distributions.md * Update 20210703 Can Windows 11 Influence Linux Distributions.md * Update 20210703 Can Windows 11 Influence Linux Distributions.md * Update 20210703 Can Windows 11 Influence Linux Distributions.md * Update 20210703 Can Windows 11 Influence Linux Distributions.md * Update 20210703 Can Windows 11 Influence Linux Distributions.md * Update 20210703 Can Windows 11 Influence Linux Distributions.md * Rename sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md to translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md --- ...indows 11 Influence Linux Distributions.md | 117 ------------------ ...indows 11 Influence Linux Distributions.md | 114 +++++++++++++++++ 2 files changed, 114 insertions(+), 117 deletions(-) delete mode 100644 sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md create mode 100644 translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md diff --git a/sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md b/sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md deleted file mode 100644 index e49a166957..0000000000 --- a/sources/talk/20210703 Can Windows 11 Influence Linux Distributions.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: subject: (Can Windows 11 Influence Linux Distributions?) -[#]: via: (https://news.itsfoss.com/can-windows-11-influence-linux/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (zz-air) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Can Windows 11 Influence Linux Distributions? -====== - -Microsoft’s Windows 11 has been finally revealed. While some compare it to macOS, others compare the nitty-gritty details to find similarities with GNOME and KDE (which does not make much sense). - -But, among all the buzz, I am curious about something else — **Can Microsoft’s Windows 11 influence the future design decisions of desktop Linux distributions?** - -Here I shall mention some of my thoughts on why it might happen, if it has happened before, and what the future holds for Linux distributions. - -### Some Linux Distributions Already Focus on Windows-like Experience: But, why? - -Microsoft’s Windows is the most popular desktop operating system with **88% of the market share** for its ease of use, software support, and hardware compatibility. - -On the contrary, Linux has **about 2% of the market share,** even with all the added [benefits of Linux over Windows][1]. - -So what can Linux do to convince more users to try Linux as their desktop operating system? - -The main focus of every desktop operating system should be the user experience. While Microsoft and Apple have managed to provide a comfortable user experience for the masses, Linux distributions did not manage to get a big win on that front. - -However, you will find several [Linux distributions that aim to replace Windows 10][2]. These Linux distributions try to provide a familiar user interface that could encourage a Windows user to consider switching to Linux. - -And, due to the existence of such distributions, [switching to Linux in 2021][3] makes more sense than ever. - -Hence, to get more users to jump-ship to Linux, Microsoft Windows has influenced many distributions for years now. - -### Is Windows 11 Better than Linux in Some Way? - -The user interface is constantly evolving with Windows. Even if that’s subjective, it is what most desktop users seem to be going for. - -So I’d say Windows 11 has made some attractive improvements on that front. - -![][4] - -Not just limited to the UI/UX, things like integrating Microsoft Team’s chat features in the taskbar makes it convenient for users to instantly connect with anyone. - -**While Linux distributions do not have their own full-fledged services, more out-of-the-box integrations tailored like this should make the onboarding experience easier for new users.** - -And that brings me to another aspect of Windows 11—a personalized news and information feed. - -Sure, Microsoft collects data for that, and you may have to sign in using a Microsoft account. But this is yet something that reduces friction for the users to go and look for a separate app to keep track of weather, news, and other daily information. - -Linux does not force these choices for a user but features/integrations like this can be added as additional options which can be presented in the form of a choice to users. - -**In other words, making things more accessible while integrated with the OS should get rid of a steep learning curve.** - -And, the dreaded Microsoft Store has also got a serious upgrade with Windows 11. - -![][5] - -Unfortunately, for Linux distributions, I don’t see much meaningful upgrade to the app centers to make it visually appealing, and something interesting. - -elementaryOS is probably making a good effort to focus on the UX/UI, and the evolving the experience with app center but for the most other distros, no significant upgrade. - -![Software Manager in Linux Mint 20.1][6] - -While I appreciate what Deepin Linux does in this regard, but it isn’t the popular choice for many users who try Linux for the first time. - -### Windows 11 Introduces More Competition: Linux Has to Keep Up - -With the launch of Windows 11, Linux as a desktop choice will get more competition. - -While we do have some replacements for Windows 10 experience in the Linux world, there’s nothing that targets Windows 11, yet. - -But this brings us to the obvious counter-response from the Linux community – **a Linux distribution that takes a dab at Windows 11**. - -No matter whether you hate or love Microsoft’s latest design approach to Windows 11, the masses will adopt it over the next few years. - -And to keep Linux as a compelling desktop alternative, the design language with Linux distributions must evolve as well. - -Not just the desktop market—but laptop-exclusive design choices also need a significant improvement for Linux distributions. - -Some options like [Pop!_OS by System76][7] have been trying to offer that experience for Linux, which is a good start. - -I think Zorin OS can be one of the distributions to introduce a “**Windows 11**” layout as an option to get more users to try Linux. - -Not to forget—[Deepin Linux introduced Android app support][8] right after Windows 11 marketed it as a feature. - -So, you see when Microsoft’s Windows makes a move, it does have a ripple effect on Linux, too. And Deepin Linux’s Android app support is just the start…Let’s see what else comes up next. - -_What do you think about Windows 11 influencing the future of Linux desktop? Do we need to evolve as well? Or should we continue being different and not get influenced by what the masses choose?_ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/can-windows-11-influence-linux/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[zz-air](https://github.com/zz-air) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linux-better-than-windows/ -[2]: https://itsfoss.com/windows-like-linux-distributions/ -[3]: https://news.itsfoss.com/switch-to-linux-in-2021/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY0OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://pop.system76.com -[8]: https://news.itsfoss.com/deepin-linux-20-2-2-release/ diff --git a/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md b/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md new file mode 100644 index 0000000000..a031bd5626 --- /dev/null +++ b/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md @@ -0,0 +1,114 @@ +[#]: subject: (Can Windows 11 Influence Linux Distributions?) +[#]: via: (https://news.itsfoss.com/can-windows-11-influence-linux/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (zz-air) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Windows 11 能影响 Linux 发行版吗? +====== + +微软的 Windows11 终于发布了。 有些人将其与 macOS 进行比较,另一些人则比较其本质细节以找到与 GNOME 和 KDE 的相似之处(这没有多大意义)。 + +但是,在所以的热议中,我对另一件事很好奇—— **微软的 Windows 11 能影响桌面 Linux 发行版未来的决策吗?** + +在这里,如果它以前发生过,我将提到一些我的想法,关于它为什么会发生,以及 Linux 发行版未来会发生什么。 + +### 一些Linux发行版已经关注类似Windows的体验:但是,为什么呢? + +微软的 Windows 是最受欢迎的桌面操作系统,因其易操作、软件支持和硬件兼容占据了 88% 的市场分额。 +相反, Linux 占有 **大约 2% 的市场分额,** [即使 Linux 比 Windows 有更多的优势][1]。 + +那么 Linux 能做什么来说服更多的用户将 Linux 作为他们的桌面操作系统呢? + +每个桌面操作系统的主要关注点应该是用户体验。当微软和苹果设法为大众提供舒适的用户体验时, Linux 发行版并没有设法在这方面取得巨大的胜利。 + +然而,你将会发现有几个 [Linux 发行版打算取代 Windows 10][2]。这些 Linux 发行版试图提供一个熟悉的用户界面,鼓励 Windows 用户考虑切换到 Linux 。 + +而且,由于这些发行版的存在,[在 2021 年切换到 Linux][3] 比以往任何时候都更有意义。 + +因此,为了让更多的用户跳转到 Linux ,微软 Window 多年来已经影响了许多发行版。 +### Windows 11 在某些方面比 Linux 好? +用户界面随着 Windows 的发展而不断的发展。即使这是主观的,它似乎是大多数桌面用户的选择。 + +所以我要说 Windows11 在这方面做了一些有吸引力的改进。 + +![][4] + +不仅仅局限于 UI/UX ,比如在任务栏中集成微软团队的聊天功能,可以方便用户与任何人即时联系。 + +**虽然 Linux 发行版没有自己成熟的服务,但是像这样定制的更多开箱即用的集成,应该会使新用户更容易上手。** + +并且这让我想起了 Windows 11 的另一个方面——一个个性化的欣慰和信息提要。 + +当然,微软会为此收集数据,你可能需要使用微软账号登录。但这也减少了用户寻找独立应用程序来跟踪天气、新闻和其他日常信息。 + +Linux 不会强迫用户做出这些选择,但是像这样的特性/集成可以作为额外的选项添加,可以以选择的形式呈现给用户。 + +**换句话说,在与操作系统集成的同时使事物更容易访问,应该可以摆脱陡峭的学习曲线。** + +而且,可怕的微软商店也在 Windows 11 上进行了重大升级。 + +![][5] + +不幸的是,对于 Linux 发行版,我没有看到对应用中心进行有意义的升级,来使其在视觉上更吸引人,更有趣。 + + +elementaryOS 可能正努力专注于 UX/UI ,并发展应用中心的体验,但对于大多数其他发行版,没有重大的升级。 + +![Linux Mint 20.1 中的软件管理器][6] + +虽然我很欣赏 Deepin Linux 在这方面所做的,但它并不是许多用户第一次尝试 Linux 时的热门选择。 + +### Windows 11 引入了更多的竞争:Linux 必须跟上 + +随着 Windows 11 的推出,作为桌面选择的 Linux 将面临更多的竞争。 + +虽然在 Linux 世界中,我们确实有一些 Windows 10 经验的替代品,但还没有针对 Windows 11 的。 + +但这让我们看到了来自 Linux 社区的明显回应—— **在 Windows 11 上使用 dab 的 Linux 发行版**. + +不管是讨厌还是喜欢微软最新的 Windows 11 设计方案,在接下来的几年里,大众将会接受它。 + +并且,为了使 Linux 成为一个引人注目的桌面替代品, Linux 发行版的设计语言也必须发展。 + +不仅仅是桌面市场————还有笔记本专用的设计选择————也需要对 Linux 发行版进行显著改进。 + +有些选择想 [Pop!_OS_System 76 ][7] 一直试图为 Linux 提供这种体验,这是一个良好的开端。 + +我认为 Zorin 操作系统开源作为一个发行版引入 “**Windows 11**” 布局作为一个选择,让更多用户尝试 Linux。 +别忘了——在 windows 11 将 Android 应用程序支持作为一项功能推向市场之后,[Deepin Linux 就引入了 Android 应用程序支持。][8] + +所以,你看,当微软的 Windows 采取行动时,对 Linux 也会产生连锁反应。而 Deepin Linux 的 Android 应用支持只是一个开始......让我们看看接下来还会出现什么。 + +_你对 Windows 11 影响 Linux 桌面的未来有什么看法?我们也需要进化吗?或者我们应该继续与众不同,不受大众选择的影响?_ + +#### 大型科技网站获得数百万美元的收入, 是自由/开源软件吸引了你! + +如果你喜欢我们的自由/开源软件,请考虑捐款支持我们的独立出版。您的支持将帮助我们继续发布专注于桌面 Linux 和开源软件的内容。 + +我不感兴趣 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/can-windows-11-influence-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[zz-air](https://github.com/zz-air) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-better-than-windows/ +[2]: https://itsfoss.com/windows-like-linux-distributions/ +[3]: https://news.itsfoss.com/switch-to-linux-in-2021/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY0OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://pop.system76.com +[8]: https://news.itsfoss.com/deepin-linux-20-2-2-release/ From 5905093bfef04d6988407876b4cc39a0cdf6631c Mon Sep 17 00:00:00 2001 From: lcf33 Date: Fri, 16 Jul 2021 09:44:35 +0800 Subject: [PATCH 442/870] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Lets You Edit Metadata with an Improved UI - Qt 6 Support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md b/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md index 4898095a65..f73a88e2e3 100644 --- a/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md +++ b/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/pdf-mix-tool-1-0-1-release/) [#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lcf33) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d0e4037c9d81326cd39c565c196b8464d52836ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Jul 2021 10:03:20 +0800 Subject: [PATCH 443/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lcf33 感谢您,完成了第一篇翻译贡献! --- ...w Available With New Features and Tools.md | 68 ++++++++++--------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md b/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md index 2e1adbd47e..9c173d59a5 100644 --- a/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md +++ b/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md @@ -3,16 +3,20 @@ [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (lcf33) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -包含新功能和工具的Linux Mint 20.2 已经发布。 +包含新功能和工具的 Linux Mint 20.2 已经发布 ====== -几周前,Linux Mint 20.2 beta版[发布][1]了。现在,Linux Mint 20.2 最终稳定版也发布了。 +>Linux Mint 20.2 是一次令人兴奋的升级,它有新的应用程序、更新提醒和桌面环境的升级。是时候升级了? -这个版本是基于Ubuntu 20.04 的LTS(长期支持版本),支持2025年截止。 +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/linux-mint-20-2.jpg?w=1200&ssl=1) + +几周前,Linux Mint 20.2 beta 版 [发布][1]了。现在,Linux Mint 20.2 最终稳定版也发布了。 + +这个版本是基于 Ubuntu 20.04 的 LTS(长期支持版本),支持 2025 年截止。 来看下这个版本有什么新特性,以及如何获取它。 @@ -20,59 +24,59 @@ 这个版本主要两点是增加了更新通知。该功能鼓励用户更新系统,以确保安全性。 -该功能不像[Windows系统那样强制更新][2],但它会留意你多久没有更新系统,检查系统运行时间,然后提醒你更新。 +该功能不像 [Windows 系统那样强制更新][2],但它会留意你多久没有更新系统,检查系统运行时间,然后提醒你更新。 ![][3] 更棒的是,你可以配置更新通知。 -其他主要升级还有:桌面环境**Cinnamon 5**,新的**批量改名工具**Bulky,**用Sticky Notes取代GNote**作为默认笔记应用。 +其他主要升级还有:桌面环境 **Cinnamon 5**,新的**批量改名工具** Bulky,**用 Sticky Notes 取代 GNote** 作为默认笔记应用。 + ![][4] -批量文件改名工具可以在所有桌面版本,但不包括Xfce。因为Xfce默认文件管理器(Thunar)已经有该功能(批量文件改名)。 +批量文件改名工具可以在所有桌面版本中使用,但不包括 Xfce。因为 Xfce 默认的文件管理器(Thunar)已经有该功能。 + +Cinnamon 5 不是很让人激动,不过有一些内在性能改进,并增加了限制内存使用的选项。 -Cinnamon 5不是很让人激动,不过有一些内在性能改进,并增加了限制内存使用的选项。 ![][5] -Sticky Notes 是用GTK 3开发的,支持HiDPI,并提供了更多的功能。同时,与系统托盘整合得更好。 +Sticky Notes 是用 GTK 3 开发的,支持 HiDPI,并提供了更多的功能。同时,与系统托盘整合得更好。 + ![][6] ### 其他改进 -在网络上共享文件的[Warpinator应用程序][7]得到了一些升级,变得更有用。 +在网络上共享文件的 [Warpinator 应用程序][7] 得到了一些升级,变得更有用。 -其他桌面环境的升级包括Xfce 4.16和MATE 1.24。除此之外,你还会发现一些细微的UI改进和错误修复。 +其他桌面环境的升级包括 Xfce 4.16 和 MATE 1.24。除此之外,你还会发现一些细微的 UI 改进和错误修复。 -特别是解决了NVIDIA显卡**对混合图形的支持**的问题,这对笔记本电脑用户来说是个好消息。 +特别是解决了 NVIDIA 显卡**对混合图形的支持**的问题,这对笔记本电脑用户来说是个好消息。 -要了解更多变更详情,你可以参考任一桌面版本的[官方公告][8]。 +要了解更多变更详情,你可以参考任一桌面版本的 [官方公告][8]。 -### 下载或升级至Linux Mint 20.2 +### 下载或升级至 Linux Mint 20.2 -你可以直接在官方网站[下载页面][9]找到稳定版本。 -[Download Linux Mint 20.2][9] +你可以直接在官方网站 [下载页面][9] 找到稳定版本。 -如果已经安装了Linux Mint 20 或者 20.1。你可以先检查所有可用更新,然后更新管理器会收到更新。 +- [下载 Linux Mint 20.2][9] + +如果已经安装了 Linux Mint 20 或者 20.1。你可以先检查所有可用更新,然后更新管理器会收到更新。 + +接下来,确保你做了备份(如果你想的话,可以使用 timeshift 工具),然后从**编辑**菜单种静茹更新管理器的系统升级选项,如下所示。 -接下来,确保你做了备份(如果你想的话,可以使用timeshift工具),然后从**编辑**菜单种静茹更新管理器的系统升级选项,如下所示。 ![][10] -当你单击后,屏幕上会出现升级的提示。你也可以通过[官方升级说明][11]获得进一步帮助。 +当你单击后,屏幕上会出现升级的提示。你也可以通过 [官方升级说明][11] 获得进一步帮助。 -_你完成升级了吗?你对最新版本有什么看法?欢迎在下面的平路种分享你的想法。_ +_你完成升级了吗?你对最新版本有什么看法?欢迎在下面的评论中分享你的想法。_ -#### 大型科技网站It's FOSS需要你,获得数百万收入 - -如果你喜欢我们It's FOSS网站,请考虑捐款支持我们的独立出版物。您的支持将帮助我们继续出版专注于桌面Linux和开源软件的内容。 - -我不感兴趣。 -------------------------------------------------------------------------------- via: https://news.itsfoss.com/linux-mint-20-2-release/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/lcf33) -校对:[校对者ID](https://github.com/校对者ID) +译者:[lcf33](https://github.com/lcf33) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -80,12 +84,12 @@ via: https://news.itsfoss.com/linux-mint-20-2-release/ [b]: https://github.com/lujun9972 [1]: https://news.itsfoss.com/linux-mint-20-2-beta-release/ [2]: https://news.itsfoss.com/linux-mint-updates-notice/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2MCIgd2lkdGg9IjQ5NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9IjU3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/linux-mint-update-reminder.png?w=494&ssl=1 +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/bulky-mint.png?w=570&ssl=1 +[5]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/cinnamon-memory.png?w=800&ssl=1 +[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/mint-sticky-notes-ui.png?resize=1568%2C937&ssl=1 [7]: https://news.itsfoss.com/warpinator-android-app/ [8]: https://blog.linuxmint.com/?p=4102 [9]: https://linuxmint.com/download.php -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2MCIgd2lkdGg9IjUzMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/mint-upgrade.png?w=533&ssl=1 [11]: https://blog.linuxmint.com/?p=4111 From 36c9bd3eca95e00324a040e63a856b189aa6e12c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Jul 2021 10:04:38 +0800 Subject: [PATCH 444/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lcf33 本文首发地址:https://linux.cn/article-13584-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/lcf33 --- ... Mint 20.2 is Now Available With New Features and Tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md (98%) diff --git a/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md b/published/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md similarity index 98% rename from translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md rename to published/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md index 9c173d59a5..2c4933f98f 100644 --- a/translated/news/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md +++ b/published/20210708 Linux Mint 20.2 is Now Available With New Features and Tools.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (lcf33) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13584-1.html) 包含新功能和工具的 Linux Mint 20.2 已经发布 ====== From 537676b172727753c9c5bc50ea39f500caa1c3b0 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Fri, 16 Jul 2021 10:06:16 +0800 Subject: [PATCH 445/870] Update 20210713 Use XMLStarlet to parse XML in your the Linux terminal.md --- ...13 Use XMLStarlet to parse XML in your the Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md b/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md index 00f07458ee..7b04c85fbe 100644 --- a/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md +++ b/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/parse-xml-linux) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c5d87dd90fb76ff702245a5b9c7b7e10c5defa07 Mon Sep 17 00:00:00 2001 From: zxy-wyx <86962296+zxy-wyx@users.noreply.github.com> Date: Fri, 16 Jul 2021 10:23:29 +0800 Subject: [PATCH 446/870] Zxy wyx patch 1 (#22572) * Update 20210629 A brief history of FreeDOS.md * Update 20210629 A brief history of FreeDOS.md * Update 20210629 A brief history of FreeDOS.md * Update 20210629 A brief history of FreeDOS.md * Update 20210629 A brief history of FreeDOS.md * Update and rename sources/talk/20210629 A brief history of FreeDOS.md to translated/talk/20210629 A brief history of FreeDOS.md --- .../20210629 A brief history of FreeDOS.md | 110 ------------------ .../20210629 A brief history of FreeDOS.md | 106 +++++++++++++++++ 2 files changed, 106 insertions(+), 110 deletions(-) delete mode 100644 sources/talk/20210629 A brief history of FreeDOS.md create mode 100644 translated/talk/20210629 A brief history of FreeDOS.md diff --git a/sources/talk/20210629 A brief history of FreeDOS.md b/sources/talk/20210629 A brief history of FreeDOS.md deleted file mode 100644 index 2586f79cfd..0000000000 --- a/sources/talk/20210629 A brief history of FreeDOS.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: subject: (A brief history of FreeDOS) -[#]: via: (https://opensource.com/article/21/6/history-freedos) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -A brief history of FreeDOS -====== -Throughout its nearly 30-year journey, FreeDOS has been the modern DOS. -![Person typing on a 1980's computer][1] - -A master was explaining the nature of [The Tao of Programming][2] to one of his novices. "The Tao is embodied in all software—regardless of how insignificant," said the master. - -"Is Tao in a hand-held calculator?" asked the novice. - -"It is," came the reply. - -"Is the Tao in a video game?" continued the novice. - -"It is even in a video game," said the master. - -"And is the Tao in the DOS for a personal computer?" - -The master coughed and shifted his position slightly. "The lesson is over for today," he said. - -The Tao of Programming, Geoffrey James, InfoBooks, 1987 - -Computing used to be limited only to expensive mainframes and "Big Iron" computer systems like the PDP11. But the advent of the microprocessor brought about a computing revolution in the 1970s. You could finally have a computer in your home—the "personal computer" had arrived! - -The earliest personal computers I remember seeing included the Commodore, TRS-80, and Apple. The personal computer became such a hot topic that IBM decided to enter the market. After a rapid development cycle, IBM released the IBM 5150 Personal Computer (the original "IBM PC") in August 1981. - -Creating a computer from scratch is no easy task, so IBM famously used "off-the-shelf" hardware to build the PC, and licensed other components from outside developers. One of those was the operating system, licensed from Microsoft. In turn, Microsoft acquired 86-DOS from Seattle Computer Products, applied various updates, and debuted the new version with the IBM PC as IBM PC-DOS. - -### Early DOS - -Running in memory _up to_ 640 kilobytes, DOS really couldn't do much more than manage the hardware and allow the user to launch applications. As a result, the PC-DOS 1.0 command line was pretty anemic, only including a few commands to set the date and time, manage files, control the terminal, and format floppy disks. DOS also included a BASIC language interpreter, which was a standard feature in all personal computers of the era. - -It wasn't until PC-DOS 2.0 that DOS became more interesting, adding new commands to the command line, and including other useful tools. But for me, it wasn't until MS-DOS 5.0 in 1991 that DOS began to feel "modern." Microsoft overhauled DOS in this release, updating many of the commands and replacing the venerable Edlin editor with a new full-screen editor that was more user-friendly. DOS 5 included other features that I liked, as well, such as a new BASIC interpreter based on Microsoft QuickBASIC Compiler, simply called QBASIC. If you've ever played the Gorillas game on DOS, it was probably in MS-DOS 5.0. - -Despite these upgrades, I wasn't entirely satisfied with the DOS command line. DOS never strayed far from the original design, which proved limiting. DOS gave the user a few tools to do some things from the command line—otherwise, you were meant to use the DOS command line to launch applications. Microsoft assumed the user would spend most of their time in a few key applications, such as a word processor or spreadsheet. - -But developers wanted a more functional DOS, and a sub-industry sprouted to offer neat tools and programs. Some were full-screen applications, but many were command-line utilities that enhanced the DOS command environment. When I learned a bit of C programming, I started writing my own utilities that extended or replaced the DOS command line. And despite the rather limited underpinnings of MS-DOS, I found that the third-party utilities, plus my own, created a powerful DOS command line. - -### FreeDOS - -In early 1994, I started seeing a lot of interviews with Microsoft executives in tech magazines saying the next version of Windows would totally do away with DOS. I'd used Windows before—but if you remember the era, you know Windows 3.1 wasn't a great platform. Windows 3.1 was clunky and buggy—if an application crashed, it might take down the entire Windows system. And I didn't like the Windows graphical user interface, either. I preferred doing my work at the command line, not with a mouse. - -I considered Windows and decided, “If Windows 3.2 or Windows 4.0 will be anything like Windows 3.1, I want nothing to do with it.” But what were my options? I'd already experimented with Linux at this point, and thought [Linux was great][3]—but Linux didn't have any applications. My word processor, spreadsheet, and other programs were on DOS. I needed DOS. - -Then I had an idea! I thought, “If developers can come together over the internet to write a complete Unix operating system, surely we can do the same thing with DOS.” After all, DOS was a fairly straightforward operating system compared to Unix. DOS ran one task at a time (single-tasking) and had a simpler memory model. It shouldn't be _that_ hard to write our own DOS. - -So on June 29, 1994, I [posted an announcement][4] to `comp.os.msdos.apps`, on a message board network called Usenet: - -ANNOUNCEMENT OF PD-DOS PROJECT: - -A few months ago, I posted articles relating to starting a public domain version of DOS. The general support for this at the time was strong, and many people agreed with the statement, "start writing!" So, I have... - -Announcing the first effort to produce a PD-DOS. I have written up a "manifest" describing the goals of such a project and an outline of the work, as well as a "task list" that shows exactly what needs to be written. I'll post those here, and let discussion follow. - -_* A note about the name—I wanted this new DOS to be something that everyone could use, and I naively assumed that when everyone could use it, it was "public domain." I quickly realized the difference, and we renamed "PD-DOS" to "Free-DOS"—and later dropped the hyphen to become "FreeDOS."_ - -A few developers reached out to me, to offer utilities they had created to replace or enhance the DOS command line, similar to my own efforts. We pooled our utilities and created a useful system that we released as "Alpha 1" in September 1994, just a few months after announcing the project. Development was pretty swift in those days, and we followed up with "Alpha 2" in December 1994, "Alpha 3" in January 1995, and "Alpha 4" in June 1995. - -### A modern DOS - -Since then, we've always focused on making FreeDOS a "modern" DOS. And much of that modernization is centered on creating a rich command-line environment. Yes, DOS still needs to support applications, but we believe FreeDOS needs a strong command-line environment, as well. That's why FreeDOS includes dozens of useful tools, including commands to navigate directories, manage files, play music, connect to networks, ... and a collection of Unix-like utilities such as `less`, `du`, `head`, `tail`, `sed`, and `tr`. - -While FreeDOS development has slowed, it has not stopped. Developers continue to write new programs for FreeDOS, and add new features to FreeDOS. I'm particularly excited about several great additions to FreeDOS 1.3 RC4, the latest release candidate for the forthcoming FreeDOS 1.3. A few recent updates: - - * Mateusz Viste created a new ebook reader called Ancient Machine Book (AMB) that we've leveraged as the new help system in FreeDOS 1.3 RC4 - * Rask Ingemann Lambertsen, Andrew Jenner, TK Chia, and others are updating the IA-16 version of GCC, including a new _libi86_ library that provides some degree of compatibility with the Borland Turbo C++ compiler's C library - * Jason Hood has updated an unloadable CD-ROM redirector substitute for Microsoft's MSCDEX, supporting up to 10 drives - * SuperIlu has created DOjS, a Javascript development canvas with an integrated editor, graphics and sound output, and mouse, keyboard, and joystick input - * Japheth has created a DOS32PAE extender that is able to use huge amounts of memory through PAE paging - - - -Despite all of the new development on FreeDOS, we remain true to our DOS roots. As we continue working toward FreeDOS 1.3 "final," we carry several core assumptions, including: - - * **Compatibility is key**—FreeDOS isn't really "DOS" if it can't run classic DOS applications. While we provide many great open source tools, applications, and games, you can run your legacy DOS applications, too. - * **Continue to run on old PCs (XT, '286, '386, etc)**—FreeDOS 1.3 will remain 16-bit Intel but will support new hardware with expanded driver support, where possible. For this reason, we continue to focus on a single-user command-line environment. - * **FreeDOS is open source software**—I've always said that FreeDOS isn't a "free DOS" if people can't access, study, and modify the source code. FreeDOS 1.3 will include software that uses recognized open source licenses as much as possible. But DOS actually pre-dates the GNU General Public License (1989) and the Open Source Definition (1998) so some DOS software might use its own "free with source code" license that isn't a standard "open source" license. As we consider packages to include in FreeDOS, we continue to evaluate any licenses to ensure they are suitably "open source," even if they are not officially recognized. - - - -We welcome your help in making FreeDOS great! Please join us on our email list—we welcome all newcomers and contributors. We communicate over an email list, but the list is fairly low volume so is unlikely to fill up your Inbox. - -Visit the FreeDOS website at [www.freedos.org][5]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/history-freedos - -作者:[Jim Hall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) -[2]: https://www.mit.edu/~xela/tao.html -[3]: https://opensource.com/article/17/5/how-i-got-started-linux-jim-hall-freedos -[4]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ -[5]: https://www.freedos.org/ diff --git a/translated/talk/20210629 A brief history of FreeDOS.md b/translated/talk/20210629 A brief history of FreeDOS.md new file mode 100644 index 0000000000..3931cd87d6 --- /dev/null +++ b/translated/talk/20210629 A brief history of FreeDOS.md @@ -0,0 +1,106 @@ +[#]: subject: (A brief history of FreeDOS) +[#]: via: (https://opensource.com/article/21/6/history-freedos) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (zxy-wyx) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +FreeDOS 简史 +====== +经历了近30年的发展, FreeDOS 已经成为了世界先进的 DOS。 +![第一批使用计算机的人][1] + +一个老师正在给他的一个学生讲[编程之道][2]。 “编程之道包含在所有的软件中--不管它多么微不足道,” 老师说道。 + +“编程之道在手提电脑里面吗?” 学生问道。 + +“是的,” 老师回答道。 + +“编程之道在电脑游戏里面吗?”学生继续问道 + +“他甚至在电脑游戏里面," 老师说。 + +“那编程之道在个人电脑的操作系统里面吗?” + +老师咳嗽了一下,稍稍改变了姿势,说道,“今天的课结束了。” + +编程之道, Geoffrey James, 信息类书籍, 1987 + +过去,计算仅限于昂贵的大型机和“超大型计算机”计算机系统,如 PDP 11。但是微处理器的出现在 20 世纪 70 年代带来了一场计算机革命。 你终于可以在家里有一台电脑了——“个人电脑浪潮”已经到了! + +我记得看到的最早的个人电脑包括 Commodore, TRS-80, 和 Apple。个人电脑成了一个热门话题,所以 IBM 决定进入这个市场。 在经历了一个短暂的开发周期之后,IBM 于 1981 年 8 月发布了 IBM 5150 个人计算机(最初的“IBM PC”)。 + +从零开始创建一台计算机并非易事,因此 IBM 用现成的硬件来构建 PC 而闻名,并从外部开发人员那里获得了其他组件的许可。 其中之一是微软授权的操作系统。反过来,微软从西雅图电脑产品公司获得了 86-DOS ,进行了各种更新,并在 IBM PC 上推出了新版本的 IBM PC-DOS。 + +###早期的 DOS + +早期的 DOS 在内存中运行最多为 640 千字节, DOS 只能管理硬件,允许用户启动应用程序。因此,PC-DOS 1.0 命令行非常贫乏,只包含了一些设置日期和时间、管理文件、控制终端和格式化软盘的命令。DOS 还包括一个基本的语言解释器,这是这个时代所有个人计算机的一个基本功能。 + +直到 PC-DOS 2.0,DOS 才变得更加有趣,在命令行中添加了新的命令,并包含了其他有用的工具。但对我来说,直到1991 年 MS-DOS 5.0 才开始感觉到先进。微软在这个版本中对 DOS 进行了全面改革,更新了许多命令,并用一个新的全屏编辑器取代了老旧的 Edlin 编辑器,这个编辑器对用户更加友好。 DoS 5 还包括我喜欢的其他特性,比如基于 Microsoft QuickBASIC Compiler, 简称 QBASIC. 如果你曾经在 DOS 上玩过 the Gorillas 游戏, 可能是在 MS-DOS 5.0 中运行。 + +尽管进行了这些升级,但我对 DOS 命令行并不完全满意。DOS 从来没有偏离原来的设计,改变有限。DOS 为用户提供了一些工具,可以从命令行执行一些事情--否则,你就应该使用 DOS 命令行来启动应用程序。微软认为用户大部分时间都会花在几个关键的应用程序上,比如文字处理器或电子表格。 + +但是开发人员想要一个功能更强的 DOS,此时一个子行业正在萌芽,以提供整洁的工具和程序。有些是全屏应用程序,但也有许多是增强 DOS 命令环境的命令行实用程序. 当我学到一点 C 编程时,我开始编写自己的实用程序,扩展或替换 DOS 命令行。尽管 MS-DOS 的基础相当有限,但我发现第三方实用程序加上我自己的工具创建了一个功能强大的DOS命令行。 + +### FreeDOS + +1994 年初,我开始在科技杂志上看到很多微软高管的采访,他们说下一个版本的 Windows 将完全取代 DOS。 我以前使用过 Windows,但如果你还记得那个时代,你就知道 Windows 3.1 不是一个很好的平台。 Windows 3.1 是笨重的和有很多漏洞的——如果一个应用程序崩溃,它可能会摧毁整个 Windows 系统。我也不喜欢 Windows 的图形用户界面。我更喜欢在命令行做我的工作,而不是用鼠标。 + +我考虑了 Windows,并决定,“如果 Windows3.2 或 Windows4.0 将类似于 Windows3.1,我我将不会去使用它。” 但我有什么选择?此时,我已经对 Linux 进行了实验,并认为 [linux很棒][3]—但是 Linux 没有任何应用程序。我的文字处理器、电子表格和其他程序都在 DOS 上。我需要 DOS。 + +然后我有了个主意!我想,“如果开发人员能够在互联网上共同编写一个完整的 Unix 操作系统,那么我们当然可以在 DOS 中做同样的事情。”毕竟,与 Unix 相比,DOS 是一个相当简单的操作系统。DOS 一次运行一个任务(单任务),并且有一个更简单的内存模型。写我们自己的 DOS 应该不难。 + +因此,在 1994 年 6 月 29 日,我在一个名为 Usenet 的留言板网络上向 ‘comp.os.msdos.apps’[发布了一个公告][4] 。 + +PD-DOS 项目宣布: + +几个月前,我发表了关于启动 DOS 公共领域版本的文章。 当时对此的普遍支持很强烈,许多人都同意这样的说法:“开始创作吧!”所以我有..。 + +第一次宣布努力生产 PD-DOS。我已经写了一个“清单”,描述了这样一个项目的目标和工作大纲,以及一个“任务列表”,它准确地显示了需要写什么。我会把这些贴在这里,然后讨论一下。 + +*关于这个名字的注释--我希望这个新的 DOS 成为每个人都可以使用的东西,我天真地认为,当每个人都可以使用它时,它就是“公共领域”。我很快就意识到了这种差别,所以我们把 “PD-DOS” 改名为 “Free-DOS”,然后去掉连字符变成 “FreeDOS”。 + +一些开发人员联系我,提供他们为替换或增强 DOS 命令行而创建的实用程序,类似于我自己的努力。就在项目宣布几个月后,我们汇集了我们的实用程序,并创建了一个实用的系统,我们在 1994 年 9 月发布了一个名为 “Alpha 1” 的系统。当时的发展相当迅速,我们在 1994 年 12 月采用了 “Alpha 2”,1995 年 1 月采用了“Alpha 3”,1995 年 6 月采用了“Alpha 4”。 + +### 一个现代的 DOS + +从那以后,我们一直致力于使 FreeDOS 成为“现代” DOS。而大部分现代化都集中在创建一个丰富的命令行环境上。是的,DOS 仍然需要支持应用程序,但是我们相信 FreeDOS 也需要一个强大的命令行环境。这就是为什么 FreeDOS 包含了许多有用的工具,包括导航目录、管理文件、播放音乐、连接网络的命令,……以及类似 Unix 的实用程序集合,如 “Less”、“Du”、“Head”、“tail”、“Se”和“trt”。 + +虽然 FreeDOS 的开发已经放缓,但它并没有停止。开发人员继续为 FreeDOS 编写新程序,并向 FreeDOS 添加新功能。我对 FreeDOS 1.3 RC4 的几个重要补充感到特别兴奋,FreeDOS 1.3 RC4 是即将发布的FreeDOS 1.3 的最新候选版本。最近的一些更新如下: + + *Mateusz Viste 创建了一个新的电子书阅读器,名为 Ancient Machine Book (AMB),我们利用它作为 FreeDOS 1.3 RC4 中的新帮助系统。 + *Rask Ingemann Lambertsen、Andrew Jenner、TK Chia 和其他人正在更新 GCC 的 ia-16 版本,包括一个新的_libi86_库,它提供了与 Borland TurboC++ 编译器的 C 库的某种程度的兼容性。 + *Jason Hood 更新了一个可下载的 CD-ROM 重定向器,以替代微软的 MSCDEX,最多支持10个驱动器。 + *SuperIlu 已经创建了 DOjS,这是一个 Javascript 开发画布,具有集成的编辑器、图形和声音输出,以及鼠标、键盘和操纵杆输入。 + *Japheth 已经创建了一个 DOS32PAE 扩展程序,它能够通过 PAE 分页使用大量的内存。 + +尽管 FreeDOS 有了新的发展,我们仍然忠于我们的 DOS 根基。在我们继续朝着 FreeDOS 1.3 “最终”的方向努力时,我们提出了几个核心假设,包括: + + ***兼容性是关键**-如果FreeDOS不能运行经典DOS应用程序,它就不是真正的DOS。虽然我们提供了许多优秀的开源工具、应用程序和游戏,但您也可以运行遗留的DOS应用程序。 + ***继续在旧 PC 上运行(XT,‘286,386 等)**-FreeDOS 1.3 将保持 16 位英特尔,但在可能的情况下将支持扩展驱动程序支持的新硬件。为此,我们继续专注于单用户命令行环境。 + ***FreeDOS 是开源软件**-我一直说,如果人们不能访问、学习和修改源代码,FreeDOS 就不是“免费 DOS”。FreeDOS 1.3 将包括尽可能多地使用公认的开源许可证的软件。但 DOS 实际上早于 GNU 通用公共许可证 (1989)和开放源码定义 (1998),因此一些 DOS 软件可能会使用自己的“免费源代码”许可证,而这并不是标准的“开源”许可。当我们认为软件包包括在 FreeDOS,我们将继续评估任何许可证,以确保它们是合适的“开放源码”,即使它们没有得到正式承认。 + +我们欢迎您的帮助,使FreeDOS强大! 请加入我们的电子邮件名单-我们欢迎所有新来者和投稿人。我们通过电子邮件列表进行交流,但是列表的容量非常小,所以不太可能填满你的收件箱。 + +访问FreeDOS网站[www.freedos.org][5]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/history-freedos + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[zxy-wyx](https://github.com/zxy-wyx) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://www.mit.edu/~xela/tao.html +[3]: https://opensource.com/article/17/5/how-i-got-started-linux-jim-hall-freedos +[4]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ +[5]: https://www.freedos.org/ From c74e9728d64516708d4ea12b2a245504f682132f Mon Sep 17 00:00:00 2001 From: SamMa Date: Fri, 16 Jul 2021 10:40:52 +0800 Subject: [PATCH 447/870] Update 20210708 Write good examples by starting with real code.md --- ... good examples by starting with real code.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/translated/tech/20210708 Write good examples by starting with real code.md b/translated/tech/20210708 Write good examples by starting with real code.md index cb38d95fad..e0c94894f6 100644 --- a/translated/tech/20210708 Write good examples by starting with real code.md +++ b/translated/tech/20210708 Write good examples by starting with real code.md @@ -3,18 +3,18 @@ [#]: author: "Julia Evans https://jvns.ca/" [#]: collector: "lujun9972" [#]: translator: "zepoch" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " 从实际代码开始编写好的示例 ====== -当我写关于编程的事情时,我花费了大量时间在生产好的示例上。我从未见过有人写过关于如何写出好的示例,所以我就写了一下如何写出一份好的示例。 +当编写程序时,我花费了大量时间在编写好的示例上。我从未见过有人写过关于如何写出好的示例,所以我就写了一下如何写出一份好的示例。 -最基础的就是你真的去写代码,然后删除不相关的细节,使其成为一个自成一体的例子,而不是无中生有地想出一些例子。 +基础思路就是从你写的真实代码开始,然后删除不相关的细节,使其成为一个独立的例子,而不是无中生有地想出一些例子。 -我将会谈论两种示例:实例和令人惊讶的例子 +我将会谈论两种示例:基于真实案例的示例和奇怪的示例 ### 好的示例是真实的 @@ -25,9 +25,9 @@ numbers = [1, 2, 3, 4] squares = map(lambda x: x * x, numbers) ``` -我觉得这个示例是不真实的,有两方面的原因: +我觉得这个示例不是真实的,有两方面的原因: - * 将一组数字作平方运算不是你想要在真正的程序中完成的事,除非是项目 Euler 或某种东西(也有很多其它的更有可能的操作系统) + * 将一组数字作平方运算不是在真实的程序中完成的事,除非是项目 Euler 或某种东西(更多的可能是针对列表的操作) * `map` 在 Python 中并不是很常用,即便是做这个我也更愿意写 `[x*x for x in numbers]` 一个更加真实的 Python lambdas 的示例是使用 `sort` 函数,就像这样: @@ -58,9 +58,8 @@ sorted_children = sorted(children, key=lambda x: x['age']) ### 从真实代码中提炼出示例可能需要很长时间 -The example I just gave of explaining how to use `sort` with `lambda` is pretty simple and it didn’t take me a long time to come up with, but turning real code into a standalone example can take a really long time! -我给出的解释如何使用 `lambda` 和 `sort` 函数的例子是十分简单的,它并不需要花费我很长时间来想出来,但是将真实的代码化为一个独立的示例则是会需要花费很长的时间 +我给出的解释如何使用 `lambda` 和 `sort` 函数的例子是十分简单的,它并不需要花费我很长时间来想出来,但是将真实的代码化为一个独立的示例则是会需要花费很长的时间! 举个例子,我想在这篇文章中融入一些奇怪的 CSS 行为的例子来说明创造一个怪异或令人惊讶的案例是十分有趣的。我花费了两个小时来解决我这周遇到的一个实际的问题,确保我理解 CSS 的实际情况,并将其变成一个迷你的示例。 @@ -86,7 +85,7 @@ via: https://jvns.ca/blog/2021/07/08/writing-great-examples/ 作者:[Julia Evans][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/校对者ID) +校对:[校对者ID](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2169737e032d2aa1dbcae9a30861122b3da7ee5d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Jul 2021 10:48:26 +0800 Subject: [PATCH 448/870] PRF @geekpi @turbokernel --- ...ntOS, RHEL, Rocky Linux Minimal Install.md | 54 ++++++++----------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md b/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md index 2a1c1ff6f9..8d0e0aef9b 100644 --- a/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md +++ b/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md @@ -4,23 +4,23 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (turbokernel) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: url: ( ) 如何在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网 ====== + +![](https://img.linux.net.cn/data/attachment/album/202107/16/104745wne0x111onmafxj9.jpg) + 在最小化服务器安装中,设置互联网或网络是非常容易的。在本指南中,我们将解释如何在 CentOS、RHEL、Rocky Linux 最小安装中设置互联网或网络。 -当你初次完成最小化任何服务器发行版安装时,你没有任何图形界面或桌面环境用于设置你的网络或互联网。因此,当你只能使用终端时,了解如何设置联网是很重要的。NetworkManager 以及 systemd 服务为完成这项工作提供了必要的工具。以下是具体使用方法。 +当你刚刚完成任何服务器发行版的最小化安装时,你没有任何图形界面或桌面环境可以用于设置你的网络或互联网。因此,当你只能使用终端时,了解如何设置联网是很重要的。NetworkManager 以及 systemd 服务为完成这项工作提供了必要的工具。以下是具体使用方法。 ### 在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网 - * 完成安装后,启动服务器终端。理想情况下,你应该会看到提示符。使用 root 或 admin 账户登录。 - - - * 然后,首先尝试使用 nmcli 检查网络接口的状态和细节。nmcli 是一个控制 NetworkManager 服务的命令行工具。使用以下命令进行检查。 - +完成安装后,启动服务器终端。理想情况下,你应该会看到提示符。使用 root 或 admin 账户登录。 +然后,首先尝试使用 `nmcli` 检查网络接口的状态和细节。`nmcli` 是一个控制 NetworkManager 服务的命令行工具。使用以下命令进行检查。 ``` nmcli device status @@ -30,43 +30,31 @@ nmcli device status ![nmcli device status][1] - * 运行工具 `nmtui` 来配置网络接口。[nmtui][2] 是 NetworkManager 工具的一部分,它为你提供了一个漂亮的用户界面来配置网络。这是 NetworkManager-tui 包的一部分,当你完成最小服务器的安装时它应该默认安装。 - - +运行工具 `nmtui` 来配置网络接口。[nmtui][2] 是 NetworkManager 工具的一部分,它为你提供了一个漂亮的用户界面来配置网络。这是 NetworkManager-tui 包的一部分,当你完成最小服务器的安装时它应该默认安装。 ``` nmtui ``` - * 在 nmtui 窗口中点击编辑一个连接。 - - +在 `nmtui` 窗口中点击编辑一个连接。 ![nmtui – Select options][3] - * 选择网口名称 - - +选择网口名称: ![Select Interface to Edit][4] - * 在编辑连接窗口,为 IPv4 和 IPv6 选择自动。并选择自动连接。完成后按 OK。 - - +在编辑连接窗口,为 IPv4 和 IPv6 选择自动。并选择自动连接。完成后按 “OK”。 ![nmtui – Edit Connection][5] - * 通过使用如下 [systemd systemctl][6] 命令,重新启动 NetworkManager 服务。 - - +通过使用如下 [systemd systemctl][6] 命令,重新启动 NetworkManager 服务。 ``` systemctl restart NetworkManager ``` - * 如果一切顺利,你应该在 CentOS、RHEL、Rocky Linux 服务器的最小化安装中连接到网络和互联网。前提是你的网络有互联网连接。你可以用 ping 来验证它是否正常。 - - +如果一切顺利,在 CentOS、RHEL、Rocky Linux 服务器的最小化安装中你应该可以连接到网络和互联网了,前提是你的网络有互联网连接。你可以用 `ping` 来验证它是否正常。 ![setup internet minimal server – CentOS Rocky Linux RHEL][7] @@ -74,19 +62,19 @@ systemctl restart NetworkManager 当你把网络配置设置为自动,当你连接到互联网时,网口会动态地分配 IP。在某些情况下,当你建立一个局域网 (LAN) 时,你可能想给你的网口分配静态 IP。这超级简单。 -打开你的网络的网络配置脚本。根据你的设备修改高亮部分。 +打开你的网络的网络配置脚本。根据你的设备修改高亮部分: ``` vi /etc/sysconfig/network-scripts/ifcfg-ens3 ``` -在上面的文件中,用 IPADDR 属性添加你想要的 IP 地址。保存该文件。 +在上面的文件中,用 `IPADDR` 属性添加你想要的 IP 地址。保存该文件。 ``` IPADDR=192.168.0.55 ``` -在 `/etc/sysconfig/network` 中为你的网络添加网关。 +在 `/etc/sysconfig/network` 中为你的网络添加网关: ``` NETWORKING=yes @@ -94,12 +82,14 @@ HOSTNAME=debugpoint GATEWAY=10.1.1.1 ``` -在 `/etc/resolv.conf` 的 resolv.conf 中添加任意公共 DNS 服务器。 +在 `/etc/resolv.conf` 的 `resolv.conf` 中添加任意公共 DNS 服务器: +``` nameserver 8.8.8.8 nameserver 8.8.4.4 +``` -并重新启动网络服务。 +并重新启动网络服务: ``` systemctl restart NetworkManager @@ -109,8 +99,6 @@ systemctl restart NetworkManager 我希望这个指南能帮助你在你的最小化服务器中设置网络、互联网和静态 IP。如果你有任何问题,请在评论区告诉我。 -* * * - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/ @@ -118,7 +106,7 @@ via: https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/ 作者:[Arindam][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/turbokernel) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7e54211c7ff2b7106a1adcfe69ab30f729e7b0c1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Jul 2021 10:50:58 +0800 Subject: [PATCH 449/870] PUB @geekpi @turbokernel https://linux.cn/article-13585-1.html --- ...tup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/tech => published}/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md (98%) diff --git a/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md b/published/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md similarity index 98% rename from translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md rename to published/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md index 8d0e0aef9b..7beff5677d 100644 --- a/translated/tech/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md +++ b/published/20210625 How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install.md @@ -5,7 +5,7 @@ [#]: translator: (geekpi) [#]: reviewer: (turbokernel) [#]: publisher: (wxy) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-13585-1.html) 如何在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网 ====== From ff96ba5cff3b67baad9f1600136279ab83b4ec54 Mon Sep 17 00:00:00 2001 From: SamMa Date: Fri, 16 Jul 2021 11:36:57 +0800 Subject: [PATCH 450/870] Update 20210708 Write good examples by starting with real code.md --- ...ood examples by starting with real code.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20210708 Write good examples by starting with real code.md b/translated/tech/20210708 Write good examples by starting with real code.md index e0c94894f6..92e26cc9f6 100644 --- a/translated/tech/20210708 Write good examples by starting with real code.md +++ b/translated/tech/20210708 Write good examples by starting with real code.md @@ -25,10 +25,10 @@ numbers = [1, 2, 3, 4] squares = map(lambda x: x * x, numbers) ``` -我觉得这个示例不是真实的,有两方面的原因: +我觉得这个示例不是真实的,有如下两方面的原因: * 将一组数字作平方运算不是在真实的程序中完成的事,除非是项目 Euler 或某种东西(更多的可能是针对列表的操作) - * `map` 在 Python 中并不是很常用,即便是做这个我也更愿意写 `[x*x for x in numbers]` + * `map` 在 Python 中并不常用,即便是做这个我也更愿意写 `[x*x for x in numbers]` 一个更加真实的 Python lambdas 的示例是使用 `sort` 函数,就像这样: @@ -37,11 +37,11 @@ children = [{"name": "ashwin", "age": 12}, {"name": "radhika", "age": 3}] sorted_children = sorted(children, key=lambda x: x['age']) ``` -但是这个示例是被精心设计的(为什么我们需要按照年龄对这些孩子进行排序呢?)。所以我们如何来做一个真实的示例呢? +但是这个示例是被精心设计的(为什么我们需要对这些孩子按照年龄进行排序呢?)。所以我们如何来做一个真实的示例呢? -### 如何让你的示例真实起来:看你写实际代码 +### 如何让你的示例真实起来:看你所写实际代码 -我认为最简单的来生成一个例子的方法就是,不是凭空出现一个例子(就像我用那个`儿童`的例子),而只是从看真正的代码开始! +我认为最简单的来生成一个例子的方法就是,不是凭空出现一个例子(就像我用那个`儿童`的例子),而只是从真正的代码开始! 举一个例子吧,如果我要用 `sort.+key` 来编写一串 Python 代码,我会发现很多我按某个标准对列表进行排序的真实例子,例如: @@ -50,18 +50,18 @@ sorted_children = sorted(children, key=lambda x: x['age']) * `sorted_keysizes = sorted(scores.keys(), key=scores.get)` * `shows = sorted(dates[date], key=lambda x: x['time']['performanceTime'])` -在这里很容易看到一个规律——这些大都是按时间排序的!因此,您可以明白如何轻松地将按时间排序的某些对象(电子邮件、事件等)的简单实例放在一起。 +在这里很容易看到一个规律——这些基本是按时间排序的!因此,您可以明白如何将按时间排序的某些对象(电子邮件、事件等)的简单实例轻松地放在一起。 -### 现实的例子有助于"推销"你试图解释的概念 +### 现实的例子有助于"布道"你试图解释的概念 当我试图去解释一个想法(就好比 Python Lambdas)的时候,我通常也会试图说服读者,说这是值得学习的想法。Python lambdas 是如此的有用!当我去试图说服某个人 lambdas 是很好用的时候,让他想象一下 lambdas 如何帮助他们完成一项他们将要去做的任务或是以及一项他们以前做过的任务,对说服他会很有帮助。 ### 从真实代码中提炼出示例可能需要很长时间 -我给出的解释如何使用 `lambda` 和 `sort` 函数的例子是十分简单的,它并不需要花费我很长时间来想出来,但是将真实的代码化为一个独立的示例则是会需要花费很长的时间! +我给出如何使用 `lambda` 和 `sort` 函数的解释例子是十分简单的,它并不需要花费我很长时间来想出来,但是将真实的代码提炼出为一个独立的示例则是会需要花费很长的时间! -举个例子,我想在这篇文章中融入一些奇怪的 CSS 行为的例子来说明创造一个怪异或令人惊讶的案例是十分有趣的。我花费了两个小时来解决我这周遇到的一个实际的问题,确保我理解 CSS 的实际情况,并将其变成一个迷你的示例。 +举个例子,我想在这篇文章中融入一些奇怪的 CSS 行为的例子来说明创造一个奇怪的案例是十分有趣的。我花费了两个小时来解决我这周遇到的一个实际的问题,确保我理解 CSS 的实际情况,并将其变成一个小示例。 最后,它“仅仅”用了[五行 HTML 和一点点的 CSS][1] 来说明了这个问题,看起来并不想是我花费了好多小时写出来的。但是最初它却是几百行的 JS/CSS/JavaScript,它需要花费很长时间来将所有的代码化为核心的很少的代码。 @@ -69,10 +69,10 @@ sorted_children = sorted(children, key=lambda x: x['age']) ### 就这么多了! -我觉得关于示例还有更多可以去讲的——我觉得还有几个不同类型的有用示例,例如 +我觉得还有更多关于示例可以去讲的——几种不同类型的有用示例,例如: - * 可以更多的改变人的思维而不是直接提供使用的代码的让读者感到惊喜的示例 - * 易于复制粘贴以用作起点的示例 + * 可以更多的改变人的思维而不是直接提供使用的惊喜读者的示例代码 + * 易于复制粘贴以用作初始化的示例 @@ -85,7 +85,7 @@ via: https://jvns.ca/blog/2021/07/08/writing-great-examples/ 作者:[Julia Evans][a] 选题:[lujun9972][b] 译者:[zepoch](https://github.com/zepoch) -校对:[校对者ID](https://github.com/turbokernel) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 25e57364bccd2c858a1f1c7647936481282fe4c4 Mon Sep 17 00:00:00 2001 From: mcfd <43702470+mcfd@users.noreply.github.com> Date: Fri, 16 Jul 2021 11:59:55 +0800 Subject: [PATCH 451/870] Update 20201012 My top 7 keywords in Rust.md --- sources/tech/20201012 My top 7 keywords in Rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201012 My top 7 keywords in Rust.md b/sources/tech/20201012 My top 7 keywords in Rust.md index cca2eeefc1..034ccd0cda 100644 --- a/sources/tech/20201012 My top 7 keywords in Rust.md +++ b/sources/tech/20201012 My top 7 keywords in Rust.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mcfd) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From bea986ea66f02a05969a2416d72539d6a0e42aa1 Mon Sep 17 00:00:00 2001 From: stevending1st <1139274654@qq.com> Date: Fri, 16 Jul 2021 13:29:27 +0800 Subject: [PATCH 452/870] translated 20200528 9 open source JavaScript frameworks for front-end web development.md --- ...rameworks for front-end web development.md | 295 ------------------ ...rameworks for front-end web development.md | 277 ++++++++++++++++ 2 files changed, 277 insertions(+), 295 deletions(-) delete mode 100644 sources/tech/20200528 9 open source JavaScript frameworks for front-end web development.md create mode 100644 translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md diff --git a/sources/tech/20200528 9 open source JavaScript frameworks for front-end web development.md b/sources/tech/20200528 9 open source JavaScript frameworks for front-end web development.md deleted file mode 100644 index e585379bbb..0000000000 --- a/sources/tech/20200528 9 open source JavaScript frameworks for front-end web development.md +++ /dev/null @@ -1,295 +0,0 @@ -stevending is translating -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 open source JavaScript frameworks for front-end web development) -[#]: via: (https://opensource.com/article/20/5/open-source-javascript-frameworks) -[#]: author: (Bryant Son https://opensource.com/users/brson) - -9 open source JavaScript frameworks for front-end web development -====== -A breakdown of many JavaScript options for frameworks—their strengths -and key features. -![Computer screen with files or windows open][1] - -About a decade ago, the JavaScript developer community began to witness fierce battles emerging among JavaScript frameworks. In this article, I will introduce some of the most well-known of these frameworks. And it's important to note that these are all open source JavaScript projects, meaning that you can freely utilize them under an [open source license][2] and even contribute to the source code and communities. - -If you prefer to follow along as I explore these frameworks, you can watch my video. - -Before getting started, though, it will be useful to learn some of the terminology JavaScript developers commonly use when discussing frameworks. - -Term | What It Is ----|--- -[Document Object Model (DOM)][3] | A tree-structure representation of a website where each node is an object representing part of the webpage. The World Wide Web Consortium (W3C), the international standards organization for the World Wide Web, maintains the definition of the DOM. -[Virtual DOM][4] | A "virtual" or "ideal" representation of a user interface (UI) is kept in memory and synced with the "real" DOM by a library such as [ReactDOM][5]. To explore further, please read ReactJS's virtual DOM and internals documentation. -[Data Binding][6] | A programming concept to provide a consistent interface for accessing data on websites. Web elements are associated with a property or attribute of an element maintained by the DOM. For example, when you need to fill out a password in a webpage form, the data binding mechanism can check with the password validation logic to ensure that the password is in a valid format. - -Now that we are clear about common terms, let's explore what open source JavaScript frameworks are out there. - -Framework | About | License | Release Date ----|---|---|--- -[ReactJS][7] | Created by Facebook, currently the most popular JavaScript framework | MIT License | May 24, 2013 -[Angular][8] | Popular JavaScript framework created by Google | MIT License | Jan 5, 2010 -[VueJS][9] | Rapidly growing JavaScript framework | MIT License | Jul 28, 2013 -[MeteorJS][10] | Powerful framework that is more than a JavaScript framework | MIT License | Jan 18, 2012 -[KnockoutJS][11] | Open source Model-View-ViewModel (MVVM) framework | MIT License | Jul 5, 2010 -[EmberJS][12] | Another open source Model-View-ViewModel framework | MIT License | Dec 8, 2011 -[BackboneJS][13] | JavaScript framework with RESTful JSON and Model-View-Presenter pattern | MIT License | Sep 30, 2010 -[Svelte][14] | Open source JavaScript framework not using virtual DOM | MIT License | Nov 20, 2016 -[AureliaJS][15] | A collection of Modern JavaScript modules | MIT License | Feb 14, 2018 - -For context, here is the publicly available data on popularity based on NPM package downloads per framework, thanks to [npm trends][16]. - -![Framework downloads graph][17] - -### ReactJS - -![React page][18] - -[ReactJS][19] was invented by Facebook, and it is the clear leader among JavaScript frameworks today, though it was invented well after Angular. React introduces a concept called a virtual DOM, an abstract copy where developers can utilize only the ReactJS features that they want, without having to rewrite the entire project to work within the framework. In addition, the active open source community with the React project has definitely been the workhorse behind the growth. Here are some of React's key strengths: - - * Reasonable learning curve—React developers can easily create the React components without rewriting the entire code in JavaScript. See the benefits of ReactJS and how it makes it the programming easier on ReactJS's [front page][20]. - * Highly optimized for performance—React's virtual DOM implementation and other features boost app rendering performance. See ReactJS's [description][21] of how its performance can be benchmarked and measured in terms of how the app performs. - * Excellent supporting tools—[Redux][22], [Thunk][23], and [Reselect][24] are some of the best tools for building well-structured, debuggable code. - * One way data binding—The model used in Reach flows from owner to child only making it simpler to trace cause and effect in code. Read more about it on ReactJS's [page on data binding][25]. - - - -Who is using ReactJS? Since Facebook invented it, the company itself heavily uses React for its frontpage, and [Instagram][26] is said to be completely based on the ReactJS library. You might be surprised to know that other well-known companies like [New York Times][27], [Netflix][28], and [Khan Academy][29] also implement ReactJS in their technology stacks. - -What may be even more surprising is the availability of jobs for ReactJS developers, as you can see below from research done by Stackoverflow. Hey, you can work on an open source project and get paid to do it. That is pretty cool! - -![React jobs page][30] - -Stackoverflow shows the huge demand for ReactJS developers—[Source: Developer Hiring Trends in 2017—Stackoverflow Blog][31] - -  - -[ReactJS's GitHub][7] currently shows over 13K commits and 1,377 contributors to the open source project. And it is an open source project under MIT License. - -![React GitHub page][32] - -### Angular - -![Angular homepage][33] - -React may now be the leading JavaScript framework in terms of the number of developers, but [Angular][34] is close behind. In fact, while React is the more popular choice among open source developers and startup companies, larger corporations tend to prefer Angular (a few are listed below). The main reason is that, while Angular might be more complicated, its uniformity and consistency works well for larger projects. For example, I have worked on both Angular and React throughout my career, and I observed that the larger companies generally consider Angular's strict structure a strength. Here are some other key strengths of Angular: - - * Well-designed Command Line Interface: Angular has an excellent Command Line Interface (CLI) tool to easily bootstrap and to develop with Angular. ReactJS also offers the Command Line Interface as well as other tools, but Angular has extensive support and excellent documentation, as you can see on [this page][35]. - * One way data binding—Similarly to React, the one-way data binding model makes the framework less susceptible to unwanted side effects. - * Great support for TypeScript—Angular has excellent alignment with [TypeScript][36], which is effectively JavaScript more type enforcement. It also transcompiling to JavaScript, making it a great option to enforce types for less buggy code. - - - -Well-known websites like YouTube, [Netflix][37], [IBM][38], and [Walmart][39] all have implemented Angular into their applications. I personally started front-end JavaScript development with Angular by educating myself on the subject. I have worked on quite a few personal and professional projects involving Angular, but that was Angular 1.x, which was called by AngularJS at the time. When Google decided to upgrade the version to 2.0, they completely revamped the framework, and then it became Angular. The new Angular was a complete transformation of the previous AngularJS, which drove off some existing developers while bringing new developers. - -[Angular's][8] [GitHub][8] page shows 17,781 commits and 1,133 contributors at the time of this writing. It is also an open source project with an MIT License, so you can feel free to use it for your project or to contribute. - -  - -![Angular GitHub page][40] - -### VueJS - -![Vue JS page][41] - -[VueJS][42] is a very interesting framework. It is a newcomer to the JavaScript framework scene, but its popularity has increased significantly over the course of a few years. VueJS was created by [Evan Yu][43], a former Google engineer who had worked on the Angular project. The framework got so popular that many front-end engineers now prefer VueJS over other JavaScript frameworks. The chart below depicts how fast the framework gained traction over time. - -![Vue JS popularity graph][44] - -Here are some of the key strengths of VueJS: - - * Easier learning curve—Even compared to Angular or React, many front-end developers feel that VueJS has the lowest learning curve. - * Small size—VueJS is relatively lightweight compared to Angular or React. In its [official documentation][45], its size is stated to be only about 30 KB, while the project generated by Angular, for example, is over 65 KB. - * Concise documentation—Vue has thorough but concise and clear documentation. See [its official documentation][46] for yourself. - - - -[VueJS's GitHub][9] shows 3,099 commits and 239 contributors. - -![Vue JS GitHub page][47] - -### MeteorJS - -![Meteor page][48] - -[MeteorJS][49] is a free and open source [isomorphic framework][50], which means, just like NodeJS, it runs both client and server-side JavaScript. Meteor can be used in conjunction with any other popular front-end framework like Angular, React, Vue, Svelte, etc. - -Meteor is used by several corporations such as Qualcomm, Mazda, and Ikea, and many applications like Dispatch and Rocket.Chat. [See the case studies on its official website.][51] - -![Meteor case study][52] - -Some of the key features of Meteor include: - - * Data on the wire—The server sends the data, not HTML, and the client renders it. Data on the wire refers mostly to the way that Meteor forms a WebSocket connection to the server on page load, and then transfers the data needed over that connection. - * Develop everything in JavaScript—Client-side, application server, webpage, and mobile interface can be all designed with JavaScript. - * Supports most major frameworks—Angular, React, and Vue can be all combined and used in conjunction with Meteor. Thus, you can still use your favorite framework, like React or Angular, but still leverage some of the great features that Meteor offers. - - - -As of now, [Meteor's][10] [GitHub][10] shows 22,804 commits and 428 contributors. That is quite a lot for open source activities! - -![Meteor GitHub page][53] - -### EmberJS - -![EmberJS page][54] - -[EmberJS][55] is an open source JavaScript framework based on the [Model-view-viewModel(MVVM)][56] pattern. If you've never heard about EmberJS, you'll definitely be surprised how many companies are using it. Apple Music, Square, Discourse, Groupon, LinkedIn, Twitch, Nordstorm, and Chipotle all leverage EmberJS as one of their technology stacks. Check [EmberJS's official page][57] to discover all applications and customers that use EmberJS. - -Although Ember has similar benefits to the other frameworks we've discussed, here are some of its unique differentiators: - - * Convention over configuration—Ember standardizes naming conventions and automatically generates the result code. This approach has a little more of a learning curve but ensures that programmers follow best-recommended practices. - * Fully-fledged templating mechanism—Ember relies on straight text manipulation, building the HTML document dynamically while knowing nothing about DOM. - - - -As one might expect from a framework used by many applications, [Ember's GitHub][58] page shows 19,808 commits and 785 contributors. That is huge! - -![EmberJS GitHub page][59] - -### KnockoutJS - -![KnockoutJS page][60] - -[KnockoutJS][61] is a standalone open source JavaScript framework adopting a [Model-View-ViewModel (MVVM)][56] pattern with templates. Although fewer people may have heard about this framework compared to Angular, React, or Vue, the project is still quite active among the development community and leverages features such as: - - * Declarative binding—Knockout's declarative binding system provides a concise and powerful way to link data to the UI. It's generally easy to bind to simple data properties or to use a single binding. Read more about it [here at KnockoutJS's official documentation page][62]. - * Automatic UI refresh - * Dependency tracking templating - - - -[Knockout's GitHub][11] page shows about 1,766 commits and 81 contributors. Those numbers are not as significant compared to the other frameworks, but the project is still actively maintained. - -![Knockout GitHub page][63] - -### BackboneJS - -![BackboneJS page][64] - -[BackboneJS][65] is a lightweight JavaScript framework with a RESTful JSON interface and is based on Model-View-Presenter (MVP) design paradigm. - -The framework is said to be used by [Airbnb][66], Hulu, SoundCloud, and Trello. You can find all of these case studies on [Backbone's page][67]. - -The [BackboneJS GitHub][13] page shows 3,386 commits and 289 contributors. - -![BackboneJS GitHub page][68] - -### Svelte - -![Svelte page][69] - -[Svelte][70] is an open source JavaScript framework that generates the code to manipulate DOM instead of including framework references. This process of converting an app into JavaScript at build time rather than run time might offer a slight boost in performance in some scenarios. - -[Svelte's][14] [GitHub][14] page shows 5,729 commits and 296 contributors as of this writing. - -![Svelte GitHub page][71] - -### AureliaJS - -![Aurelia page][72] - -Last on the list is [Aurelia][73]. Aurelia is a front-end JavaScript framework that is a collection of modern JavaScript modules. Aurelia has the following interesting features: - - * Fast rendering—Aurelia claims that its framework can render faster than any other framework today. - * Uni-directional data flow—Aurelia uses an observable-based binding system that pushes the data from the model to the view. - * Build with vanilla JavaScript—You can build all of the website's components with plain JavaScript. - - - -[Aurelia's][15] [GitHub][15] page shows 788 commits and 96 contributors as of this writing. - -![Aurelia GitHub page][74] - -So that is what I found when looking at what is new in the JavaScript framework world. Did I miss any interesting frameworks? Feel free to share your ideas in the comment section! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/open-source-javascript-frameworks - -作者:[Bryant Son][a] -选题:[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/brson -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) -[2]: https://opensource.com/article/17/9/open-source-licensing -[3]: https://www.w3schools.com/js/js_htmldom.asp -[4]: https://reactjs.org/docs/faq-internals.html -[5]: https://reactjs.org/docs/react-dom.html -[6]: https://en.wikipedia.org/wiki/Data_binding -[7]: https://github.com/facebook/react -[8]: https://github.com/angular/angular -[9]: https://github.com/vuejs/vue -[10]: https://github.com/meteor/meteor -[11]: https://github.com/knockout/knockout -[12]: https://github.com/emberjs/ember.js -[13]: https://github.com/jashkenas/backbone -[14]: https://github.com/sveltejs/svelte -[15]: https://github.com/aurelia/framework -[16]: https://www.npmtrends.com/angular-vs-react-vs-vue-vs-meteor-vs-backbone -[17]: https://opensource.com/sites/default/files/uploads/open-source-javascript-framework-downloads-opensourcedotcom_0.png (Framework downloads graph) -[18]: https://opensource.com/sites/default/files/uploads/3_react.jpg (React page) -[19]: https://reactjs.org -[20]: https://reactjs.org/ -[21]: https://reactjs.org/docs/perf.html -[22]: https://redux.js.org/ -[23]: https://github.com/reduxjs/redux-thunk -[24]: https://github.com/reduxjs/reselect -[25]: https://reactjs.org/docs/two-way-binding-helpers.html -[26]: https://instagram-engineering.com/react-native-at-instagram-dd828a9a90c7 -[27]: https://open.nytimes.com/introducing-react-tracking-declarative-tracking-for-react-apps-2c76706bb79a -[28]: https://medium.com/dev-channel/a-netflix-web-performance-case-study-c0bcde26a9d9 -[29]: https://khan.github.io/react-components/ -[30]: https://opensource.com/sites/default/files/uploads/4_reactjobs_0.jpg (React jobs page) -[31]: https://stackoverflow.blog/2017/03/09/developer-hiring-trends-2017 -[32]: https://opensource.com/sites/default/files/uploads/5_reactgithub.jpg (React GitHub page) -[33]: https://opensource.com/sites/default/files/uploads/6_angular.jpg (Angular homepage) -[34]: https://angular.io -[35]: https://cli.angular.io/ -[36]: https://www.typescriptlang.org/ -[37]: https://netflixtechblog.com/netflix-likes-react-509675426db -[38]: https://developer.ibm.com/technologies/javascript/tutorials/wa-react-intro/ -[39]: https://medium.com/walmartlabs/tagged/react -[40]: https://opensource.com/sites/default/files/uploads/7_angulargithub.jpg (Angular GitHub page) -[41]: https://opensource.com/sites/default/files/uploads/8_vuejs.jpg (Vue JS page) -[42]: https://vuejs.org -[43]: https://www.freecodecamp.org/news/between-the-wires-an-interview-with-vue-js-creator-evan-you-e383cbf57cc4/ -[44]: https://opensource.com/sites/default/files/uploads/9_vuejspopularity.jpg (Vue JS popularity graph) -[45]: https://vuejs.org/v2/guide/comparison.html#Size -[46]: https://vuejs.org/v2/guide/ -[47]: https://opensource.com/sites/default/files/uploads/10_vuejsgithub.jpg (Vue JS GitHub page) -[48]: https://opensource.com/sites/default/files/uploads/11_meteor_0.jpg (Meteor Page) -[49]: https://www.meteor.com -[50]: https://en.wikipedia.org/wiki/Isomorphic_JavaScript -[51]: https://www.meteor.com/showcase -[52]: https://opensource.com/sites/default/files/uploads/casestudy1_meteor.jpg (Meteor case study) -[53]: https://opensource.com/sites/default/files/uploads/12_meteorgithub.jpg (Meteor GitHub page) -[54]: https://opensource.com/sites/default/files/uploads/13_emberjs.jpg (EmberJS page) -[55]: https://emberjs.com -[56]: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel -[57]: https://emberjs.com/ember-users -[58]: https://github.com/emberjs -[59]: https://opensource.com/sites/default/files/uploads/14_embergithub.jpg (EmberJS GitHub page) -[60]: https://opensource.com/sites/default/files/uploads/15_knockoutjs.jpg (KnockoutJS page) -[61]: https://knockoutjs.com -[62]: https://knockoutjs.com/documentation/binding-syntax.html -[63]: https://opensource.com/sites/default/files/uploads/16_knockoutgithub.jpg (Knockout GitHub page) -[64]: https://opensource.com/sites/default/files/uploads/17_backbonejs.jpg (BackboneJS page) -[65]: https://backbonejs.org -[66]: https://medium.com/airbnb-engineering/our-first-node-js-app-backbone-on-the-client-and-server-c659abb0e2b4 -[67]: https://sites.google.com/site/backbonejsja/examples -[68]: https://opensource.com/sites/default/files/uploads/18_backbonejsgithub.jpg (BackboneJS GitHub page) -[69]: https://opensource.com/sites/default/files/uploads/19_svelte.jpg (Svelte page) -[70]: https://svelte.dev -[71]: https://opensource.com/sites/default/files/uploads/20_svletegithub.jpg (Svelte GitHub page) -[72]: https://opensource.com/sites/default/files/uploads/21_aurelia.jpg (Aurelia page) -[73]: https://aurelia.io -[74]: https://opensource.com/sites/default/files/uploads/22_aureliagithub.jpg (Aurelia GitHub page) diff --git a/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md b/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md new file mode 100644 index 0000000000..4a57ea27a0 --- /dev/null +++ b/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md @@ -0,0 +1,277 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevending1st) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 open source JavaScript frameworks for front-end web development) +[#]: via: (https://opensource.com/article/20/5/open-source-javascript-frameworks) +[#]: author: (Bryant Son https://opensource.com/users/brson) + +9 个用于 web 前端开发的 JavaScript 开源框架 +====== + +根据 JavaScript 框架的优点和功能的分类。 + +![Computer screen with files or windows open][1] + +大约十年前,JavaScript 社区开始见证一场 JavaScript 框架的激战。在本文中我将介绍其中最著名的一些框架。值得注意的是,这些都是开源的 JavaScript 项目,这意味着你可以在 [开源许可证][2] 下自由地使用它们,甚至为它们的源代码和社区做出贡献。 + +你如果喜欢和我一起探索框架,可以看我的视频。 + +不过,在开始之前,了解一些 JavaScript 开发者谈论框架时常用的术语,将对后续的内容大有裨益。 + +术语 | 释义 +---|--- +[文档对象模型(DOM)][3] | 网站用树结构表示,每一个节点都是代表网页一部分的对象。万维网联盟(W3C),是万维网的国际标准组织,维护着 DOM 的定义。 +[虚拟 DOM][4] | 用户界面(UI)以“虚拟”或“理想”的方式保存在内存中,并通过 [ReactDOM][5] 等一些库与“真实” DOM 同步。要进一步探索,请阅读 ReactJS 的虚拟 DOM 和内部文档。 +[数据绑定][6] | 一个编程概念,为访问网站上的数据提供一致的接口。Web 元素与 DOM 维护的元素的 property 或 attribute 相关联(译者注:根据 MDN 的解释,Javascript 的 property 是对象的特征,通常描述与数据结构相关的特征;attribute 是指元素所有属性节点的一个实时集合)。例如,当需要在网页表单中填写密码时,数据绑定机制可以用密码验证逻辑检验,确保密码格式有效。 + +我们已经清楚了常用的术语,下面我们来探索一下开源的 JavaScript 框架有哪些。 + +框架 | 简介 | 许可证 | 发布日期 +---|---|---|--- +[ReactJS][7] | 目前最流行的 JavaScript 框架,由 Facebook 创建 | MIT 许可证 | 2013-5-24 +[Angular][8] | Google 创建的流行的 JavaScript 框架 | MIT 许可证 | 2010-1-5 +[VueJS][9] | 快速增长的 JavaScript 框架 | MIT 许可证 | 2013-7-28 +[MeteorJS][10] | 比 JavaScript 框架更强大的框架 | MIT 许可证 | 2012-1-18 +[KnockoutJS][11] | 开源的 MVVM(Model-View-ViewModel,模型-视图-视图模型) 框架 | MIT 许可证 | 2010-7-5 +[EmberJS][12] | 另一个开源的 MVVM 框架 | MIT 许可证 | 2011-12-8 +[BackboneJS][13] | 带有 RESTful JSON 和 Model-View-Presenter 模式的 JavaScript 框架 | MIT 许可证 | 2010-9-30 +[Svelte][14] | 不使用虚拟 DOM 的 JavaScript 开源框架 | MIT 许可证 | 2016-11-20 +[AureliaJS][15] | 现代 JavaScript 模块的集合 | MIT 许可证 | 2018-2-14 + +为了说明情况,下面是每个框架的 NPM 包下载量的公开数据,感谢 [npm trends][16]。 + +![Framework downloads graph][17] + +### ReactJS + +![React page][18] + +[ReactJS][19] 是由 Facebook 研发的,它虽然在 Angular 之后发布,但明显是当今 JavaScript 框架的领导者。React 引入了一个虚拟 DOM 的概念,这是一个抽象副本,开发者能在框架内仅使用他们想要的 ReactJS 功能,而无需重写整个项目。此外,React 项目活跃的开源社区无疑成为增长背后的主力军。下面是一些 React 的主要优势: + + * 合理的学习曲线——React 开发者可以轻松地创建 React 组件,而不需要重写整个 JavaScript 的代码。在 ReactJS 的 [首页][20] 查看它的好处以及它如何使编程更容易。 + * 高度优化的性能——React 的虚拟 DOM 的实现和其他功能提升了应用程序的渲染性能。请查看 ReactJS 的关于如何对其性能进行基准测试,并对应用性能进行衡量的相关 [描述][21]。 + * 优秀的支持工具——[Redux][22]、[Thunk][23] 和 [Reselect][24] 是构建良好、可调式代码的最佳工具。 + * 单项数据绑定——模型使用 Reach 流,只从所有者流向子模块,这使得在代码中追踪因果关系更加简单。请在 ReactJS 的 [数据绑定页][25] 阅读更多相关资料。 + +谁在使用 ReactJS?Facebook 自从发明它,就大量使用 React 构建公司首页,据说 [Instagram][26] 完全基于 ReactJS 库。你可能会惊讶地发现,其他知名公司如 [New York Times][27]、[Netflix][28] 和 [Khan Academy][29] 也在他们的技术栈中使用了 ReactJS。 + +更令人惊讶的是 ReactJS 开发者的工作可用性,正如在下面 Stackoverflow 所做的研究中看到的,嘿,可以从事开源项目并获得报酬。这很酷! + +![React jobs page][30] + +Stackoverflow 的研究显示了对 ReactJS 开发者的巨大需求——[来源:2017年开发者招聘趋势——Stackoverflow 博客][31] + +[ReactJS 的 GitHub][7] 目前显示超过 13,000 次提交和 1,377 位贡献者。它是一个在 MIT 许可证下的开源项目。 + +![React GitHub page][32] + +### Angular + +![Angular homepage][33] + +对于大多数开发者来说,也许现在 React 是领先的 JavaScript 框架,但是 [Angular][34] 紧随其后。事实上,开源开发者和初创公司更乐于选择 React,而较大的公司往往更喜欢 Angular(下面列出了一些例子)。主要原因是,虽然 Angular 可能更复杂,但它的统一性和一致性适用于大型项目。例如,在我整个职业生涯中一直研究 Angular 和 React,我观察到大公司通常认为 Angular 严格的结构是一种优势。下面是 Angular 的另外一些关键优势: + + * 精心设计的命令行工具——Angular 有一个优秀的命令行工具(CLI),可以轻松引导和使用 Angular 进行开发。ReactJS 提供命令行工具和其他工具,同时 Angular 有广泛的支持和出色的文档,你可以参见 [这个页面][35]。 + * 单项数据绑定——和 React 类似,单向数据绑定模型使框架受更少的不必要的副作用的影响。 + * 更好的 TypeScript 支持——Angular 与 [TypeScript][36] 有很好的一致性,它其实是 JavaScript 强制类型的拓展。它还可以转译为 JavaScript,强制类型是减少错误代码的绝佳选择。 + +像 YouTube、[Netflix][37]、[IBM][38] 和 [Walmart][39] 等知名网站,都已在其应用程序中采用了 Angular。我通过自学使用 Angular 来开始学习前端 JavaScript 开发。我参与了许多涉及 Angular 的个人和专业项目,但那是当时被称为 AngularJS 的 Angular 1.x。当 Google 决定将版本升级到 2.0 时,他们对框架进行了彻底的改造,然后成了 Angular。新的 Angular 是对之前的 AngularJS 的彻底改造,这一举动带来了一部分新开发者也驱逐了一部分原有的开发者。 + +截止到撰写本文,[Angular 的 GitHub][8] 页面显示 17,781 次提交和 1,133 位贡献者。它也是一个遵循 MIT 许可证的开源项目,因此你可以自由地在你的项目或贡献中使用。 + +![Angular GitHub page][40] + +### VueJS + +![Vue JS page][41] + +[VueJS][42] 是一个非常有趣的框架。它是 JavaScript 框架领域的新来者,但是在过去几年里它的受欢迎程度显著增加。VueJS 由 [尤雨溪][43] 创建,他是曾参与过 Angular 项目的谷歌工程师。该框架现在变得如此受欢迎,以至于许多前端工程师更喜欢 VueJS 而不是其他 JavaScript 框架。下图描述了该框架随着时间的推移获得关注的速度。 + +![Vue JS popularity graph][44] + +这里有一些 VueJS 的主要优点: + + * 更容易地学习曲线——与 Angular 或 React 相比,许多前端开发者都认为 VueJS 有更平滑的学习曲线。 + * 小体积——与 Angular 或 React 相比,VueJS 相对轻巧。在 [官方文档][45] 中,它的大小据说只有约 30 KB;而 Angular 生成的项目超过 65 KB。 + * 简明的文档——VueJS 有全面清晰的文档。请自行查看它的 [官方文档][46]。 + +[VueJS 的 GitHub][9] 显示该项目有 3,099 次提交和 239 位贡献者。 + +![Vue JS GitHub page][47] + +### MeteorJS + +![Meteor page][48] + +[MeteorJS][49] 是一个免费开源的 [同构框架][50],这意味着它和 NodeJS 一样,同时运行客户端和服务器的 JavaScript。Meteor 能够和任何其他流行的前端框架一起使用,如 Angular、React、Vue、Svelte 等。 + +Meteor 被高通、Mazda 和宜家等多家公司以及如 Dispatch 和 Rocket.Chat 等多个应用程序使用。[您可以其在官方网站上查看更多案例][51]。 + +![Meteor case study][52] + +Meteor 的一些主要功能包括: + + * 在线数据——服务器发送数据而不是 HTML,并由客户端渲染。在线数据主要是指 Meteor 在页面加载时通过一个 WebSocket 连接服务器,然后通过该链接传输所需要的数据。 + * 用 JavaScript 开发一切——客户端、应用服务、网页和移动界面都可以用 JavaScript 设计。 + * 支持大多数主流框架——Angular、React 和 Vue 都可以与 Meteor 结合。因此,你仍然可以使用最喜欢的框架如 React 或 Angular,这并不防碍 Meteor 为你提供一些优秀的功能。 + +截止到目前,[Meteor 的 GitHub][10] 显示 22,804 次提交和 428 位贡献者。这对于开源项目来说相当多了。 + +![Meteor GitHub page][53] + +### EmberJS + +![EmberJS page][54] + +[EmberJS][55] 是一个基于 [模型-视图-视图模型(MVVM)][56] 模式的开源 JavaScript 框架。如果你从来没有听说过 EmberJS,你肯定会惊讶于有多少公司在使用它。Apple Music、Square、Discourse、Groupon、LinkedIn、Twitch、Nordstorm 和 Chipotle 都将 EmberJS 作为公司的技术栈之一。你可以通过查询 [EmberJS 的官方页面][57] 来发掘所有使用 EmberJS 的应用和客户。 + +Ember 虽然和我们讨论过的其他框架有类似的好处,但这里有些独特的区别: + + * 约定优于配置——Ember 标准化命名约定并自动生成结果代码。这种方法学习曲线有些陡峭,但可以确保程序员遵循最佳实践。 + * 成熟的模板机制——Ember 依赖于直接文本操作,直接构建 HTML 文档,而并不关心 DOM。 + +正如所期待的那样,作为一个被许多应用程序使用的框架,[Ember 的 GitHub][58] 页面显示该项目拥有 19,808 次提交和 785 位贡献者。这是一个巨大的数字! + +![EmberJS GitHub page][59] + +### KnockoutJS + +![KnockoutJS page][60] + +[KnockoutJS][61] 是一个独立开源的 JavaScript 框架,采用 [模板-视图-视图模型(MVVM)][56] 模式与模板。尽管与 Angular、React 或 Vue 相比,听说过这个框架的人可能比较少,这个项目在开发者社区仍然相当活跃,并且有以下功能: + + * 声明式绑定——Knockout 的声明式绑定系统提供了一种简洁而强大的方式来将数据链接到 UI。绑定简单的数据属性或使用单向绑定很简单。请在 [KnockoutJS 的官方文档页面][62] 阅读更多相关信息。 + * 自动 UI 刷新。 + * 依赖跟踪模板。 + +[Knockout 的 GitHub][11] 页面显示约有 1,766 次提交和 81 位贡献者。与其他框架相比,这些数据并不重要,但是该项目仍然在积极维护中。 + +![Knockout GitHub page][63] + +### BackboneJS + +![BackboneJS page][64] + +[BackboneJS][65] 是一个具有 RESTful JSON 接口,基于 Model-View-Presenter(MVP)设计范式的轻量级 JavaScript 框架。 + +这个框架据说已经被 [Airbnb][66]、Hulu、SoundCloud 和 Trello 使用。你可以在 [Backbone 的页面][67] 找到上面所有这些案例来研究。 + +[BackboneJS 的 GitHub][13] 页面显示有 3,386 次提交和 289 位贡献者。 + +![BackboneJS GitHub page][68] + +### Svelte + +![Svelte page][69] + +[Svelte][70] 是一个开源的 JavaScript 框架,它生成操作 DOM 的代码,而不是包含框架引用。在构建时而非运行时将应用程序转换为 JavaScript 的过程,在某些情况下可能会带来轻微的性能提升。 + +[Svelte 的 GitHub][14] 页面显示,截止到本文撰写为止,该项目有 5,729 次提交和 296 位贡献者。 + +![Svelte GitHub page][71] + +### AureliaJS + +![Aurelia page][72] + +最后我们介绍一下 [Aurelia][73]。Aurelia 是一个前端 JavaScript 框架,是一个现代 JavaScript 模块的集合。Aurelia 有以下有趣的功能: + + * 快速渲染——Aurelia 宣称比当今其他任何框架的渲染速度都快。 + * 单向数据流——Aurelia 使用一个基于观察的绑定系统,将数据从模型推送到视图。 + * 使用 vanilla JavaScript 架构——可以用 vanilla JavaScript 构建网站的所有组件。 + +[Aurelia 的 GitHub][15] 页面显示,截止到撰写本文为止该项目有 788 次提交和 96 位贡献者。 + +![Aurelia GitHub page][74] + +这就是我在查看 JavaScript 框架世界时发现的新内容。我错过了其他有趣的框架吗?欢迎在评论区分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/open-source-javascript-frameworks + +作者:[Bryant Son][a] +选题:[lujun9972][b] +译者:[stevending1st](https://github.com/stevending1st) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://opensource.com/article/17/9/open-source-licensing +[3]: https://www.w3schools.com/js/js_htmldom.asp +[4]: https://reactjs.org/docs/faq-internals.html +[5]: https://reactjs.org/docs/react-dom.html +[6]: https://en.wikipedia.org/wiki/Data_binding +[7]: https://github.com/facebook/react +[8]: https://github.com/angular/angular +[9]: https://github.com/vuejs/vue +[10]: https://github.com/meteor/meteor +[11]: https://github.com/knockout/knockout +[12]: https://github.com/emberjs/ember.js +[13]: https://github.com/jashkenas/backbone +[14]: https://github.com/sveltejs/svelte +[15]: https://github.com/aurelia/framework +[16]: https://www.npmtrends.com/angular-vs-react-vs-vue-vs-meteor-vs-backbone +[17]: https://opensource.com/sites/default/files/uploads/open-source-javascript-framework-downloads-opensourcedotcom_0.png (Framework downloads graph) +[18]: https://opensource.com/sites/default/files/uploads/3_react.jpg (React page) +[19]: https://reactjs.org +[20]: https://reactjs.org/ +[21]: https://reactjs.org/docs/perf.html +[22]: https://redux.js.org/ +[23]: https://github.com/reduxjs/redux-thunk +[24]: https://github.com/reduxjs/reselect +[25]: https://reactjs.org/docs/two-way-binding-helpers.html +[26]: https://instagram-engineering.com/react-native-at-instagram-dd828a9a90c7 +[27]: https://open.nytimes.com/introducing-react-tracking-declarative-tracking-for-react-apps-2c76706bb79a +[28]: https://medium.com/dev-channel/a-netflix-web-performance-case-study-c0bcde26a9d9 +[29]: https://khan.github.io/react-components/ +[30]: https://opensource.com/sites/default/files/uploads/4_reactjobs_0.jpg (React jobs page) +[31]: https://stackoverflow.blog/2017/03/09/developer-hiring-trends-2017 +[32]: https://opensource.com/sites/default/files/uploads/5_reactgithub.jpg (React GitHub page) +[33]: https://opensource.com/sites/default/files/uploads/6_angular.jpg (Angular homepage) +[34]: https://angular.io +[35]: https://cli.angular.io/ +[36]: https://www.typescriptlang.org/ +[37]: https://netflixtechblog.com/netflix-likes-react-509675426db +[38]: https://developer.ibm.com/technologies/javascript/tutorials/wa-react-intro/ +[39]: https://medium.com/walmartlabs/tagged/react +[40]: https://opensource.com/sites/default/files/uploads/7_angulargithub.jpg (Angular GitHub page) +[41]: https://opensource.com/sites/default/files/uploads/8_vuejs.jpg (Vue JS page) +[42]: https://vuejs.org +[43]: https://www.freecodecamp.org/news/between-the-wires-an-interview-with-vue-js-creator-evan-you-e383cbf57cc4/ +[44]: https://opensource.com/sites/default/files/uploads/9_vuejspopularity.jpg (Vue JS popularity graph) +[45]: https://vuejs.org/v2/guide/comparison.html#Size +[46]: https://vuejs.org/v2/guide/ +[47]: https://opensource.com/sites/default/files/uploads/10_vuejsgithub.jpg (Vue JS GitHub page) +[48]: https://opensource.com/sites/default/files/uploads/11_meteor_0.jpg (Meteor Page) +[49]: https://www.meteor.com +[50]: https://en.wikipedia.org/wiki/Isomorphic_JavaScript +[51]: https://www.meteor.com/showcase +[52]: https://opensource.com/sites/default/files/uploads/casestudy1_meteor.jpg (Meteor case study) +[53]: https://opensource.com/sites/default/files/uploads/12_meteorgithub.jpg (Meteor GitHub page) +[54]: https://opensource.com/sites/default/files/uploads/13_emberjs.jpg (EmberJS page) +[55]: https://emberjs.com +[56]: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel +[57]: https://emberjs.com/ember-users +[58]: https://github.com/emberjs +[59]: https://opensource.com/sites/default/files/uploads/14_embergithub.jpg (EmberJS GitHub page) +[60]: https://opensource.com/sites/default/files/uploads/15_knockoutjs.jpg (KnockoutJS page) +[61]: https://knockoutjs.com +[62]: https://knockoutjs.com/documentation/binding-syntax.html +[63]: https://opensource.com/sites/default/files/uploads/16_knockoutgithub.jpg (Knockout GitHub page) +[64]: https://opensource.com/sites/default/files/uploads/17_backbonejs.jpg (BackboneJS page) +[65]: https://backbonejs.org +[66]: https://medium.com/airbnb-engineering/our-first-node-js-app-backbone-on-the-client-and-server-c659abb0e2b4 +[67]: https://sites.google.com/site/backbonejsja/examples +[68]: https://opensource.com/sites/default/files/uploads/18_backbonejsgithub.jpg (BackboneJS GitHub page) +[69]: https://opensource.com/sites/default/files/uploads/19_svelte.jpg (Svelte page) +[70]: https://svelte.dev +[71]: https://opensource.com/sites/default/files/uploads/20_svletegithub.jpg (Svelte GitHub page) +[72]: https://opensource.com/sites/default/files/uploads/21_aurelia.jpg (Aurelia page) +[73]: https://aurelia.io +[74]: https://opensource.com/sites/default/files/uploads/22_aureliagithub.jpg (Aurelia GitHub page) From 74c64a82d9876a8e0ca7e3f116c9d5ce8f0879a2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Jul 2021 05:04:17 +0800 Subject: [PATCH 453/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210716=20?= =?UTF-8?q?What=20does=20the=20Open-Closed=20Principle=20mean=20for=20refa?= =?UTF-8?q?ctoring=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210716 What does the Open-Closed Principle mean for refactoring.md --- ...n-Closed Principle mean for refactoring.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20210716 What does the Open-Closed Principle mean for refactoring.md diff --git a/sources/tech/20210716 What does the Open-Closed Principle mean for refactoring.md b/sources/tech/20210716 What does the Open-Closed Principle mean for refactoring.md new file mode 100644 index 0000000000..1a52b9ba8e --- /dev/null +++ b/sources/tech/20210716 What does the Open-Closed Principle mean for refactoring.md @@ -0,0 +1,80 @@ +[#]: subject: (What does the Open-Closed Principle mean for refactoring?) +[#]: via: (https://opensource.com/article/21/7/open-closed-principle-refactoring) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What does the Open-Closed Principle mean for refactoring? +====== +Resolve the tension between protecting clients from unwanted changes and +extending the capabilities of services. +![Brain on a computer screen][1] + +In his 1988 book, _[Object-Oriented Software Construction][2]_, professor [Bertrand Meyer][3] defined the [Open-Closed Principle][4] as: + +> "A module will be said to be open if it is still available for extension. For example, it should be possible to add fields to the data structures it contains or new elements to the set of functions it performs. +> +> "A module will be said to be closed if it is available for use by other modules. This assumes that the module has been given a well-defined, stable description (the interface in the sense of information hiding)." + +A more succinct way to put it would be: + +> Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. + +Similarly (and in parallel to Meyer's findings), [Alistair Cockburn][5] defined the [Protected Variation][6] pattern: + +> "Identify points of predicted variation and create a stable interface around them." + +Both of these deal with volatility in software. When, as is always the case, you need to make some change to a software module, the ripple effects can be disastrous. The root cause of disastrous ripple effects is tight coupling, so the Open-Closed Principle and Protected Variation Pattern teach us how to properly decouple various modules, components, functions, and so forth. + +### Does the Open-Closed Principle preclude refactoring? + +If a module (i.e., a named block of code) must remain closed to any modifications, does that mean you're not allowed to touch it once it gets deployed? And if yes, wouldn't that eliminate any possibility of refactoring? + +Without the ability to refactor the code, you are forced to adopt the Finality Principle. This holds that rework is not allowed (why would stakeholders agree to pay you to work again on something they already paid for?) and you must carefully craft your code, because you will get only one chance to do it right. This is in total contradiction to the discipline of refactoring. + +If you are allowed to extend the deployed code but not change it, are you doomed to swim forever in the waterfall rivers? Being given only one shot at doing anything is a recipe for disaster. + +Let's review the approach to solve this conundrum. + +### How to protect clients from unwanted changes + +Clients (meaning modules or functions that use some block of code) utilize some functionality by adhering to the protocol as originally implemented in the component or service. However, as the component or service inevitably changes, the original "partnership" between the service or component and various clients breaks down. Clients "discover" the change by breakage, which is always an unpleasant surprise that often ruins the initial trust. + +Clients must be protected from those breakages. The only way to do so is by introducing a layer of abstraction between the clients and the service or component. In software engineering lingo, we call that layer of abstraction an "interface" (or an API). + +Interfaces and APIs hide the implementation. Once you arrange for a service to be delivered via an interface or API, you free yourself from the worries of changing the implementation code. No matter how much you change the service's implementation, your clients remain blissfully unaffected. + +That way, you are back to your comfortable world of iterations. You are now completely free to refactor, to rearrange the code, and to keep rearranging it in pursuit of a more optimal solution. + +The thing in this arrangement that remains closed for modification is the interface or API. The volatility of an interface or API is the thing that threatens to break the established trust between the service and its clients. Interfaces and APIs must remain open for extension. And that extension happens behind the scenes—by refactoring and adding new capabilities while guaranteeing non-volatility of the public-facing protocol. + +### How to extend capabilities of services + +While services remain non-volatile from the client's perspective, they also remain open for business when it comes to enhancing their capabilities. This Open-Closed Principle is implemented through refactoring. + +For example, if the first increment of the `OrderPayment` service offers mere bare-bones capabilities (e.g., able to process the order total and calculate sales tax), the next increment can be safely added by respecting the Open-Closed Principle. Without breaking the handshake between the clients and the `OrderPayment` service, you can refactor the implementation behind the `OrderPayment` API by adding new blocks of code. + +So, the second increment could contain the ability to calculate shipping costs. And so on, you get the picture; you accomplish the Protected Variation Pattern by observing the Open-Closed Principle. It's all about carefully modeling business abstractions. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-closed-principle-refactoring + +作者:[Alex Bunardzic][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen) +[2]: https://en.wikipedia.org/wiki/Object-Oriented_Software_Construction +[3]: https://en.wikipedia.org/wiki/Bertrand_Meyer +[4]: https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle +[5]: https://en.wikipedia.org/wiki/Alistair_Cockburn +[6]: https://martinfowler.com/ieeeSoftware/protectedVariation.pdf From 1d17b29daf656f9e8a01017c66d3f092bd5e1695 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Jul 2021 05:05:09 +0800 Subject: [PATCH 454/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210716=20?= =?UTF-8?q?Dear=20Mozilla,=20Please=20Remove=20This=20Annoying=20=E2=80=98?= =?UTF-8?q?Feature=E2=80=99=20from=20Firefox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md --- ...ve This Annoying ‘Feature- from Firefox.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/news/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md diff --git a/sources/news/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md b/sources/news/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md new file mode 100644 index 0000000000..cd4031ab75 --- /dev/null +++ b/sources/news/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md @@ -0,0 +1,66 @@ +[#]: subject: (Dear Mozilla, Please Remove This Annoying ‘Feature’ from Firefox) +[#]: via: (https://news.itsfoss.com/mozilla-annoying-new-tab/) +[#]: author: (Abhishek https://news.itsfoss.com/author/root/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Dear Mozilla, Please Remove This Annoying ‘Feature’ from Firefox +====== + +Despite its receding user base, Mozilla Firefox has remained my primary browser. Mozilla has revamped Firefox in the last couple of years and have added several features to it specially focused on protecting user privacy. I respect that. + +However, there is one ‘feature’ that annoys the hell out of me. This so-called feature relates to the auto-update of Firefox in the background. + +Auto-upgrade immediately remind of Windows updates. I mean, Windows is infamous for the forced restarts and updates, right? + +![Image Credit: Digital Trend][1] + +But why am I talking about this in reference to Firefox? Because Firefox, too, has a ‘Windows-que’ feature. + +It updates Firefox in the background. No problem there. That’s not entirely a bad thing. + +But then if you try to open a website in the new tab, it won’t let you do that unless you restart the browser. + +![][2] + +And that small thing stops the users from keep going with their work. What the hell, Mozilla! + +You may argue that it’s not that much of a pain. A quick restart won’t bring your world down, Abhishek. + +Right but imagine you are busy at work. You have more than 20 tabs opened. That’s normal if you are trying to troubleshoot as a developer, sysadmin, student or just trying to learn something in your field of interest. + +You cannot open a new webpage anymore. You have to restart the browser and when you restart, you have to click on each tab manually because Firefox does not load the previously opened webpages on its own. Sure you can see the tabs but the web pages are not actually loaded. + +This should be considered a bug, not a feature. Users should be given a choice to between rebooting right away or doing it later. + +I don’t remember any other browser infringing like this on its users, not even Google Chrome. But somehow Mozilla eggheads thought that this is a good “feature” to add to their open source browser. + +No, Mozilla! This is not a feature. This is a bug and should be fixed. You just cannot annoy your users like this otherwise they will be forced to use [alternate browsers like Brave][3] or Vivaldi and of course, Chrome. + +I end my rant and leave the field open for you. What do you think of these forced restarts by Mozilla Firefox? + +### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/mozilla-annoying-new-tab/ + +作者:[Abhishek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyNyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://news.itsfoss.com/chrome-like-browsers-2021/ From 52d4bde97044613ce45c61197f0273b7c9951523 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 17 Jul 2021 09:27:58 +0800 Subject: [PATCH 455/870] Update 20210712 Box64 Emulator Released for Arm64 Linux.md --- .../news/20210712 Box64 Emulator Released for Arm64 Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md index 2676c713d5..8f7751f5c1 100644 --- a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md +++ b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/box64-emulator-released/) [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zd200572) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 74e227ed5207004de93a07752052eaadcfb87ee8 Mon Sep 17 00:00:00 2001 From: mcfd <990773468@qq.com> Date: Sat, 17 Jul 2021 09:58:31 +0800 Subject: [PATCH 456/870] translated --- .../20201012 My top 7 keywords in Rust.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 translated/tech/20201012 My top 7 keywords in Rust.md diff --git a/translated/tech/20201012 My top 7 keywords in Rust.md b/translated/tech/20201012 My top 7 keywords in Rust.md new file mode 100644 index 0000000000..d61d9a53ff --- /dev/null +++ b/translated/tech/20201012 My top 7 keywords in Rust.md @@ -0,0 +1,55 @@ +[#]: collector: "lujun9972" +[#]: translator: "mcfd" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "My top 7 keywords in Rust" +[#]: via: "https://opensource.com/article/20/10/keywords-rust" +[#]: author: "Mike Bursell https://opensource.com/users/mikecamel" + +在Rust中的前7个关键字 +====== +从Rust标准库学习一些有用的关键字。 +![Rustacean t-shirt][1] + +我使用 [Rust][2] 已经有几个月了,写的东西比我预期的要多——尽管很多已经废弃掉了,但随着我的学习,我改进了所写的代码,并完成了一些超出我最初意图的更复杂的任务。 + +我仍然喜欢它,并认为谈论一些在 Rust 中重复出现的重要关键字会很好。我将提供我个人的总结:为什么你需要考虑如何使用它们,以及任何其他有用的东西,特别是对于刚接触 Rust 的新手或来自另一种语言的人(如 Java;请阅读我的文章 [*为什么作为一个 Java 程序员的我喜欢学习 Rust*](https://opensource.com/article/20/5/rust-java)). + +事不宜迟,让我们开始吧。获取更多信息的好地方总是 Rust 官方文档——你可能想从[ std 标准库][4]开始. + + 1. **const** – 你可以用 const 声明常量。虽然这不是造火箭,但请一定要用 const ,如果你要在不同的模块中使用常量,那请创建一个 `lib.rs` 文件(Rust 默认的)你可以把所有的常量放在一个命名良好的模块中。我曾经在不同模块的不同文件中发生过 const 变量名(和值)的冲突,仅仅是因为我太懒了,除了在不同文件中剪切和粘贴之外,我本可以通过创建一个共享模块来节省大量的工作。 + 2. **let** – 你并不 _总是_ 需要用 let 语句声明一个变量,但当你这样做时你的代码会更加清晰。此外,如果可以,请一定要添加变量类型。Rust 编译器会尽最大努力猜测它应该是什么类型的变量,但它不一定总能在编译时做到这一点(在这种情况下,编译器 [Cargo][5] 会提示你), 它甚至可能做不到你期望的那样。在这种情况下,对于 Cargo 来说,抱怨你所赋值的函数(例如)与声明不一致,总比 Rust 试图帮助你做错事,而你却不得不在其他地方花费大量时间来进行调试要简单。 + 3. **match** – match 对我来说是新鲜事物,我喜欢使用它。它与其他编程语言中的 "switch" 没有什么不同,但在 Rust 中被广泛使用。它使代码更清晰易读,如果你做了一些愚蠢的事情(例如错过一些可能的情况),Cargo 会很好地提示你。我一般的经验法则是,在管理不同的 option 或进行分支时,如果可以使用 match,那就请一定要使用它。 + 4. **mut** – 在声明一个变量时,如果它的值在声明后会发生变化,那么你需要声明它是可变的(Rust 中变量默认是不可变的)。常见的错误是在某个变量 _没有_ 变化的情况下声明它是可变的,这时编译器会警告你。如果你收到了 Cargo 的警告,说一个可变的变量没有被改变,而你认为它被 _改变_ 了,那么你可能要检查该变量的范围,并确保你使用的是正确的版本。 + 5. **return** – 实际上我很少使用 return,它用于从函数中返回一个值,但是如果你只是在函数的最后一行提供值(或提供返回值的函数),通常会变得更简单,能更清晰地阅读。警告:在很多情况下,你 _会_ 忘记省略这一行末尾的分号(;),如果你这样做,编译器会不高兴的。 + 6. **unsafe** – 如其意:如果你想做一些不能保证 Rust 内存安全的事情,那么你就需要使用这个关键字。我绝对无意在现在或将来的任何时候宣布我的任何 Rust 代码不安全;Rust如此友好的原因之一是它阻止了这种黑客行为。如果你真的需要这样做,再想想,再想想,然后重新设计代码。除非你是一个非常低级的系统程序员,否则要 _避免_ 使用 unsafe。 + 7. **use** – 当你想使用另一个 crate 中的东西时,例如结构体、变量、函数等来自另一个 crate ,那么你需要在你要使用它的代码的代码块的开头声明它。另一个常见的错误是,你这样做了,但没有在 `Cargo.toml` 文件中添加该 crate (最好有一个版本号)。 + + + +我知道,这不是我写过的最复杂的文章,但这是我在开始学习 Rust 时会欣赏的那种文章。我计划在关键函数和其他 Rust 必知知识方面创建类似的文章:如果你有任何要求,请告诉我! + +* * * + +_本文最初发表于 [Alice, Eve, and Bob][6] 经作者许可转载。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/keywords-rust + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[mcfd](https://github.com/mcfd) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rustacean-tshirt.jpg?itok=u7LBmyaj "Rustacean t-shirt" +[2]: https://www.rust-lang.org/ +[3]: https://opensource.com/article/20/5/rust-java +[4]: https://doc.rust-lang.org/std/ +[5]: https://doc.rust-lang.org/cargo/ +[6]: https://aliceevebob.com/2020/09/01/rust-my-top-7-keywords/ From be65ae33d7bd24501a09060f4bec49cccebb5143 Mon Sep 17 00:00:00 2001 From: mcfd <990773468@qq.com> Date: Sat, 17 Jul 2021 10:04:29 +0800 Subject: [PATCH 457/870] del --- .../20201012 My top 7 keywords in Rust.md | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 sources/tech/20201012 My top 7 keywords in Rust.md diff --git a/sources/tech/20201012 My top 7 keywords in Rust.md b/sources/tech/20201012 My top 7 keywords in Rust.md deleted file mode 100644 index 034ccd0cda..0000000000 --- a/sources/tech/20201012 My top 7 keywords in Rust.md +++ /dev/null @@ -1,55 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (mcfd) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (My top 7 keywords in Rust) -[#]: via: (https://opensource.com/article/20/10/keywords-rust) -[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) - -My top 7 keywords in Rust -====== -Learn a handful of useful keywords from the Rust standard library. -![Rustacean t-shirt][1] - -I've been using [Rust][2] for a few months now, writing rather more of it than I expected—though quite a lot of that has been thrown away as I've learned, improved what I'm writing, and taken some more complex tasks beyond what I originally intended. - -I still love it and thought it might be good to talk about some of the important keywords that come up again and again in Rust. I'll provide my personal summary of what they do, why you need to think about how you use them, and anything else that's useful, particularly for people who are new to Rust or coming from another language (such as Java; see my article [_Why I'm enjoying learning Rust as a Java programmer_][3]). - -Without further ado, let's get going. A good place for further information is always the official Rust documentation—you'll probably want to start with the [std library][4]. - - 1. **const** – You get to declare constants with const, and you should. This isn't rocket science, but do declare with const, and if you're going to use constants across different modules, then do the right thing and create a `lib.rs` file (the Rust default) into which you can put all of them with a nicely named module. I've had clashes of const variable names (and values!) across different files in different modules simply because I was too lazy to do anything other than cut and paste across files when I could have saved myself lots of work simply by creating a shared module. - 2. **let** – You don't _always_ need to declare a variable with a let statement, but your code will be clearer when you do. What's more, always add the type if you can. Rust will do its very best to guess what it should be, but it may not always be able to do so at runtime (in which case [Cargo][5], the compiler, will tell you), or it may even not do what you expect. In the latter case, it's always simpler for Cargo to complain that the function you're assigning from (for instance) doesn't match the declaration than for Rust to try to help you do the wrong thing, only for you to have to spend ages debugging elsewhere. - 3. **match** – match was new to me, and I love it. It's not dissimilar to "switch" in other languages but is used extensively in Rust. It makes for legible code, and Cargo will have a good go at warning you if you do something foolish (such as miss possible cases). My general rule of thumb, where I'm managing different options or doing branching, is to ask whether I can use match. If I can, I will. - 4. **mut** – When declaring a variable, if it's going to change after its initialisation, then you need to declare it mutable. A common mistake is to declare something mutable when it _isn't_ changed—but the compiler will warn you about that. If you get a warning from Cargo that a mutable variable isn't changed when you think it _is_, then you may wish to check the scope of the variable and make sure that you're using the right version. - 5. **return** – I actually very rarely use return, which is for returning a value from a function, because it's usually simpler and clearer to read if you just provide the value (or the function providing the return value) at the end of the function as the last line. Warning: you _will_ forget to omit the semicolon at the end of this line on many occasions; if you do, the compiler won't be happy. - 6. **unsafe** – This does what it says on the tin: If you want to do things where Rust can't guarantee memory safety, then you're going to need to use this keyword. I have absolutely no intention of declaring any of my Rust code unsafe now or at any point in the future; one of the reasons Rust is so friendly is because it stops this sort of hackery. If you really need to do this, think again, think yet again, and then redesign. Unless you're a seriously low-level systems programmer, _avoid_ unsafe. - 7. **use** – When you want to use an item, e.g., struct, variable, function, etc. from another crate, then you need to declare it at the beginning of the block where you'll be using it. Another common mistake is to do this but fail to add the crate (preferably with a minimum version number) to the `Cargo.toml` file. - - - -This isn't the most complicated article I've ever written, I know, but it's the sort of article I would have appreciated when I was starting to learn Rust. I plan to create similar articles on key functions and other Rust must-knows: let me know if you have any requests! - -* * * - -_This article was originally published on [Alice, Eve, and Bob][6] and is reprinted with the author's permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/10/keywords-rust - -作者:[Mike Bursell][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mikecamel -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rustacean-tshirt.jpg?itok=u7LBmyaj (Rustacean t-shirt) -[2]: https://www.rust-lang.org/ -[3]: https://opensource.com/article/20/5/rust-java -[4]: https://doc.rust-lang.org/std/ -[5]: https://doc.rust-lang.org/cargo/ -[6]: https://aliceevebob.com/2020/09/01/rust-my-top-7-keywords/ From eaba2c797d0653b2d49ac05406e8c0b4032cdfcd Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 17 Jul 2021 10:13:39 +0800 Subject: [PATCH 458/870] Update 20210712 Box64 Emulator Released for Arm64 Linux.md --- ...Box64 Emulator Released for Arm64 Linux.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md index 8f7751f5c1..56438e5f1b 100644 --- a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md +++ b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md @@ -7,44 +7,44 @@ [#]: publisher: ( ) [#]: url: ( ) -Box64 Emulator Released for Arm64 Linux +Box64模拟器发布Arm64-Linux版本 ====== -[Box86][1], the popular x86 emulator, has just received a huge upgrade. This comes in the form of [Box64][2], the ARM64 equivalent. +[Box86][1]是一个流行的X86模拟器,刚进行了一次大的升级。发布了[Box64][2],也就是对应的ARM64版本。 -If you did not know, Box64_86 lets you run 64-bit or 32-bit Linux programs on ARM systems. In other words, it makes it possible for you to access desktop Linux programs on your Raspberry Pi or [Raspberry Pi alternatives][3]. +可能你还不了解这个模拟器,Box64_86让你在ARM系统上运行32或者64位的X86/64-Linux软件。换句话说,它能让你在树莓派或者[Raspberry Pi alternatives][3]上运行Linux桌面程序。 -Fortunately, now we have Box86 and Box64 to the rescue no matter what type of ARM system you’ve got. +幸运的是,现在我们有Box86和Box64的支援,无论你有什么样的ARM系统. -### What is Box64? +### Box64是什么? ![][4] -You may have heard about Apple’s Rosetta 2, a translation layer that allows apps designed for older Macs to run on the new M1-powered Macs. Box64 is something similar that allows apps designed for x86 to run on ARM Linux devices. +你可能听说过苹果的Rosetta 2,它是一个翻译层,允许为老款mac(Intel X86处理器)设计的应用程序在新的M1(ARM处理器)驱动的mac上运行。Box64与之类似,允许为X86设计的应用运行在ARM-Linux上。 -It manages to do this all while being 100% open-source, free, and surprisingly fast, thanks to its Dynarec module. This improves speed by re-compiling the program for ARM, meaning that it runs the same as any other ARM-supported app. +由于它的Dynarec模块,它可以以100%开源、免费和令人吃惊地速度完成这所有。它为ARM进行重新编译来提升速度,这意味着和其他ARM原生应用一样快。 -However, even if Box64 is unable to recompile the app, it can still run it using on-the-fly emulation, with impressive results here too. +但是,即使Box64不能重新编译应用,它仍然可以使用飞行模拟,也有令人印象深刻的结果。 -Many Raspberry Pi users will be familiar with Box86, a similar program that has been around for about a year now. The biggest difference is that Box86 is only compatible with Arm32, while Box64 is only compatible with Arm64. +许多树莓派用户对Box86很熟悉,约一年前发布的一个类似程序。二者最大的区别是Box86只兼容Arm32,而Box64只兼容Arm64。 -So that’s Box64, the awesome compatibility layer that allows users to run x86_64 apps on your ARM-based PCs. +这就是Box64,一个非常棒的兼容层,允许在ARM电脑上运行x86_64应用。 -### Wrapping Up +### 包装 -If you were to ask me what I think about Box64, I would say it’s an absolute game changer. Between the incredible performance and massive potential, this compatibility layer is sure to play a huge role in the future ARM-based Linux PCs. +如果你问我认为Box64怎么样,我会说这是一个绝对改变了游戏规则。具有难以置信的性能和具大的潜力,这个兼容层肯定在未来的ARM电脑中扮演一个重要角色。 -Check out its [GitHub page][5] if you are curious to know how it works, and how you can get started with it. +如果你对它如何工作,怎么开始使用感到好奇,可以看下它的[GitHub页面][5] -With that, I’ll leave you now to dive into and test for yourself. +有那,你将会沉浸其中和自己测试。 -_What do you think of Box64? Let me know down in the comments below!_ +_你觉得Box64怎样?写下你的评论让我知道。_ -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. +#### 大型技术网站获得百万收,这里是自由开源软件FOSS! + +如果你喜欢我们FOSS所做的事,请考虑为我们的独立出版物做点贡献。你的支持将帮助我们持续出版关于桌面Linux和开源软件的内容。 -I'm not interested -------------------------------------------------------------------------------- @@ -52,7 +52,7 @@ via: https://news.itsfoss.com/box64-emulator-released/ 作者:[Jacob Crume][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zde200572](https://github.com/zd200572) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a4f31d35bf537f7c784a240e063b52338699d7da Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 17 Jul 2021 10:27:16 +0800 Subject: [PATCH 459/870] Update 20210712 Box64 Emulator Released for Arm64 Linux.md --- ...Box64 Emulator Released for Arm64 Linux.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md index 56438e5f1b..a1592d39f1 100644 --- a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md +++ b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md @@ -10,9 +10,9 @@ Box64模拟器发布Arm64-Linux版本 ====== -[Box86][1]是一个流行的X86模拟器,刚进行了一次大的升级。发布了[Box64][2],也就是对应的ARM64版本。 +[Box86][1]是一个流行的X86模拟器,刚进行了一次巨大的升级。发布了[Box64][2],也就是对应的ARM64版本。 -可能你还不了解这个模拟器,Box64_86让你在ARM系统上运行32或者64位的X86/64-Linux软件。换句话说,它能让你在树莓派或者[Raspberry Pi alternatives][3]上运行Linux桌面程序。 +可能你还不了解这个模拟器,Box64_86允许你在ARM系统上运行32或64位的X86/64 Linux程序。换句话说,它能让你在树莓派或者[树莓派替代品][3]上运行Linux桌面程序。 幸运的是,现在我们有Box86和Box64的支援,无论你有什么样的ARM系统. @@ -20,25 +20,25 @@ Box64模拟器发布Arm64-Linux版本 ![][4] -你可能听说过苹果的Rosetta 2,它是一个翻译层,允许为老款mac(Intel X86处理器)设计的应用程序在新的M1(ARM处理器)驱动的mac上运行。Box64与之类似,允许为X86设计的应用运行在ARM-Linux上。 +你可能听说过苹果的Rosetta 2,它是一个翻译层,允许为老款mac(Intel X86处理器)设计的应用程序在新的M1(ARM处理器)驱动的mac上运行。Box64与之类似,允许为X86设计的应用程序运行在ARM Linux设备上。 -由于它的Dynarec模块,它可以以100%开源、免费和令人吃惊地速度完成这所有。它为ARM进行重新编译来提升速度,这意味着和其他ARM原生应用一样快。 +由于它的Dynarec模块,它可以以100%开源、免费和令人惊讶地速度完成这一切。它通过重新编译ARM程序来提升速度,这意味着和其他ARM原生应用一样快。 -但是,即使Box64不能重新编译应用,它仍然可以使用飞行模拟,也有令人印象深刻的结果。 +但是,即使Box64无法重新编译应用,它仍然可以使用即时模拟,也有令人印象深刻的结果。 -许多树莓派用户对Box86很熟悉,约一年前发布的一个类似程序。二者最大的区别是Box86只兼容Arm32,而Box64只兼容Arm64。 +许多树莓派用户很熟悉Box86,一个约一年前发布的类似程序。二者最大的区别是Box86只兼容Arm32,而Box64只兼容Arm64。 这就是Box64,一个非常棒的兼容层,允许在ARM电脑上运行x86_64应用。 ### 包装 -如果你问我认为Box64怎么样,我会说这是一个绝对改变了游戏规则。具有难以置信的性能和具大的潜力,这个兼容层肯定在未来的ARM电脑中扮演一个重要角色。 +如果你问我认为Box64怎么样,我会说这是一个绝对的游戏规则改变者。在难以置信的性能和具大的潜力之间,这个兼容层肯定会在未来的ARM电脑中扮演一个重要角色。 -如果你对它如何工作,怎么开始使用感到好奇,可以看下它的[GitHub页面][5] +如果你想知道它的工作原理,以及如何开始使用它,请查看基[GitHub页面][5] -有那,你将会沉浸其中和自己测试。 +说到这一点,我现在就离开你去潜入并自己测试啦。 -_你觉得Box64怎样?写下你的评论让我知道。_ +你觉得Box64怎样?写下你的评论让我知道。 #### 大型技术网站获得百万收,这里是自由开源软件FOSS! From 8600ff8e8b8b0505504f4e6c4a6289a4d5f8ff52 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 17 Jul 2021 10:30:57 +0800 Subject: [PATCH 460/870] Update 20210712 Box64 Emulator Released for Arm64 Linux.md --- .../20210712 Box64 Emulator Released for Arm64 Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md index a1592d39f1..4cb0e3db96 100644 --- a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md +++ b/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md @@ -7,7 +7,7 @@ [#]: publisher: ( ) [#]: url: ( ) -Box64模拟器发布Arm64-Linux版本 +Box64模拟器发布Arm64 Linux版本 ====== [Box86][1]是一个流行的X86模拟器,刚进行了一次巨大的升级。发布了[Box64][2],也就是对应的ARM64版本。 @@ -34,14 +34,14 @@ Box64模拟器发布Arm64-Linux版本 如果你问我认为Box64怎么样,我会说这是一个绝对的游戏规则改变者。在难以置信的性能和具大的潜力之间,这个兼容层肯定会在未来的ARM电脑中扮演一个重要角色。 -如果你想知道它的工作原理,以及如何开始使用它,请查看基[GitHub页面][5] +如果你想知道它的工作原理,以及如何开始使用它,请查看其[GitHub页面][5] -说到这一点,我现在就离开你去潜入并自己测试啦。 +说到这一点,我现在就离开,去潜入其中并自己测试啦。 你觉得Box64怎样?写下你的评论让我知道。 -#### 大型技术网站获得百万收,这里是自由开源软件FOSS! +#### 大型技术网站获得百万收入,这里是自由开源软件FOSS! 如果你喜欢我们FOSS所做的事,请考虑为我们的独立出版物做点贡献。你的支持将帮助我们持续出版关于桌面Linux和开源软件的内容。 From 0332cb4a1114c387d9823f88fa6a2c3ae2d87121 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 17 Jul 2021 10:36:04 +0800 Subject: [PATCH 461/870] Rename sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md to translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md --- .../news/20210712 Box64 Emulator Released for Arm64 Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/news/20210712 Box64 Emulator Released for Arm64 Linux.md (100%) diff --git a/sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md b/translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md similarity index 100% rename from sources/news/20210712 Box64 Emulator Released for Arm64 Linux.md rename to translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md From a62c73e78339a0f982753880d820602261ef8685 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 17 Jul 2021 11:02:32 +0800 Subject: [PATCH 462/870] =?UTF-8?q?Rename=20sources/news/20210716=20Dear?= =?UTF-8?q?=20Mozilla,=20Please=20Remove=20This=20Annoying=20=E2=80=98Feat?= =?UTF-8?q?ure-=20from=20Firefox.md=20to=20sources/talk/20210716=20Dear=20?= =?UTF-8?q?Mozilla,=20Please=20Remove=20This=20Annoying=20=E2=80=98Feature?= =?UTF-8?q?-=20from=20Firefox.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md (100%) diff --git a/sources/news/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md b/sources/talk/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md similarity index 100% rename from sources/news/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md rename to sources/talk/20210716 Dear Mozilla, Please Remove This Annoying ‘Feature- from Firefox.md From 7bca604211800cfe7a1f6d7d07ab8418075e1de5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Jul 2021 11:38:29 +0800 Subject: [PATCH 463/870] PRF @zz-air --- ...indows 11 Influence Linux Distributions.md | 65 ++++++++++--------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md b/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md index a031bd5626..1164f7f7d6 100644 --- a/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md +++ b/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md @@ -3,37 +3,44 @@ [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (zz-air) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) Windows 11 能影响 Linux 发行版吗? ====== -微软的 Windows11 终于发布了。 有些人将其与 macOS 进行比较,另一些人则比较其本质细节以找到与 GNOME 和 KDE 的相似之处(这没有多大意义)。 +> Windows 11 正在为全球的桌面用户制造新闻。它会影响 Linux 发行版走向桌面用户吗? -但是,在所以的热议中,我对另一件事很好奇—— **微软的 Windows 11 能影响桌面 Linux 发行版未来的决策吗?** +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/windows-linux-desktop-influence.png?w=1200&ssl=1) -在这里,如果它以前发生过,我将提到一些我的想法,关于它为什么会发生,以及 Linux 发行版未来会发生什么。 +微软的 Windows11 终于发布了。有些人将其与 macOS 进行比较,另一些人则比较其细枝末节发现与 GNOME 和 KDE 的相似之处(这没有多大意义)。 -### 一些Linux发行版已经关注类似Windows的体验:但是,为什么呢? +但是,在所有的热议当中,我对另一件事很好奇—— **微软的 Windows 11 能影响桌面 Linux 发行版未来的决策吗?** + +在这里,我将提到一些我的想法,即如果它以前发生过,为什么会发生?以及 Linux 发行版未来会怎样。 + +### 一些 Linux 发行版已经关注类似 Windows 的体验:但是,为什么呢? 微软的 Windows 是最受欢迎的桌面操作系统,因其易操作、软件支持和硬件兼容占据了 88% 的市场分额。 -相反, Linux 占有 **大约 2% 的市场分额,** [即使 Linux 比 Windows 有更多的优势][1]。 + +相反, Linux 占有 **大约 2% 的市场分额,** [即使 Linux 比 Windows 有更多的优势][1]。 那么 Linux 能做什么来说服更多的用户将 Linux 作为他们的桌面操作系统呢? -每个桌面操作系统的主要关注点应该是用户体验。当微软和苹果设法为大众提供舒适的用户体验时, Linux 发行版并没有设法在这方面取得巨大的胜利。 +每个桌面操作系统的主要关注点应该是用户体验。当微软和苹果设法为大众提供舒适的用户体验时,Linux 发行版并没有设法在这方面取得巨大的胜利。 然而,你将会发现有几个 [Linux 发行版打算取代 Windows 10][2]。这些 Linux 发行版试图提供一个熟悉的用户界面,鼓励 Windows 用户考虑切换到 Linux 。 而且,由于这些发行版的存在,[在 2021 年切换到 Linux][3] 比以往任何时候都更有意义。 因此,为了让更多的用户跳转到 Linux ,微软 Window 多年来已经影响了许多发行版。 + ### Windows 11 在某些方面比 Linux 好? + 用户界面随着 Windows 的发展而不断的发展。即使这是主观的,它似乎是大多数桌面用户的选择。 -所以我要说 Windows11 在这方面做了一些有吸引力的改进。 +所以我要说 Windows 11 在这方面做了一些有吸引力的改进。 ![][4] @@ -41,26 +48,25 @@ Windows 11 能影响 Linux 发行版吗? **虽然 Linux 发行版没有自己成熟的服务,但是像这样定制的更多开箱即用的集成,应该会使新用户更容易上手。** -并且这让我想起了 Windows 11 的另一个方面——一个个性化的欣慰和信息提要。 +并且这让我想起了 Windows 11 的另一个方面——个性化的新闻和信息提要。 -当然,微软会为此收集数据,你可能需要使用微软账号登录。但这也减少了用户寻找独立应用程序来跟踪天气、新闻和其他日常信息。 +当然,微软会为此收集数据,你可能需要使用微软账号登录。但这也减少了用户寻找独立应用程序来跟踪天气、新闻和其他日常信息的摩擦。 Linux 不会强迫用户做出这些选择,但是像这样的特性/集成可以作为额外的选项添加,可以以选择的形式呈现给用户。 -**换句话说,在与操作系统集成的同时使事物更容易访问,应该可以摆脱陡峭的学习曲线。** +**换句话说,在与操作系统集成的同时,使事物更容易访问,应该可以摆脱陡峭的学习曲线。** 而且,可怕的微软商店也在 Windows 11 上进行了重大升级。 ![][5] -不幸的是,对于 Linux 发行版,我没有看到对应用中心进行有意义的升级,来使其在视觉上更吸引人,更有趣。 +不幸的是,对于 Linux 发行版,我没有看到对应用中心进行多少有意义的升级,来使其在视觉上更吸引人,更有趣。 - -elementaryOS 可能正努力专注于 UX/UI ,并发展应用中心的体验,但对于大多数其他发行版,没有重大的升级。 +elementaryOS 可能正努力专注于 UX/UI ,并不断发展应用中心的体验,但对于大多数其他发行版,没有重大的升级。 ![Linux Mint 20.1 中的软件管理器][6] -虽然我很欣赏 Deepin Linux 在这方面所做的,但它并不是许多用户第一次尝试 Linux 时的热门选择。 +虽然我很欣赏深度 Linux 在这方面所做的,但它并不是许多用户第一次尝试 Linux 时的热门选择。 ### Windows 11 引入了更多的竞争:Linux 必须跟上 @@ -68,29 +74,24 @@ elementaryOS 可能正努力专注于 UX/UI ,并发展应用中心的体验, 虽然在 Linux 世界中,我们确实有一些 Windows 10 经验的替代品,但还没有针对 Windows 11 的。 -但这让我们看到了来自 Linux 社区的明显回应—— **在 Windows 11 上使用 dab 的 Linux 发行版**. +但这让我们看到了来自 Linux 社区的明显反击—— **一个针对 Windows 11 的 Linux 发行版**。 不管是讨厌还是喜欢微软最新的 Windows 11 设计方案,在接下来的几年里,大众将会接受它。 -并且,为了使 Linux 成为一个引人注目的桌面替代品, Linux 发行版的设计语言也必须发展。 +并且,为了使 Linux 成为一个引人注目的桌面替代品,Linux 发行版的设计语言也必须发展。 -不仅仅是桌面市场————还有笔记本专用的设计选择————也需要对 Linux 发行版进行显著改进。 +不仅仅是桌面市场,还有笔记本专用的设计选择也需要对 Linux 发行版进行重大改进。 -有些选择想 [Pop!_OS_System 76 ][7] 一直试图为 Linux 提供这种体验,这是一个良好的开端。 +像 [Pop!_OS_System 76][7] 这些选择一直试图为 Linux 提供这种体验,这是一个良好的开端。 -我认为 Zorin 操作系统开源作为一个发行版引入 “**Windows 11**” 布局作为一个选择,让更多用户尝试 Linux。 -别忘了——在 windows 11 将 Android 应用程序支持作为一项功能推向市场之后,[Deepin Linux 就引入了 Android 应用程序支持。][8] +我认为 Zorin OS 可以作为一个引入 “**Windows 11**” 布局的发行版,作为让更多用户尝试 Linux 的一个选择。 -所以,你看,当微软的 Windows 采取行动时,对 Linux 也会产生连锁反应。而 Deepin Linux 的 Android 应用支持只是一个开始......让我们看看接下来还会出现什么。 +别忘了,在 Windows 11 将 Android 应用程序支持作为一项功能推向市场之后,[深度 Linux 就引入了 Android 应用程序支持。][8] + +所以,你看,当微软的 Windows 采取行动时,对 Linux 也会产生连锁反应。而深度 Linux 的 Android 应用支持只是一个开始……让我们看看接下来还会出现什么。 _你对 Windows 11 影响 Linux 桌面的未来有什么看法?我们也需要进化吗?或者我们应该继续与众不同,不受大众选择的影响?_ -#### 大型科技网站获得数百万美元的收入, 是自由/开源软件吸引了你! - -如果你喜欢我们的自由/开源软件,请考虑捐款支持我们的独立出版。您的支持将帮助我们继续发布专注于桌面 Linux 和开源软件的内容。 - -我不感兴趣 - -------------------------------------------------------------------------------- via: https://news.itsfoss.com/can-windows-11-influence-linux/ @@ -98,7 +99,7 @@ via: https://news.itsfoss.com/can-windows-11-influence-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[zz-air](https://github.com/zz-air) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -107,8 +108,8 @@ via: https://news.itsfoss.com/can-windows-11-influence-linux/ [1]: https://itsfoss.com/linux-better-than-windows/ [2]: https://itsfoss.com/windows-like-linux-distributions/ [3]: https://news.itsfoss.com/switch-to-linux-in-2021/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY0OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/windows-11-home.png?w=1024&ssl=1 +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/windows-10-app-store.png?w=1024&ssl=1 +[6]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/software-manager-linux-mint.png?w=862&ssl=1 [7]: https://pop.system76.com [8]: https://news.itsfoss.com/deepin-linux-20-2-2-release/ From c078ca0ef2489637f73ef9582d8760be879f1955 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Jul 2021 11:39:25 +0800 Subject: [PATCH 464/870] PUB @zz-air https://linux.cn/article-13588-1.html --- .../20210703 Can Windows 11 Influence Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210703 Can Windows 11 Influence Linux Distributions.md (98%) diff --git a/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md b/published/20210703 Can Windows 11 Influence Linux Distributions.md similarity index 98% rename from translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md rename to published/20210703 Can Windows 11 Influence Linux Distributions.md index 1164f7f7d6..23c32ec7a1 100644 --- a/translated/talk/20210703 Can Windows 11 Influence Linux Distributions.md +++ b/published/20210703 Can Windows 11 Influence Linux Distributions.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (zz-air) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13588-1.html) Windows 11 能影响 Linux 发行版吗? ====== From 8cbff140e8290c507607659da295e63945de5e84 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Jul 2021 12:23:07 +0800 Subject: [PATCH 465/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @mcfd 感谢您,完成了第一篇翻译贡献! --- .../20201012 My top 7 keywords in Rust.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20201012 My top 7 keywords in Rust.md b/translated/tech/20201012 My top 7 keywords in Rust.md index d61d9a53ff..4c96d6a56c 100644 --- a/translated/tech/20201012 My top 7 keywords in Rust.md +++ b/translated/tech/20201012 My top 7 keywords in Rust.md @@ -1,34 +1,34 @@ [#]: collector: "lujun9972" [#]: translator: "mcfd" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "My top 7 keywords in Rust" [#]: via: "https://opensource.com/article/20/10/keywords-rust" [#]: author: "Mike Bursell https://opensource.com/users/mikecamel" -在Rust中的前7个关键字 +我的 7 大 Rust 关键字 ====== -从Rust标准库学习一些有用的关键字。 + +> 从 Rust 标准库学习一些有用的关键字。 + ![Rustacean t-shirt][1] -我使用 [Rust][2] 已经有几个月了,写的东西比我预期的要多——尽管很多已经废弃掉了,但随着我的学习,我改进了所写的代码,并完成了一些超出我最初意图的更复杂的任务。 +我使用 [Rust][2] 已经有几个月了,写的东西比我预期的要多——尽管随着我的学习,我改进了所写的代码,并完成了一些超出我最初意图的更复杂的任务,相当多的东西已经被扔掉了。 -我仍然喜欢它,并认为谈论一些在 Rust 中重复出现的重要关键字会很好。我将提供我个人的总结:为什么你需要考虑如何使用它们,以及任何其他有用的东西,特别是对于刚接触 Rust 的新手或来自另一种语言的人(如 Java;请阅读我的文章 [*为什么作为一个 Java 程序员的我喜欢学习 Rust*](https://opensource.com/article/20/5/rust-java)). +我仍然喜欢它,并认为谈论一些在 Rust 中反复出现的重要关键字可能会有好处。我会提供我个人对它们的作用的总结:为什么你需要考虑如何使用它们,以及任何其他有用的东西,特别是对于刚接触 Rust 的新手或来自另一种语言的人(如 Java;请阅读我的文章 [为什么作为一个 Java 程序员的我喜欢学习 Rust][3])。 -事不宜迟,让我们开始吧。获取更多信息的好地方总是 Rust 官方文档——你可能想从[ std 标准库][4]开始. +事不宜迟,让我们开始吧。获取更多信息的好地方总是 Rust 官方文档 —— 你可能想从 [std 标准库][4]开始。 - 1. **const** – 你可以用 const 声明常量。虽然这不是造火箭,但请一定要用 const ,如果你要在不同的模块中使用常量,那请创建一个 `lib.rs` 文件(Rust 默认的)你可以把所有的常量放在一个命名良好的模块中。我曾经在不同模块的不同文件中发生过 const 变量名(和值)的冲突,仅仅是因为我太懒了,除了在不同文件中剪切和粘贴之外,我本可以通过创建一个共享模块来节省大量的工作。 - 2. **let** – 你并不 _总是_ 需要用 let 语句声明一个变量,但当你这样做时你的代码会更加清晰。此外,如果可以,请一定要添加变量类型。Rust 编译器会尽最大努力猜测它应该是什么类型的变量,但它不一定总能在编译时做到这一点(在这种情况下,编译器 [Cargo][5] 会提示你), 它甚至可能做不到你期望的那样。在这种情况下,对于 Cargo 来说,抱怨你所赋值的函数(例如)与声明不一致,总比 Rust 试图帮助你做错事,而你却不得不在其他地方花费大量时间来进行调试要简单。 - 3. **match** – match 对我来说是新鲜事物,我喜欢使用它。它与其他编程语言中的 "switch" 没有什么不同,但在 Rust 中被广泛使用。它使代码更清晰易读,如果你做了一些愚蠢的事情(例如错过一些可能的情况),Cargo 会很好地提示你。我一般的经验法则是,在管理不同的 option 或进行分支时,如果可以使用 match,那就请一定要使用它。 - 4. **mut** – 在声明一个变量时,如果它的值在声明后会发生变化,那么你需要声明它是可变的(Rust 中变量默认是不可变的)。常见的错误是在某个变量 _没有_ 变化的情况下声明它是可变的,这时编译器会警告你。如果你收到了 Cargo 的警告,说一个可变的变量没有被改变,而你认为它被 _改变_ 了,那么你可能要检查该变量的范围,并确保你使用的是正确的版本。 - 5. **return** – 实际上我很少使用 return,它用于从函数中返回一个值,但是如果你只是在函数的最后一行提供值(或提供返回值的函数),通常会变得更简单,能更清晰地阅读。警告:在很多情况下,你 _会_ 忘记省略这一行末尾的分号(;),如果你这样做,编译器会不高兴的。 - 6. **unsafe** – 如其意:如果你想做一些不能保证 Rust 内存安全的事情,那么你就需要使用这个关键字。我绝对无意在现在或将来的任何时候宣布我的任何 Rust 代码不安全;Rust如此友好的原因之一是它阻止了这种黑客行为。如果你真的需要这样做,再想想,再想想,然后重新设计代码。除非你是一个非常低级的系统程序员,否则要 _避免_ 使用 unsafe。 - 7. **use** – 当你想使用另一个 crate 中的东西时,例如结构体、变量、函数等来自另一个 crate ,那么你需要在你要使用它的代码的代码块的开头声明它。另一个常见的错误是,你这样做了,但没有在 `Cargo.toml` 文件中添加该 crate (最好有一个版本号)。 + 1. `const` – 你可以用 `const` 来声明常量,而且你应该这样做。虽然这不是造火箭,但请一定要用 `const` ,如果你要在不同的模块中使用常量,那请创建一个 `lib.rs` 文件(Rust 默认的),你可以把所有的常量放在一个命名良好的模块中。我曾经在不同模块的不同文件中发生过 `const` 变量名(和值)的冲突,仅仅是因为我太懒了,除了在不同文件中剪切和粘贴之外,我本可以通过创建一个共享模块来节省大量的工作。 + 2. `let` – 你并不 _总是_ 需要用 `let` 语句声明一个变量,但当你这样做时你的代码会更加清晰。此外,如果可以,请一定要添加变量类型。Rust 会尽最大努力猜测它应该是什么类型的变量,但它不一定总能在运行时做到这一点(在这种情况下,编译器 [Cargo][5] 会提示你),它甚至可能做不到你期望的那样。在后一种情况下,对于 Cargo 来说,抱怨你所赋值的函数(例如)与声明不一致,总比 Rust 试图帮助你做错事,而你却不得不在其他地方花费大量时间来进行调试要简单。 + 3. `match` – `match` 对我来说是新鲜事物,我喜欢使用它。它与其他编程语言中的 `switch` 没有什么不同,但在 Rust 中被广泛使用。它使代码更清晰易读,如果你做了一些愚蠢的事情(例如错过一些可能的情况),Cargo 会很好地提示你。我一般的经验法则是,在管理不同的选项或进行分支时,如果可以使用 `match`,那就请一定要使用它。 + 4. `mut` – 在声明一个变量时,如果它的值在声明后会发生变化,那么你需要声明它是可变的(LCTT 译注:Rust 中变量默认是不可变的)。常见的错误是在某个变量 _没有_ 变化的情况下声明它是可变的,这时编译器会警告你。如果你收到了 Cargo 的警告,说一个可变的变量没有被改变,而你认为它被 _改变_ 了,那么你可能要检查该变量的范围,并确保你使用的是正确的那个。 + 5. `return` – 实际上我很少使用 `return`,它用于从函数中返回一个值,但是如果你只是在函数的最后一行提供值(或提供返回值的函数),通常会变得更简单,能更清晰地阅读。警告:在很多情况下,你 _会_ 忘记省略这一行末尾的分号(`;`),如果你这样做,编译器会不高兴的。 + 6. `unsafe` – 如其意:如果你想做一些不能保证 Rust 内存安全的事情,那么你就需要使用这个关键字。我绝对无意在现在或将来的任何时候宣布我的任何 Rust 代码不安全;Rust 如此友好的原因之一是它阻止了这种黑客行为。如果你真的需要这样做,再想想,再想想,然后重新设计代码。除非你是一个非常低级的系统程序员,否则要 _避免_ 使用 `unsafe`。 + 7. `use` – 当你想使用另一个 crate 中的东西时,例如结构体、变量、函数等,那么你需要在你要使用它的代码的代码块的开头声明它。另一个常见的错误是,你这样做了,但没有在 `Cargo.toml` 文件中添加该 crate (最好有一个最小版本号)。 - - -我知道,这不是我写过的最复杂的文章,但这是我在开始学习 Rust 时会欣赏的那种文章。我计划在关键函数和其他 Rust 必知知识方面创建类似的文章:如果你有任何要求,请告诉我! +我知道,这不是我写过的最复杂的文章,但这是我在开始学习 Rust 时会欣赏的那种文章。我计划在关键函数和其他 Rust 必知知识方面编写类似的文章:如果你有任何要求,请告诉我! * * * @@ -41,7 +41,7 @@ via: https://opensource.com/article/20/10/keywords-rust 作者:[Mike Bursell][a] 选题:[lujun9972][b] 译者:[mcfd](https://github.com/mcfd) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8d2df388b5ed3c8dd3d0255e4f16fb11b48822d5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Jul 2021 12:26:07 +0800 Subject: [PATCH 466/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @mcfd 本文首发地址:https://linux.cn/article-13589-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/mcfd --- .../tech => published}/20201012 My top 7 keywords in Rust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201012 My top 7 keywords in Rust.md (98%) diff --git a/translated/tech/20201012 My top 7 keywords in Rust.md b/published/20201012 My top 7 keywords in Rust.md similarity index 98% rename from translated/tech/20201012 My top 7 keywords in Rust.md rename to published/20201012 My top 7 keywords in Rust.md index 4c96d6a56c..2f770e9532 100644 --- a/translated/tech/20201012 My top 7 keywords in Rust.md +++ b/published/20201012 My top 7 keywords in Rust.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "mcfd" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13589-1.html" [#]: subject: "My top 7 keywords in Rust" [#]: via: "https://opensource.com/article/20/10/keywords-rust" [#]: author: "Mike Bursell https://opensource.com/users/mikecamel" From 6f741a91784252f2a90512815ded8833c36c67d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E9=BE=99?= <2638000368@qq.com> Date: Sat, 17 Jul 2021 13:17:43 +0800 Subject: [PATCH 467/870] amended 'An advanced guide to NLP analysis with Python and NLTK' --- ...de to NLP analysis with Python and NLTK.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md index 37ea3744c9..8223727f4b 100644 --- a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md +++ b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md @@ -24,7 +24,7 @@ ### WordNet 和同义词集synsets -[WordNet][4] 是 NLTK 里的一个大型词典数据库。WordNet 包含各单词的诸多认知同义词cognitive synonyms (一个认知同义词cognitive synonyms常被称作 synset)。 +[WordNet][4] 是 NLTK 里的一个大型词典数据库。WordNet 包含各单词的诸多认知同义词cognitive synonyms (一个认知同义词常被称作 synset)。在 WordNet 里,名词、动词、形容词和副词,各自被组织成一个同义词的网络。 WordNet 是文本分析的一个很有用的工具。它有面向多种语言的版本 (汉语、英语、日语、俄语和西班牙语等),也使用多种许可证 (从开源许可证到商业许可证都有)。初代版本的 WordNet 由普林斯顿大学研发,面向英语,使用类 MIT 许可证MIT-like license。 @@ -34,13 +34,13 @@ WordNet 是文本分析的一个很有用的工具。它有面向多种语言的 |---|---|---| |名称Name| 此 synset 的名称 | 单词 code 有 5 个 synset,名称分别是 `code.n.01`、 `code.n.02`、 `code.n.03`、`code.v.01` 和 `code.v.02`| |词性POS| 此 synset 的词性 | 单词 code 有 3 个名词词性的 synset 和 2 个动词词性的 synset| -|定义Definition| 该词作对应词性时的定义 | 动词 code 的一个定义是: (计算机科学computer science)数据或计算机程序指令的象征性排列symbolic arrangement| +|定义Definition| 该词作对应词性时的定义 | 动词 code 的一个定义是:(计算机科学) 数据或计算机程序指令的象征性排列symbolic arrangement| |例子Examples| 使用该词的例子 | code 一词的例子:为了安全,我们应该给信息编码。We should encode the message for security reasons| -|词元Lemmas| 与该词向关联的其他 synset (包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元lemma直接与其他词元lemma连关联,而不是直接与单词words/rt>相关联| `code.v.02` 的词元lemma是`code.v.02.encipher`、`code.v.02.cipher`、`code.v.02.cypher`、`code.v.02.encrypt`、`code.v.02.inscribe` 和 `code.v.02.write_in_code`| -|反义词Antonyms| 意思相反的词 | 词元lemma`encode.v.01.encode` 的反义词antonym是 `decode.v.01.decode`| -|上义词Hypernym|该词所属的一个范畴更大的词 | `code.v.01` 的一个上义词hypernym是 `tag.v.01`| -|分项词Meronym| 属于该词组成部分的词 | 计算机computer的一个分项词meronym芯片chip| -|总项词Holonym| 该词作为组成部分所属的词 | window的一个总项词holonym电脑屏幕computer screen| +|词元Lemmas| 与该词相关联的其他 synset (包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元直接与其他词元相关联,而不是直接与单词words/rt>相关联|`code.v.02` 的词元是`code.v.02.encipher`、`code.v.02.cipher`、`code.v.02.cypher`、`code.v.02.encrypt`、`code.v.02.inscribe` 和 `code.v.02.write_in_code`| +|反义词Antonyms| 意思相反的词 | 词元 `encode.v.01.encode` 的反义词是 `decode.v.01.decode`| +|上义词Hypernym|该词所属的一个范畴更大的词 | `code.v.01` 的一个上义词是 `tag.v.01`| +|分项词Meronym| 属于该词组成部分的词 | computer 的一个分项词是 chip | +|总项词Holonym| 该词作为组成部分所属的词 | window 的一个总项词是 computer screen| synset 还有一些其他属性,在 `<你的 Python 安装路径>/Lib/site-packages` 下的 `nltk/corpus/reader/wordnet.py`,你可以找到它们。 @@ -116,7 +116,7 @@ Part Holonyms: [] Part Meronyms: [] ``` -同义词集synsets词元lemma在 WordNet 里是按照树状结构组织起来的,下面的代码会给出直观的展现: +同义词集synsets词元lemmas在 WordNet 里是按照树状结构组织起来的,下面的代码会给出直观的展现: ``` def hypernyms(synset): @@ -194,7 +194,7 @@ Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players t    is 0.05 ``` -两个词各个 synset 之间路径相似度path similarity最大的是 0.5,表明它们关联性很大 (路径相似度指两个词的意义在上下义关系的词汇分类结构hypernym/hypnoym taxonomy中的最短距离)。 +两个词各个 synset 之间路径相似度path similarity最大的是 0.5,表明它们关联性很大 ([路径相似度path similarity][6]指两个词的意义在上下义关系的词汇分类结构hypernym/hypnoym taxonomy中的最短距离)。 那么 code 和 bug 呢?这两个计算机领域的词的相似度是: @@ -226,7 +226,7 @@ NLTK 提供多种相似度计分器similarity scorers, * jcn_similarity * lin_similarity -要进一步了解这个相似度计分器similarity scorers,请查看 [WordNet Interface][6] 的 Similarity 部分。 +要进一步了解这些相似度计分器similarity scorers,请查看 [WordNet Interface][6] 的 Similarity 部分。 #### 自主尝试 @@ -408,7 +408,7 @@ tree.draw() ``` -`sentence = 'Peterson first suggested the name "open source" at Palo Alto, California'` +sentence = 'Peterson first suggested the name "open source" at Palo Alto, California' ``` 验证这个句子里的人名name地名place有没有被识别出来。照例先预处理: @@ -488,18 +488,18 @@ NLTK 也可以使用其他标注器tagger,比如 [Stanfo 使用 Python 库,下载维基百科的 [Category: Computer science page][18],然后: - * 找出其中频率最高的单词unigrams、二元搭配bigrams三元搭配trigrams,将它们作为一个关键词keywords列表或者技术techonologies列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。 + * 找出其中频率最高的单词unigrams、二元搭配bigrams三元搭配trigrams,将它们作为一个关键词列表或者技术列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。 * 图形化地显示这个领域里重要的人名、技术、日期和地点。这会是一份很棒的信息图。 - * 构建一个搜索引擎search engine。你的搜索引擎search engine性能能够超过维基百科吗? + * 构建一个搜索引擎。你的搜索引擎性能能够超过维基百科吗? -### 接下来可以做什么? +### 下一步? -自然语言处理NLP应用构建application building的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。 +自然语言处理是应用构建application building的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。 在这个系列的文章里,我用 NLTK 作为例子,展示了自然语言处理可以做什么。自然语言处理和 NLTK 还有太多东西值得探索,这个系列的文章只是帮助你探索它们的切入点。 -如果你的需求慢慢增长到 NLTK 已经满足不了了,你可以训练新的模型或者向 NLTK 添加新的功能。基于 NLTK 构建的新的自然语言处理库NLP libraries正在不断涌现,机器学习也正被深度用于自然语言处理。 +如果你的需求增长到 NLTK 已经满足不了了,你可以训练新的模型或者向 NLTK 添加新的功能。基于 NLTK 构建的新的自然语言处理库正在不断涌现,机器学习也正被深度用于自然语言处理。 -------------------------------------------------------------------------------- From 7991865d749d4dccaeb755396592b16206d2ebb2 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 17 Jul 2021 18:10:51 +0800 Subject: [PATCH 468/870] Translating --- ...4 How different programming languages read and write data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210714 How different programming languages read and write data.md b/sources/tech/20210714 How different programming languages read and write data.md index 4bcc61a96a..ec3b8df217 100644 --- a/sources/tech/20210714 How different programming languages read and write data.md +++ b/sources/tech/20210714 How different programming languages read and write data.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/programming-read-write) [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 75c1c0a7786578715b73447aff5dadc06f23db8b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 18 Jul 2021 05:03:23 +0800 Subject: [PATCH 469/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210716=20?= =?UTF-8?q?Apps=20for=20daily=20needs=20part=201:=20web=20browsers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210716 Apps for daily needs part 1- web browsers.md --- ...ps for daily needs part 1- web browsers.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20210716 Apps for daily needs part 1- web browsers.md diff --git a/sources/tech/20210716 Apps for daily needs part 1- web browsers.md b/sources/tech/20210716 Apps for daily needs part 1- web browsers.md new file mode 100644 index 0000000000..b893b223dc --- /dev/null +++ b/sources/tech/20210716 Apps for daily needs part 1- web browsers.md @@ -0,0 +1,112 @@ +[#]: subject: (Apps for daily needs part 1: web browsers) +[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/) +[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Apps for daily needs part 1: web browsers +====== + +![][1] + +Photo by [Brooke Cagle][2] on [Unsplash][3] + +One of the important apps for daily needs is a web browser. That’s because surfing the internet is an activity most people do in front of the computer. This article will introduce some of the open source web browsers that you can use on Fedora Linux. You need to install the software mentioned. All the browsers mentioned in this article are already available in the official Fedora repository. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. + +### Firefox + +Firefox is a fast and privacy-focused browser that works across many devices. It was created by [Mozilla][5] and is a browser with complete features offering many extensions. You can add many powerful functions and useful features to your Firefox browser. It uses just enough memory to create a smooth experience so your computer stays responsive to other tasks. You can create an account that will allow you to share configurations on multiple devices, so you don’t need to set up Firefox on each device. + +![][6] + +Firefox offers the following features: + + * Private Browsing mode + * Ad tracker blocking + * Password manager + * Sync between devices + * Picture-in-Picture + + + +More information about Firefox browser is available at this link: [https://www.mozilla.org/en-US/firefox][7] + +### GNOME Web + +GNOME Web is a browser for GNOME desktop which is the default desktop environment for Fedora Workstation. It may be very appropriate as your main browser if you use Fedora Workstation with GNOME as the default desktop environment. This browser has a simple, clean, and beautiful look. GNOME Web has fewer features than Firefox, but it is sufficient for common uses. + +![][8] + +GNOME Web offers the following features: + + * Incognito mode + * GNOME desktop integration + * built-in adblocker + * Intelligent tracking prevention + + + +More information about GNOME Web is available at this link: + +### Chromium + +Chromium is an open-source web browser from the Chromium Project and has a minimalist user interface. It has a similar appearance to Chrome, because it actually serves as the base for Chrome and several other browsers. Many people use Chromium because they are used to Chrome. + +![][9] + +Chromium offers the following features: + + * Incognito mode + * Extensions + * Autofill for passwords + + + +More information about Chromium browser is available at this link: + +### qutebrowser + +This browser is a little bit different than the browsers mentioned above. qutebrowser is a keyboard-focused browser with a minimal GUI. Therefore, you won’t find the buttons normally found in other browsers, like back, home, reload, etc. Instead, you can type commands with the keyboard to run functions in the qutebrowser. It uses Vim-style key bindings, so it’s suitable for Vim users. You should try this browser if you are interested in getting a different experience in surfing the internet. + +![][10] + +qutebrowser offers the following features: + + * Adblock + * Private browsing mode + * Quickmarks + + + +More information about qutebrowser browser is available at this link: + +### Conclusion + +Everyone has different needs in using the internet, especially for browsing. Each browser mentioned in this article has different features. So choose a browser that suits your daily needs and preferences. If you use the browsers mentioned in this article, share your story in the comments. And if you use a browser other than the one mentioned in this article, please mention it. Hopefully this article can help you in choosing the browser that you will use for your daily needs on Fedora. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/ + +作者:[Arman Arisman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-1-Browsers-2-816x345.jpg +[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ +[5]: https://www.mozilla.org/en-US/ +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Firefox-1-1024x707.png +[7]: https://www.mozilla.org/en-US/firefox/ +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Web-1024x658.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Chromium-1-1024x690.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-qb-1024x687.png From e8ca3d1c66f35c0e5088295545228daac0f4c96e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 18 Jul 2021 05:03:45 +0800 Subject: [PATCH 470/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210718=20?= =?UTF-8?q?Up=20for=20a=20Challenge=3F=20Try=20These=20=E2=80=98Advanced?= =?UTF-8?q?=E2=80=99=20Linux=20Distros=20[Not=20Based=20on=20Debian,=20Arc?= =?UTF-8?q?h=20or=20Red=20Hat]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md --- ...ros -Not Based on Debian, Arch or Red Hat.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md diff --git a/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md b/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md new file mode 100644 index 0000000000..d3a958a85f --- /dev/null +++ b/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md @@ -0,0 +1,140 @@ +[#]: subject: (Up for a Challenge? Try These ‘Advanced’ Linux Distros [Not Based on Debian, Arch or Red Hat]) +[#]: via: (https://itsfoss.com/advanced-linux-distros/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Up for a Challenge? Try These ‘Advanced’ Linux Distros [Not Based on Debian, Arch or Red Hat] +====== + +There are hundreds of Linux distributions. Some are for general purpose usage, while some are specifically tailored for education, robotics, hacking, gaming and what not. + +You’ll notice that most of them originate from Debian/Ubuntu, Arch and Red Hat/Fedora. If you like distrohopping and experiment with a range of distributions, you may soon get ‘bored’ out of it. Most Linux distributions would feel too similar after a point and apart from a few visual changes here and there, you won’t get a different experience. + +Does that sound familiar? If yes, let me list some advanced, independent, Linux distributions to test your expertise. + +### Advanced Linux distributions for experts + +![][1] + +You may argue against the use of term “expert” here. After all, ‘expert Linux users’ don’t necessarily need to use advanced Linux distributions. They can easily utilize their expertise on [beginner-friendly distributions like Linux Mint][2]. + +The term expert here is intended for people who won’t easily get overwhelmed when they are taken out of their comfort zone and land in an unfamiliar environment. + +Alright then. Let’s see which distributions you can use to test your expertise on. + +#### NixOS + +![NixOS Linux illustration][3] + +[NixOS][4] is a unique distribution in the terms of how it approaches everything from the kernel to configuration to applications. + +NixOS is built on top of the Nix package manager and everything from the kernel to configuration is based on it. All packages are kept in isolation from each other. + +It ensures that installing or upgrading one package does not break other packages. You can also easily roll back to previous versions. + +The isolation feature also helps you in trying new tools without hesitation, creating development environments and more. + +Sounds good enough to give it a try? You call, truly. + +#### Void Linux + +![Void Linux illustration][5] + +[Void Linux][6] is another independent Linux distribution which was implemented from scratch. It is a rolling release distribution but it focuses on stability rather than being bleeding edge like Arch Linux. + +Void Linux has its own XBPS package management system for installing and removing software with option to build packages from sources (from XBPS source packages collection). + +Another thing that sets Void Linux apart from the crowd of other distribution is its use of [runit][7] as init system instead of systemd. + +Can Void Linux fill the void in your distrohopping life? Find it out yourself. + +#### Slackware + +![Slackware Linux illustration][8] + +The oldest active Linux distribution, [Slackware][9], can surely be counted as an expert Linux distribution. + +Which is amusing because once upon a time, many new Linux users started their Linux journey with Slackware. But that was back in the mid-90s and it is safe to assume that those newbies have turned into veteran with their neck beard touching the ground. + +Originally, Slackware was based on Softlanding Linux System (SLS), one of the earliest Linux distributions in 1992. + +Slackware is an advanced Linux distribution with aim to produce the most “UNIX-like” Linux distribution out there. + +No slacking here. Be ready to use the command line extensively in Slackware. + +#### Gentoo + +![Gentoo Linux illustration][10] + +[Gentoo Linux][11] is named after the fast swimming Gentoo penguin. It reflects the speed optimization capabilities of Gentoo Linux. + +How? It’s software distribution system, Portage, gives it extreme configurability and performance. Portage keeps a collection of build scripts for the packages and it automatically builds a custom version of package based on end user’s preference and optimized for end user’s hardware. + +This ‘build’ stuff is why there are many jokes and meme in Linux-verse about compiling everything in Gentoo. + +Can you catch up with the Gentoo? + +#### Clear Linux + +![Clear Linux illustration][12] + +[Clear Linux][13] is not your general purpose desktop Linux distribution. It is an open source, rolling release distribution, created from the ground up by Intel and obviously, it is highly tuned for Intel platforms. + +Clear Linux OS primarily targets professionals in the field of IT, DevOps, Cloud/Container deployments, and AI. + +The package management is done through [swupd][14] but unlike regular package managers, versioning happens at the individual file level. This means that it generates an entirely new OS version when any software change takes place in the system. + +Is it clear enough to try Clear Linux? + +#### Linux From Scratch + +![Linux From Scratch illustration][15] + +If you think installing Arch Linux was a challenge, try [Linux From Scratch][16] (LFS). As the name suggests, here you ~~get~~ have to do everything from scratch. + +From installing to using, you do everything at a low level and that’s the beauty of it. You are not installing a pre-compiled Linux distribution here. You build your own customized Linux system entirely from the source code. + +It is often suggested to use Linux From Scratch to learn the core functioning of the Linux and it is indeed a learning experience. + +Still scratching your head about Linux From Scratch? You can [read it][17][s][17] [documentation in book format][17]. + +#### Conclusion + +There are a few more independent Linux distributions. Mageia and Solus are two of the relatively more popular ones. I did not include them in this list because I consider them more friendly and not as complicated to use as others on the list. Feel free to disagree with me in the comments. + +It is your turn now. Have you used any advanced Linux distributions ever? Was it in the past or are you still using it? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/advanced-linux-distros/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/advanced-linux-distros.png?resize=800%2C450&ssl=1 +[2]: https://itsfoss.com/best-linux-beginners/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/nix-os.png?resize=800%2C350&ssl=1 +[4]: https://nixos.org/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/void-linux.png?resize=800%2C350&ssl=1 +[6]: https://voidlinux.org/ +[7]: http://smarden.org/runit/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/slackware.png?resize=800%2C350&ssl=1 +[9]: http://www.slackware.com/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/gentoo-linux.png?resize=800%2C350&ssl=1 +[11]: https://www.gentoo.org/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clear-linux.png?resize=800%2C350&ssl=1 +[13]: https://clearlinux.org/ +[14]: https://docs.01.org/clearlinux/latest/guides/clear/swupd.html#swupd-guide +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/linux-from-scratch.png?resize=800%2C350&ssl=1 +[16]: https://www.linuxfromscratch.org/ +[17]: https://www.linuxfromscratch.org/lfs/read.html From 6d2336c1cf7d8f83de5f6e08f7bb942f4c339aa9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 18 Jul 2021 05:04:09 +0800 Subject: [PATCH 471/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210717=20?= =?UTF-8?q?How=20to=20avoid=20waste=20when=20writing=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210717 How to avoid waste when writing code.md --- ...17 How to avoid waste when writing code.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210717 How to avoid waste when writing code.md diff --git a/sources/tech/20210717 How to avoid waste when writing code.md b/sources/tech/20210717 How to avoid waste when writing code.md new file mode 100644 index 0000000000..7438dd9031 --- /dev/null +++ b/sources/tech/20210717 How to avoid waste when writing code.md @@ -0,0 +1,84 @@ +[#]: subject: (How to avoid waste when writing code) +[#]: via: (https://opensource.com/article/21/7/avoid-waste-coding) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to avoid waste when writing code +====== +The more we can reduce waste in software development, the better off +everyone will be. +![Learning to program][1] + +The long road toward quality is filled with diversions, false starts, and detours. The enemy of quality is waste, because waste is never desirable. No one pays anyone to deliver waste. We sometimes tolerate waste as part of the process of making something useful and desirable, but the more we can reduce waste while making something, the better. + +In software engineering, waste can be expressed in a few ways: + + 1. Defects + 2. Idling and waiting + 3. Overproduction + 4. Overprocessing + 5. Any other activity that doesn't directly put value in users' hands + + + +Let's examine each of these five types of waste. + +### Defects + +There seems to be a prevailing sentiment in the software industry that bugs (defects) are inevitable. It's not if—but when and how many—bugs find their way into production. + +You can fight that defeatist sentiment by reminding software engineers that each and every bug is authored. Bugs don't occur spontaneously. They're created by us, human beings trying to do the best software development we can. But nobody's perfect. Of course we don't create bugs intentionally, but they do happen. They're often a result of rushing things through, or perhaps due to inadequate education and training. + +Whatever the reason, bugs are _caused_, which means we can eliminate bugs by solving the problems that cause them. + +### Idling and waiting + +Our business partners funding our software development efforts tend to perceive any time we're not producing shipping code as time spent idling. Why are we idling, and what are we waiting on? It's a reasonable question to ask, if you consider they're paying potentially thousands of dollars per hour to keep the team going. + +Idling is wasteful. It does not contribute to the bottom line and may be a sign of confusion. If the team says they're waiting on someone to return from their leave of absence, that signals poor organizing skills. No team should ever get to the point where they paint themselves into a corner and are suffering from a single point of failure. If a team member can't participate, other members should step in and continue the work. If that's not possible, you are dealing with a very brittle, inflexible, and unreliable team. + +Of course, there are many other possible reasons the team is idling. Maybe there is confusion about the current highest priority, so the team is hanging and waiting to learn about the correct priority. + +There are many other [reasonable causes of idling][2], which is why this type of waste seems hardest to get on top of. Whatever the case, mature organizations take precautionary steps to minimize potential idling and waiting time. + +### Overproduction + +Often labeled "gold plating," overproduction is one of the most insidious forms of waste. Software engineers are notorious for their propensity to go overboard in their enthusiasm for building features and nifty capabilities. And because software, as its name implies, is very pliable and malleable, there is very little pushback against the onslaught of bloat. + +This dreadful bloat creates a lot of waste. Fighting bloat is what prudent software engineering discipline is all about. + +### Overprocessing + +One of the biggest problems in software engineering is known as Geek-At-Keyboard (GAK). A common misconception is that software engineers spend most of their time writing code. That is far from the truth. Most of the time spent on regular daily activities (aside from attending meetings) goes toward keyboard activities unrelated to writing code: messing with configurations and environments, manually running and navigating the app, typing and retyping test data, stepping through the debugger, etc. + +All those activities are waste. They don't contribute to delivering value. One of the most effective remedies for minimizing unproductive GAK time is [test-driven development][3] (TDD). Writing tests before writing code is a proven method for avoiding overprocessing. The test-first approach is a very effective way of eliminating waste. + +### Other activities that don't put value in users' hands + +In the early days of our profession, value was measured by the number of lines of code produced per unit of time (per day, week, month, etc.). Later, this rather ineffective way of measuring value was abandoned in favor of working code. There is no convincing correlation between the number of lines of code and working code. And once working code became the measure of value, the number of lines of code became irrelevant. + +Today, we recognize that [working code][4] is also a meaningless metric. Just because code compiles, builds, and works doesn't mean it is doing anything of value. Successfully running code could be doing inane processing, such as counting from 0 to 10 and then back to 0. It is much more important to focus on code that meets end users' expectations. + +Helping end users fulfill their goals when using your software product is the only measure of value. Any other activity that does not contribute to that value should be regarded as waste. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/avoid-waste-coding + +作者:[Alex Bunardzic][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/learn-programming-code-keyboard.png?itok=xaLyptT4 (Learning to program) +[2]: https://opensource.com/article/21/2/simplicity +[3]: https://opensource.com/article/20/1/test-driven-development +[4]: https://opensource.com/article/20/7/code-tdd From 4b944d39fa470041b523888c1bc0cf5cce602760 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Jul 2021 09:47:38 +0800 Subject: [PATCH 472/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zd200572 感谢您,完成了第一篇翻译贡献! --- ...Box64 Emulator Released for Arm64 Linux.md | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md b/translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md index 4cb0e3db96..e2bfae0a71 100644 --- a/translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md +++ b/translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md @@ -3,48 +3,46 @@ [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) [#]: translator: (zd200572) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Box64模拟器发布Arm64 Linux版本 +Box64 模拟器发布 Arm64 Linux 版本 ====== -[Box86][1]是一个流行的X86模拟器,刚进行了一次巨大的升级。发布了[Box64][2],也就是对应的ARM64版本。 +> 在 Box64 模拟器的帮助下,在 ARM 设备上运行 x64 Linux 程序。想试试吗? -可能你还不了解这个模拟器,Box64_86允许你在ARM系统上运行32或64位的X86/64 Linux程序。换句话说,它能让你在树莓派或者[树莓派替代品][3]上运行Linux桌面程序。 +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/box64-arm.jpg?w=1200&ssl=1) -幸运的是,现在我们有Box86和Box64的支援,无论你有什么样的ARM系统. +[Box86][1] 是一个流行的 X86 模拟器,刚进行了一次巨大的升级。发布了 [Box64][2],也就是对应的 ARM64 版本。 -### Box64是什么? +可能你还不了解这个模拟器,Box64_86 允许你在 ARM 系统上运行 32 或 64 位的 X86/64 Linux 程序。换句话说,它能让你在树莓派或者 [树莓派替代品][3] 上运行 Linux 桌面程序。 + +幸运的是,现在我们有 Box86 和 Box64 的支持,无论你的 ARM 系统是什么类型。 + +### Box64 是什么? ![][4] -你可能听说过苹果的Rosetta 2,它是一个翻译层,允许为老款mac(Intel X86处理器)设计的应用程序在新的M1(ARM处理器)驱动的mac上运行。Box64与之类似,允许为X86设计的应用程序运行在ARM Linux设备上。 +你可能听说过苹果的 Rosetta 2,它是一个翻译层,允许为老款 Mac(Intel X86 处理器)设计的应用程序在新的 M1(ARM 处理器)驱动的 Mac 上运行。Box64 与之类似,允许为 X86 设计的应用程序运行在 ARM Linux 设备上。 -由于它的Dynarec模块,它可以以100%开源、免费和令人惊讶地速度完成这一切。它通过重新编译ARM程序来提升速度,这意味着和其他ARM原生应用一样快。 +由于它的 Dynarec 模块,它能够做到这一点,同时又是 100% 开源的、免费的,而且速度惊人。它通过重新编译 ARM 程序来提升速度,这意味着和其他 ARM 原生应用一样快。 -但是,即使Box64无法重新编译应用,它仍然可以使用即时模拟,也有令人印象深刻的结果。 +但是,即使 Box64 无法重新编译应用,它仍然可以使用即时模拟,也有令人印象深刻的结果。 -许多树莓派用户很熟悉Box86,一个约一年前发布的类似程序。二者最大的区别是Box86只兼容Arm32,而Box64只兼容Arm64。 +许多树莓派用户很熟悉 Box86,这是一个大约一年前发布的类似程序。二者最大的区别是 Box86 只兼容 Arm32,而 Box64 只兼容 Arm64。 -这就是Box64,一个非常棒的兼容层,允许在ARM电脑上运行x86_64应用。 +这就是 Box64,一个非常棒的兼容层,允许你在 ARM 电脑上运行 x86_64 应用。 -### 包装 +### 总结 -如果你问我认为Box64怎么样,我会说这是一个绝对的游戏规则改变者。在难以置信的性能和具大的潜力之间,这个兼容层肯定会在未来的ARM电脑中扮演一个重要角色。 +如果你问我认为 Box64 怎么样,我会说这是一个绝对的游戏规则改变者。在难以置信的性能和巨大的潜力之间,这个兼容层肯定会在未来的 ARM 电脑中扮演一个重要角色。 -如果你想知道它的工作原理,以及如何开始使用它,请查看其[GitHub页面][5] +如果你想知道它的工作原理,以及如何开始使用它,请查看其 [GitHub 页面][5]。 -说到这一点,我现在就离开,去潜入其中并自己测试啦。 - -你觉得Box64怎样?写下你的评论让我知道。 - - -#### 大型技术网站获得百万收入,这里是自由开源软件FOSS! - -如果你喜欢我们FOSS所做的事,请考虑为我们的独立出版物做点贡献。你的支持将帮助我们持续出版关于桌面Linux和开源软件的内容。 +就这样吧,现在你自己去潜入其中并测试吧。 +你觉得 Box64 怎样?写下你的评论让我知道。 -------------------------------------------------------------------------------- @@ -53,7 +51,7 @@ via: https://news.itsfoss.com/box64-emulator-released/ 作者:[Jacob Crume][a] 选题:[lujun9972][b] 译者:[zde200572](https://github.com/zd200572) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -62,5 +60,5 @@ via: https://news.itsfoss.com/box64-emulator-released/ [1]: http://github.com/ptitseb/box86 [2]: http://github.com/ptitseb/box64 [3]: https://itsfoss.com/raspberry-pi-alternatives/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIxOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/Box64Logo-1024x287-1.png?w=1024&ssl=1 [5]: https://github.com/ptitseb/box64 From 6a387ff1f56d3f6e4600cf830c61646511bc4841 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Jul 2021 09:49:52 +0800 Subject: [PATCH 473/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zd200572 本文首发地址:https://linux.cn/article-13591-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/zd200572 --- .../20210712 Box64 Emulator Released for Arm64 Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210712 Box64 Emulator Released for Arm64 Linux.md (97%) diff --git a/translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md b/published/20210712 Box64 Emulator Released for Arm64 Linux.md similarity index 97% rename from translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md rename to published/20210712 Box64 Emulator Released for Arm64 Linux.md index e2bfae0a71..6e7ba13f93 100644 --- a/translated/news/20210712 Box64 Emulator Released for Arm64 Linux.md +++ b/published/20210712 Box64 Emulator Released for Arm64 Linux.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (zd200572) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13591-1.html) Box64 模拟器发布 Arm64 Linux 版本 ====== From 8a2957028e033a0f324a6db9d2b8cd98f94549ab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Jul 2021 10:27:12 +0800 Subject: [PATCH 474/870] PRF&PUB @geekpi @turbokernel https://linux.cn/article-13592-1.html --- ...ecrypt files with a passphrase on Linux.md | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) rename {translated/tech => published}/20210708 Encrypt and decrypt files with a passphrase on Linux.md (61%) diff --git a/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md b/published/20210708 Encrypt and decrypt files with a passphrase on Linux.md similarity index 61% rename from translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md rename to published/20210708 Encrypt and decrypt files with a passphrase on Linux.md index f8473cea6d..78fe9af89c 100644 --- a/translated/tech/20210708 Encrypt and decrypt files with a passphrase on Linux.md +++ b/published/20210708 Encrypt and decrypt files with a passphrase on Linux.md @@ -4,40 +4,40 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (turbokernel) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13592-1.html) 在 Linux 上用密码加密和解密文件 ====== -age 是一个简单的、易于使用的工具,允许你用一个密码来加密和解密文件。 -![Scissors cutting open access to files][1] -文件的保护和敏感文档的安全加密是用户长期以来关心的问题。即使越来越多的数据被存放在网站和云服务上,并由带有越来越安全和高强度密码的用户账户来保护,但我们能够在自己的文件系统中存储敏感数据仍有很大的价值,特别是我们能够快速和容易地加密这些数据时。 +> age 是一个简单的、易于使用的工具,允许你用一个密码来加密和解密文件。 + +![](https://img.linux.net.cn/data/attachment/album/202107/18/102604m808ppq4ddd8w910.jpg) + +文件的保护和敏感文档的安全加密是用户长期以来关心的问题。即使越来越多的数据被存放在网站和云服务上,并由具有越来越安全和高强度密码的用户账户来保护,但我们能够在自己的文件系统中存储敏感数据仍有很大的价值,特别是我们能够快速和容易地加密这些数据时。 [age][2] 能帮你这样做。它是一个小型且易于使用的工具,允许你用一个密码加密一个文件,并根据需要解密。 ### 安装 age -age 可以在众多 Linux 软件库中[安装][3]。 +`age` 可以从众多 Linux 软件库中 [安装][3]。 在 Fedora 上安装它: - ``` -`$ sudo dnf install age -y` +$ sudo dnf install age -y ``` 在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5] 来安装。在 Windows 上,使用 [Chocolatey][6] 来安装。 ### 用 age 加密和解密文件 -age 可以用公钥或用户自定义密码来加密和解密文件。 +`age` 可以用公钥或用户自定义密码来加密和解密文件。 #### 在 age 中使用公钥 首先,生成一个公钥并写入 `key.txt` 文件: - ``` $ age-keygen -o key.txt Public key: age16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 @@ -47,55 +47,53 @@ Public key: age16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 要用你的公钥加密一个文件: - ``` -`$ touch mypasswds.txt | age -r ageage16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 > mypass.tar.gz.age` +$ touch mypasswds.txt | age -r \ + ageage16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 \ + > mypass.tar.gz.age ``` -在这个例子中,文件 `mypasswds.txt` 被我使用生成的公钥加密,放保存在名为 `mypass.tar.gz.age` 的加密文件中。 +在这个例子中,我使用生成的公钥加密文件 `mypasswds.txt`,保存在名为 `mypass.tar.gz.age` 的加密文件中。 ### 用公钥解密 如需解密加密文件,使用 `age` 命令和 `--decrypt` 选项: - ``` -`$ age --decrypt -i key.txt -o mypass.tar.gz mypass.tar.gz.age` +$ age --decrypt -i key.txt -o mypass.tar.gz mypass.tar.gz.age ``` -在这个例子中,age 使用存储在 `key.text` 中的密钥,并解密了我在上一步创建的加密文件。 +在这个例子中,`age` 使用存储在 `key.text` 中的密钥,并解密了我在上一步创建的加密文件。 ### 使用密码加密 不使用公钥的情况下对文件进行加密被称为对称加密。它允许用户设置密码来加密和解密一个文件。要做到这一点: - ``` $ age --passphrase --output mypasswd-encrypted.txt mypasswd.txt Enter passphrase (leave empty to autogenerate a secure one): Confirm passphrase: ``` -在这个例子中,age 提示你输入一个密码,它将通过这个密码对输入文件 `mypasswd.txt` 进行加密,并生成加密文件 `mypasswd-encrypted.txt`。 +在这个例子中,`age` 提示你输入一个密码,它将通过这个密码对输入文件 `mypasswd.txt` 进行加密,并生成加密文件 `mypasswd-encrypted.txt`。 ### 使用密码解密 如需将用密码加密的文件解密,可以使用 `age` 命令和 `--decrypt` 选项: - ``` -`$ age --decrypt --output passwd-decrypt.txt mypasswd-encrypted.txt` +$ age --decrypt --output passwd-decrypt.txt mypasswd-encrypted.txt ``` -在这个例子中,age 提示你输入密码,只要你提供的密码与加密时设置的密码一致,age 随后将 `mypasswd-encrypted.txt` 加密文件的内容解密为 `passwd-decrypt.txt`。 +在这个例子中,`age` 提示你输入密码,只要你提供的密码与加密时设置的密码一致,`age` 随后将 `mypasswd-encrypted.txt` 加密文件的内容解密为 `passwd-decrypt.txt`。 ### 不要丢失你的密钥 -无论你是使用密码加密还是公钥加密,你都_不能_丢失加密数据的凭证。根据设计,如果没有用于加密的密钥,通过 age 加密的文件是不能被解密的。所以,请备份你的公钥,并记住这些密码! +无论你是使用密码加密还是公钥加密,你都_不能_丢失加密数据的凭证。根据设计,如果没有用于加密的密钥,通过 `age` 加密的文件是不能被解密的。所以,请备份你的公钥,并记住这些密码! ### 轻松实现加密 -age 是一个真正强大的工具。我喜欢把我的敏感文件,特别是税务记录和其他档案数据,加密到 `.tz` 文件中,以便以后访问。age 是用户友好的,使其非常容易随时加密。 +`age` 是一个真正强大的工具。我喜欢把我的敏感文件,特别是税务记录和其他档案数据,加密到 `.tz` 文件中,以便以后访问。`age` 是用户友好的,使其非常容易随时加密。 -------------------------------------------------------------------------------- @@ -104,7 +102,7 @@ via: https://opensource.com/article/21/7/linux-age 作者:[Sumantro Mukherjee][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/turbokernel) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9976ec8be77a6642676e03328943833e5546a198 Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Sun, 18 Jul 2021 15:08:32 +0800 Subject: [PATCH 475/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210317 Programming 101- Input and output with Java.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210317 Programming 101- Input and output with Java.md b/sources/tech/20210317 Programming 101- Input and output with Java.md index 5cd5d1a644..e58c0c363a 100644 --- a/sources/tech/20210317 Programming 101- Input and output with Java.md +++ b/sources/tech/20210317 Programming 101- Input and output with Java.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/io-java) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (piaoshi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f828a4fe87dec605a57340dd422af10a0745e912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sun, 18 Jul 2021 16:03:04 +0800 Subject: [PATCH 476/870] Create 20210606 How Real-World Apps Lose Data.md complete translation --- .../20210606 How Real-World Apps Lose Data.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 translated/talk/20210606 How Real-World Apps Lose Data.md diff --git a/translated/talk/20210606 How Real-World Apps Lose Data.md b/translated/talk/20210606 How Real-World Apps Lose Data.md new file mode 100644 index 0000000000..85870a44d5 --- /dev/null +++ b/translated/talk/20210606 How Real-World Apps Lose Data.md @@ -0,0 +1,56 @@ +[#]: subject: (How Real-World Apps Lose Data) +[#]: via: (https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) +[#]: collector: (lujun9972) +[#]: translator: (PearFL) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +真实世界的应用程序是如何丢失数据? +====== + +现代应用程序开发的一大优点是,云提供商会担心硬件故障或如何设置RAID等问题。优秀的云供应商不太可能丢失你的应用数据, 所以有时我会被询问现在的备份究竟是什么呢?下面是一些现实世界的故事。 + +### 故事 #1 + +第一个故事来自一个数据科学项目:它基本上是一个从正在进行的研究中来收集数据的庞大而复杂的管道,然后用各种不同的方式处理以满足一些尖端模型的需要。这个面向用户的应用程序还没有启动,但是一个由数据科学家和开发人员组成的团队已经为建立这个模型和它的数据集工作了好几个月。 + +在项目中工作的人有他们自己的实验工作的开发环境。他们会在终端中做一些类似' export ENVIRONMENT=simonsdev '的事情,然后所有在终端上运行的软件都会在那个环境下运行,而不是在生产环境下。 + +该团队需要承受着巨大的压力去推出面向用户的应用程序,以便利益相关者能够从他们几个月的投资中真正看到一些回报。一个星期六,一位工程师试图赶完一些工作。他在晚上很晚的时候做完了一个实验,决定收拾东西回家。他启动了一个清理脚本来删除他的开发环境中的所有内容,但奇怪的是,这比平时花费了更长的时间。那时他意识到他已经忘记了哪个终端被配置为指向哪个环境。 + +### 故事 #2 + +第二个故事来自于一个商业网页和手机应用。后端有一个由一组工程师负责的微服务体系结构。这意味着部署需要协调,但是使用正式的发布过程和自动化简化了一些。新代码在准备好后会被审查并合并到 master 中,并且高级开发人员经常会为每个微服务标记一个版本,然后自动部署到暂存环境。临时环境中的版本会定期收集到一个元版本中,在自动部署到生产之前,该版本会得到不同人的认可(这是一个合规环境)。 + +有一天,一位开发人员正在开发一个复杂的功能,而其他开发该微服务的开发人员一致认为,应该致力于掌握正在进行的代码,并理解它不应该被实际发布。长话短说,并不是团队中的每个人都收到了消息,而是代码进入了发布管道。更糟糕的是,实验代码需要一种新的方式来表示用户配置文件数据,因此它有一个临时数据迁移,在启动到生产时运行并损坏所有用户配置文件。 + +### 故事 #3 + +第三个故事来自另一款网络应用。这个有一个更简单的架构:大部分代码在一个应用程序中,数据在数据库中。然而,这个应用程序也是在很大的截止日期压力下编写的。事实证明,在开发初期,当彻底的数据库架构更改很常见时,添加了一项功能来检测此类更改并清理旧数据。这实际上对发布前的早期开发很有用,并且始终仅作为开发环境的临时功能。不幸的是,在匆忙构建应用的其余部分并启动时,我们忘记了代码。当然,直到有一天它在生产环境中被触发。 + +### 事后分析 + +对于任何停机问题的事后分析,很容易忽视大局,最终将一切归咎于一些小细节。一个特例是发现某人犯了一些错误,然后责怪那个人。这些故事中的所有工程师实际上都是优秀的工程师(雇佣SRE顾问的公司不是为了偷工减料),所以解雇他们,换掉他们并不能解决任何问题。即使你拥有100个开发人员,这100个开发人员仍然是有限的,所以在足够的复杂性和压力下,错误也会发生。最重要的解决方案是备份,它可以帮助你在丢失数据的情况下(包括来自恶意软件的数据,这是最近新闻中的一个热门话题)。如果你无法容忍零拷贝,就不要只有一个副本。 + +故事1的结局很糟糕:没有备份。该项目因近六个月的数据收集而推迟。顺便说一句,有些地方只保留一个每日快照作为备份,这个故事也是一个很好的例子,说明了这是如何出错的:如果数据丢失发生在星期六,并且准备在星期一尝试恢复,那么一日备份就只能得到星期日的空数据。 + +故事2并不有趣,但效果要好得多。备份可用,但数据迁移也是可逆的。不有趣的部分是发布是在午餐前完成的,并且必须在生产站点关闭时对修复进行编码。我讲这个故事的主要原因是为了提醒大家,备份并不仅仅是灾难性的数据丢失。部分数据损坏也会发生,而且可能会更加混乱。 + +故事3仅仅只是一般。尽管少量数据永久丢失,但大部分数据可以从备份中恢复。团队中的每个人都对现在没有注释的极其危险的代码感到非常糟糕。我没有参与早期的开发,但我感觉很糟糕,因为恢复数据所需的时间比正常情况要长得多。通过经过良好测试的恢复过程,我认为该站点应该在总共不到 15 分钟的时间内重新上线。但是第一次恢复没有成功,我不得不调试为什么不能成功,然后重试。当一个生产站点宕机了,需要你重新启动它,每10秒就会感觉很漫长。 值得庆幸的是,涉众比某些人理解得多。他们实际上松了一口气,因为一次数分钟的数据丢失和不到一小时的停机时间本就可以使公司陷入瘫痪的灾难。 + +在实践中,进行了备份“工作”但恢复失败是非常常见的。很多时候,小型数据集上进行恢复测试是可以正常工作的,但在生产规模的大数据集上就会失败。当每个人都压力过大时,灾难最有可能发生,而关闭生产站点只会增加压力。在时间合适的时候测试和记录完整的恢复过程是一个非常好的主意。 +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html + +作者:[Simon Arneaud][a] +选题:[lujun9972][b] +译者:[PearFL](https://github.com/PearFL) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://theartofmachinery.com +[b]: https://github.com/lujun9972 From 6e399ac9de11f4b5fced2df5603b23bf74c89714 Mon Sep 17 00:00:00 2001 From: Lin-vy Date: Sun, 18 Jul 2021 17:23:44 +0800 Subject: [PATCH 477/870] Update 20210308 How the ARPANET Protocols Worked.md --- sources/talk/20210308 How the ARPANET Protocols Worked.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210308 How the ARPANET Protocols Worked.md b/sources/talk/20210308 How the ARPANET Protocols Worked.md index 50c5d37f56..bcddd7f808 100644 --- a/sources/talk/20210308 How the ARPANET Protocols Worked.md +++ b/sources/talk/20210308 How the ARPANET Protocols Worked.md @@ -2,7 +2,7 @@ [#]: via: (https://twobithistory.org/2021/03/08/arpanet-protocols.html) [#]: author: (Two-Bit History https://twobithistory.org) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Lin-vy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 63fe2a7ad8f4d1a76eb7571ab15c9592d5e570c4 Mon Sep 17 00:00:00 2001 From: Lin-vy Date: Sun, 18 Jul 2021 17:52:03 +0800 Subject: [PATCH 478/870] Update and rename sources/talk/20210308 How the ARPANET Protocols Worked.md to translated/talk/20210308 How the ARPANET Protocols Worked.md --- .../talk/20210308 How the ARPANET Protocols Worked.md | 4 ++++ 1 file changed, 4 insertions(+) rename {sources => translated}/talk/20210308 How the ARPANET Protocols Worked.md (97%) diff --git a/sources/talk/20210308 How the ARPANET Protocols Worked.md b/translated/talk/20210308 How the ARPANET Protocols Worked.md similarity index 97% rename from sources/talk/20210308 How the ARPANET Protocols Worked.md rename to translated/talk/20210308 How the ARPANET Protocols Worked.md index bcddd7f808..8ec4c660f1 100644 --- a/sources/talk/20210308 How the ARPANET Protocols Worked.md +++ b/translated/talk/20210308 How the ARPANET Protocols Worked.md @@ -8,10 +8,14 @@ [#]: url: ( ) How the ARPANET Protocols Worked +ARPANET 协议是如何工作的 ====== The ARPANET changed computing forever by proving that computers of wildly different manufacture could be connected using standardized protocols. In my [post on the historical significance of the ARPANET][1], I mentioned a few of those protocols, but didn’t describe them in any detail. So I wanted to take a closer look at them. I also wanted to see how much of the design of those early protocols survives in the protocols we use today. +ARPANET 通过证明完全不同制造商的计算机能够使用标准化的协议连接起来,从而永久的改变了计算。在我的[关于 ARPANET 的历史意义的帖子][1]中,我提到了其中的一些协议,但没有详细描述它们。所以我想更进一步探索它们。也想看看那些早期协议的设计在我们今天使用的协议中有多少被保留了下来。 + + The ARPANET protocols were, like our modern internet protocols, organized into layers.[1][2] The protocols in the higher layers ran on top of the protocols in the lower layers. Today the TCP/IP suite has five layers (the Physical, Link, Network, Transport, and Application layers), but the ARPANET had only three layers—or possibly four, depending on how you count them. I’m going to explain how each of these layers worked, but first an aside about who built what in the ARPANET, which you need to know to understand why the layers were divided up as they were. From 79ec0de81b7476259527d67cec1aa0860924f471 Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Sun, 18 Jul 2021 17:59:06 +0800 Subject: [PATCH 479/870] Remove Source File, and add translated file --- ...ramming 101- Input and output with Java.md | 163 ------------------ ...ramming 101- Input and output with Java.md | 163 ++++++++++++++++++ 2 files changed, 163 insertions(+), 163 deletions(-) delete mode 100644 sources/tech/20210317 Programming 101- Input and output with Java.md create mode 100644 translated/tech/20210317 Programming 101- Input and output with Java.md diff --git a/sources/tech/20210317 Programming 101- Input and output with Java.md b/sources/tech/20210317 Programming 101- Input and output with Java.md deleted file mode 100644 index e58c0c363a..0000000000 --- a/sources/tech/20210317 Programming 101- Input and output with Java.md +++ /dev/null @@ -1,163 +0,0 @@ -[#]: subject: (Programming 101: Input and output with Java) -[#]: via: (https://opensource.com/article/21/3/io-java) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (piaoshi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Programming 101: Input and output with Java -====== -Learn how Java handles reading and writing data. -![Coffee beans and a cup of coffee][1] - -When you write a program, your application may need to read from and write to files stored on the user's computer. This is common in situations when you want to load or store configuration options, you need to create log files, or your user wants to save work for later. Every language handles this task a little differently. This article demonstrates how to handle data files with Java. - -### Installing Java - -Regardless of your computer's platform, you can install Java from [AdoptOpenJDK][2]. This site offers safe and open source builds of Java. On Linux, you may also find AdoptOpenJDK builds in your software repository. - -I recommend using the latest long-term support (LTS) release. The latest non-LTS release is best for developers looking to try the latest Java features, but it likely outpaces what most users have installed—either by default on their system or installed previously for some other Java application. Using the LTS release ensures you're up-to-date with what most users have installed. - -Once you have Java installed, open your favorite text editor and get ready to code. You might also want to investigate an [integrated development environment for Java][3]. BlueJ is ideal for new programmers, while Eclipse and Netbeans are nice for intermediate and experienced coders. - -### Reading a file with Java - -Java uses the `File` library to load files. - -This example creates a class called `Ingest` to read data from a file. When you open a file in Java, you create a `Scanner` object, which scans the file you provide, line by line. In fact, a `Scanner` is the same concept as a cursor in a text editor, and you can control that "cursor" for reading and writing with `Scanner` methods like `nextLine`: - - -``` -import java.io.File; -import java.util.Scanner; -import java.io.FileNotFoundException; - -public class Ingest { -  public static void main([String][4][] args) { -    -      try { -          [File][5] myFile = new [File][5]("example.txt"); -          Scanner myScanner = new Scanner(myFile); -          while (myScanner.hasNextLine()) { -              [String][4] line = myScanner.nextLine(); -              [System][6].out.println(line); -          } -          myScanner.close(); -      } catch ([FileNotFoundException][7] ex) { -          ex.printStackTrace();   -      } //try -    } //main -} //class -``` - -This code creates the variable `myfile` under the assumption that a file named `example.txt` exists. If that file does not exist, Java "throws an exception" (this means it found an error in what you attempted to do and says so), which is "caught" by the very specific `FileNotFoundException` library. The fact that there's a library specific to this exact error betrays how common this error is. - -Next, it creates a `Scanner` and loads the file into it. I call it `myScanner` to differentiate it from its generic class template. A `while` loop sends `myScanner` over the file, line by line, for as long as there _is_ a next line. That's what the `hasNextLine` method does: it detects whether there's any data after the "cursor." You can simulate this by opening a file in a text editor: Your cursor starts at the very beginning of the file, and you can use the keyboard to scan through the file with the cursor until you run out of lines. - -The `while` loop creates a variable `line` and assigns it the data of the current line. Then it prints the contents of `line` just to provide feedback. A more useful program would probably parse each line to extract whatever important data it contains. - -At the end of the process, the `myScanner` object closes. - -### Running the code - -Save your code as `Ingest.java` (it's a Java convention to give classes an initial capital letter and name the file to match). If you try to run this simple application, you will probably receive an error because there is no `example.txt` for the application to load yet: - - -``` -$ java ./Ingest.java -java.io.[FileNotFoundException][7]: -example.txt (No such file or directory) -``` - -What a perfect opportunity to write a Java application that writes data to a file! - -### Writing data to a file with Java - -Whether you're storing data that your user creates with your application or just metadata about what a user did in an application (for instance, game saves or recent songs played), there are lots of good reasons to store data for later use. In Java, this is achieved through the `FileWriter` library, this time by opening a file, writing data into it, and then closing the file: - - -``` -import java.io.FileWriter; -import java.io.IOException; - -public class Exgest { -  public static void main([String][4][] args) { -    try { -        [FileWriter][8] myFileWriter = new [FileWriter][8]("example.txt", true); -        myFileWriter.write("Hello world\n"); -        myFileWriter.close(); -    } catch ([IOException][9] ex) { -        [System][6].out.println(ex); -    } // try -  } // main -} -``` - -The logic and flow of this class are similar to reading a file. Instead of a `Scanner`, it creates a `FileWriter` object with the name of a file. The `true` flag at the end of the `FileWriter` statement tells `FileWriter` to _append_ text to the end of the file. To overwrite a file's contents, remove the `true`: - - -``` -`FileWriter myFileWriter = new FileWriter("example.txt", true);` -``` - -Because I'm writing plain text into a file, I added my own newline character (`\n`) at the end of the data (`Hello world`) written into the file. - -### Trying the code - -Save this code as `Exgest.java`, following the Java convention of naming the file to match the class name. - -Now that you have the means to create and read data with Java, you can try your new applications, in reverse order: - - -``` -$ java ./Exgest.java -$ java ./Ingest.java -Hello world -$ -``` - -Because it appends data to the end, you can repeat your application to write data as many times as you want to add more data to your file: - - -``` -$ java ./Exgest.java -$ java ./Exgest.java -$ java ./Exgest.java -$ java ./Ingest.java -Hello world -Hello world -Hello world -$ -``` - -### Java and data - -You're don't write raw text into a file very often; in the real world, you probably use an additional library to write a specific format instead. For instance, you might use an XML library to write complex data, an INI or YAML library to write configuration files, or any number of specialized libraries to write binary formats like images or audio. - -For full information, refer to the [OpenJDK documentation][10]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/io-java - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) -[2]: https://adoptopenjdk.net -[3]: https://opensource.com/article/20/7/ide-java -[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file -[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filenotfoundexception -[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter -[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception -[10]: https://access.redhat.com/documentation/en-us/openjdk/11/ diff --git a/translated/tech/20210317 Programming 101- Input and output with Java.md b/translated/tech/20210317 Programming 101- Input and output with Java.md new file mode 100644 index 0000000000..ce6f572679 --- /dev/null +++ b/translated/tech/20210317 Programming 101- Input and output with Java.md @@ -0,0 +1,163 @@ +[#]: subject: (Programming 101: Input and output with Java) +[#]: via: (https://opensource.com/article/21/3/io-java) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (piaoshi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +编程秘笈:Java 中的输入和输出 +====== +学习 Java 如何外理数据的读与写 +![Coffee beans and a cup of coffee][1] + +当你写一个程序时,你的应用程序可能需要读取和写入存储在用户计算机上的文件。这在你想加载或存储配置选项,你需要创建日志文件,或你的用户想要保存工作以待后用的情况下是很常见的。每种语言处理这项任务的方式都有所不同。本文演示了如何用 Java 处理数据文件。 + +### 安装 Java + +不管你的计算机是什么平台,你都可以从 [AdoptOpenJDK][2] 安装 Java。这个网站提供安全和开源的 Java 构建。在 Linux 上,你的软件库中也可能找到 AdvertOpenJDK 的构建。 + +我建议你使用最新的长期支持(LTS)版本。最新的非 LTS 版本对希望尝试最新 Java 功能的开发者来说是最好的,但它很可能超过大多数用户所安装的版本——要么是系统上默认安装的,要么是以前为其他 Java 应用安装的。使用 LTS 版本可以确保你与大多数用户所安装的版本保持一致。 + +一旦你安装好了 Java,就可以打开你最喜欢的文本编辑器并准备开始写代码了。你可能还想要研究一下 [Java 集成开发环境][3]。BlueJ 是新程序员的理想选择,而 Eclipse 和 Netbeans 对中级和有经验的编码者更友好。 + +### 利用 Java 读取文件 + +Java 使用 `File` 类来加载文件。 + +这个例子创建了一个叫 `Ingest` 的类来读取文件中数据。当你要在 Java 中打开一个文件时,你创建了一个 `Scanner` 对象,它可以逐行扫描你提供的文件。事实上,`Scanner` 与文本编辑器中的光标是相同的概念,这样你可以用 `Scanner` 的一些方法(如 `nextLine`)来控制这个“光标”以进行读写。 + + +``` +import java.io.File; +import java.util.Scanner; +import java.io.FileNotFoundException; + +public class Ingest { +  public static void main([String][4][] args) { +    +      try { +          [File][5] myFile = new [File][5]("example.txt"); +          Scanner myScanner = new Scanner(myFile); +          while (myScanner.hasNextLine()) { +              [String][4] line = myScanner.nextLine(); +              [System][6].out.println(line); +          } +          myScanner.close(); +      } catch ([FileNotFoundException][7] ex) { +          ex.printStackTrace();   +      } //try +    } //main +} //class +``` + +这段代码首先在假设存在一个名为 `example.txt` 的文件的情况下创建了变量 `myfile`。如果该文件不存在,Java 就会“抛出一个异常”(这意味着它在你试图做的事情中发现了一个错误,并这样告诉你),这个异常是被非常明确的 `FileNotFoundException` 类所“捕获”。事实上,有一个专门的类来处理这个明确的错误,这说明这个错误是多么常见。 + +接下来,它创建了一个 `Scanner` 并将文件加载到其中。我把它叫做 `myScanner`,以区别于它的通用类模板。接着,一个 `while` 循环将 `myScanner` 逐行送入文件中,只要_存在_下一行。这就是 `hasNextLine` 方法的作用:它检测“光标”之后是否还有数据。你可以通过在文本编辑器中打开一个文件来模拟这个过程:你的光标从文件的第一行开始,你可以用键盘控制光标来向下扫描文件,直到你用完了所有的行。 + +`while` 循环创建了一个变量 `line`,并将文件当前行的数据分配给它。然后将 `line` 的内容打印出来以提供反馈。一个更有用的程序可能会解析每一行的内容,从而提取它所包含的任何重要数据。 + +在这个过程结束时,关闭 `myScanner` 对象。 + +### 运行代码 + +将你的代码保存到 `Ingest.java` 文件(这是一个 Java 惯例,将类名的首字母大写,并以类名来命名相应的文件)。如果你试图运行这个简单的应用程序,你可能会接收到一个错误信息,这是因为还没有 `example.txt` 文件供应用程序加载: + + +``` +$ java ./Ingest.java +java.io.[FileNotFoundException][7]: +example.txt (No such file or directory) +``` + +正好可以编写一个将数据写入文件的 Java 应用程序,多么完美的时机! + +### 利用 Java 将数据写入文件 + +无论你是存储用户使用你的应用程序创建的数据,还是仅仅存储关于用户在应用程序中做了什么的元数据(例如,游戏保存或最近播放的歌曲),有很多很好的理由来存储数据供以后使用。在 Java 中,这是通过 `FileWriter` 类实现的,这次先打开一个文件,向其中写入数据,然后关闭该文件。 + + +``` +import java.io.FileWriter; +import java.io.IOException; + +public class Exgest { +  public static void main([String][4][] args) { +    try { +        [FileWriter][8] myFileWriter = new [FileWriter][8]("example.txt", true); +        myFileWriter.write("Hello world\n"); +        myFileWriter.close(); +    } catch ([IOException][9] ex) { +        [System][6].out.println(ex); +    } // try +  } // main +} +``` + +这个类的逻辑和流程与读取文件类似。但它不是一个 `Scanner`,而是以一个文件的名字为参数创建的一个 `FileWriter` 对象。`FileWriter` 语句末尾的 `true` 标志告诉 `FileWriter` 将文本_追加_到文件的末尾。要覆盖一个文件的内容,请移除 `true` 标志。 + + +``` +`FileWriter myFileWriter = new FileWriter("example.txt", true);` +``` + +因为我在向文件中写入纯文本,所以我在写入文件的数据(Hello world)的结尾处手动添加了换行符(\n)。 + +### 试试代码 + +将这段代码保存到 `Exgest.java` 文件,遵循 Java 的惯例,使文件名为与类名相匹配。 + +既然你已经掌握了用 Java 创建和读取数据的方法,你可以按相反的顺序尝试运行你的新应用程序。 + + +``` +$ java ./Exgest.java +$ java ./Ingest.java +Hello world +$ +``` + +因为程序是把数据追加到文件末尾,所以你可以重复执行你的应用程序以多次写入数据,只要你想把更多的数据添加到你的文件中。 + + +``` +$ java ./Exgest.java +$ java ./Exgest.java +$ java ./Exgest.java +$ java ./Ingest.java +Hello world +Hello world +Hello world +$ +``` + +### Java 和数据 + +你并不经常向文件中写入原始文本;实事上,你可能会使用一个其它的类库以写入特定的格式。例如,你可能使用 XML 类库来写复杂的数据,使用 INI 或 YAML 类库来写配置文件,或者使用任何数量的专门类库来写二进制格式,如图像或音频。 + +更完整的信息,请参阅 [OpenJDK 文档][10]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/io-java + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[piaoshi](https://github.com/piaoshi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) +[2]: https://adoptopenjdk.net +[3]: https://opensource.com/article/20/7/ide-java +[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filenotfoundexception +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception +[10]: https://access.redhat.com/documentation/en-us/openjdk/11/ From 712a24f1cfc533b9b42740d0ed0df61391a6acc0 Mon Sep 17 00:00:00 2001 From: mcfd <43702470+mcfd@users.noreply.github.com> Date: Sun, 18 Jul 2021 18:14:15 +0800 Subject: [PATCH 480/870] =?UTF-8?q?=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...igured With Xmonad, Awesome, i3, and Bspwm Window Manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md b/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md index cbe68de7d3..8b1ceff015 100644 --- a/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md +++ b/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/hash-linux-review/) [#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mcfd) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7750a4a5cd0d6ce3510b20d41508534bd484ca75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E6=A2=A8=E5=AD=90?= Date: Sun, 18 Jul 2021 18:15:13 +0800 Subject: [PATCH 481/870] Delete 20210606 How Real-World Apps Lose Data.md --- .../20210606 How Real-World Apps Lose Data.md | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 sources/talk/20210606 How Real-World Apps Lose Data.md diff --git a/sources/talk/20210606 How Real-World Apps Lose Data.md b/sources/talk/20210606 How Real-World Apps Lose Data.md deleted file mode 100644 index 71f5569c8c..0000000000 --- a/sources/talk/20210606 How Real-World Apps Lose Data.md +++ /dev/null @@ -1,56 +0,0 @@ -[#]: subject: (How Real-World Apps Lose Data) -[#]: via: (https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html) -[#]: author: (Simon Arneaud https://theartofmachinery.com) -[#]: collector: (lujun9972) -[#]: translator: (PearFL) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How Real-World Apps Lose Data -====== - -A great thing about modern app development is that there are cloud providers to worry about things like hardware failures or how to set up RAID. Decent cloud providers are extremely unlikely to lose your app’s data, so sometimes I get asked what backups are really for these days. Here are some real-world stories that show exactly what. - -### Story #1 - -This first story is from a data science project: it was basically a big, complex pipeline that took data collected from ongoing research and crunched it in various ways to feed some cutting-edge model. The user-facing application hadn’t been launched yet, but a team of data scientists and developers had been working on building the model and its dataset for several months. - -The people working on the project had their own development environments for experimental work. They’d do something like `export ENVIRONMENT=simonsdev` in a terminal, and then all the software running in that terminal would run against that environment instead of the production environment. - -The team was under a lot of pressure to get a user-facing app launched so that stakeholders could actually see some results from their several months of investment. One Saturday, an engineer tried to catch up with some work. He finished an experiment he was doing late in the evening, and decided to tidy up and go home. He fired off a cleanup script to delete everything from his development environment, but strangely it took a lot longer than usual. That’s when he realised he’d lost track of which terminal was configured to point to which environment. - -### Story #2 - -Story #2 is from a commercial web and mobile app. The backend had a microservice architecture worked on by a team of engineers. That meant deployments required co-ordination, but things were simplified a bit using a formal release process and automation. New code would get reviewed and merged into master when ready, and every so often a senior developer would tag a release for each microservice, which would then automatically deploy to the staging environment. The releases in the staging environment would periodically get collected together into a meta-release that got signoff from various people (it was a compliance environment) before being automatically deployed to production. - -One day a developer was working on a complex feature, and the other developers working on that microservice agreed that the work-in-progress code should be committed to master with the understanding that it shouldn’t be actually released yet. To cut a long story short, not everyone in the team got the message, and the code got into the release pipeline. Worse, the experimental code required a new way to represent user profile data, so it had an ad-hoc data migration that ran on launch into production and corrupted all user profiles. - -### Story #3 - -Story #3 is from another web app. This one had a much simpler architecture: most of the code was in one app, and the data was in a database. However, this app had also been written under a lot of deadline pressure. It turned out that early on in development, when radical database schema changes were common, a feature was added to detect such changes and clean up old data. This was actually useful for early development before launch, and was always meant to be a temporary feature for development environments only. Unfortunately, the code was forgotten about in the rush to build the rest of the app and get to launch. Until, of course, one day it got triggered in the production environment. - -### Postmortem - -With any outage postmortem, it’s easy to lose sight of the big picture and end up blaming everything on some little detail. A special case of that is finding some mistake someone made and then blaming that person. All of the engineers in these stories were actually good engineers (companies that hire SRE consultants aren’t the ones to cut corners with their permanent hires), so firing them and replacing them wouldn’t have solved any problem. Even if you have 100x developers, that 100x is still finite, so mistakes will happen with enough complexity and pressure. The big-picture solution is back ups, which help you however you lose the data (including from malware, which is a hot topic in the news lately). If you’re not okay with having zero copies of it, don’t have one copy. - -Story #1 had a bad end: there were no backups. The project was set back by nearly six months of data collection. By the way, some places only keep a single daily snapshot as a backup, and this story is a good example of how that can go wrong, too: if the data loss happened on Saturday and recovery was attempted on Monday, the one-day backup would only have an empty database from the Sunday. - -Story #2 wasn’t fun, but worked out much better. Backups were available, but the data migration was reversible, too. The unfun part was that the release was done just before lunch and the fix had to be coded up while the production site was down. The main reason I’m telling this story is as a reminder that backups aren’t just about catastrophic data loss. Partial data corruption happens, too, and can be extra messy. - -Story #3 was so-so. A small amount of data was lost permanently, but most was recovered from the backup. Everyone on the team felt pretty bad about not flagging the now-extremely-obviously-dangerous code. I wasn’t involved in the early development, but I felt bad because the recovery took a lot longer than it should have. With a well-tested recovery process, I think the site should have been back online in under 15mins total. But the recovery didn’t work first time, and I had to debug why not and retry. When a production site is down and it’s on you to get it up again, every 10s feels like an eternity. Thankfully, the stakeholders were much more understanding than some. They were actually relieved that a one-off disaster that could have sunk the company only resulted in minutes of lost data and under an hour of downtime. - -It’s extremely common in practice for the backup to “work” but the recovery to fail. Often the recovery works when tested on small datasets, but fails on production-sized datasets. Disaster is most likely to strike when everyone is stressed out, and having the production site down only increases the pressure. It’s a really good idea to test and document the full recovery process while times are good. --------------------------------------------------------------------------------- - -via: https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html - -作者:[Simon Arneaud][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://theartofmachinery.com -[b]: https://github.com/lujun9972 From 595042ab97e3ee1abd171e78bfde192bd1afcfe0 Mon Sep 17 00:00:00 2001 From: Lin-vy Date: Sun, 18 Jul 2021 18:32:31 +0800 Subject: [PATCH 482/870] Update 20210308 How the ARPANET Protocols Worked.md --- .../talk/20210308 How the ARPANET Protocols Worked.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/translated/talk/20210308 How the ARPANET Protocols Worked.md b/translated/talk/20210308 How the ARPANET Protocols Worked.md index 8ec4c660f1..4640604a28 100644 --- a/translated/talk/20210308 How the ARPANET Protocols Worked.md +++ b/translated/talk/20210308 How the ARPANET Protocols Worked.md @@ -18,14 +18,24 @@ ARPANET 通过证明完全不同制造商的计算机能够使用标准化的协 The ARPANET protocols were, like our modern internet protocols, organized into layers.[1][2] The protocols in the higher layers ran on top of the protocols in the lower layers. Today the TCP/IP suite has five layers (the Physical, Link, Network, Transport, and Application layers), but the ARPANET had only three layers—or possibly four, depending on how you count them. +ARPANET 协议类似与如今的互联网协议,也是通过分层形式来组织管理的。[1][2] 较高层协议运行在较低层协议之上。如今的 TCP/IP 协议栈有5层(物理层、数据链路层、网络层、传输层、以及应用层),但是这个 ARPANET 仅有3层或者可能4层,这取决于你们怎样去数它们。 + I’m going to explain how each of these layers worked, but first an aside about who built what in the ARPANET, which you need to know to understand why the layers were divided up as they were. +我将会解释每一层是如何工作的,但首先,你需要知道谁在 ARPANET 中构建了些什么,以及需要了解为什么层要被划分成这样。 + ### Some Quick Historical Context +短暂的历史背景 The ARPANET was funded by the US federal government, specifically the Advanced Research Projects Agency within the Department of Defense (hence the name “ARPANET”). The US government did not directly build the network; instead, it contracted the work out to a Boston-based consulting firm called Bolt, Beranek, and Newman, more commonly known as BBN. +ARPANET 由美国联邦政府资助,确切的说是位于美国国防部内的高级研究计划属(因此命名为“ARPANET”)。美国政府并没有直接建设这个网络;而是,它把这项工作外包给了基于波士顿的一家名为 Bolt, Beranek, 和 Newman, 通常更多时候被称为 BBN 的咨询公司。 + + BBN, in turn, handled many of the responsibilities for implementing the network but not all of them. What BBN did was design and maintain a machine known as the Interface Message Processor, or IMP. The IMP was a customized Honeywell minicomputer, one of which was delivered to each site across the country that was to be connected to the ARPANET. The IMP served as a gateway to the ARPANET for up to four hosts at each host site. It was basically a router. BBN controlled the software running on the IMPs that forwarded packets from IMP to IMP, but the firm had no direct control over the machines that would connect to the IMPs and become the actual hosts on the ARPANET. +反过来,BBN 承担了实现这个网络的大部门责任,但不是全部。BBN 所做的是设计和维护一个称为接口消息处理器或者简称IMP的机器。 + The host machines were controlled by the computer scientists that were the end users of the network. These computer scientists, at host sites across the country, were responsible for writing the software that would allow the hosts to talk to each other. The IMPs gave hosts the ability to send messages to each other, but that was not much use unless the hosts agreed on a format to use for the messages. To solve that problem, a motley crew consisting in large part of graduate students from the various host sites formed themselves into the Network Working Group, which sought to specify protocols for the host computers to use. So if you imagine a single successful network interaction over the ARPANET, (sending an email, say), some bits of engineering that made the interaction successful were the responsibility of one set of people (BBN), while other bits of engineering were the responsibility of another set of people (the Network Working Group and the engineers at each host site). That organizational and logistical happenstance probably played a big role in motivating the layered approach used for protocols on the ARPANET, which in turn influenced the layered approach used for TCP/IP. From fddf002fb13e01ac2a35c1b4d917ecf4ad0ad4dc Mon Sep 17 00:00:00 2001 From: mcfd <990773468@qq.com> Date: Sun, 18 Jul 2021 20:01:58 +0800 Subject: [PATCH 483/870] tan --- ..., Awesome, i3, and Bspwm Window Manager.md | 135 ------------------ ..., Awesome, i3, and Bspwm Window Manager.md | 135 ++++++++++++++++++ 2 files changed, 135 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md create mode 100644 translated/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md diff --git a/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md b/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md deleted file mode 100644 index 8b1ceff015..0000000000 --- a/sources/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: subject: (Hash Linux: Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager) -[#]: via: (https://itsfoss.com/hash-linux-review/) -[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) -[#]: collector: (lujun9972) -[#]: translator: (mcfd) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Hash Linux: Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager -====== - -With some effort, [you can install Arch Linux][1]. You may also install a desktop environment or windows manager of your choice on your Arch system. - -That takes some time and effort but it is surely achievable. However, there exists projects that try to ease the pain by providing you a system preconfigured with a desktop environment or window manager of your choice. [ArcoLinux][2] is one such example. - -Recently, I came across another project that has its sole focus on providing choice of window managers on top of the wonderful Arch distribution. - -[Hash Project][3] offers four preconfigured Arch variants with tiling window managers: Awesome, [Xmonad][4], i3, and Bspwm. - -If you’re a beginner window manager hopper, the Hash project is what you should definitely try at once. Without investing time to configure it first, you can explore the potential of window managers and get used to keyboard-driven systems. - -In this article, I’ll discuss my part of the experience with the **Hash Linux Xmonad edition** featuring Linux kernel 5.12. - -### Installation Of Hash Linux - -The ISO image of all four editions of Hash Linux is available to [download][5] for x86_64 system architecture. - -To avoid any unexpected error while installing it on a bare system, I created a virtual machine of Hash Linux Xmonad version in GNOME Boxes. - -As I booted into Hash Linux, I noticed two things. First, a panel providing important shortcuts for managing windows and commands. I’ll discuss it later after installation. Second, a beautiful and easy-to-use GUI installer. - -![Hash Linux GUI Installer][6] - -As usual, the graphical installer made the installation process very smooth by providing buttons to click on. Within a few steps of configuration, Hash Linux was installed and ready to reboot. - -![Installer Welcome Page][7] - -### First Impression - -![Hash Linux][8] - -If you’ve ever installed Xmonad window manager on your Linux system, what is the first thing you saw after reboot? Blank screen right. - -And if you’re a beginner or you don’t know the default key binding, you get stuck on the same screen. Hence, you must have to read keyboard shortcuts first before using any window manager. - -What if you get all the important shortcuts right on your window? A cheat sheet can save you a lot of time. - -Therefore, for the sake of simplicity and beginner-friendly, Hash Linux has pinned important keys on the desktop window. - -So, let’s try some of it first. Starting with one of the most important `[Super]+Enter`, it opens the default termite terminal emulator with Z shell (ZSH). - -If you click it multiple times, you notice that by default Xmonad follows a dwindle layout where it first fixes one window on the right side and then arranges the rest of all on the left side in the same manner. - -![Xmonad default layout][9] - -Using `[Super]+[Space]`, you can also change the current layout to a tabbed one. Even you can use `[Super]+[left+click]` to move a window into a float mode. - -![Moved to float][10] - -To quit the currently focussed window, you can press `[Super]+Q`. - -### Applications In Hash Linux - -By default, Hash Linux contains several useful command-line tools such as NeoFetch, Htop, Vim, Pacman, Git, and Speedtest-cli. - -![Htop][11] - -It also has a good amount of graphical applications such as Firefox 89, Gparted, Nitrogen, Conky, Flameshot, Geany, and CPU-X. - -`[Super]+D` is the default key in Hash Linux to open application search menu. - -![Application search menu][12] - -### Theming - -Hash Cyan is the default theme in Hash Linux. Besides it, Hash Linux provides four more themes: Light Orange, Sweet Purple, Night Red, and Arch Dark. - -Hash Theme Selector is a home-baked Hash Linux application that you can use to configure the theme for a window manager. - -![Hash Theme Selector][13] - -### Upgrading Hash Linux - -Being a rolling release distribution, you don’t need to download a new ISO of Hash Linux to update the existing system. The only thing you need to upgrade your system is to run `upgrade` command in a terminal. - -![upgrading hash linux][14] - -### Closing Thought - -If you want to use a window manager instead of the desktop environment but do not want to spend a lot of time configuring it, Hash project saves the day. - -First, it will save you a lot of time and effort for configuration, and second, it will easily make you comfortable in using a keyboard-driven system. Later, you can definitely learn to configure according to your own needs. - -As Hash Linux already provides four ISO with the different window managers, you can start using any version and find your favorite one. Overall, it is a [good Arch-based Linux distribution][15]. - -At last, I would also like to mention that the current official [site][3] of Hash Linux does not contain much information about it. - -![][16] - -An earlier [site][17] (not accessible to me now) that also mentioned in the release info, contained information about it including configuration details when I checked last time. - -Don’t want to go the Arch way just for tiling window manager? Try [Regolith Linux][18]. It is Ubuntu preconfigured with i3wm. Awesome, right? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/hash-linux-review/ - -作者:[Sarvottam Kumar][a] -选题:[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/sarvottam/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-arch-linux/ -[2]: https://arcolinux.com/ -[3]: https://hashproject.ga/ -[4]: https://xmonad.org/ -[5]: https://hashproject.ga/index.html#downloads -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-GUI-Installer.jpg?resize=800%2C451&ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Installer-Welcome-Page.png?resize=800%2C452&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux.jpg?resize=800%2C451&ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Xmonad-default-layout.png?resize=800%2C452&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Moved-to-float.png?resize=800%2C452&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Htop.jpg?resize=800%2C451&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Application-search-menu.jpg?resize=800%2C451&ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Theme-Selector.png?resize=800%2C452&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Upgrading-hash-linux.png?resize=800%2C452&ssl=1 -[15]: https://itsfoss.com/arch-based-linux-distros/ -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-Site-URL.png?resize=575%2C193&ssl=1 -[17]: https://hashproject.org/ -[18]: https://itsfoss.com/regolith-linux-desktop/ diff --git a/translated/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md b/translated/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md new file mode 100644 index 0000000000..b0d4ebb4a7 --- /dev/null +++ b/translated/tech/20210616 Hash Linux- Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager.md @@ -0,0 +1,135 @@ +[#]: subject: "Hash Linux: Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager" +[#]: via: "https://itsfoss.com/hash-linux-review/" +[#]: author: "Sarvottam Kumar https://itsfoss.com/author/sarvottam/" +[#]: collector: "lujun9972" +[#]: translator: "mcfd" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Hash Linux: 预配置 Xmonad、Awesome、i3 和 Bspwm 窗口管理器的 Arch Linux 衍生版 +====== + +通过一些努力,[你可以安装 Arch Linux][1]。也可以在你的 Arch 系统上安装一个你选择的桌面环境或窗口管理器。 + +这需要一些时间和精力,但肯定是可以实现的。但是,有一些项目可以减轻你的痛苦,为你提供一个预先配置好的桌面环境或窗口管理器的系统。[ArcoLinux][2] 就是这样一个例子。 + +最近,我发现了另一个项目,它只专注于在出色的 Arch 发行版上提供完善的窗口管理器的选择。 + +[Hash Project][3] 提供了四种预配置平铺式窗口管理器的 Arch 变体:Awesome、 [Xmonad][4]、 i3、和 Bspwm。 + +如果你是一个初学窗口管理器的人,Hash Project 绝对是你应该马上尝试的。不用先投入时间去配置它,你就可以探索窗口管理器的潜力,并习惯由键盘驱动的系统。 + +在本文中,我将讨论我在使用 **Hash Linux Xmonad 版本** 时的部分体验,该版本采用 Linux 5.12的内核。 + +### 安装 Hash Linux + +Hash Linux 四个版本的 ISO 镜像均可 [下载][5] ,适用于 x86_64 系统架构。 + +为了避免在实体机上安装时出现的各种意外错误,我在 GNOME Boxes 中创建了一个 Hash Linux Xmonad 版本的虚拟机。 + +当我启动到 Hash Linux 时,我注意到两件事。 首先是一个面板,提供用于管理窗口和命令的快捷方式。 我将在安装后讨论它。 其次,是一个漂亮且易于使用的 GUI 安装程序。 + +![Hash Linux GUI Installer][6] + +像其他衍生版一样,图形化的安装程序使安装过程非常顺畅。在几个步骤的配置中,Hash Linux 已安装完毕,并准备重新启动。 + +![Installer Welcome Page][7] + +### 第一印象 + +![Hash Linux][8] + +如果你曾经在你的 Linux 系统上安装过 Xmonad 窗口管理器,那么你重启后首先看到的是什么? 空白的屏幕吧。 + +如果你是一个初学者,或者你不知道默认的按键绑定,你会被卡在一个屏幕上。因此,在使用任何窗口管理器之前,你必须先阅读其键盘快捷键。 + +如果你想把所有重要的快捷键提示都放在窗口上呢?一个备忘单可以为你节省很多时间。 + +因此,为了简化和方便初学者,Hash Linux 将重要的快捷键都钉在了桌面上。 + +所以,让我们先尝试其中的一些。从最重要的一个开始 `[Super]+Enter`,它可以打开默认的 termite 终端模拟器与 Z shell (ZSH)。 + +如果你多次点击它,你会发现默认情况下 Xmonad 遵循一个缩小布局,它首先将一个窗口固定在右边,然后以同样的方式将其余的全部安排在左边。 + +![Xmonad default layout][9] + +按下 `[Super]+[Space]`,你也可以将当前的布局改为标签式布局。甚至你可以按下 `[Super]+[left+click]` 将窗口拖动。 + +![Moved to float][10] + +要退出当前的窗口,你可以按下 `[Super]+Q`。 + +### Hash Linux 中的应用 + +默认情况下,Hash Linux 包含几个有用的命令行工具,如:NeoFetch、Htop、Vim、Pacman、Git 和 Speedtest-cli。 + +![Htop][11] + +它还拥有大量的图形应用程序,如:Firefox 89、Gparted、Nitrogen、Conky、Flameshot、Geany 和 CPU-X。 + +`[Super]+D` 是 Hash Linux 中打开应用程序搜索菜单的默认快捷键。 + +![Application search menu][12] + +### 主题美化 + +Hash Cyan 是 Hash Linux 的默认主题。除了它之外,Hash Linux 还提供了另外四个主题:Light Orange、Sweet Purple、Night Red 和 Arch Dark。 + +Hash Theme Selector 是一个自制的 Hash Linux 应用程序,你可以用它来配置窗口管理器的主题。 + +![Hash Theme Selector][13] + +### 升级 Hash Linux + +作为一个滚动发行版,你不需要下载一个新的 Hash Linux 的 ISO 来更新现有系统。你唯一需要的是在终端运行 ` upgrade` 命令来升级你的系统。 + +![upgrading hash linux][14] + +### 结束语 + +如果你想使用一个窗口管理器来代替桌面环境,但又不想花很多时间来配置它,Hash Project 可以节省你的时间。 + +首先,它可以节省你大量的配置时间和精力,其次,它可以很轻松地让你适应使用键盘控制的系统。以后,你肯定可以学会根据自己的需要进行配置。 + +由于 Hash Linux 已经提供了4个带有不同的窗口管理器的 ISO,你可以开始使用任何一个版本,并找到你最喜欢的一个版本。总的来说,它是一个[很好的 Arch Linux 衍生版][15]。 + +最后我还要提一下,目前 Hash Linux 的官方[网站][3]并没有包含很多关于它的信息。 + +![][16] + +早期的[网站][17](我现在无法访问)也在发布信息中提到,在我上次访问时,其中包含了许多关于它的信息,包括配置细节等。 + +不想入 Arch 的教,只想用平铺式窗口管理器?可以试试 [Regolith Linux][18] 。它是预先配置了 i3wm 的 Ubuntu。棒极了,对吧? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/hash-linux-review/ + +作者:[Sarvottam Kumar][a] +选题:[lujun9972][b] +译者:[mcfd](https://github.com/mcfd) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sarvottam/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-arch-linux/ +[2]: https://arcolinux.com/ +[3]: https://hashproject.ga/ +[4]: https://xmonad.org/ +[5]: https://hashproject.ga/index.html#downloads +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-GUI-Installer.jpg?resize=800%2C451&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Installer-Welcome-Page.png?resize=800%2C452&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux.jpg?resize=800%2C451&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Xmonad-default-layout.png?resize=800%2C452&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Moved-to-float.png?resize=800%2C452&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Htop.jpg?resize=800%2C451&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Application-search-menu.jpg?resize=800%2C451&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Theme-Selector.png?resize=800%2C452&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Upgrading-hash-linux.png?resize=800%2C452&ssl=1 +[15]: https://itsfoss.com/arch-based-linux-distros/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-Site-URL.png?resize=575%2C193&ssl=1 +[17]: https://hashproject.org/ +[18]: https://itsfoss.com/regolith-linux-desktop/ From a605592e8022abe4853776325af0f231f718ff7c Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Sun, 18 Jul 2021 20:23:07 +0800 Subject: [PATCH 484/870] Update 20210713 Use XMLStarlet to parse XML in your the Linux terminal.md --- ...to parse XML in your the Linux terminal.md | 174 +++++++++--------- 1 file changed, 89 insertions(+), 85 deletions(-) diff --git a/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md b/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md index 7b04c85fbe..b7330cabaa 100644 --- a/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md +++ b/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md @@ -1,124 +1,125 @@ -[#]: subject: (Use XMLStarlet to parse XML in your the Linux terminal) -[#]: via: (https://opensource.com/article/21/7/parse-xml-linux) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (zepoch) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "Use XMLStarlet to parse XML in your the Linux terminal" +[#]: via: "https://opensource.com/article/21/7/parse-xml-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "zepoch" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " -Use XMLStarlet to parse XML in your the Linux terminal +在你的 Linux 终端中使用 XMLStarlet 来解析 XML ====== -Become an XML star with XMLStarlet, an XML toolkit for your terminal. + +借助 XMLStarlet,一个终端上的 XML 工具包,你就是 XML 之星。 ![Penguin with green background][1] -Learning to parse XML is often considered a complex venture, but it doesn't have to be. [XML is highly and strictly structured][2], so it's relatively predictable. There are also lots of tools out there to help make the job manageable. +学习解析 XML 通常被认为是一件复杂的事情,但其实大可不必。[XML 是高度严格结构化的][2],所以也是相对来说可预测的。也有许多其他工具可以帮助你管理工作。 -One of my favorite XML utilities is [XMLStarlet][3], an XML toolkit for your terminal. With XMLStarlet, you can validate, parse, edit, format, and transform XML data. XMLStarlet is a relatively minimal command, but navigating XML is full of potential, so this article demonstrates how to use it to query XML data. +我最喜欢的 XML 实用程序之一是 [XMLStarlet][3], 用于终端的 XML 工具包,借助 XML 工具包,你可以验证、解析、编辑、格式化和转换 XML 数据。XMLStarLet 是个相对最小的命令,但指导 XML 却充满潜力,因此本文演示了如何使用它来查询 XML 数据。 -### Install +### 安装 -XMLStarlet is installed by default on CentOS, Fedora, and many other modern Linux distributions, so just open a terminal and type `xmlstarlet` to access it. If XMLStarlet isn't already installed, your operating system offers to install it for you. +XMLStarLet 默认安装在 CentOS,Fedora,和许多其他现代 Linux 发行版上,所以你可以打开终端,输入 `xmlstarlet` 来访问它。如果 XMLStarLet 还没有被安装,你的操作系统则会为你安装它。 -Alternately, you can install the `xmlstarlet` command from your package manager: +或者,你可以用包管理器安装 `xmlstarlet`: ``` `$ sudo dnf install xmlstarlet` ``` -On macOS, use [MacPorts][4] or [Homebrew][5]. On Windows, use [Chocolatey][6]. +在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。在 Windows 上,使用 [Chocolatey][6]。 -Should all else fail, you can install it manually from the [source code on Sourceforge][7]. +如果都失败了,您可以从 [Sourceforge 上的源代码][7]手动安装它。 -### Parsing XML with XMLStarlet +### 用 XMLStarlet 解析 XML -There are many tools designed to help parse and transform XML data, including software libraries that let you [write your own parser][8] and complex commands like `fop` and `xsltproc`. Sometimes you don't need to process XML data, though; you just need a convenient way to extract important data from, update, or just validate it. For spontaneous XML interactions, I use `xmlstarlet`, a classic "Swiss Army knife"-style application that does the most common XML tasks. You can see what it has to offer by running the command along with the `--help` option: +有许多工具可以帮助解析和转换XML数据,包括允许您[编写自己的解析器][8]和复杂命令的软件库,如 `fop` 和 `xsltproc`。尽管有时您不需要处理XML数据;您可以很方便的从 XML 数据中来提取、更新或验证重要数据。对于自发的XML交互,我使用 `xmlstarlet`,这是常见的处理 XML任务的一个典型的“瑞士军刀”式应用。通过运行 `--help` 命令,您可以看到它提供哪些选项: ``` $ xmlstarlet --help Usage: xmlstarlet [<options>] <command> [<cmd-options>] where <command> is one of: -  ed    (or edit)      - Edit/Update XML document(s) -  sel   (or select)    - Select data or query XML document(s) (XPATH, etc) -  tr    (or transform) - Transform XML document(s) using XSLT -  val   (or validate)  - Validate XML document(s) (well-formed/DTD/XSD/RelaxNG) -  fo    (or format)    - Format XML document(s) -  el    (or elements)  - Display element structure of XML document -  c14n  (or canonic)   - XML canonicalization -  ls    (or list)      - List directory as XML + ed (or edit) - Edit/Update XML document(s) + sel (or select) - Select data or query XML document(s) (XPATH, etc) + tr (or transform) - Transform XML document(s) using XSLT + val (or validate) - Validate XML document(s) (well-formed/DTD/XSD/RelaxNG) + fo (or format) - Format XML document(s) + el (or elements) - Display element structure of XML document + c14n (or canonic) - XML canonicalization + ls (or list) - List directory as XML [...] ``` -You can get further help by appending `--help` to the end of any of these subcommands: +您可以通过在这些子命令的末尾附加 `-help` 来获得进一步的帮助: ``` $ xmlstarlet sel --help -  -Q or --quiet             - do not write anything to standard output. -  -C or --comp              - display generated XSLT -  -R or --root              - print root element <xsl-select> -  -T or --text              - output is text (default is XML) -  -I or --indent            - indent output + -Q or --quiet - do not write anything to standard output. + -C or --comp - display generated XSLT + -R or --root - print root element <xsl-select> + -T or --text - output is text (default is XML) + -I or --indent - indent output [...] ``` -#### Selecting data with sel +#### 用 sel 命令选择数据 -You can view the data in XML with the `xmlstarlet select` (`sel` for short) command. Here's a simple XML document: +可以使用 `xmlstarlet select`(简称 `sel`)命令查看XML格式的数据。下面是一个简单的XML文档: ``` <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xml> -  <os> -   <linux> -    <distribution> -      <name>Fedora</name> -      <release>7</release> -      <codename>Moonshine</codename> -      <spins> -        <name>Live</name> -        <name>Fedora</name> -        <name>Everything</name> -      </spins> -    </distribution> + <os> + <linux> + <distribution> + <name>Fedora</name> + <release>7</release> + <codename>Moonshine</codename> + <spins> + <name>Live</name> + <name>Fedora</name> + <name>Everything</name> + </spins> + </distribution> -    <distribution> -      <name>Fedora Core</name> -      <release>6</release> -      <codename>Zod</codename> -      <spins></spins> -    </distribution> -   </linux> -  </os>     + <distribution> + <name>Fedora Core</name> + <release>6</release> + <codename>Zod</codename> + <spins></spins> + </distribution> + </linux> + </os> </xml> ``` -When looking for data in an XML file, your first task is to focus on the node you want to explore. If you know the path to the node, specify the full path with the `--value-of` option. The earlier in the [Document Object Model][9] (DOM) tree you start to explore, the more information you see: +在 XML 文件中查找数据时,您的第一个任务是关注要探索的节点。如果知道节点的路径,请使用 `-value of` 选项指定完整路径。您越早浏览 [Document Object Model][9](DOM)树,就可以看到更多信息: ``` $ xmlstarlet select --template \ \--value-of /xml/os/linux/distribution \ \--nl myfile.xml -      Fedora -      7 -      Moonshine -      -        Live -        Fedora -        Everything      -      -      Fedora Core -      6 -      Zod + Fedora + 7 + Moonshine + + Live + Fedora + Everything + + Fedora Core + 6 + Zod ``` -The `--nl` stands for "new line," and it inserts copious amounts of whitespace to ensure your terminal prompt gets a new line after your results are in. I've removed some of the excess space in the sample output. +`--nl` 代表“新的一行”,它插入大量的空白,以确保在输入结果后,终端在新的一行显示。我已经删除了样本输出中的一些多余空间。 -Narrow your focus by descending further into the DOM tree: +通过进一步深入 DOM 树来凝聚焦点: ``` @@ -129,13 +130,13 @@ Fedora Fedora Core ``` -#### Conditional selects +#### 条件选择 -One of the most powerful tools for navigating and parsing XML is called XPath. It governs the syntax used in XML searches and invokes functions from XML libraries. XMLStarlet understands XPath expressions, so you can make your selection conditional with an XPath function. XPath features a wealth of functions, and it's [documented in detail by W3C][10], but I find [Mozilla's XPath documentation][11] more concise. +用于导航和解析 XML 的最强大工具之一被称为 XPath。它控制 XML 搜索中使用的语法,并从 XML 库调用函数。XMLStarlet 能够解析 XPath 表达式,因此可以使用 XPath 函数来有条件的进行选择。XPath 具有丰富的函数,[由 W3C 详细记录][10],但我觉得 [Mozilla 的 XPath 文档][11]更简洁。 -You can use square brackets as a test function, comparing the contents of an element to some value. Here's a test for the value of the `` element, which returns the release number associated only with a specific match. +可以使用方括号作为测试函数,将元素的内容与某个值进行比较。下面是对 `` 元素的值的测试,它仅返回与特定匹配相关联的版本号。 -Imagine for a moment that the sample XML file contains all Fedora releases beginning with 1. To view all release numbers associated with the old name "Fedora Core" (the project dropped "Core" from the name from release 7 onward): +想象一下,示例 XML 文件包含以 1 开头的所有 Fedora 版本。要查看与旧名称 “Fedora Core” 关联的所有版本号(项目从版本 7 开始名称中的 “Core” 被删除掉了),请执行以下操作: ``` @@ -150,13 +151,13 @@ $ xmlstarlet sel --template \ 1 ``` -You could view all codenames for those releases, too, by changing the `--value-of` path to `/xml/os/linux/distribution[name = "Fedora Core"]/codename`. +通过将 `--path 的值`更改为 `/xml/os/linux/distribution[name=“Fedora Core”]/codename`,您便可以查看这些版本的所有代号。 -### Matching paths and getting values +### 匹配路径和获取目标值 -An advantage of viewing XML tags as nodes is that once you find the node, you can think of it as your current "directory" of data. It's not really a directory, at least not in the filesystem sense, but it is a collection of data that you can query. To help you keep your destination and the data "inside" it separate, XMLStarlet differentiates between what you're trying to match with the `--match` option and the value of the data you want with a `--value-of` option. +将 XML 标记视为节点的一个优点是,一旦找到节点,就可以将其视为当前的数据“目录”。它不是一个真正的目录,至少不是文件系统意义上的目录,但它是一个可以查询的数据集合。为了帮助您将目标和“其他”的数据分开,XMLStarlet 把您试图用 `--match` 选项匹配的内容和用 `--value` 选项匹配的数据值进行了区分。 -Suppose you know that the `` node contains several elements. That makes it your destination. Once you're there, you can use `--value-of` to specify which element you want a value for. To look at all elements, use a dot (`.`) to represent your current location: +假设你知道 `` 节点包含几个元素。这就是你的目的节点了。一旦到了这一步,就可以使用 `-value of` 指定要为哪个元素赋值。要查看所有元素,可以使用点(`.`)展示当前位置的所有元素: ``` @@ -168,7 +169,7 @@ Fedora Everything ``` -As with navigating the DOM, you can use XPath expressions to limit the scope of what data is returned. In this example, I use the `last()` function to retrieve just the last element in the `spin` node: +与导航 DOM 一样,可以使用 XPath 表达式来限制返回数据的范围。在本例中,我使用 `last()` 函数来检索 `spin` 节点中的最后一个元素: ``` @@ -178,7 +179,7 @@ $ xmlstarlet select --template \ Everything ``` -In this example, I use the `position()` function to select a specific element in the `spin` node: +在本例中,我使用 `position()` 函数选择 `spin` 节点中的特定元素: ``` @@ -190,15 +191,17 @@ Fedora The `--match` and `--value-of` options can overlap, so it's up to you how you want to use them together. These two expressions, in the case of the sample XML, do the same thing: +`--match` 和 `--value` 选项可以重叠,因此如何将它们一起使用取决于您自己。对于示例 XML,这两个表达式执行的是相同的操作: + ``` -$ xmlstarlet select  --template \ +$ xmlstarlet select --template \ \--match '/xml/os/linux/distribution/spin' \ \--value-of '.' \ \--nl myfile.xml Live Fedora -Everything      +Everything $ xmlstarlet select --template \ \--match '/xml/os/linux/distribution' \ @@ -209,9 +212,9 @@ Fedora Everything ``` -### Getting comfortable with XML +### 熟悉XML -XML can seem over-verbose and unwieldy at times, but the tools built to interact with it consistently surprise me. If you're looking to take advantage of XML, then XMLStarlet could be a good entry point. The next time you're about to open an XML file to look at structured data, try using XMLStarlet and see if you can query that data instead. The more comfortable you get with XML, the better it can serve you as a robust and flexible data format. +XML 有时看起来过于冗长和笨拙,但为与之交互和构建的工具却总是让我吃惊。如果您想要好好使用 XML,那么XMLStarlet 可能是一个很好的切入点。下次要打开 XML 文件查看结构化数据时,请尝试使用 XMLStarlet,看看是否可以改为查询该数据。当 XML 越适合你时,它就越能作为一种健壮灵活的数据格式而存在。 -------------------------------------------------------------------------------- @@ -219,14 +222,14 @@ via: https://opensource.com/article/21/7/parse-xml-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zepoch](https://github.com/zepoch) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 "Penguin with green background" [2]: https://opensource.com/article/21/6/what-xml [3]: https://en.wikipedia.org/wiki/XMLStarlet [4]: https://opensource.com/article/20/11/macports @@ -237,3 +240,4 @@ via: https://opensource.com/article/21/7/parse-xml-linux [9]: https://opensource.com/article/21/6/what-xml#dom [10]: https://www.w3.org/TR/1999/REC-xpath-19991116 [11]: https://developer.mozilla.org/en-US/docs/Web/XPath/Functions + From 66980a2d3eb7754bfda25d345dee3a834bb13497 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Sun, 18 Jul 2021 20:24:04 +0800 Subject: [PATCH 485/870] Rename sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md to translated/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md --- ...0713 Use XMLStarlet to parse XML in your the Linux terminal.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md (100%) diff --git a/sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md b/translated/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md similarity index 100% rename from sources/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md rename to translated/tech/20210713 Use XMLStarlet to parse XML in your the Linux terminal.md From f5ac534a33b82d25973a95f55e8ebebe470c18ea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Jul 2021 20:53:57 +0800 Subject: [PATCH 486/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @stevending1st 感谢您,完成了第一篇翻译贡献! --- ...rameworks for front-end web development.md | 78 +++++++++---------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md b/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md index 4a57ea27a0..dd7d03039a 100644 --- a/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md +++ b/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md @@ -1,30 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (stevending1st) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (9 open source JavaScript frameworks for front-end web development) [#]: via: (https://opensource.com/article/20/5/open-source-javascript-frameworks) [#]: author: (Bryant Son https://opensource.com/users/brson) -9 个用于 web 前端开发的 JavaScript 开源框架 +用于 Web 前端开发的 9 个 JavaScript 开源框架 ====== -根据 JavaScript 框架的优点和功能的分类。 +> 根据 JavaScript 框架的优点和主要特点对许多 JavaScript 框架进行细分。 -![Computer screen with files or windows open][1] +![](https://img.linux.net.cn/data/attachment/album/202107/18/205233kz0sqwdwwvrwp2ss.jpg) -大约十年前,JavaScript 社区开始见证一场 JavaScript 框架的激战。在本文中我将介绍其中最著名的一些框架。值得注意的是,这些都是开源的 JavaScript 项目,这意味着你可以在 [开源许可证][2] 下自由地使用它们,甚至为它们的源代码和社区做出贡献。 - -你如果喜欢和我一起探索框架,可以看我的视频。 +大约十年前,JavaScript 社区开始见证一场 JavaScript 框架的激战。在本文中,我将介绍其中最著名的一些框架。值得注意的是,这些都是开源的 JavaScript 项目,这意味着你可以在 [开源许可证][2] 下自由地使用它们,甚至为它们的源代码和社区做出贡献。 不过,在开始之前,了解一些 JavaScript 开发者谈论框架时常用的术语,将对后续的内容大有裨益。 术语 | 释义 ---|--- -[文档对象模型(DOM)][3] | 网站用树结构表示,每一个节点都是代表网页一部分的对象。万维网联盟(W3C),是万维网的国际标准组织,维护着 DOM 的定义。 +[文档对象模型(DOM)][3] | 网站的树形结构表示,每一个节点都是代表网页一部分的对象。万维网联盟(W3C),是万维网的国际标准组织,维护着 DOM 的定义。 [虚拟 DOM][4] | 用户界面(UI)以“虚拟”或“理想”的方式保存在内存中,并通过 [ReactDOM][5] 等一些库与“真实” DOM 同步。要进一步探索,请阅读 ReactJS 的虚拟 DOM 和内部文档。 -[数据绑定][6] | 一个编程概念,为访问网站上的数据提供一致的接口。Web 元素与 DOM 维护的元素的 property 或 attribute 相关联(译者注:根据 MDN 的解释,Javascript 的 property 是对象的特征,通常描述与数据结构相关的特征;attribute 是指元素所有属性节点的一个实时集合)。例如,当需要在网页表单中填写密码时,数据绑定机制可以用密码验证逻辑检验,确保密码格式有效。 +[数据绑定][6] | 一个编程概念,为访问网站上的数据提供一致的接口。Web 元素与 DOM 维护的元素的属性property特性attribute 相关联(LCTT 译注:根据 MDN 的解释,Javascript 的属性property是对象的特征,通常描述与数据结构相关的特征;特性attribute 是指元素所有属性节点的一个实时集合)。例如,当需要在网页表单中填写密码时,数据绑定机制可以用密码验证逻辑检验,确保密码格式有效。 我们已经清楚了常用的术语,下面我们来探索一下开源的 JavaScript 框架有哪些。 @@ -33,10 +31,10 @@ [ReactJS][7] | 目前最流行的 JavaScript 框架,由 Facebook 创建 | MIT 许可证 | 2013-5-24 [Angular][8] | Google 创建的流行的 JavaScript 框架 | MIT 许可证 | 2010-1-5 [VueJS][9] | 快速增长的 JavaScript 框架 | MIT 许可证 | 2013-7-28 -[MeteorJS][10] | 比 JavaScript 框架更强大的框架 | MIT 许可证 | 2012-1-18 -[KnockoutJS][11] | 开源的 MVVM(Model-View-ViewModel,模型-视图-视图模型) 框架 | MIT 许可证 | 2010-7-5 +[MeteorJS][10] | 超乎于 JavaScript 框架的强大框架 | MIT 许可证 | 2012-1-18 +[KnockoutJS][11] | 开源的 MVVM(模型-视图-视图模型Model-View-ViewModel) 框架 | MIT 许可证 | 2010-7-5 [EmberJS][12] | 另一个开源的 MVVM 框架 | MIT 许可证 | 2011-12-8 -[BackboneJS][13] | 带有 RESTful JSON 和 Model-View-Presenter 模式的 JavaScript 框架 | MIT 许可证 | 2010-9-30 +[BackboneJS][13] | 带有 RESTful JSON 和模型-视图-主持人Model-View-Presenter模式的 JavaScript 框架 | MIT 许可证 | 2010-9-30 [Svelte][14] | 不使用虚拟 DOM 的 JavaScript 开源框架 | MIT 许可证 | 2016-11-20 [AureliaJS][15] | 现代 JavaScript 模块的集合 | MIT 许可证 | 2018-2-14 @@ -50,18 +48,18 @@ [ReactJS][19] 是由 Facebook 研发的,它虽然在 Angular 之后发布,但明显是当今 JavaScript 框架的领导者。React 引入了一个虚拟 DOM 的概念,这是一个抽象副本,开发者能在框架内仅使用他们想要的 ReactJS 功能,而无需重写整个项目。此外,React 项目活跃的开源社区无疑成为增长背后的主力军。下面是一些 React 的主要优势: - * 合理的学习曲线——React 开发者可以轻松地创建 React 组件,而不需要重写整个 JavaScript 的代码。在 ReactJS 的 [首页][20] 查看它的好处以及它如何使编程更容易。 - * 高度优化的性能——React 的虚拟 DOM 的实现和其他功能提升了应用程序的渲染性能。请查看 ReactJS 的关于如何对其性能进行基准测试,并对应用性能进行衡量的相关 [描述][21]。 - * 优秀的支持工具——[Redux][22]、[Thunk][23] 和 [Reselect][24] 是构建良好、可调式代码的最佳工具。 - * 单项数据绑定——模型使用 Reach 流,只从所有者流向子模块,这使得在代码中追踪因果关系更加简单。请在 ReactJS 的 [数据绑定页][25] 阅读更多相关资料。 + * 合理的学习曲线 —— React 开发者可以轻松地创建 React 组件,而不需要重写整个 JavaScript 的代码。在 ReactJS 的 [首页][20] 查看它的优点以及它如何使编程更容易。 + * 高度优化的性能 —— React 的虚拟 DOM 的实现和其他功能提升了应用程序的渲染性能。请查看 ReactJS 的关于如何对其性能进行基准测试,并对应用性能进行衡量的相关 [描述][21]。 + * 优秀的支持工具 —— [Redux][22]、[Thunk][23] 和 [Reselect][24] 是构建良好、可调式代码的最佳工具。 + * 单向数据绑定 —— 模型使用 Reach 流,只从所有者流向子模块,这使得在代码中追踪因果关系更加简单。请在 ReactJS 的 [数据绑定页][25] 阅读更多相关资料。 -谁在使用 ReactJS?Facebook 自从发明它,就大量使用 React 构建公司首页,据说 [Instagram][26] 完全基于 ReactJS 库。你可能会惊讶地发现,其他知名公司如 [New York Times][27]、[Netflix][28] 和 [Khan Academy][29] 也在他们的技术栈中使用了 ReactJS。 +谁在使用 ReactJS?Facebook 自从发明它,就大量使用 React 构建公司首页,据说 [Instagram][26] 完全基于 ReactJS 库。你可能会惊讶地发现,其他知名公司如 [纽约时报][27]、[Netflix][28] 和 [可汗学院][29] 也在他们的技术栈中使用了 ReactJS。 -更令人惊讶的是 ReactJS 开发者的工作可用性,正如在下面 Stackoverflow 所做的研究中看到的,嘿,可以从事开源项目并获得报酬。这很酷! +更令人惊讶的是 ReactJS 开发者的工作机会,正如在下面 Stackoverflow 所做的研究中看到的,嘿,你可以从事开源项目并获得报酬。这很酷! ![React jobs page][30] -Stackoverflow 的研究显示了对 ReactJS 开发者的巨大需求——[来源:2017年开发者招聘趋势——Stackoverflow 博客][31] +*Stackoverflow 的研究显示了对 ReactJS 开发者的巨大需求——[来源:2017 年开发者招聘趋势——Stackoverflow 博客][31]* [ReactJS 的 GitHub][7] 目前显示超过 13,000 次提交和 1,377 位贡献者。它是一个在 MIT 许可证下的开源项目。 @@ -71,13 +69,13 @@ Stackoverflow 的研究显示了对 ReactJS 开发者的巨大需求——[来 ![Angular homepage][33] -对于大多数开发者来说,也许现在 React 是领先的 JavaScript 框架,但是 [Angular][34] 紧随其后。事实上,开源开发者和初创公司更乐于选择 React,而较大的公司往往更喜欢 Angular(下面列出了一些例子)。主要原因是,虽然 Angular 可能更复杂,但它的统一性和一致性适用于大型项目。例如,在我整个职业生涯中一直研究 Angular 和 React,我观察到大公司通常认为 Angular 严格的结构是一种优势。下面是 Angular 的另外一些关键优势: +就开发者数量来说,也许 React 是现在最领先的 JavaScript 框架,但是 [Angular][34] 紧随其后。事实上,开源开发者和初创公司更乐于选择 React,而较大的公司往往更喜欢 Angular(下面列出了一些例子)。主要原因是,虽然 Angular 可能更复杂,但它的统一性和一致性适用于大型项目。例如,在我整个职业生涯中一直研究 Angular 和 React,我观察到大公司通常认为 Angular 严格的结构是一种优势。下面是 Angular 的另外一些关键优势: - * 精心设计的命令行工具——Angular 有一个优秀的命令行工具(CLI),可以轻松引导和使用 Angular 进行开发。ReactJS 提供命令行工具和其他工具,同时 Angular 有广泛的支持和出色的文档,你可以参见 [这个页面][35]。 - * 单项数据绑定——和 React 类似,单向数据绑定模型使框架受更少的不必要的副作用的影响。 - * 更好的 TypeScript 支持——Angular 与 [TypeScript][36] 有很好的一致性,它其实是 JavaScript 强制类型的拓展。它还可以转译为 JavaScript,强制类型是减少错误代码的绝佳选择。 + * 精心设计的命令行工具 —— Angular 有一个优秀的命令行工具(CLI),可以轻松起步和使用 Angular 进行开发。ReactJS 提供命令行工具和其他工具,同时 Angular 有广泛的支持和出色的文档,你可以参见 [这个页面][35]。 + * 单向数据绑定 —— 和 React 类似,单向数据绑定模型使框架受更少的不必要的副作用的影响。 + * 更好的 TypeScript 支持 —— Angular 与 [TypeScript][36] 有很好的一致性,它其实是 JavaScript 强制类型的拓展。它还可以转译为 JavaScript,强制类型是减少错误代码的绝佳选择。 -像 YouTube、[Netflix][37]、[IBM][38] 和 [Walmart][39] 等知名网站,都已在其应用程序中采用了 Angular。我通过自学使用 Angular 来开始学习前端 JavaScript 开发。我参与了许多涉及 Angular 的个人和专业项目,但那是当时被称为 AngularJS 的 Angular 1.x。当 Google 决定将版本升级到 2.0 时,他们对框架进行了彻底的改造,然后成了 Angular。新的 Angular 是对之前的 AngularJS 的彻底改造,这一举动带来了一部分新开发者也驱逐了一部分原有的开发者。 +像 YouTube、[Netflix][37]、[IBM][38] 和 [Walmart][39] 等知名网站,都已在其应用程序中采用了 Angular。我通过自学使用 Angular 来开始学习前端 JavaScript 开发。我参与了许多涉及 Angular 的个人和专业项目,但那是当时被称为 AngularJS 的 Angular 1.x。当 Google 决定将版本升级到 2.0 时,他们对框架进行了彻底的改造,然后变成了 Angular。新的 Angular 是对之前的 AngularJS 的彻底改造,这一举动带来了一部分新开发者也驱逐了一部分原有的开发者。 截止到撰写本文,[Angular 的 GitHub][8] 页面显示 17,781 次提交和 1,133 位贡献者。它也是一个遵循 MIT 许可证的开源项目,因此你可以自由地在你的项目或贡献中使用。 @@ -93,9 +91,9 @@ Stackoverflow 的研究显示了对 ReactJS 开发者的巨大需求——[来 这里有一些 VueJS 的主要优点: - * 更容易地学习曲线——与 Angular 或 React 相比,许多前端开发者都认为 VueJS 有更平滑的学习曲线。 - * 小体积——与 Angular 或 React 相比,VueJS 相对轻巧。在 [官方文档][45] 中,它的大小据说只有约 30 KB;而 Angular 生成的项目超过 65 KB。 - * 简明的文档——VueJS 有全面清晰的文档。请自行查看它的 [官方文档][46]。 + * 更容易地学习曲线 —— 与 Angular 或 React 相比,许多前端开发者都认为 VueJS 有更平滑的学习曲线。 + * 小体积 —— 与 Angular 或 React 相比,VueJS 相对轻巧。在 [官方文档][45] 中,它的大小据说只有约 30 KB;而 Angular 生成的项目超过 65 KB。 + * 简明的文档 —— VueJS 有全面清晰的文档。请自行查看它的 [官方文档][46]。 [VueJS 的 GitHub][9] 显示该项目有 3,099 次提交和 239 位贡献者。 @@ -105,17 +103,17 @@ Stackoverflow 的研究显示了对 ReactJS 开发者的巨大需求——[来 ![Meteor page][48] -[MeteorJS][49] 是一个免费开源的 [同构框架][50],这意味着它和 NodeJS 一样,同时运行客户端和服务器的 JavaScript。Meteor 能够和任何其他流行的前端框架一起使用,如 Angular、React、Vue、Svelte 等。 +[MeteorJS][49] 是一个自由开源的 [同构框架][50],这意味着它和 NodeJS 一样,同时运行客户端和服务器的 JavaScript。Meteor 能够和任何其他流行的前端框架一起使用,如 Angular、React、Vue、Svelte 等。 -Meteor 被高通、Mazda 和宜家等多家公司以及如 Dispatch 和 Rocket.Chat 等多个应用程序使用。[您可以其在官方网站上查看更多案例][51]。 +Meteor 被高通、马自达和宜家等多家公司以及如 Dispatch 和 Rocket.Chat 等多个应用程序使用。[您可以其在官方网站上查看更多案例][51]。 ![Meteor case study][52] Meteor 的一些主要功能包括: - * 在线数据——服务器发送数据而不是 HTML,并由客户端渲染。在线数据主要是指 Meteor 在页面加载时通过一个 WebSocket 连接服务器,然后通过该链接传输所需要的数据。 - * 用 JavaScript 开发一切——客户端、应用服务、网页和移动界面都可以用 JavaScript 设计。 - * 支持大多数主流框架——Angular、React 和 Vue 都可以与 Meteor 结合。因此,你仍然可以使用最喜欢的框架如 React 或 Angular,这并不防碍 Meteor 为你提供一些优秀的功能。 + * 在线数据 —— 服务器发送数据而不是 HTML,并由客户端渲染。在线数据主要是指 Meteor 在页面加载时通过一个 WebSocket 连接服务器,然后通过该链接传输所需要的数据。 + * 用 JavaScript 开发一切 —— 客户端、应用服务、网页和移动界面都可以用 JavaScript 设计。 + * 支持大多数主流框架 —— Angular、React 和 Vue 都可以与 Meteor 结合。因此,你仍然可以使用最喜欢的框架如 React 或 Angular,这并不防碍 Meteor 为你提供一些优秀的功能。 截止到目前,[Meteor 的 GitHub][10] 显示 22,804 次提交和 428 位贡献者。这对于开源项目来说相当多了。 @@ -129,8 +127,8 @@ Meteor 的一些主要功能包括: Ember 虽然和我们讨论过的其他框架有类似的好处,但这里有些独特的区别: - * 约定优于配置——Ember 标准化命名约定并自动生成结果代码。这种方法学习曲线有些陡峭,但可以确保程序员遵循最佳实践。 - * 成熟的模板机制——Ember 依赖于直接文本操作,直接构建 HTML 文档,而并不关心 DOM。 + * 约定优于配置 —— Ember 将命名约定标准化并自动生成结果代码。这种方法学习曲线有些陡峭,但可以确保程序员遵循最佳实践。 + * 成熟的模板机制 —— Ember 依赖于直接文本操作,直接构建 HTML 文档,而并不关心 DOM。 正如所期待的那样,作为一个被许多应用程序使用的框架,[Ember 的 GitHub][58] 页面显示该项目拥有 19,808 次提交和 785 位贡献者。这是一个巨大的数字! @@ -142,7 +140,7 @@ Ember 虽然和我们讨论过的其他框架有类似的好处,但这里有 [KnockoutJS][61] 是一个独立开源的 JavaScript 框架,采用 [模板-视图-视图模型(MVVM)][56] 模式与模板。尽管与 Angular、React 或 Vue 相比,听说过这个框架的人可能比较少,这个项目在开发者社区仍然相当活跃,并且有以下功能: - * 声明式绑定——Knockout 的声明式绑定系统提供了一种简洁而强大的方式来将数据链接到 UI。绑定简单的数据属性或使用单向绑定很简单。请在 [KnockoutJS 的官方文档页面][62] 阅读更多相关信息。 + * 声明式绑定 —— Knockout 的声明式绑定系统提供了一种简洁而强大的方式来将数据链接到 UI。绑定简单的数据属性或使用单向绑定很简单。请在 [KnockoutJS 的官方文档页面][62] 阅读更多相关信息。 * 自动 UI 刷新。 * 依赖跟踪模板。 @@ -154,7 +152,7 @@ Ember 虽然和我们讨论过的其他框架有类似的好处,但这里有 ![BackboneJS page][64] -[BackboneJS][65] 是一个具有 RESTful JSON 接口,基于 Model-View-Presenter(MVP)设计范式的轻量级 JavaScript 框架。 +[BackboneJS][65] 是一个具有 RESTful JSON 接口,基于模型-视图-主持人Model-View-Presenter(MVP)设计范式的轻量级 JavaScript 框架。 这个框架据说已经被 [Airbnb][66]、Hulu、SoundCloud 和 Trello 使用。你可以在 [Backbone 的页面][67] 找到上面所有这些案例来研究。 @@ -178,9 +176,9 @@ Ember 虽然和我们讨论过的其他框架有类似的好处,但这里有 最后我们介绍一下 [Aurelia][73]。Aurelia 是一个前端 JavaScript 框架,是一个现代 JavaScript 模块的集合。Aurelia 有以下有趣的功能: - * 快速渲染——Aurelia 宣称比当今其他任何框架的渲染速度都快。 - * 单向数据流——Aurelia 使用一个基于观察的绑定系统,将数据从模型推送到视图。 - * 使用 vanilla JavaScript 架构——可以用 vanilla JavaScript 构建网站的所有组件。 + * 快速渲染 —— Aurelia 宣称比当今其他任何框架的渲染速度都快。 + * 单向数据流 —— Aurelia 使用一个基于观察的绑定系统,将数据从模型推送到视图。 + * 使用原生 JavaScript 架构 —— 可以用原生 JavaScript 构建网站的所有组件。 [Aurelia 的 GitHub][15] 页面显示,截止到撰写本文为止该项目有 788 次提交和 96 位贡献者。 @@ -195,7 +193,7 @@ via: https://opensource.com/article/20/5/open-source-javascript-frameworks 作者:[Bryant Son][a] 选题:[lujun9972][b] 译者:[stevending1st](https://github.com/stevending1st) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 11cf12e6f612cf586e65868b51c79cd20cbad027 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Jul 2021 20:55:03 +0800 Subject: [PATCH 487/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @stevending1st 本文首发地址:https://linux.cn/article-13594-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/stevending1st --- ...rce JavaScript frameworks for front-end web development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200528 9 open source JavaScript frameworks for front-end web development.md (99%) diff --git a/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md b/published/20200528 9 open source JavaScript frameworks for front-end web development.md similarity index 99% rename from translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md rename to published/20200528 9 open source JavaScript frameworks for front-end web development.md index dd7d03039a..8b2dab76c6 100644 --- a/translated/tech/20200528 9 open source JavaScript frameworks for front-end web development.md +++ b/published/20200528 9 open source JavaScript frameworks for front-end web development.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevending1st) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13594-1.html) [#]: subject: (9 open source JavaScript frameworks for front-end web development) [#]: via: (https://opensource.com/article/20/5/open-source-javascript-frameworks) [#]: author: (Bryant Son https://opensource.com/users/brson) From e3b60d3f240bb71ca29ff6ec13b99ea9ff8c0dc8 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 18 Jul 2021 21:49:38 +0800 Subject: [PATCH 488/870] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ogramming languages read and write data.md | 284 ------------------ ...ogramming languages read and write data.md | 281 +++++++++++++++++ 2 files changed, 281 insertions(+), 284 deletions(-) delete mode 100644 sources/tech/20210714 How different programming languages read and write data.md create mode 100644 translated/tech/20210714 How different programming languages read and write data.md diff --git a/sources/tech/20210714 How different programming languages read and write data.md b/sources/tech/20210714 How different programming languages read and write data.md deleted file mode 100644 index ec3b8df217..0000000000 --- a/sources/tech/20210714 How different programming languages read and write data.md +++ /dev/null @@ -1,284 +0,0 @@ -[#]: subject: (How different programming languages read and write data) -[#]: via: (https://opensource.com/article/21/7/programming-read-write) -[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How different programming languages read and write data -====== -Every programming language has a unique way of accomplishing a task; -that's why there are so many languages to choose from. -![Code going into a computer.][1] - -In his article _[How different programming languages do the same thing][2]_, Jim Hall demonstrates how 13 different languages accomplish the same exact task with different syntax. The lesson is that programming languages tend to have many similarities, and once you know one programming language, you can learn another by figuring its syntax and structure. - -In the same spirit, Jim's article compares how different programming languages read and write data. Whether that data comes from a configuration file or from a file a user creates, processing data on a storage device is a common task for coders. It's not practical to cover all programming languages in this way, but a recent Opensource.com series provides insight into different approaches taken by these coding languages: - - * [C][3] - * [C++][4] - * [Java][5] - * [Groovy][6] - * [Lua][7] - * [Bash][8] - * [Python][9] - - - -### Reading and writing data - -The process of reading and writing data with a computer is similar to how you read and write data in real life. To access data in a book, you first open it, then you read words or you write new words into the book, and then you close the book. - -When your code needs to read data from a file, you provide your code with a file location, and then the computer brings that data into its RAM and parses it from there. Similarly, when your code needs to write data to a file, the computer places new data into the system's in-memory write buffer and synchronizes it to the file on the storage device. - -Here's some pseudo-code for these operations: - - 1. Load a file in memory. - 2. Read the file's contents, or write data to the file. - 3. Close the file. - - - -### Reading data from a file - -You can see three trends in how the languages in the Opensource.com series read files. - -#### C - -In C, opening a file can involve retrieving a single character (up to the `EOF` designator, signaling the end of the file) or a block of data, depending on your requirements and approach. It can feel like a mostly manual process, depending on your goal, but the general process is exactly what the other languages mimic. - - -``` -FILE *infile; -int ch; - -infile = [fopen][10](argv[1], "r"); -  -do { -  ch = [fgetc][11](infile); -  if (ch != EOF) { -    [printf][12]("%c", ch); -  } - } while (ch != EOF); - -[fclose][13](infile); -``` - -You can also choose to load some portion of a file into the system buffer and then work out of the buffer. - - -``` -FILE *infile; -char buffer[300]; -  -infile = [fopen][10](argv[1], "r"); - -while (![feof][14](infile)) { -  size_t buffer_length; -  buffer_length = [fread][15](buffer, sizeof(char), 300, infile); -} - -[printf][12]("%s", buffer); -[fclose][13](infile); -``` - -#### C++ - -C++ simplifies a few steps, allowing you to parse data as strings. - - -``` -std::string sFilename = "example.txt"; - -std::ifstream fileSource(sFilename); -std::string buffer; - -while (fileSource >> buffer) { -  std::cout << buffer << std::endl; -} -``` - -#### Java - -Java and Groovy are similar to C++. They use a class called `Scanner` to set up a data object or stream containing the contents of the file of your choice. You can "scan" through the file by tokens (byte, line, integer, and many others). - - -``` -[File][16] myFile = new [File][16]("example.txt"); - -Scanner myScanner = new Scanner(myFile); -  while (myScanner.hasNextLine()) { -    [String][17] line = myScanner.nextLine(); -    [System][18].out.println(line); -  } - -myScanner.close(); -``` - -#### Groovy - - -``` -def myFile = new [File][16]('example.txt') - -def myScanner = new Scanner(myFile) -  while (myScanner.hasNextLine()) { -    def line = myScanner.nextLine() -    println(line) -  } - -myScanner.close() -``` - -#### Lua - -Lua and Python abstract the process further. You don't have to consciously create a data stream; you just assign a variable to the results of an `open` function and then parse the contents of the variable. It's quick, minimal, and easy. - - -``` -myFile = io.open('example.txt', 'r') - -lines = myFile:read("*all") -print(lines) - -myFile:close() -``` - -#### Python - - -``` -f = open('example.tmp', 'r') - -for line in f: -    print(line) - -f.close() -``` - -### Writing data to a file - -In terms of code, writing is the inverse of reading. As such, the process for writing data to a file is basically the same as reading data from a file, except using different functions. - -#### C - -In C, you can write a character to a file with the `fputc` function. - - -``` -`fputc(ch, outfile);` -``` - -Alternately, you can write data to the buffer with `fwrite`. - - -``` -`fwrite(buffer, sizeof(char), buffer_length, outfile);` -``` - -#### C++ - -Because C++ uses the `ifstream` library to open a buffer for data, you can write data to the buffer, as with C (except with C++ libraries). - - -``` -`std::cout << buffer << std::endl;` -``` - -#### Java - -In Java, you can use the `FileWriter` class to create a data object that you can write data to. It works a lot like the `Scanner` class, except going the other way. - - -``` -[FileWriter][19] myFileWriter = new [FileWriter][19]("example.txt", true); -myFileWriter.write("Hello world\n"); -myFileWriter.close(); -``` - -#### Groovy - -Similarly, Groovy uses `FileWriter` but with a slightly "groovier" syntax. - - -``` -new [FileWriter][19]("example.txt", true).with { -  write("Hello world\n") -  flush() -} -``` - -#### Lua - -Lua and Python are similar, both using functions called `open` to load a file, `write` to put data into it, and `close` to close the file. - - -``` -myFile = io.open('example.txt', 'a') -io.output(myFile) -io.write("hello world\n") -io.close(myFile) -``` - -#### Python - - -``` -myFile = open('example.txt', 'w') -myFile.write('hello world') -myFile.close() -``` - -### File modes - -Many languages specify a "mode" when opening files. Modes vary, but this is common notation: - - * **w** to write - * **r** to read - * **r+** to read and write - * **a** to append only - - - -Some languages, such as Java and Groovy, let you determine the mode based on which class you use to load the file. - -Whichever way your programming language determines a file's mode, it's up to you to ensure that you're _appending_ data—unless you intend to overwrite a file with new data. Programming languages don't have built-in prompts to warn you against data loss, the way file choosers do. - -### New language and old tricks - -Every programming language has a unique way of accomplishing a task; that's why there are so many languages to choose from. You can and should choose the language that works best for you. But once you understand the basic constructs of programming, you can also feel free to try out different languages, without fear of not knowing how to accomplish basic tasks. More often than not, the pathways to a goal are similar, so they're easy to learn as long as you keep the basic concepts in mind. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/programming-read-write - -作者:[Alan Smithee][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alansmithee -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) -[2]: https://opensource.com/article/21/4/compare-programming-languages -[3]: https://opensource.com/article/21/3/file-io-c -[4]: https://opensource.com/article/21/3/ccc-input-output -[5]: https://opensource.com/article/21/3/io-java -[6]: https://opensource.com/article/21/4/groovy-io -[7]: https://opensource.com/article/21/3/lua-files -[8]: https://opensource.com/article/21/3/input-output-bash -[9]: https://opensource.com/article/21/6/reading-and-writing-files-python -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html -[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html -[12]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html -[14]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html -[15]: http://www.opengroup.org/onlinepubs/009695399/functions/fread.html -[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file -[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter diff --git a/translated/tech/20210714 How different programming languages read and write data.md b/translated/tech/20210714 How different programming languages read and write data.md new file mode 100644 index 0000000000..638a15b63b --- /dev/null +++ b/translated/tech/20210714 How different programming languages read and write data.md @@ -0,0 +1,281 @@ +[#]: subject: "How different programming languages read and write data" +[#]: via: "https://opensource.com/article/21/7/programming-read-write" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +不同的编程语言是如何读写数据的 +====== +每种编程语言都有其独特的完成任务的方式,这也说明了为什么有这么多语言可供选择。 +![Code going into a computer.][1] + +在 Jim Hall 的_[不同的编程语言如何完成相同的事情][2]_文章中,他演示了 13 中不同的语言如何使用不同的语法来完成同一个任务。经验是,编程语言往往有很多相似之处。一旦你了解了一种编程语言,你就可以通过理解它的语法和结构来学习另一种。 + +本着同样的精神,Jim 的文章比较了不同编程语言如何读写数据。无论数据来自配置文件还是用户创建的文件,在存储设备上处理数据都是程序员的常见任务。但以这种方式涵盖所有编程语言是不切实际的,最近的 Opensource.com 系列文章提供了对这些编程语言采用的不同方法的深入了解: + + * [C][3] + * [C++][4] + * [Java][5] + * [Groovy][6] + * [Lua][7] + * [Bash][8] + * [Python][9] + + + +### 读写数据 + +用计算机读写数据的过程和你在现实生活中读写数据的过程类似。要访问书中的数据,你首先要打开它,然后阅读单词或将生词写入书中,然后合上书。 + +当程序需要从文件中读取数据时,你向程序传入一个文件位置,然后计算机将该数据读入 RAM 中并解析它。同样,当程序需要将数据写入文件时,计算机会将新数据放入系统的内存写入缓冲区,然后将其同步到存储设备上的文件中。 + +下面是这些操作的一些伪代码: + + 1. 在内存中加载文件。 + 2. 读取文件内容,或将数据写入文件。 + 3. 关闭文件。 + + + +### 从文件中读取数据 + +从 Opensource.com 系列文章的语言中,你可以看到读取文件的三种趋势。 + +#### C + +在 C 语言中,打开文件可能涉及检索单个字符,例如 `EOF` 指示符,表示文件结束,或数据块,具体取决于你的需求和方法。根据你的目标,它可能感觉像一个主要是手工的过程,但这正是其他语言所模仿的。 + + +```c +FILE *infile; +int ch; + +infile = fopen(argv[1], "r"); + +do { + ch = fgetc(infile); + if (ch != EOF) { + printf("%c", ch); + } + } while (ch != EOF); + +fclose(infile); +``` + +你还可以选择将文件的某些部分加载到系统缓冲区中,然后在缓冲区外工作。 + + +```c +FILE *infile; +char buffer[300]; + +infile = fopen(argv[1], "r"); + +while (!feof(infile)) { + size_t buffer_length; + buffer_length = fread(buffer, sizeof(char), 300, infile); +} + +printf("%s", buffer); +fclose(infile); +``` + +#### C++ + +C++ 简化了一些步骤,允许你将数据解析为字符串。 + + +```c++ +std::string sFilename = "example.txt"; + +std::ifstream fileSource(sFilename); +std::string buffer; + +while (fileSource >> buffer) { + std::cout << buffer << std::endl; +} +``` + +#### Java + +Java 和 Groovy 和 C++ 类似。它们使用名为 `Scanner` 的类来设置数据流或对象,这样就会包含你选择的文件内容。你可以通过标记(字节、行、整数等)扫描文件。 + + +```java +File myFile = new File("example.txt"); + +Scanner myScanner = new Scanner(myFile); + while (myScanner.hasNextLine()) { + String line = myScanner.nextLine(); + System.out.println(line); + } + +myScanner.close(); +``` + +#### Groovy + + +```groovy +def myFile = new File('example.txt') + +def myScanner = new Scanner(myFile) + while (myScanner.hasNextLine()) { + def line = myScanner.nextLine() + println(line) + } + +myScanner.close() +``` + +#### Lua + +Lua 和 Python 进一步抽象了整个过程。你不必有意识地创建数据流,你只需给一个变量赋值为 `open` 函数的返回值,然后解析该变量的内容。这种方式快速,最简且容易。 + + +```lua +myFile = io.open('example.txt', 'r') + +lines = myFile:read("*all") +print(lines) + +myFile:close() +``` + +#### Python + + +```python +f = open('example.tmp', 'r') + +for line in f: + print(line) + +f.close() +``` + +### 向文件中写入数据 + +就写代码来说,写入是读取的逆过程。因此,将数据写入文件的过程与从文件中读取数据基本相同,只是使用了不同的函数。 + +#### C + +在 C 语言中,你可以使用 `fputc` 函数将字符写入文件: + + +```c +fputc(ch, outfile); +``` + +或者,你可以使用 `fwrite` 将数据写入缓冲区。 + + +```c +fwrite(buffer, sizeof(char), buffer_length, outfile); +``` + +#### C++ + +因为 C++ 使用 `ifstream` 库为数据打开缓冲区,所以你可以像 C 语言那样将数据写入缓冲区(C++ 库除外)。 + + +```c++ +std::cout << buffer << std::endl; +``` + +#### Java + +在 Java 中,你可以使用 `FileWriter` 类来创建一个可以写入数据的对象。它的工作方式与 `Scanner` 类非常相似,只是方向相反。 + + +```java +[FileWriter][19] myFileWriter = new [FileWriter][19]("example.txt", true); +myFileWriter.write("Hello world\n"); +myFileWriter.close(); +``` + +#### Groovy + +类似地,Groovy 使用 `FileWriter`,但使用了稍微 "groovy" 的语法。 + + +```groovy +new FileWriter("example.txt", true).with { + write("Hello world\n") + flush() +} +``` + +#### Lua + +Lua 和 Python 很相似,都使用名为 `open` 的函数来加载文件,`writer` 函数来写入数据,`close` 函数用于关闭文件。 + + +```Lua +myFile = io.open('example.txt', 'a') +io.output(myFile) +io.write("hello world\n") +io.close(myFile)xxxxxxxxxx myFile = io.open('example.txt', 'a')io.output(myFile)io.write("hello world\n")io.close(myFile)myFile = io.open('example.txt', 'a')io.output(myFile)io.write("hello world\n")io.close(myFile) +``` + +#### Python + + +```python +myFile = open('example.txt', 'w') +myFile.write('hello world') +myFile.close() +``` + +### File 模式 + +许多语言在打开文件时会指定一个“模式”。模式有很多,但这是常见的定义: + + * **w** 表示写入 + * **r** 表示读取 + * **r+** 表示可读可写 + * **a** 表示追加 + +某些语言,例如 Java 和 Groovy,允许你根据用于加载文件的类来确定模式。 + +无论编程语言以何种方式来确定文件模式,你都需要确保你是在 _追加_ 数据,除非你打算用新数据覆盖文件。编程语言不像文件选择器那样,没有内置的提示来警告你防止数据丢失。 + +### 新语言和旧把戏 + +每种编程语言都有其独特完成任务的方式,这就是为什么有这么多语言可供选择。你可以而且应该选择最合适你的语言。但是,你一旦了解了编程的基本结构,你可以随意尝试其他语言,而不必担心不知道如何完成基本任务。通常情况下,实现目标的途径是相似的,所以只要你牢记基本概念,它们就很容易学习。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/programming-read-write + +作者:[Alan Smithee][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 "Code going into a computer." +[2]: https://opensource.com/article/21/4/compare-programming-languages +[3]: https://opensource.com/article/21/3/file-io-c +[4]: https://opensource.com/article/21/3/ccc-input-output +[5]: https://opensource.com/article/21/3/io-java +[6]: https://opensource.com/article/21/4/groovy-io +[7]: https://opensource.com/article/21/3/lua-files +[8]: https://opensource.com/article/21/3/input-output-bash +[9]: https://opensource.com/article/21/6/reading-and-writing-files-python +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html +[14]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html +[15]: http://www.opengroup.org/onlinepubs/009695399/functions/fread.html +[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file +[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter \ No newline at end of file From 1feac8a4dc4578ec5be8d392eb88bf91b8e9df36 Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Sun, 18 Jul 2021 22:50:44 +0800 Subject: [PATCH 489/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rence between a fork and a distribution.md | 81 ------------------- 1 file changed, 81 deletions(-) delete mode 100644 sources/talk/20180713 What-s the difference between a fork and a distribution.md diff --git a/sources/talk/20180713 What-s the difference between a fork and a distribution.md b/sources/talk/20180713 What-s the difference between a fork and a distribution.md deleted file mode 100644 index f7f50e014b..0000000000 --- a/sources/talk/20180713 What-s the difference between a fork and a distribution.md +++ /dev/null @@ -1,81 +0,0 @@ -What's the difference between a fork and a distribution? -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG) - -If you've been around open source software for any length of time, you'll hear the terms fork and distribution thrown around casually in conversation. For many people, the distinction between the two isn't clear, so here I'll try to clear up the confusion. - -### First, some definitions - -Before explaining the nuances of a fork vs. a distribution and the pitfalls thereof, let's define key concepts. - -**[Open source software][1]** is software that: - - * Is freely available to distribute under certain [license][2] restraints - * Permits its source code to be viewable and modified under certain license restraints - - - -Open source software can be **consumed** in the following ways: - - * Downloaded in binary or source code format, often at no charge (e.g., the [Eclipse developer environment][3]) - * As a distribution (product) by a vendor, sometimes at a cost to the user (e.g., [Red Hat products][4]) - * Embedded into proprietary software solutions (e.g., some smartphones and browsers display fonts using the open source [freetype software][5]) - - - -**Free and open source (FOSS)** is not necessarily "free" as in "zero cost." Free and open source simply means the software is free to distribute, modify, study, and use, subject to the software's licensing. The software distributor may attach a purchase price to it. For example, Linux is available at no cost as Fedora, CentOS, Gentoo, etc. or as a paid distribution as Red Hat Enterprise Linux, SUSE, etc. - -**Community** refers to the organizations and individuals that collaboratively work on an open source project. Any individual or organization can contribute to the project by writing or reviewing code, documentation, test suites, managing meetings, updating websites, etc., provided they abide by the license. For example, at [Openhub.net][6], we see government, nonprofit, commercial, and education organizations [contributing to some open source projects][7]. - -**project** is the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed. - -An open sourceis the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed. - -A **distribution** is a copy, in binary or source code format, of an open source project. For example, CentOS, Fedora, Red Hat Enterprise Linux, SUSE, Ubuntu, and others are distributions of the Linux project. Tectonic, Google Kubernetes Engine, Amazon Container Service, and Red Hat OpenShift are distributions of the Kubernetes project. - -Vendor distributions of open source projects are often called **products** , thus Red Hat OpenStack Platform is the Red Hat OpenStack product that is a distribution of the OpenStack upstream project—and it is still 100% open source. - -The **trunk** is the main workstream in the community where the open source project is developed. - -An open source **fork** is a version of the open source project that is developed along a separate workstream from the main trunk. - -Thus, **a distribution is not the same as a fork**. A distribution is a packaging of the upstream project that is made available by vendors, often as products. However, the core code and documentation in the distribution adhere to the version in the upstream project. A fork—and any distribution based on the fork—results in a version of the code and documentation that are different from the upstream project. Users who have forked upstream open source code have to maintain it on their own, meaning they lose the benefit of the collaboration that takes place in the upstream community. - -To further explain a software fork, let's use the analogy of migrating animals. Whales and sea lions migrate from the Arctic to California and Mexico; Monarch butterflies migrate from Alaska to Mexico; and (in the Northern Hemisphere) swallows and many other birds fly south for the winter. The key to a successful migration is that all animals in the group stick together, follow the leaders, find food and shelter, and don't get lost. - -### Risks of going it on your own - -A bird, butterfly, or whale that strays from the group loses the benefit of remaining with the group and knowing where to find food, shelter, and the desired destination. - -Similarly, users or organizations that fork and modify an upstream project and maintain it on their own run the following risks: - - 1. **They cannot update their code based on the upstream because their code differs.** This is known as technical debt; the more changes made to forked code, the more it costs in time and money to rebase the fork to the upstream project. - 2. **They potentially run less secure code.** If a vulnerability is found in open source code and fixed by the community in the upstream, a forked version of the code may not benefit from this fix because it is different from the upstream. - 3. **They might not benefit from new features.** The upstream community, using input from many organizations and individuals, creates new features for the benefit of all users of the upstream project. If an organization forks the upstream, they potentially cannot incorporate the new features because their code differs. - 4. **They might not integrate with other software packages.** Open source projects are rarely developed as single entities; rather they often are packaged together with other projects to create a solution. Forked code may not be able to be integrated with other projects because the developers of the forked code are not collaborating in the upstream with other participants. - 5. **They might not certify on hardware platforms.** Software packages are often certified to run on hardware platforms so, if problems arise, the hardware and software vendors can collaborate to find the root cause or problem. - - - -In summary, an open source distribution is simply a packaging of an upstream, multi-organizational, collaborative open source project sold and supported by a vendor. A fork is a separate development workstream of an open source project and risks not being able to benefit from the collaborative efforts of the upstream community. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/7/forks-vs-distributions - -作者:[Jonathan Gershater][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/jgershat -[1]:https://opensource.com/resources/what-open-source -[2]:https://opensource.com/tags/licensing -[3]:https://www.eclipse.org/che/getting-started/download/ -[4]:https://access.redhat.com/downloads -[5]:https://www.freetype.org/ -[6]:http://openhub.net -[7]:https://www.openhub.net/explore/orgs From 66c79c5c315ea7a76d2977f1c2a64efd6b793a20 Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Sun, 18 Jul 2021 23:16:15 +0800 Subject: [PATCH 490/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rence between a fork and a distribution.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 translated/20180713 What-s the difference between a fork and a distribution.md diff --git a/translated/20180713 What-s the difference between a fork and a distribution.md b/translated/20180713 What-s the difference between a fork and a distribution.md new file mode 100644 index 0000000000..57b08ffcf6 --- /dev/null +++ b/translated/20180713 What-s the difference between a fork and a distribution.md @@ -0,0 +1,82 @@ +Wlzzzz-del is translating. +What's the difference between a fork and a distribution? +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG) + +If you've been around open source software for any length of time, you'll hear the terms fork and distribution thrown around casually in conversation. For many people, the distinction between the two isn't clear, so here I'll try to clear up the confusion. + +### First, some definitions + +Before explaining the nuances of a fork vs. a distribution and the pitfalls thereof, let's define key concepts. + +**[Open source software][1]** is software that: + + * Is freely available to distribute under certain [license][2] restraints + * Permits its source code to be viewable and modified under certain license restraints + + + +Open source software can be **consumed** in the following ways: + + * Downloaded in binary or source code format, often at no charge (e.g., the [Eclipse developer environment][3]) + * As a distribution (product) by a vendor, sometimes at a cost to the user (e.g., [Red Hat products][4]) + * Embedded into proprietary software solutions (e.g., some smartphones and browsers display fonts using the open source [freetype software][5]) + + + +**Free and open source (FOSS)** is not necessarily "free" as in "zero cost." Free and open source simply means the software is free to distribute, modify, study, and use, subject to the software's licensing. The software distributor may attach a purchase price to it. For example, Linux is available at no cost as Fedora, CentOS, Gentoo, etc. or as a paid distribution as Red Hat Enterprise Linux, SUSE, etc. + +**Community** refers to the organizations and individuals that collaboratively work on an open source project. Any individual or organization can contribute to the project by writing or reviewing code, documentation, test suites, managing meetings, updating websites, etc., provided they abide by the license. For example, at [Openhub.net][6], we see government, nonprofit, commercial, and education organizations [contributing to some open source projects][7]. + +**project** is the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed. + +An open sourceis the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed. + +A **distribution** is a copy, in binary or source code format, of an open source project. For example, CentOS, Fedora, Red Hat Enterprise Linux, SUSE, Ubuntu, and others are distributions of the Linux project. Tectonic, Google Kubernetes Engine, Amazon Container Service, and Red Hat OpenShift are distributions of the Kubernetes project. + +Vendor distributions of open source projects are often called **products** , thus Red Hat OpenStack Platform is the Red Hat OpenStack product that is a distribution of the OpenStack upstream project—and it is still 100% open source. + +The **trunk** is the main workstream in the community where the open source project is developed. + +An open source **fork** is a version of the open source project that is developed along a separate workstream from the main trunk. + +Thus, **a distribution is not the same as a fork**. A distribution is a packaging of the upstream project that is made available by vendors, often as products. However, the core code and documentation in the distribution adhere to the version in the upstream project. A fork—and any distribution based on the fork—results in a version of the code and documentation that are different from the upstream project. Users who have forked upstream open source code have to maintain it on their own, meaning they lose the benefit of the collaboration that takes place in the upstream community. + +To further explain a software fork, let's use the analogy of migrating animals. Whales and sea lions migrate from the Arctic to California and Mexico; Monarch butterflies migrate from Alaska to Mexico; and (in the Northern Hemisphere) swallows and many other birds fly south for the winter. The key to a successful migration is that all animals in the group stick together, follow the leaders, find food and shelter, and don't get lost. + +### Risks of going it on your own + +A bird, butterfly, or whale that strays from the group loses the benefit of remaining with the group and knowing where to find food, shelter, and the desired destination. + +Similarly, users or organizations that fork and modify an upstream project and maintain it on their own run the following risks: + + 1. **They cannot update their code based on the upstream because their code differs.** This is known as technical debt; the more changes made to forked code, the more it costs in time and money to rebase the fork to the upstream project. + 2. **They potentially run less secure code.** If a vulnerability is found in open source code and fixed by the community in the upstream, a forked version of the code may not benefit from this fix because it is different from the upstream. + 3. **They might not benefit from new features.** The upstream community, using input from many organizations and individuals, creates new features for the benefit of all users of the upstream project. If an organization forks the upstream, they potentially cannot incorporate the new features because their code differs. + 4. **They might not integrate with other software packages.** Open source projects are rarely developed as single entities; rather they often are packaged together with other projects to create a solution. Forked code may not be able to be integrated with other projects because the developers of the forked code are not collaborating in the upstream with other participants. + 5. **They might not certify on hardware platforms.** Software packages are often certified to run on hardware platforms so, if problems arise, the hardware and software vendors can collaborate to find the root cause or problem. + + + +In summary, an open source distribution is simply a packaging of an upstream, multi-organizational, collaborative open source project sold and supported by a vendor. A fork is a separate development workstream of an open source project and risks not being able to benefit from the collaborative efforts of the upstream community. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/7/forks-vs-distributions + +作者:[Jonathan Gershater][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[译者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/jgershat +[1]:https://opensource.com/resources/what-open-source +[2]:https://opensource.com/tags/licensing +[3]:https://www.eclipse.org/che/getting-started/download/ +[4]:https://access.redhat.com/downloads +[5]:https://www.freetype.org/ +[6]:http://openhub.net +[7]:https://www.openhub.net/explore/orgs From aa2f2891da9bc7270c8d9dec6deef0da51d286e5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Jul 2021 23:17:29 +0800 Subject: [PATCH 491/870] PUB @zepoch @turbokernel https://linux.cn/article-13595-1.html --- ... good examples by starting with real code.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) rename {translated/tech => published}/20210708 Write good examples by starting with real code.md (87%) diff --git a/translated/tech/20210708 Write good examples by starting with real code.md b/published/20210708 Write good examples by starting with real code.md similarity index 87% rename from translated/tech/20210708 Write good examples by starting with real code.md rename to published/20210708 Write good examples by starting with real code.md index 92e26cc9f6..0815d4e4d4 100644 --- a/translated/tech/20210708 Write good examples by starting with real code.md +++ b/published/20210708 Write good examples by starting with real code.md @@ -4,12 +4,14 @@ [#]: collector: "lujun9972" [#]: translator: "zepoch" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13595-1.html" 从实际代码开始编写好的示例 ====== +![](https://img.linux.net.cn/data/attachment/album/202107/18/231616z1hhcerhrk3wzwkr.jpg) + 当编写程序时,我花费了大量时间在编写好的示例上。我从未见过有人写过关于如何写出好的示例,所以我就写了一下如何写出一份好的示例。 基础思路就是从你写的真实代码开始,然后删除不相关的细节,使其成为一个独立的例子,而不是无中生有地想出一些例子。 @@ -27,7 +29,7 @@ squares = map(lambda x: x * x, numbers) 我觉得这个示例不是真实的,有如下两方面的原因: - * 将一组数字作平方运算不是在真实的程序中完成的事,除非是项目 Euler 或某种东西(更多的可能是针对列表的操作) + * 将一组数字作平方运算不是在真实的程序中完成的事,除非是欧拉项目或某种东西(更多的可能是针对列表的操作) * `map` 在 Python 中并不常用,即便是做这个我也更愿意写 `[x*x for x in numbers]` 一个更加真实的 Python lambdas 的示例是使用 `sort` 函数,就像这样: @@ -50,20 +52,19 @@ sorted_children = sorted(children, key=lambda x: x['age']) * `sorted_keysizes = sorted(scores.keys(), key=scores.get)` * `shows = sorted(dates[date], key=lambda x: x['time']['performanceTime'])` -在这里很容易看到一个规律——这些基本是按时间排序的!因此,您可以明白如何将按时间排序的某些对象(电子邮件、事件等)的简单实例轻松地放在一起。 +在这里很容易看到一个规律——这些基本是按时间排序的!因此,你可以明白如何将按时间排序的某些对象(电子邮件、事件等)的简单实例轻松地放在一起。 -### 现实的例子有助于"布道"你试图解释的概念 +### 现实的例子有助于“布道”你试图解释的概念 当我试图去解释一个想法(就好比 Python Lambdas)的时候,我通常也会试图说服读者,说这是值得学习的想法。Python lambdas 是如此的有用!当我去试图说服某个人 lambdas 是很好用的时候,让他想象一下 lambdas 如何帮助他们完成一项他们将要去做的任务或是以及一项他们以前做过的任务,对说服他会很有帮助。 ### 从真实代码中提炼出示例可能需要很长时间 - 我给出如何使用 `lambda` 和 `sort` 函数的解释例子是十分简单的,它并不需要花费我很长时间来想出来,但是将真实的代码提炼出为一个独立的示例则是会需要花费很长的时间! 举个例子,我想在这篇文章中融入一些奇怪的 CSS 行为的例子来说明创造一个奇怪的案例是十分有趣的。我花费了两个小时来解决我这周遇到的一个实际的问题,确保我理解 CSS 的实际情况,并将其变成一个小示例。 -最后,它“仅仅”用了[五行 HTML 和一点点的 CSS][1] 来说明了这个问题,看起来并不想是我花费了好多小时写出来的。但是最初它却是几百行的 JS/CSS/JavaScript,它需要花费很长时间来将所有的代码化为核心的很少的代码。 +最后,它“仅仅”用了 [五行 HTML 和一点点的 CSS][1] 来说明了这个问题,看起来并不想是我花费了好多小时写出来的。但是最初它却是几百行的 JS/CSS/JavaScript,它需要花费很长时间来将所有的代码化为核心的很少的代码。 但我认为花点时间把示例讲得非常简单明了是值得的——如果有成百上千的人在读你的示例,你就节省了他们这么多时间! @@ -74,8 +75,6 @@ sorted_children = sorted(children, key=lambda x: x['age']) * 可以更多的改变人的思维而不是直接提供使用的惊喜读者的示例代码 * 易于复制粘贴以用作初始化的示例 - - 也许有一天我还会再写一些呢? :) -------------------------------------------------------------------------------- From d905ca3d0b8e8ef1c8c0943df7b648e6cceb0dc9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 19 Jul 2021 05:03:47 +0800 Subject: [PATCH 492/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210718=20?= =?UTF-8?q?17=20open=20source=20technologists=20share=20their=20work-from-?= =?UTF-8?q?home=20uniforms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210718 17 open source technologists share their work-from-home uniforms.md --- ...sts share their work-from-home uniforms.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20210718 17 open source technologists share their work-from-home uniforms.md diff --git a/sources/tech/20210718 17 open source technologists share their work-from-home uniforms.md b/sources/tech/20210718 17 open source technologists share their work-from-home uniforms.md new file mode 100644 index 0000000000..b8dd681da9 --- /dev/null +++ b/sources/tech/20210718 17 open source technologists share their work-from-home uniforms.md @@ -0,0 +1,117 @@ +[#]: subject: (17 open source technologists share their work-from-home uniforms) +[#]: via: (https://opensource.com/article/21/7/work-home-uniforms) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +17 open source technologists share their work-from-home uniforms +====== +Nerdwear of the technically employed. What's your style? +![Taking a walk outside][1] + +As the world turns and some folks begin returning to the office, I feel it's a good time to ask our community of open source techies: _What's your work-from-home (WFH) uniform?_ + +Do you dress like you would if you were going into the office? Or are you more comfortable in workout clothes or even your PJs? Do you have a template you stick to most days? + +I have a format that helps me feel both productive and comfortable, and if I need to run an errand in public, I don't have to change first: A clean, nice-fitting shirt (T-shirts are OK) on top of comfortable pants (yoga is OK but not pajama). I've leaned into my stash of T-shirts from fun conferences I've attended with people I miss seeing and locales in my home state that make me proud. + +Some Opensource.com friends and contributors weigh in on their work-from-home uniforms below. What's yours? + +* * * + +Over the last eight years, I've learned that if I try to work in my PJs, I will get nothing done. In warm weather, I'm in shorts (cargo, of course) and a T-shirt. In cooler weather, it's jeans and a T-shirt with a sweater or hoodie. Never shoes, but I'll wear socks once my feet start getting cold. —[Ben Cotton][2] + +Last winter, I un-ironically told two friends: "I miss my clothes." Most of my wardrobe went untouched for a year, not because I had outgrown or no longer liked my outfits, but because I had nowhere to wear them. Working from home means I'm exercising at least once before, during, or after work. Between walking a (very brisk-paced) dog and taking a class at the gym on my lunch break, I often work in sneakers complete with bike shorts and a tank top. But when the situation calls, I can pop a cardigan on to look more professional. —[Lauren Maffeo][3] + +Before the pandemic, I tried dressing like I was going to do something that day. WFH was a privilege, and I really appreciated it, as it afforded me the ability to take care of my needs and work at the same time. Once the pandemic hit though, it became tiring to put on a front that I was going somewhere because, well, no one was. Most of the time, I'm wearing a Red Hat or Kubernetes/Cloud Native T-shirt and workout shorts. I live in Michigan, though, so those shorts get swapped out for joggers when it's cold. But that's pretty rare given my office is pretty warm thanks to all the computers. Oh, and slippers, like right now because my feet are cold for some reason. —[Chris Short][4] + +My WFW (work from work) uniform was always conference T's, jeans/cargo pants, and sandals or sneakers. So, my wardrobe hasn't changed... Well, that's not exactly true: Having not replenished my supply of conference T's, some of them have become a bit ratty, but I'm not on camera. And my hair is a bit messier. Sidenote: The New York Times had a recent [article][5] on a slide in hygiene and grooming during COVID, and, according to the article, many are saying they're going to remain a bit sloppier post-COVID. —[Kevin Cole][6] + +I used to wear suits and professional woman's wear for the office. Now I get to go back to the tech WFH uniform: nerd shirt, pants/skirt. Often I add a scarf to jazz it up for video. I wear shoes because my feet get cold. My colleagues mock me, but I do my hair and makeup every day. How I missed all my nerdware and hoodies due to "serious non-tech office jobs." —[Heather Leson][7] + +I try to stay dressed at home like there could be a strong reason to go out at short notice with my shoes and go-bag near the door. Too many years living in earthquake country, I guess. —[Stefano Maffulli][8] + +I wear pajamas most of the time, but I keep a "video shirt" ready in case I need to go on video for some reason. For a template, my day is driven by the calls and meetings on my calendar. During my breaks there, I'll run up and down the stairs a few times just to stretch my legs. —[Peter Gervase][9] + +No video meetings for me, but shorts and T-shirts are the regular. Jeans when it's colder. —[Bob Murphy][10] + +I love playing around with color, so I wear five different colored tops (mostly not ironed) for five days, paired with comfortable cotton pants. I love my earrings, so I match my tops and earrings. Every now and then, I do wear my jeans and other formal outfits to make sure that I fit into them. —[Nimisha Mukherjee][11] + +I start my day in gym clothes because I squeeze in a morning workout before I hit the keyboard. My current WFH uniform is a T-shirt or polo and shorts. I try to wear shorts as much as I can when I WFH. In fall and winter, I stick to chamois shirts, fleeces, and jeans. I end my day back in gym clothes because I hit the gym four out of five nights during the week. —[Will Kelly][12] + +My WFH outfit is the same as my office outfit: knit shirts and jeans. Unlike some of my colleagues, I have not grown a beard and let my hair get long and shaggy. A bike racer I knew once said, "You dress like a bum, you ride like a bum," and I feel the same is true for me: "You dress like a bum, you work like a bum." —[Gary Smith][13] + +I learned long ago when I started full-time remote work, that I needed to do the whole "get up, get ready, get dressed like you were going into the office" thing, providing some structure to my day and to get my head in "the right place" for work. Jeans, T-shirt, socks, boots (or shoes, but mostly boots1), and my ever-present head wrap. I don't know about everyone else, but I have a space that is dedicated for work, and I have my EDC2 bag that I take to and from my home office with my personal belongings, the same as I would any other job. When it is time to stop working, I pick up my bag and take it with me as a signal to myself that I'm done for the day. —[Kevin Sonney][14] +1 You keep livestock, you wear boots. I'm sure you can guess why. +2 "Every-day carry" + +I get up every morning at about the same time, around 7:30am, and get dressed in comfortable, casual clothes. I've been doing this for the last eight years since I retired. I have a light breakfast, and in the summer, I walk between four and five miles. Then I return home and begin my morning routine of juice or tea and toast, then checking email, attending meetings (more on Zoom or other virtual platforms this year). Keeping a routine is important to me, and dressing comfortably is, too. —[Don Watkins][15] + +At one point in my life, I was a chef. So, I have a bunch of chef pants, which are really comfortable but not stylish. I've been wearing them over the winter combined with some of my "ugliest" conference T-shirts. A couple of years ago, a coworker visited Russia and was staying with a family that had a grandmother who loved knitting wool socks. So, he brought wool socks back for everyone. So, ugly chef pants, ugly conference T-shirt, and wool socks hand-knitted by a Russian grandma. —[Craig Sebenik][16] + +My WFH uniform is not much different from my regular outfit. I like to be comfortable, no matter if I'm at home or talking in front of a thousand people at a conference. That means that I'm in T-shirts all around the year, no matter if it's WFH or a large IT event. It's one of the perks of being an engineer, not in sales or management. The only difference is that I wear jeans in public and something more comfortable, like sports pants, at home. —[Peter Czanik][17] + +It has been at least 30 years since I wore suits, then (for a while) "business casual." Most days now, I start early in my jammies. Wednesdays, I start with my yoga pants and top because my online yoga class starts at 9:30. Other days I change into jeans or cargo shorts and a solid black, conference, or other geeky T-shirt after breakfast. I always shave because that is one thing that makes me feel civilized. I am "retired," so I don't feel any need at all to have a different video presence other than my "normal" mode of dress. Besides, the only video meetings I attend are the Opensource.com and Enable Sysadmin weekly writer calls. —[David Both][18] + +The only rule is there are no rules! I wear whatever I want, mostly a Red Hat T-shirt and shorts or jogging pants. If I have an important meeting, I try to be more presentable. —[Kedar Vijay Kulkarni][19] + +Before walking the dogs, I am in sleepwear and a dressing gown while eating toast and having that first coffee. After the dog walk, I'm in shorts/polo/T-shirt if it's warm enough, or jeans/cargo pants if it's colder. I tend towards classic Shadowman shirts if I'm not on customer calls or major internal briefings, and the newer Red Hat logo-based shirts if I need official branding. Sadly, we're heading into winter here in New Zealand, so hoodies and jeans are starting to become a bit more normal. For my 3am calls with the United States, I've got a snug dressing gown and a warm drink. —[Steven Ellis][20] + +Thanks to the Opensource.com Correspondent program, here's my Spring, Summer, Fall, and Winter uniform. —[Chris Hermansen][21] + +![Opensource.com swag, a spring outfit][22] + +  + +![Opensource.com swag, a winter outfit][23] + +  + +![Opensource.com swag, a summer outfit][24] + +Summer + +* * * + +What's your WFH uniform? Are you in a T-shirt and pajama pants, or do you dress as if you're going into the office? Please share your remote work attire in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/work-home-uniforms + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/walking_selfcare_wfh_outside_520.png?itok=64WmWspJ (Taking a walk outside) +[2]: https://opensource.com/users/bcotton +[3]: https://opensource.com/users/lmaffeo +[4]: https://opensource.com/users/chrisshort +[5]: https://www.nytimes.com/2021/05/06/health/shower-bathing-pandemic.html +[6]: https://opensource.com/users/kjcole +[7]: https://opensource.com/users/hleson +[8]: https://opensource.com/users/reed +[9]: https://opensource.com/users/pgervase +[10]: https://opensource.com/users/murph +[11]: https://opensource.com/users/nimisha +[12]: https://opensource.com/users/willkelly +[13]: https://opensource.com/users/greptile +[14]: https://opensource.com/users/ksonney +[15]: https://opensource.com/users/don-watkins +[16]: https://opensource.com/users/craig5 +[17]: https://opensource.com/users/czanik +[18]: https://opensource.com/users/dboth +[19]: https://opensource.com/users/kkulkarn +[20]: https://opensource.com/users/steven-ellis +[21]: https://opensource.com/users/clhermansen +[22]: https://opensource.com/sites/default/files/uploads/spring_2.jpg (Opensource.com swag, a spring outfit) +[23]: https://opensource.com/sites/default/files/uploads/winter.jpg (Opensource.com swag, a winter outfit) +[24]: https://opensource.com/sites/default/files/uploads/summer.jpg (Opensource.com swag, a summer outfit) From 946336e250c3a7760e89ae1b02a43c7ced201add Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 19 Jul 2021 05:04:19 +0800 Subject: [PATCH 493/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210718=20?= =?UTF-8?q?Is=20Open-Source=20Software=20Secure=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210718 Is Open-Source Software Secure.md --- ...20210718 Is Open-Source Software Secure.md | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 sources/news/20210718 Is Open-Source Software Secure.md diff --git a/sources/news/20210718 Is Open-Source Software Secure.md b/sources/news/20210718 Is Open-Source Software Secure.md new file mode 100644 index 0000000000..d6d249b54b --- /dev/null +++ b/sources/news/20210718 Is Open-Source Software Secure.md @@ -0,0 +1,163 @@ +[#]: subject: (Is Open-Source Software Secure?) +[#]: via: (https://news.itsfoss.com/open-source-software-security/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Is Open-Source Software Secure? +====== + +Being someone who prefers [Linux for desktop][1] and encourages using open-source software, you may expect the answer to the question raised in the headline with a big “**Yes**“. + +But I am not going to limit discussing the benefits of open-source software. Let us explore more! + +Here, I plan to share my thoughts on if open-source software is secure and what are the things involved in it that make secure or insecure. + +### Why Should You Care if Open-Source Software is Secure? + +No matter whether you use [Linux][2] or any other operating system, you will be surrounded with open-source software in some way (directly/indirectly). + +To give you an example, most of the proprietary software tools depend on some form of open-source libraries to make things work. + +Furthermore, there is a reason why companies of various scale (including Google, Microsoft, and Facebook) rely on open-source software or contribute their resources to the open-source community in one way or the other. + +Hence, the security of open-source software is something essential to know about. + +### Myths About Open-Source Software Security + +![][3] + +While there are several arguments to pitch the cons of open-source software in terms of security, some of them just do not make any sense. + +#### Anyone Can See & Exploit the Code + +The code is accessible to everyone, yes. But just because you can see the code—does that mean anyone can exploit it? + +**Not really.** + +Even though anyone can create a fork (or copy) of the software, the original software cannot be manipulated easily. + +Usually, the project maintainer (or a group of them) manage the code repository and accept the commits from contributors. The code is reviewed before approval. And no one can hijack the code just like that. + +**It takes effort for an attacker to exploit a vulnerability or add malicious code in a software, no matter if it is open-source or closed source.** + +#### Without Dedicated Resources, Security Breaks down + +Many believe that without dedicated employees or a team for an open-source software, it is difficult to maintain security. + +In contrast, with several types of contributors joining and leaving, the software gets more attention from a wide range of developers. + +And they may be able to spot security issues better than a few employees assigned for a proprietary software. + +Some projects from the likes of Mozilla have a dedicated team to effectively iron out security issues. Similarly, most of the successful open source projects have plenty of resources to dedicate for security. + +Hence, the open-source software ecosystem is a mixed bag for security. Even without dedicated resources, the projects get help from various contributors, and some are profitable to a great extent which helps them dedicate more resources. + +### Open Source Software is Secure: Here’s How + +![][3] + +Now that we have tackled the myths, let me highlight how open-source software deals with security issues. + +In other words, the benefits in security with open-source software. + +Not to forget, the perks of open-source software translate to some of the reasons why [Linux is better than Windows][4]. + +#### More Eyes Looking at the Code + +Unlike a proprietary software, access to code is not limited to a few developers. + +Some projects may even have thousands of developers watching the code, reviewing them, and flagging or fixing security issues. + +And this gives an edge over closed-source software by having **the ability to identify issues quickly and addressing them as soon as possible.** + +Not just limited to more developers, often enterprises get involved with open-source projects that they utilize. And when they do, they will also go through the code and review it. + +This gives another source of external audit that may help improve the security of the software. + +In contrast, with a closed-source software, a limited number of developers may not be able to find all kinds of security issues. And it may take them longer to fix all the issues one by one. + +#### Community Decision Making to Prioritize Security Issues + +The developers of a closed-source software may have certain restrictions and priorities as what to work on and when to resolve an issue. + +However, in case of an open-source project, the community of contributors can prioritize and assign themselves what they want to work on and when to fix an issue. You do not need to depend on a vendor or follow their instructions to address a security issue. + +The decision making that goes into addressing and fixing the security issues is more transparent and flexible in case of an open-source software. Hence, it can prove to be more effective leaving you with three specific benefits: + + * **Transparency** + * **No dependency on the vendor** + * **Faster security updates** + + + +### Open Source Software is not Bulletproof: Here’s Why + +![][3] + +While there are cases where open-source software may get an edge for security, there could be instances or factors that affects it. + +It is important to acknowledge that these problems exist, accordingly, an enterprise or an individual can make better decision about the state of security for an open-source software. + +#### Not enough Eyes to Review Code and Uncertainty + +Even if the code is accessible the world of developers, there are chances that a **project does not have enough contributors/developers to thoroughly review the code**. + +In that case, we cannot have great confidence of an open-source software being peer-reviewed, because it lacks exactly that. + +The open-source software may “claim” to have the best security just because its open-source, which is misleading when there are not enough developers working on it. + +Also, we do not know how many developers are looking/reviewing the code and how exactly the code walkthrough is going on. + +For instance, the Heartbleed bug was spotted after 2 years of its introduction in a project that was already popular i.e **OpenSSL**. + +#### Software Responsibility or Accountability + +This may not be important for individuals, but an **open-source software often comes with no warranties**. + +So, if a business uses it, they must take the responsibility of any losses or damages caused by the use of that software. + +This is something that tells you that nothing can be 100% secure and bug-free. No matter how many eyes you have on a code, or how skilled the contributors are, there will be risks in some form, be it security or data loss. + +And this brings us to the fact that open-source software is not bulletproof. + +### Open Source May Have its Edge for Better Security But… + +Nothing is superior when it comes to security. No matter if it is closed-source or open-source, the same set of principles apply when it comes to security. + +There are various external factors that can affect the security of a software, and **many of those are not source dependent**. + +The code must be monitored in the same way to keep things secure. + +Yes, the **open-source approach introduces benefits that closed-source software will never have**, but that does not mean that it is bulletproof. + +_What do you think about the state of security when it comes to open-source software?_ _Do you think it is superior to proprietary solutions?_ + +I would appreciate your valuable thoughts in the comments down below. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/open-source-software-security/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/ +[2]: https://itsfoss.com/what-is-linux-distribution/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://itsfoss.com/linux-better-than-windows/ From 2e7f2bf2252ccb8344976993c4845fdcb828c6bf Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Mon, 19 Jul 2021 06:49:29 +0800 Subject: [PATCH 494/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...713 What-s the difference between a fork and a distribution.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated => sources/talk}/20180713 What-s the difference between a fork and a distribution.md (100%) diff --git a/translated/20180713 What-s the difference between a fork and a distribution.md b/sources/talk/20180713 What-s the difference between a fork and a distribution.md similarity index 100% rename from translated/20180713 What-s the difference between a fork and a distribution.md rename to sources/talk/20180713 What-s the difference between a fork and a distribution.md From 6488359208b5d3d70a178e5a9541a7346fbd0310 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 19 Jul 2021 07:42:22 +0800 Subject: [PATCH 495/870] Rename sources/tech/20210718 17 open source technologists share their work-from-home uniforms.md to sources/talk/20210718 17 open source technologists share their work-from-home uniforms.md --- ...en source technologists share their work-from-home uniforms.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210718 17 open source technologists share their work-from-home uniforms.md (100%) diff --git a/sources/tech/20210718 17 open source technologists share their work-from-home uniforms.md b/sources/talk/20210718 17 open source technologists share their work-from-home uniforms.md similarity index 100% rename from sources/tech/20210718 17 open source technologists share their work-from-home uniforms.md rename to sources/talk/20210718 17 open source technologists share their work-from-home uniforms.md From 10981ef26a128e17e9825b6e4ab24ac61faa157f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 19 Jul 2021 07:43:44 +0800 Subject: [PATCH 496/870] Rename sources/news/20210718 Is Open-Source Software Secure.md to sources/talk/20210718 Is Open-Source Software Secure.md --- sources/{news => talk}/20210718 Is Open-Source Software Secure.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210718 Is Open-Source Software Secure.md (100%) diff --git a/sources/news/20210718 Is Open-Source Software Secure.md b/sources/talk/20210718 Is Open-Source Software Secure.md similarity index 100% rename from sources/news/20210718 Is Open-Source Software Secure.md rename to sources/talk/20210718 Is Open-Source Software Secure.md From ff1483d11dd381e6ce927de1151aa1fb23eecc99 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 19 Jul 2021 08:36:38 +0800 Subject: [PATCH 497/870] translated --- ...sma 5.22 in Kubuntu 21.04 Hirsute Hippo.md | 134 ------------------ ...sma 5.22 in Kubuntu 21.04 Hirsute Hippo.md | 127 +++++++++++++++++ 2 files changed, 127 insertions(+), 134 deletions(-) delete mode 100644 sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md create mode 100644 translated/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md diff --git a/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md b/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md deleted file mode 100644 index 270853db00..0000000000 --- a/sources/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: (How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo) -[#]: via: (https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/) -[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo -====== -The KDE team enabled the backports PPA which you can use to install and -upgrade to KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo._This guide -outlines the following topics_ppa:kubuntu-ppa/backports -![Kubnutu 21.04 running with KDE Plasma 5.22][1] - -KDE team released the KDE Plasma 5.22 recently with a fair amount of enhancements, bug fixes along with updated KDE Framework and applications versions. This release brings several improvements such as Adaptive transparency in panels, user-friendly notification on file operation popups, package type display in Discover, various Wayland changes, and more. Check out more details about features [here][2]. - -If you are running Kubuntu 21.04 Hirsute Hippo Or, have a custom KDE Plasma installed in [Ubuntu 21.04 Hisrsute Hippo][3], you can upgrade to the latest version using the following steps. The current Hirsute Hippo series provides the prior versions of KDE Plasma 5.21.04 with KDE Framework 5.80. - -: - - 1. [How to install KDE Plasma 5.22 in Kubuntu 21.04][4] - 2. [How to install KDE Plasma 5.22 in Ubuntu 21.04 alongside GNOME][5] - 3. [Can I install KDE Plasma 5.22 in Ubuntu 20.04 LTS?][6] - 4. [How to Uninstall][7] - - - -### Install KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo – Steps - -Follow the below steps. - -If you want to use the graphical method, then add to the software sources in Discover and hit Update. - -Or, use the following terminal method for faster installation. - - * **Step 1**: Open a terminal and add below KDE Backports PPA. - - - -``` -sudo add-apt-repository ppa:kubuntu-ppa/backports -``` - - * **Step 2**: Then run the following to initiate a system upgrade. This will install the latest KDE Plasma 5.22 in your Hirsute Hippo system. - - - -``` -sudo apt update -sudo apt full-upgrade -``` - -![Upgrade to Plasma 5.22][8] - - * **Step 3**: Reboot after the update and you should be greeted with an updated KDE Plasma 5.22 desktop. - - - -The installation may take some time considering a complete version upgrade of the entire desktop environment. - -### Installing KDE Plasma 5.22 in Ubuntu 21.04 - -If you are running GNOME based default Ubuntu 21.04 Hirsute Hippo desktop, you can use this PPA to install the latest KDE Plasma. Here’s how. - -[][9] - -SEE ALSO:   Lubuntu 21.04 Hirsute Hippo - Artwork Contest is Here - -Open a terminal and add the PPA (like above steps). - -``` -sudo add-apt-repository ppa:kubuntu-ppa/backports -``` - -Then, refresh the packages. - -``` -sudo apt update -``` - -Then run the below to install the Kubuntu desktop. - -``` -sudo apt install kubuntu-desktop -``` - -This will install the KDE Plasma desktop alongside with GNOME in Ubuntu 21.04. - -### KDE Plasma 5.22 in Ubuntu 20.04 LTS - -Ubuntu 20.04 LTS edition has the earlier KDE Plasma 5.18, KDE Framework 5.68, KDE Applications 19.12.3. So, during its entire lifecycle, it would not receive the latest KDE Update. So, technically you can add the above PPA and install the KDE Plasma 5.22. But I would not recommend it due to incompatible packages, frameworks that may lead to an unstable system. - -So, it is recommended that you use either Kubuntu 21.04 with the above backports PPA Or, use KDE neon to experience the latest Plasma desktop. - -### Uninstallation of KDE Plasma 5.22 - -If you change your mind and want to go back to the stock version of the KDE Plasma, then install the ppa-purge and purge the PPA. This will downgrade packages and make the stock version available. - -``` -sudo apt install ppa-purge -sudo ppa-purge ppa:kubuntu-ppa/backports -sudo apt update -``` - -### Closing Notes - -I hope this quick guide helped you to install the latest KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo. This allows you experience the latest KDE technology coupled with KDE Framework and applications. However, you should be aware that not all the features should be made available in the backports PPA – only the selected features and bug fixes that pass regression and safe to use. That said, you can always install KDE Neon as a fresh system to enjoy the latest tech from KDE. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Kubutu-21.04-running-with-KDE-Plasma-5.22-1024x531.jpg -[2]: https://www.debugpoint.com/2021/06/kde-plasma-5-22-release/ -[3]: https://www.debugpoint.com/2021/04/ubuntu-21-04-hirsute-hippo-release/ -[4]: tmp.wazjcS11If#plasma-kubuntu-2104 -[5]: tmp.wazjcS11If#plasma-ubuntu-2104 -[6]: tmp.wazjcS11If#plasma-ubuntu-2004 -[7]: tmp.wazjcS11If#uninstall-stock-version -[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Upgrade-to-Plasma-5.22.jpg -[9]: https://www.debugpoint.com/2020/12/lubuntu-21-04-artwork/ diff --git a/translated/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md b/translated/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md new file mode 100644 index 0000000000..11c5c57721 --- /dev/null +++ b/translated/tech/20210612 How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo.md @@ -0,0 +1,127 @@ +[#]: subject: (How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo) +[#]: via: (https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/) +[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Kubuntu 21.04 Hirsute Hippo 中获得 KDE Plasma 5.22 +====== +KDE 团队启用了向后移植 PPA,你可以使用它在 Kubuntu 21.04 Hirsute Hippo 中安装和升级到 KDE Plasma 5.22。 +![Kubnutu 21.04 running with KDE Plasma 5.22][1] + +KDE 团队最近发布了 KDE Plasma 5.22,其中有相当多的增强功能、错误修复以及更新的 KDE 框架和应用版本。这个版本带来了一些改进,如面板的自适应透明度,文件操作弹出时的用户友好通知,“发现”中的软件包类型显示,各种 Wayland 的变化等。在[这里][2]查看更多关于功能细节。 + +如果你正在运行 Kubuntu 21.04 Hirsute Hippo 或者,在 [Ubuntu 21.04 Hisrsute Hippo][3] 中安装了自定义的 KDE Plasma,你可以通过以下步骤升级到最新版本。目前的 Hirsute Hippo 系列提供了 KDE Plasma 5.21.04 与 KDE Framework 5.80 的先前版本。 + +本指南包含下列主题: + + 1. [如何在 Kubuntu 21.04 中安装 KDE Plasma 5.22][4] + 2. [如何在 Ubuntu 21.04 中与 GNOME 一起安装 KDE Plasma 5.22][5] + 3. [我可以在 Ubuntu 20.04 LTS 中安装 KDE Plasma 5.22 么][6] + 4. [如何卸载][7] + + + +### 在 Kubuntu 21.04 Hirsute Hippo 中安装 KDE Plasma 5.22 的步骤 + +按照下面的步骤进行。 + +如果你想使用图形方法,那么在“发现”中添加到软件源,然后点击更新。 + +或者,使用下面的终端方法,以加快安装速度。 + + * **步骤 1**:打开一个终端,添加下面的 KDE Backports PPA。 + + + +``` +sudo add-apt-repository ppa:kubuntu-ppa/backports +``` + + * **步骤 2**:然后运行以下程序来启动系统升级。这将在你的 Hirsute Hippo 系统中安装最新的 KDE Plasma 5.22。 + + + +``` +sudo apt update +sudo apt full-upgrade +``` + +![Upgrade to Plasma 5.22][8] + + * **步骤 3**:更新后重新启动,你应该会看到一个更新的 KDE Plasma 5.22 桌面。 + + + +考虑到整个桌面环境的完整版本升级,安装可能需要一些时间。 + +### 在 Ubuntu 21.04 中安装 KDE Plasma 5.22 + +如果你正在运行基于 GNOME 的默认 Ubuntu 21.04 Hirsute Hippo 桌面,你可以使用这个 PPA 来安装最新的 KDE Plasma。下面是方法。 + +打开终端,添加 PPA(像上面的步骤那样)。 + +``` +sudo add-apt-repository ppa:kubuntu-ppa/backports +``` + +然后,刷新软件包。 + +``` +sudo apt update +``` + +然后运行下面的程序来安装 Kubuntu 桌面。 + +``` +sudo apt install kubuntu-desktop +``` + +这将在 Ubuntu 21.04 中与 GNOME 一起安装 KDE Plasma 桌面。 + +### Ubuntu 20.04 LTS 中的 KDE Plasma 5.22 + +Ubuntu 20.04 LTS 版拥有早期的 KDE Plasma 5.18、KDE Framework 5.68、KDE Applications 19.12.3。所以,在它的整个生命周期中,它不会收到最新的 KDE 更新。所以,从技术上讲,你可以添加上述 PPA 并安装 KDE Plasma 5.22。但我不建议这样做,因为不兼容的软件包、框架可能会导致系统不稳定。 + +所以,建议你使用 Kubuntu 21.04 和上面的向后移植 PPA 或者使用 KDE neon 来体验最新的 Plasma 桌面。 + +### 卸载 KDE Plasma 5.22 + +如果你改变主意,想回到 KDE Plasma 的原始版本,那么安装 ppa-purge 并清除 PPA。这将使软件包降级,并启用仓库版本。 + +``` +sudo apt install ppa-purge +sudo ppa-purge ppa:kubuntu-ppa/backports +sudo apt update +``` + +### 结束语 + +我希望这个快速指南能帮助你在 Kubuntu 21.04 Hirsute Hippo 中安装最新的 KDE Plasma 5.22。这可以让你体验到最新的 KDE 技术以及 KDE 框架和应用。然而,你应该知道,并不是所有的功能都应该在向后移植 PPA 中提供,它只有选定的功能和错误修复,这才能通过回归测试并安全使用。也就是说,你总是可以把 KDE Neon 安装成一个全新的系统来享受 KDE 的最新技术。 + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Kubutu-21.04-running-with-KDE-Plasma-5.22-1024x531.jpg +[2]: https://www.debugpoint.com/2021/06/kde-plasma-5-22-release/ +[3]: https://www.debugpoint.com/2021/04/ubuntu-21-04-hirsute-hippo-release/ +[4]: tmp.wazjcS11If#plasma-kubuntu-2104 +[5]: tmp.wazjcS11If#plasma-ubuntu-2104 +[6]: tmp.wazjcS11If#plasma-ubuntu-2004 +[7]: tmp.wazjcS11If#uninstall-stock-version +[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Upgrade-to-Plasma-5.22.jpg \ No newline at end of file From 656a115262d00be3919cdfd1dcbb9381d6fcba66 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 19 Jul 2021 08:39:57 +0800 Subject: [PATCH 498/870] translated --- .../tech/20210716 Apps for daily needs part 1- web browsers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210716 Apps for daily needs part 1- web browsers.md b/sources/tech/20210716 Apps for daily needs part 1- web browsers.md index b893b223dc..c03f7cea9c 100644 --- a/sources/tech/20210716 Apps for daily needs part 1- web browsers.md +++ b/sources/tech/20210716 Apps for daily needs part 1- web browsers.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/) [#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d0f01664f0bbb10580292c18eab6292cd8f1fa22 Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Mon, 19 Jul 2021 15:48:32 +0800 Subject: [PATCH 499/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91-ne?= =?UTF-8?q?ws-20210627=20Using=20Git=20Version=20Control=20as=20a=20Writer?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/news/20210627 Using Git Version Control as a Writer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210627 Using Git Version Control as a Writer.md b/sources/news/20210627 Using Git Version Control as a Writer.md index 478d975e97..29d58fd027 100644 --- a/sources/news/20210627 Using Git Version Control as a Writer.md +++ b/sources/news/20210627 Using Git Version Control as a Writer.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/version-control-writers/) [#]: author: (Theena https://news.itsfoss.com/author/theena/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (piaoshi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 215d3eb6433331ac53bf935a5750bfafed499775 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Mon, 19 Jul 2021 17:07:35 +0800 Subject: [PATCH 500/870] =?UTF-8?q?Update=2020210718=20Up=20for=20a=20Chal?= =?UTF-8?q?lenge-=20Try=20These=20=E2=80=98Advanced-=20Linux=20Distros=20-?= =?UTF-8?q?Not=20Based=20on=20Debian,=20Arch=20or=20Red=20Hat.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...vanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md b/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md index d3a958a85f..3feed5306f 100644 --- a/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md +++ b/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/advanced-linux-distros/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zepoch) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 41182a72ed13e4e1e7dd374af55977ed60a8e390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E9=BE=99?= <2638000368@qq.com> Date: Mon, 19 Jul 2021 18:56:12 +0800 Subject: [PATCH 501/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?'20210129=20Machine=20learning=20made=20easy=20with=20Python'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20210129 Machine learning made easy with Python.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210129 Machine learning made easy with Python.md b/sources/tech/20210129 Machine learning made easy with Python.md index da6e7f078f..d5a7c6e99b 100644 --- a/sources/tech/20210129 Machine learning made easy with Python.md +++ b/sources/tech/20210129 Machine learning made easy with Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tanloong) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e91aaa3275342c2051ebb5ec1bc3a29b1bcfac70 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Mon, 19 Jul 2021 23:22:42 +0800 Subject: [PATCH 502/870] =?UTF-8?q?Update=2020210718=20Up=20for=20a=20Chal?= =?UTF-8?q?lenge-=20Try=20These=20=E2=80=98Advanced-=20Linux=20Distros=20-?= =?UTF-8?q?Not=20Based=20on=20Debian,=20Arch=20or=20Red=20Hat.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...vanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md b/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md index 3feed5306f..db1b3a897a 100644 --- a/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md +++ b/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md @@ -7,7 +7,7 @@ [#]: publisher: ( ) [#]: url: ( ) -Up for a Challenge? Try These ‘Advanced’ Linux Distros [Not Based on Debian, Arch or Red Hat] +Up for a Challenge? Try These ‘Advanced’ Linux Distros [Not Based on Debian, Arch or Red Hat][tag] ====== There are hundreds of Linux distributions. Some are for general purpose usage, while some are specifically tailored for education, robotics, hacking, gaming and what not. From e76e3f4dbc279133f639cd5af16bcc5482a1d5d4 Mon Sep 17 00:00:00 2001 From: zEpoch <48525863+zEpoch@users.noreply.github.com> Date: Mon, 19 Jul 2021 23:30:16 +0800 Subject: [PATCH 503/870] =?UTF-8?q?Update=2020210718=20Up=20for=20a=20Chal?= =?UTF-8?q?lenge-=20Try=20These=20=E2=80=98Advanced-=20Linux=20Distros=20-?= =?UTF-8?q?Not=20Based=20on=20Debian,=20Arch=20or=20Red=20Hat.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...vanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md b/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md index db1b3a897a..3feed5306f 100644 --- a/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md +++ b/sources/tech/20210718 Up for a Challenge- Try These ‘Advanced- Linux Distros -Not Based on Debian, Arch or Red Hat.md @@ -7,7 +7,7 @@ [#]: publisher: ( ) [#]: url: ( ) -Up for a Challenge? Try These ‘Advanced’ Linux Distros [Not Based on Debian, Arch or Red Hat][tag] +Up for a Challenge? Try These ‘Advanced’ Linux Distros [Not Based on Debian, Arch or Red Hat] ====== There are hundreds of Linux distributions. Some are for general purpose usage, while some are specifically tailored for education, robotics, hacking, gaming and what not. From 52d8282882d798a20c4ed3230f99629916b00161 Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Tue, 20 Jul 2021 00:52:44 +0800 Subject: [PATCH 504/870] Delete source file and Summit translated file --- ...7 Using Git Version Control as a Writer.md | 126 ------------------ ...7 Using Git Version Control as a Writer.md | 107 +++++++++++++++ 2 files changed, 107 insertions(+), 126 deletions(-) delete mode 100644 sources/news/20210627 Using Git Version Control as a Writer.md create mode 100644 translated/news/20210627 Using Git Version Control as a Writer.md diff --git a/sources/news/20210627 Using Git Version Control as a Writer.md b/sources/news/20210627 Using Git Version Control as a Writer.md deleted file mode 100644 index 29d58fd027..0000000000 --- a/sources/news/20210627 Using Git Version Control as a Writer.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: subject: (Using Git Version Control as a Writer) -[#]: via: (https://news.itsfoss.com/version-control-writers/) -[#]: author: (Theena https://news.itsfoss.com/author/theena/) -[#]: collector: (lujun9972) -[#]: translator: (piaoshi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Using Git Version Control as a Writer -====== - -I believe modern writers should begin thinking about their processes, or workflows. - -In a highly distracted world, it is imperative to take ownership over the chain of tasks we perform every day as writers. Traditionally, writers would put their writing to the hours where the distraction is less, and the focus high. Unfortunately advice from Hemingway, Atwood, et al., isn’t really applicable to us any more. The world we live in is far more connected, and thus have far more pitfalls for writers. Part of that is being disciplined enough to not let social media or cute videos of puppies and kittens distract us at the times we are writing. - -But disconnecting from the internet isn’t really an option if part of your writing requires quick fact-checks, spellings of uncommon and technical words, etc., – this is very true for me when I am writing. The other issue is the distractions that are within the writing app itself; as a life long MS Word user, I found it getting prettier, but slower and more distracting. I spoke about this at length as being among the [primary reasons for transitioning into Vim][1] in the first place, so I am not going to speak extensively on this. The point being that writing in the modern world, on modern devices can be far from ideal. - -Since I’ve already gone into detail on the [why I switched to Vim][2] and open source version control, I would like to use this article to talk about the **how**, specifically how to use open source version control technology such as git (and GitHub). - -### What is Version Control, again? - -![Source: https://git-scm.com/][3] - -The diagram above is a illustration of how we perform traditional version control. This -diagram assumes that you have one device and that you write only in that device. In my case, I write on a number of machines, including my Android phone and a selection of laptops of varying ages that I use for specific and in specific places. The one common task that I carry out between all these devices is writing – it is imperative, therefore, that my devices capture changes and version controls my files in sane manner. No more `file1V1_device1_date.doc` as I would name my files. - -The diagram above also doesn’t take into account the tools that we use to write.A word processor such as LibreOffice Write works across Linux, Mac, and Windows machines, but using a word processor on the phone is an unpleasant experience. Some of us writers also use other text tools, including Gmail or our email clients, to write little sketches for our writing. Keeping track of all of these files and emails in a logical order is exhausting – I wrote a book using such a process, and trust me: the time I spent figuring out file names, version changes, comments, notes to self, and emails with additional notes, was enough to drive me to distraction. - -Some of you reading this might rightly point out that cloud-based backup technology -exists. While the benefits of cloud-based storage are immense, and I continue using them, version control barely exists, or isn’t powerful. - -### A better workflow - -Like the rest of the planet, the start of the pandemic led to some anxiety and some soul -searching. I spent the time teaching myself web development on [The Odin Project][4] (highly recommended for those who are thinking of learning html, CSS, JavaScript/Ruby). - -Among the first modules was an introduction to Git: what version control was, and what problems it sought to address. Reading this chapter was a revelation. I knew immediately that this _git_ was exactly what I was looking for as a writer. - -The better way, then, isn’t localized version control but _distributed_ version control. ‘Distributed’ describes the distribution of the _devices_ that I will be accessing a file from, and editing/changing thereafter. The diagram below is a visual illustration of distributed version control. - -![Source: https://git-scm.com/][5] - -### My way - -My goals in building a version control system for writing were as follows: - - * Make my manuscript repository accessible from anywhere, from any device - * Ease of use - * Reduce or remove the friction that comes about from shifting context between writing, study and coding workflows – as much as possible, we will use the same tool (i.e. Vim) - * Scalable - * Easy to maintain - - - -Based on the above needs, the diagram below is my distributed version control system for my writing. - -![][6] - -As you can see, my version control system is a simplistic adaptation of distributed version control. By adding git version control to a folder on cloud storage ([pCloud][7]) in my case, I can now draw the benefits of both technologies. Thus my workflow can be visualized as follows: - -![][8] - -#### Advantages - - 1. I have one writing (and coding) tool - 2. I have version control of my manuscripts, no matter what device I access the file from - 3. It’s [super easy, barely an inconvenience][9] - 4. Easy to maintain. - - - -#### Drawbacks - -The writers among you must wonder what drawbacks exist in the system. Here are a few that I anticipate as I continue using and refining this workflow. - - * Comments on drafts: one of the more useful features of word processors is the ability to comment. I often leave comments for myself when I want to come back to a certain portion of the text. I still haven’t figured out a workaround for this. - * Collaboration: Word processors allow for collaboration between writers. During my advertising days, I would use Google Docs to write copy and share the link with my designers to extract the copy for ads and websites. Right now, my workaround for this writing the copy in markdown, and exporting the markdown file to a .doc file via Pandoc. More critically, when my manuscripts are completed, I’d need to still send the files in .doc format for my editors. Once my editor makes -those changes and sends it back, it makes little sense for me to try opening it again in Vim. At this point, the system’s limitations will become more obvious. - - - -In no way am I saying this is the best method, but this is the best method for _me_ at this -point in my career. I imagine I will be refining this further as I get more familiar and comfortable with my new [open source tools for writing][10] and version control. - -I hope this serves as a good introduction to writers wanting to use Git for their document version control. This is by no means an extensive article, but I will share some useful links to make the journey easier for you. - - 1. [Git Basics from The Odin Project:][11] - 2. [Getting started with Git][12] - 3. GitHub’s Basics of Git Tutorial - - - -As a bonus, here’s a screen recording of me using Vim on my Android device to work on a poem, pushing the changes to Git. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/version-control-writers/ - -作者:[Theena][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/theena/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/how-i-started-loving-vim/ -[2]: https://news.itsfoss.com/configuring-vim-writing/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://www.theodinproject.com/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgwMCIgd2lkdGg9IjY2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwNSIgd2lkdGg9IjYxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://itsfoss.com/recommends/pcloud/ -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc1MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[9]: https://www.youtube.com/watch?v=NtH-HhaLw-Q -[10]: https://itsfoss.com/open-source-tools-writers/ -[11]: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/introduction-to-git -[12]: https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control diff --git a/translated/news/20210627 Using Git Version Control as a Writer.md b/translated/news/20210627 Using Git Version Control as a Writer.md new file mode 100644 index 0000000000..d9181e59a1 --- /dev/null +++ b/translated/news/20210627 Using Git Version Control as a Writer.md @@ -0,0 +1,107 @@ +[#]: subject: (Using Git Version Control as a Writer) +[#]: via: (https://news.itsfoss.com/version-control-writers/) +[#]: author: (Theena https://news.itsfoss.com/author/theena/) +[#]: collector: (lujun9972) +[#]: translator: (piaoshi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +作为一个写作者如何使用Git版本控制 +====== + +我相信当代的写作者们应该开始思考他们的工作流程了。 + +在一个注意力高度分散的世界里,作为写作者,我们必须对每天执行的任务链拥有控制权。传统上,作家们会把他们的写作放在分散注意力的事较少、注意力高度集中的时间段。不幸的是,海明威、阿特伍德们的这些建议不再真正适用于我们了。我们所生活的世界联系得更紧密了,因此对作家来说就有了更多的陷阱。这首先要求我们要有足够的自制力,不要让社交媒体或小狗和小猫的可爱视频在我们写作的时候分散我们的注意力。 + +但是,如果你的写作需要快速地检查事实、拼写不常见和技术性的词汇等,断开与互联网连接并不是一个现实的选项——这正是我写作时的场景。另一个问题是你用于写作的应用程序本身的干扰;作为一个长期使用 MS Word 的人,我发现它越来越漂亮,但速度越来越慢,也越来越让人分心。作为当初我[迁移到 Vim 的主要原因][1]之一,我曾详细地谈到了这一点,所以我不打算再在这个问题上大谈特谈。重点是,在现代世界中,在现代设备上进行写作,可能远非理想状态。 + +因为我已经详细介绍过了[我为什么转向 Vim][2]和开源版本控制,在这篇文章中,我更想谈谈该 **怎么做**,特别是如何使用开源的版本控制技术,比如git(和GitHub)。 + +### 什么是版本控制?再来一次? + +![Source: https://git-scm.com/][3] + +上图是我们如何进行传统版本控制的一个说明。这个图中假设你有一台设备,而且你只在那台设备上写作。但对我而言,我在许多机器上写作,包括我的安卓手机和一些不同年代的笔记本电脑,我会在特定的任务特定的位置使用到它们。我在所有这些设备上进行的一个共同任务就是写作——因此,我的设备必须以合理的方式捕捉变化并控制文件的版本。不要再让我将 `file1V1_device1_date.doc` 作为文件名了。 + +上图也没有考虑到我们用来写作的工具。像 LibreOffice Write 这样的文字处理器可以在 Linux、Mac 和 Windows 系统上使用,但在手机上使用文字处理器将会是一段不愉快的经历。我们中的一些写作者还使用其他文本工具——包括 Gmail 或我们的电子邮件客户端——来为我们的写作打草稿。但按逻辑顺序跟踪所有这些文件和电子邮件是相当折磨人的——我就用这样的流程写过一本书,相信我:我花在弄清文件名、版本变化、评论、给自己的注释以及带有附加注释的电子邮件上的时间,足以让我精神错乱。 + +读到这里,你们中的一些人可能会正确地指出,有云备份技术呀。虽然云存储的好处是巨大的,而且我也在继续使用它们,但其版本控制几乎没有,或者说并不强大。 + +### 一个更好的工作流程 + +就像地球上的其它地方一样,大流行病的开始引发了一些焦虑和一些反思。我利用这段时间在 [The Odin Project][4](强烈推荐给那些想学习 html、CSS、JavaScript/Ruby 的人)上自学了网络开发。 + +在课程的第一个模块中,有一个关于 Git 的介绍:什么是版本控制,以及它试图解决什么问题。读了这一章后,我豁然开朗。我立即意识到,这个 _git_ 正是我作为一个写作者所要寻找的东西。 + +是的,更好的方法不是本地化的版本控制,而是 _分布式_ 的版本控制。“分布式”描述的是设备的分布,而我在这些设备上访问文件,以及之后进行编辑修改。下图是分布式版本控制的一个直观说明。 + +![Source: https://git-scm.com/][5] + +### 我的方法 + +我为写作建立一个版本控制系统的目标如下: + + * 使我的稿件库可以从任何地方、任何设备上访问 + * 易于使用 + * 减少或消除因在写作、学习和编码各工作流程之间的场景切换而产生的摩擦——尽可能使用同一工具(即 Vim)。 + * 可扩展性 + * 易于维护 + +基于以上需求,下图是我进行写作的分布式版本控制系统。 + +![][6] + +如你所见,我的版本控制系统是分布式版本控制的一个简单的适配。在我的例子中,通过将 git 版本控制应用到云存储([pCloud][7])的一个文件夹上,我可以同时利用这两种技术的优点。因此,我的工作流程可以用下图描述: + +![][8] + +#### 优势 + + 1. 我用一个写作(和编码)工具 + 2. 我可以对我的手稿进行版本控制,无论我是从什么设备上访问文件的 + 3. [超级简单,几乎没有任何不便之处][9] + 4. 易于维护 + +#### 缺点 + +你们中的写作者一定想知道这个系统存在什么缺点。以下是我在持续使用和完善这一工作流程时预计到的几个问题。 + + * 对草稿的评论:文字处理器的一个更有用的功能是具有评论的功能。当我希望以后再回到文本的某一部分时,我经常在这部分为自己留下一个评论。我仍然没有想出一个解决这个问题的办法。 + * 协作:文字处理程序允许写作者之间进行协作。在我以前做广告相关工作的时候,我会用 Google Docs 来写文案,然后分享链接给我的设计师,从而他可以为广告和网站对文案进行摘录。现在,我的解决方法是用 markdown 写文案,并通过 Pandoc 将 markdown 文件导出为 .doc 文件。更关键的是,当我的手稿完成后,我仍然需要将文件以 .doc 格式发送给我的编辑。一旦我的编辑做了一些修改并把它发回来,我再尝试用 Vim 打开它就没有意义了。在这一点上,该系统的局限性变得更加明显。 + +我并不是说这是最好的方法,但在我职业生涯的这个阶段,这是对我来说最好的方法。我想,随着我对我的新的[用于写作的开源工具][10]和版本控制越来越熟悉和适应,我将进一步完善这个方法。 + +我希望这篇文章能为那些想使用 Git 进行文档版本控制的写作者提供一个很好的介绍。这肯定不是一篇详尽的文章,但我将分享一些有用的链接,使你的旅程更容易。 + + 1. [The Odin Project 介绍的 Git 基础知识][11] + 2. [开始使用 Git][12] + 3. GitHub 的 Git 基础知识教程 + +作为彩蛋,这里有一段我在安卓设备上使用 Vim 处理一首诗,并将改动推送到 Git 的屏幕录像。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/version-control-writers/ + +作者:[Theena][a] +选题:[lujun9972][b] +译者:[piaoshi](https://github.com/piaoshi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/theena/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/how-i-started-loving-vim/ +[2]: https://news.itsfoss.com/configuring-vim-writing/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://www.theodinproject.com/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgwMCIgd2lkdGg9IjY2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwNSIgd2lkdGg9IjYxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://itsfoss.com/recommends/pcloud/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc1MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[9]: https://www.youtube.com/watch?v=NtH-HhaLw-Q +[10]: https://itsfoss.com/open-source-tools-writers/ +[11]: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/introduction-to-git +[12]: https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control From 13ecf810df6303cd5953ee011837790fcd8b43bd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Jul 2021 05:04:06 +0800 Subject: [PATCH 505/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210719=20?= =?UTF-8?q?Apps=20for=20daily=20needs=20part=202:=20office=20suites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210719 Apps for daily needs part 2- office suites.md --- ...s for daily needs part 2- office suites.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20210719 Apps for daily needs part 2- office suites.md diff --git a/sources/tech/20210719 Apps for daily needs part 2- office suites.md b/sources/tech/20210719 Apps for daily needs part 2- office suites.md new file mode 100644 index 0000000000..d5a84fe848 --- /dev/null +++ b/sources/tech/20210719 Apps for daily needs part 2- office suites.md @@ -0,0 +1,124 @@ +[#]: subject: (Apps for daily needs part 2: office suites) +[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/) +[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Apps for daily needs part 2: office suites +====== + +![][1] + +Photo by [Brooke Cagle][2] on [Unsplash][3] + +Today, almost every family has a desktop computer or laptop. That’s because the computer has become a very important requirement. Moreover, many people have to create documents and presentations in digital format for work or study. Therefore, the office suites are must-have application on almost all computers. This article will introduce some of the open source office suites that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is the list of apps for daily needs in the office suites category. + +### LibreOffice + +LibreOffice is the most popular office suite among GNU/Linux users. It has a user interface and user experience similar to Microsoft Office. This makes LibreOffice easy to learn for those who have just migrated from Microsoft Office. LibreOffice has complete features to meet your needs working on documents and presentations. It consists of six applications: Writer, Calc, Impress, Draw, Math, and Base. + +The first application is Writer that is used to create various kinds of documents, such as letters, faxes, agendas, minutes, etc. It is a full-featured word processing and desktop publishing tool. The second application is Calc which is a spreadsheet program that is perfect for presenting data and documenting it in tabular format. Calc can create simple tables or do professional data analysis. The third application is Impress which is an easy-to-use presentation application. You can easily choose what you features want in your presentation slides, such as text, images, tables, diagrams, etc. + +![LibreOffice Writer][5] + +![LibreOffice Calc][6] + +![LibreOffice Impress][7] + +The three LibreOffice applications mentioned earlier are the most commonly used applications in creating documents and presentations. However, LibreOffice provides three other applications that are also very useful. The first is Draw which can be used to create drawings and diagrams, ranging from simple to complex. The next application is Math which can help us make perfectly formatted mathematical and scientific formulas. The last is Base which is an application for processing databases. + +![LibreOffice Draw][8] + +![LibreOffice Math][9] + +![LibreOffice Base][10] + +More information is available at this link: + +* * * + +### ONLYOFFICE + +ONLYOFFICE is an office suite application that is highly compatible with Microsoft Office. Therefore we do not have to worry about collaborating with colleagues who use Microsoft Office because it can read various file formats such as docx, xlsx, and pptx. + +ONLYOFFICE provides three applications with a clean and modern look. We can easily find the features and tools that we need. Although the features are not as complete as LibreOffice, they are very sufficient to help us create good documents and presentations. + +The first application is Documents Editor which has the same function as Writer from LibreOffice. It has all the basic features needed in a word processor, such as managing fonts and styles, formatting text, adjusting line and paragraph spacing, inserting headers and footers, customizing page layout, and setting margins. The second application is Spreadsheet Editor which is an application for processing data and creating it as a document in tabular format. It is an application with the same functionality as Calc. The last one is Presentations Editor which is a presentation application with functions similar to Impress. + +Unfortunately ONLYOFFICE is not available in the official Fedora Linux repositories. But you can still install it on Fedora Linux using Flatpak or Appimages. + +![ONLYOFFICE Documents Editor][11] + +![ONLYOFFICE Spreadsheets Editor][12] + +![ONLYOFFICE Presentations Editor][13] + +More information is available at this link: + +* * * + +### Calligra + +Calligra is an office suite created by KDE. Therefore, this application is actually more suitable for users of the KDE Plasma desktop environment. But it can still run well on other desktop environments, such as Fedora Workstation using GNOME. + +Calligra provides several applications with a slightly different look from LibreOffice or ONLYOFFICE. It may take some adjustment for those who are used to mainstream office suite applications. However, Calligra is still a reliable office suite to support our daily needs. + +The first application is Words which is an intuitive word processor with desktop publishing features. It has a full range of features to help us in document creation. The second application is Sheets which has the same functionality as Calc and Spreadsheet Editors as a fully-featured spreadsheet application. The third application is Stage which can help us in making presentation slides. + +![Calligra Words][14] + +![Calligra Sheets][15] + +![Calligra Stage][16] + +The three Calligra applications are the most commonly used applications for creating documents and presentations. There are three other applications that are also very useful. The first is Karbon which can be used to create drawings and diagrams, ranging from simple to complex. The next application is Plan which is project management application that can help in managing moderately large projects with multiple resources. The last is KEXI which is a visual database application creator. + +![Calligra Karbon][17] + +![Calligra Plan][18] + +![Calligra Kexi][19] + +More information is available at this link: + +* * * + +### Conclusion + +This article presented 3 office suites for your daily needs that you can use on Fedora Linux. If you want a complete set of features in your office suite, then LibreOffice may be the right choice. For good compatibility with Microsoft Office, then you may choose ONLYOFFICE. However, if you want a different user interface and experience in creating documents and presentations, you can try Calligra. Hopefully this article can help you to choose the right office suite. If you have experience in using these applications, please share your experience in the comments. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/ + +作者:[Arman Arisman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-2-Office-816x345.jpg +[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ +[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-writer-1-1024x575.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-calc-1-1024x575.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-impress-1-1024x575.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-draw-1-1024x575.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-math-1-1024x575.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-base-1-1024x575.png +[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-doc-1024x575.png +[12]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-sheet-1024x575.png +[13]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-presentation-1024x575.png +[14]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-words-1024x575.png +[15]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-sheets-1024x575.png +[16]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-stage-1024x575.png +[17]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-karbon-1-1024x575.png +[18]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-plan-1024x575.png +[19]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-kexi-1024x575.png From e74f97f22bb65b59f5763c99556cee552795f814 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Jul 2021 05:04:21 +0800 Subject: [PATCH 506/870] add done: 20210719 Apps for daily needs part 2- office suites.md --- sources/tech/20210720 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210720 .md diff --git a/sources/tech/20210720 .md b/sources/tech/20210720 .md new file mode 100644 index 0000000000..4e3e86794d --- /dev/null +++ b/sources/tech/20210720 .md @@ -0,0 +1,25 @@ +[#]: subject: () +[#]: via: (https://www.2daygeek.com/save-command-output-to-a-file-linux/) +[#]: author: ( ) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/save-command-output-to-a-file-linux/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From b066f55015902a3e6d2fd58f185016047931eb29 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Jul 2021 05:04:40 +0800 Subject: [PATCH 507/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210720=20?= =?UTF-8?q?Meet=20Clapper:=20A=20Sleek=20Looking=20Linux=20Video=20Player?= =?UTF-8?q?=20for=20Minimalists?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md --- ...king Linux Video Player for Minimalists.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md diff --git a/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md b/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md new file mode 100644 index 0000000000..d0f91333b4 --- /dev/null +++ b/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md @@ -0,0 +1,93 @@ +[#]: subject: (Meet Clapper: A Sleek Looking Linux Video Player for Minimalists) +[#]: via: (https://itsfoss.com/clapper-video-player/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Meet Clapper: A Sleek Looking Linux Video Player for Minimalists +====== + +Love minimalism? You’ll love Clapper. + +Clapper is a new [video player for Linux][1]. Actually, it’s more for GNOME than Linux. + +Built on top of GNOME’s JavaScript library and GTK4 toolkit, it blends naturally in the GNOME desktop environment. It uses [GStreamer][2] for media backend and [OpenGL][3] for rendering. + +I like application with minimalist approach. While VLC is the Swiss Knife of media players, I prefer [MPV player][4] for the sleek, minimal interface. And now I think I am going to stick with Clapper for sometime. + +### Clapper video player + +![A screenshot of Clapper video player][5] + +[Clapper uses hardware acceleration][6] by default. It supports Intel and AMD GPUs and works on both Xorg and Wayland. + +[Clapper][7] doesn’t use the traditional upper window bar. There are auto-hiding preference menu, mode changer and window control buttons for you to access a few features. This gives it a sleek, minimalist look. + +It has three modes: + + * Windowed mode: the default mode shows the progress bar and window control + * Floating mode: the progress bar is hidden and the player is floating on top of other applications like the ‘[always on top][8]‘ feature or ‘picture in picture’ mode + * Fullscreen mode: Player goes full screen, progress bar is bigger but they all auto-hide + + + +![Interface of Clapper video player with preference control and window modes][9] + +Clapper also has an adaptive UI which can also be used on Linux-based smartphones and tablets. So if you have got yourself a Pine Phone or Librem5, you can use Clapper on it. + +There is support for subtitles with option to change the font. However, the subtitles didn’t work in my testing. There is also no option to explicitly add subtitles to a playing video. This is something that must be improved. + +Like VLC, Clapper also gives you the option to resume playback from the last point if you open the same video file again. One of the [handy features I love in VLC][10]. + +Clapper supports playing videos from the internet as well if you provide the URL. + +Here, in the screenshot, I am playing a YouTube video in Clapper. It is a beautiful song sung by a beautiful singer and actress. Can you guess which song or movie it is? + +![Clapper playing a video from YouTube][11] + +### Install Clapper on Linux + +Clapper is available in AUR for Arch and Manjaro users. That should not be a surprise for anyone. AUR has everything under the sun. + +For other distributions, Clapper officially provides [Flatpak package][12]. So, please [enable Flatpak support for your distribution][13] and then use the following command to install it: + +``` +flatpak install flathub com.github.rafostar.Clapper +``` + +Once installed, simply search for it in the application menu or right click on a video file and choose to open it with Clapper. + +Clapper is far from being the perfect video player. However, it has potential to become a popular Linux application. + +If you use it, please do share your experience. If you find bugs, please [notify the developer][14]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/clapper-video-player/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/video-players-linux/ +[2]: https://gstreamer.freedesktop.org/ +[3]: https://www.opengl.org/ +[4]: https://itsfoss.com/mpv-video-player/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-screenshot.png?resize=800%2C498&ssl=1 +[6]: https://github.com/Rafostar/clapper/wiki/Hardware-acceleration +[7]: https://github.com/Rafostar/clapper +[8]: https://itsfoss.com/always-on-top/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-video-player-interface.jpg?resize=800%2C480&ssl=1 +[10]: https://itsfoss.com/simple-vlc-tips/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-youtube-video.jpg?resize=800%2C501&ssl=1 +[12]: https://flathub.org/apps/details/com.github.rafostar.Clapper +[13]: https://itsfoss.com/flatpak-guide/ +[14]: https://github.com/Rafostar/clapper/issues From 9471eb158f7a0c29690593b0c5045250a55740c2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Jul 2021 05:05:10 +0800 Subject: [PATCH 508/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210719=20?= =?UTF-8?q?Linux=20package=20managers:=20dnf=20vs=20apt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210719 Linux package managers- dnf vs apt.md --- ...0719 Linux package managers- dnf vs apt.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20210719 Linux package managers- dnf vs apt.md diff --git a/sources/tech/20210719 Linux package managers- dnf vs apt.md b/sources/tech/20210719 Linux package managers- dnf vs apt.md new file mode 100644 index 0000000000..3981e3fba9 --- /dev/null +++ b/sources/tech/20210719 Linux package managers- dnf vs apt.md @@ -0,0 +1,232 @@ +[#]: subject: (Linux package managers: dnf vs apt) +[#]: via: (https://opensource.com/article/21/7/dnf-vs-apt) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux package managers: dnf vs apt +====== +Package managers do the same general things—installing, managing, and +uninstalling applications—but they don't do everything the same. +![Gift box opens with colors coming out][1] + +There are many ways to [get applications onto a Linux system][2]. Some, like Flatpak and containers, are new. Others, like DEB and RPM, are classic formats that have withstood the test of time. + +There isn't a universal installer for any operating system. Today, all major OSes use a mix of app stores (both first and third party), drag-and-drop installation, and installation wizards because there are innumerable developers delivering software. Different developers have different requirements for the code they deliver, and this informs the installation method they each choose. + +Linux pioneered the concept of a _package manager_, a command to install, manage, and uninstall applications. Two common package manager commands are `apt` and `dnf`. The `apt` command manages DEB packages, while `dnf` manages RPM packages. The two are not strictly exclusive of one another in theory, although in practice, a Linux distribution generally uses one or the other. It's theoretically possible to run both on one system, but package installations would overlap, versioning would be difficult, and the commands would be redundant to one another. However, if you work in a mixed Linux environment, interacting with workstations running one distribution and servers running another, you may need to know both. + +### Searching for applications + +Before you can install an application with a package manager, you need to know the package's name. Usually, the application name and the package name are the same. The process to verify the name of the package you want to install is exactly the same on `dnf` and `apt`: + + +``` +$ sudo dnf search zsh +====== Name Exactly Matched: zsh ====== +zsh.x86_64 : Powerful interactive shell +[...] +``` + +With `apt`: + + +``` +$ sudo apt search zsh +Sorting... Done +Full Text Search... Done +csh/stable 20110502-4+deb10u1 amd64 +  Shell with C-like syntax + +ddgr/stable 1.6-1 all +  DuckDuckGo from the terminal + +direnv/stable 2.18.2-2 amd64 +  Utility to set directory specific environment variables + +draai/stable 20180521-1 all +  Command-line music player for MPD +[...] +``` + +To get relevant results from `apt` earlier in the search, you can use [regex][3]: + + +``` +apt search ^zsh +Sorting... Done +Full Text Search... Done +zsh/stable 5.7.1-1 amd64 +  shell with lots of features +[...] +``` + +### Finding an application's package + +Some commands come bundled with other commands, all in one package. When that happens, you can use your package manager to learn which package provides what you need. The `dnf` and `apt` commands diverge on how they search for this kind of metadata. + +On `dnf`: + + +``` +$ sudo dnf provides pgrep +procps-ng-3.3.15-6.el8.x86_64 : System and process monitoring utilities +Repo        : baseos +Matched from: +Filename    : /usr/bin/pgrep +``` + +The `apt` command uses a subcommand, `apt-file`. To use `apt-file`, you must first install it and then prompt it to update its cache: + + +``` +$ sudo apt install apt-file +Reading package lists... Done +Building dependency tree       +Reading state information... Done +The following additional packages will be installed: +  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl libregexp-assemble-perl +The following NEW packages will be installed: +  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl libregexp-assemble-perl +0 upgraded, 5 newly installed, 0 to remove and 14 not upgraded. +Need to get 297 kB of archives. +After this operation, 825 kB of additional disk space will be used. +Do you want to continue? [Y/n] y + +$ sudo apt-file update +[...] +``` + +You can use `apt-file` to search for a command. You can cast a very wide net by just searching for the command, but if you happen to know the command's expected path, it's more accurate: + + +``` +$ sudo apt-file search /usr/bin/pgrep +pgreplay: /usr/bin/pgreplay               +procps: /usr/bin/pgrep +``` + +### Installing applications + +Installing applications is essentially identical with `apt` and `dnf`: + + +``` +`$ sudo apt install zsh` +``` + +With `dnf`, you can install a single package using the same option: + + +``` +`$ sudo dnf install zsh` +``` + +Many RPM-based distributions feature _installation groups_, which collect sometimes superficially related applications into one easily installable target. For instance, the [Design Suite][4] group in Fedora contains popular creative applications. Many artists who want one creative application are likely to want similar applications, and installing the whole group is an easy and quick way to get a sensible start on building a digital studio. You can view available groups with `group list` (use `-v` to see the group names without spaces): + + +``` +$ sudo dnf group list -v +[...] +Available Groups: +   Container Management (container-management) +   RPM Development Tools (rpm-development-tools) +   Design Suite (design-suite) +   Development Tools (development) +[...] +``` + +Install an RPM group using the `group install` subcommands: + + +``` +`$ sudo dnf group install design-suite` +``` + +You can use the `@` notation to reduce typing: + + +``` +`$ sudo dnf install @design-suite` +``` + +### Upgrading applications + +One advantage of using a package manager is that it is aware of _all_ the applications it has ever installed. That means you don't have to go hunting for updated versions of applications. Instead, you can tell your package manager to scan for updates. + +The subcommands used by `dnf` and `apt` are slightly different. Because `apt` keeps a cache of information that requires regular updating, it uses the `upgrade` subcommand for application updates: + + +``` +`$ sudo apt upgrade` +``` + +By contrast, `dnf` updates metadata every time you use the command, so the `update` and `upgrade` subcommands are interchangeable: + + +``` +`$ sudo dnf upgrade` +``` + +This is the same as: + + +``` +`$ sudo dnf update` +``` + +### Removing applications + +If you've ever tried to remove an application manually on any platform, then you know there are inevitably leftover files, such as preference files or assets or icons, scattered all around your hard drive after you remove the application. Yet another advantage to using a package manager is that your package manager knows _every single file_ installed with a package: + + +``` +`$ sudo dnf remove zsh` +``` + +The `remove` subcommand is also used for `apt`: + + +``` +`$ sudo apt remove zsh` +``` + +Removing a package with `apt` doesn't remove modified user configuration files, in case you removed the package by accident. If you want `apt` to remove an application _and_ its configuration files, use `purge` on an application you've previously removed: + + +``` +`$ sudo apt purge zsh` +``` + +Both `apt` and `dnf` (even with `purge`) don't remove data or configuration files in your home directory. To remove data from your home directory, you must do it manually (it's usually found in `~/.config` and `~/.local`). + +### Learning package management + +Whether your Linux distribution of choice favors `apt` or `dnf`, the commands' purposes are broadly identical. They help you install, update, and remove packages. These two, being the most common package managers, largely mirror one another's most important syntactical elements, so switching between them is pretty easy. + +Each has some advanced features, such as repository management, that diverge substantially, but those tend not to be run as frequently as the classic sequence of `search` and `install`. + +Regardless of which package manager you use more often, you can download our [apt cheat sheet][5] and [dnf cheat sheet][6] so that you have the most important syntax close at hand when you need it the most. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/dnf-vs-apt + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out) +[2]: https://opensource.com/article/18/1/how-install-apps-linux +[3]: https://opensource.com/article/18/5/getting-started-regular-expressions +[4]: https://labs.fedoraproject.org/en/design-suite/ +[5]: https://opensource.com/downloads/apt-cheat-sheet +[6]: https://opensource.com/downloads/dnf-cheat-sheet From f116aee0744204e10052e0930118524a29c0fe85 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Jul 2021 05:05:31 +0800 Subject: [PATCH 509/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210719=20?= =?UTF-8?q?Run=20Python=20applications=20in=20virtual=20environments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210719 Run Python applications in virtual environments.md --- ...on applications in virtual environments.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20210719 Run Python applications in virtual environments.md diff --git a/sources/tech/20210719 Run Python applications in virtual environments.md b/sources/tech/20210719 Run Python applications in virtual environments.md new file mode 100644 index 0000000000..c86d1849ae --- /dev/null +++ b/sources/tech/20210719 Run Python applications in virtual environments.md @@ -0,0 +1,161 @@ +[#]: subject: (Run Python applications in virtual environments) +[#]: via: (https://opensource.com/article/21/7/python-pipx) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Run Python applications in virtual environments +====== +Avoid versioning conflicts and improve security by running Python +applications in isolation with pipx. +![Digital creative of a browser on the internet][1] + +If you use Python, you probably install a lot of Python applications. Some are tools you just want to try out. Others are tried and true applications you use every day, so you install them on every computer you use. In either situation, it can be useful to run your Python applications in virtual environments to keep them and their dependencies separate from one another to avoid versioning conflicts and to keep them from the rest of your system to improve security. + +This is where [pipx][2] comes into the picture. + +Most Python apps can be installed using [pip][3], which just installs the Python package. Pipx, however, creates and manages a virtual environment for your Python applications and helps you run them. + +### Installing pipx + +Pipx is primarily an RPM package, and you can install it on any Fedora, RHEL, or CentOS machine with: + + +``` +`$ sudo dnf install pipx` +``` + +### Using pipx + +I'll demonstrate how to use pipx with the Cowsay package and the [Concentration][4] tool. + +#### Installing packages + +After pipx is installed, you can install Python packages with: + + +``` +`$ pipx install ` +``` + +To install the Cowsay package: + + +``` +$ pipx install cowsay                                                 ✔ │ 20:13:41   +  installed package cowsay 4.0, Python 3.9.5 +  These apps are now globally available +        - cowsay +done! ✨ 🌟 ✨ +``` + +Now you can run Cowsay anywhere in your system to talk to you through your terminal! + + +``` +$  cowsay "I <3 OSDC"                                                                                                                                       +  _________ +| I <3 OSDC | +  ========= +        \ +        \ +                ^__^ +                (oo)\\_______ +                (__)\           )\/\ +                ||----w | +                ||      || +``` + +![Cowsay][5] + +(Sumantro Mukherjee, [CC BY-SA 4.0][6]) + +#### Installing with special permissions + +Not all applications are as simple as Cowsay. For instance, the Concentration application interacts with many other components on your system, so it requires special permissions. Install it with: + + +``` +$ pipx install concentration                                                                           ✔ │ 10s  │  │ 20:26:12   +  installed package concentration 1.1.5, Python 3.9.5 +  These apps are now globally available +        - concentration +done! ✨ 🌟 ✨ +``` + +Concentration is designed to help you focus by blocking specific websites listed in a "distractors" file. To do that, it needs to run with sudo or root privileges. You can do this with [OpenDoas][7], a version of the `doas` command that runs any command with specific user privileges. To use `doas` to run Concentration with sudo privileges: + + +``` +$ doas concentration improve                                                                  ✔ │  │ 20:26:54   +doas (sumantrom) password:   +Concentration is now improved :D! +``` + +As you can see, the isolated application was able to change something in the system. + +#### Listing installed apps + +The `pipx list` command displays all apps installed with pipx and their executable paths: + + +``` +$ pipx list                                                                                                                                               +venvs are in /home/sumantrom/.local/pipx/venvs +apps are exposed on your $PATH at /home/sumantrom/.local/bin +   package concentration 1.1.5, Python 3.9.5 +        - concentration +   package cowsay 4.0, Python 3.9.5 +        - cowsay +``` + +#### Uninstalling apps + +It's important to know how to uninstall things when you're finished with them. Pipx has a very simple uninstall command: + + +``` +`$ pipx uninstall ` +``` + +Or you can remove every package: + + +``` +$ pipx uninstall-all + +pipx uninstall-all                                                     2 ✘ │ 20:13:35   +uninstalled cowsay! ✨ 🌟 ✨ +uninstalled concentration! ✨ 🌟 ✨ +``` + +### Try pipx + +Pipx is a package manager for popular Python applications. It has access to everything on [PyPi][8], but it can also install applications from a local directory containing a valid Python package, a Python wheel, or a network location. + +If you install a lot of Python apps, try pipx. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/python-pipx + +作者:[Sumantro Mukherjee][a] +选题:[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/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://pypi.org/project/pipx/ +[3]: https://pypi.org/project/pip/ +[4]: https://opensource.com/article/20/8/python-concentration +[5]: https://opensource.com/sites/default/files/uploads/cowsay.png (Cowsay) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://github.com/Duncaen/OpenDoas +[8]: https://pypi.org/ From 334665adce14f1c558e31cfc2dd17c4b732a8a9f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Jul 2021 05:06:24 +0800 Subject: [PATCH 510/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210719=20?= =?UTF-8?q?Edward=20Snowden=20Thinks=20GIMP=20Needs=20a=20Major=20UI=20Ove?= =?UTF-8?q?rhaul?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md --- ...n Thinks GIMP Needs a Major UI Overhaul.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md diff --git a/sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md b/sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md new file mode 100644 index 0000000000..2f3eaf1c2a --- /dev/null +++ b/sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md @@ -0,0 +1,88 @@ +[#]: subject: (Edward Snowden Thinks GIMP Needs a Major UI Overhaul) +[#]: via: (https://news.itsfoss.com/gimp-ui-edward-snowden/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Edward Snowden Thinks GIMP Needs a Major UI Overhaul +====== + +Edward Snowden’s recent tweet praised what free and open-source software can achieve. + +In the tweet, he highlights that every time he uses Blender (an open-source 3D software suite), it reminds him of the advantages of FOSS and the growth of the ecosystem. + +He did not just limit to that, in a follow-up reply to the same thread, he also tagged **GIMP** and added, “**I’m really hoping for a major UI overhaul. You guys could be eating Adobe’s lunch.**“ + +> P.S. [@GIMP_Official][1], I'm really hoping for a major UI overhaul. You guys could be eating Adobe's lunch. +> +> — Edward Snowden (@Snowden) [July 18, 2021][2] + +### Does GIMP Require a Major UI Overhaul? + +![][3] + +[GIMP][4] is one of the most effective free and open-source image manipulation tools available. + +It is actively used by professionals and all kinds of individuals to get a variety of things done. + +You can even [make a GIF in GIMP][5]. Hence, it is tailored for simple and advanced tasks. + +While it offers a learning curve to get used to its UI, it is good enough functionality-wise. + +Does it require a UI overhaul? + +Yes, as per the trends, all kinds of designing/editing tools are working to improve the user-friendliness factor, GIMP may have missed out on this front. + +Of course, a sudden UI change may affect the workflow for a lot of veteran users. But, it does require a UI overhaul to beat its competitors like Adobe’s tools. + +Also, with an easy-to-use interface, it will attract more users, potentially helping it grow and monetize the project even further. + +And, it is also clear that Snowden thinks the same way, which is why he is hoping for a major UI overhaul while expecting GIMP to challenge Adobe tools in a big way. + +### Why is GIMP Not Working on a Major User Experience Overhaul Yet? + +Unfortunately, GIMP does not have regular UX contributors or developers to work on a major overhaul. + +They mentioned it as a reply to one of the tweets in Snowden’s tweet thread: + +> “We worked with a UX architect between 2005 and 2012. Good things came out of it. We make small UX improvements in almost every update now that point releases (e.g. 2.10.24) are allowed to have new stuff. But we don’t have a regular UX contributor or devs for a huge overhaul” + +Well, this is definitely a sad thing for such a popular project that gets immense love from thousands of users. + +And, I hope, after Snowden’s tweet, the GIMP project gets more traction and we see regular contributors to help evolve GIMP with the love it deserves. + +If you want to help, you can explore [GIMP’s contribution page][6] to learn more about helping the project. + +_Feel free to let me know your thoughts on GIMP and if you find it useful. Do you think that it needs a major UI overhaul, comments section is all yours!_ + +**Image Credits (Snowden’s image)**: [TheGuardian][7] + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gimp-ui-edward-snowden/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/GIMP_Official?ref_src=twsrc%5Etfw +[2]: https://twitter.com/Snowden/status/1416778909358731266?ref_src=twsrc%5Etfw +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://www.gimp.org +[5]: https://itsfoss.com/make-gif-in-gimp/ +[6]: https://www.gimp.org/develop/ +[7]: https://www.theguardian.com/books/2019/aug/01/edward-snowden-memoir-to-reveal-whistleblowers-secrets-permanent-record From 598b049bbec639a7d439aba82eb53f142a3bd5a5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Jul 2021 06:10:18 +0800 Subject: [PATCH 511/870] =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=BF=87=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ks Like an All-in-One Browser for Linux.md | 115 ------------------ ... Brings another Promising Release 0.5.0.md | 95 --------------- ...tep to Have Flatpak Apps Out-of-the-box.md | 95 --------------- ...ux Desktop Application is Now Available.md | 90 -------------- ...to Ditch the Standard Mixed Color Theme.md | 86 ------------- ...s New Features and Privacy Improvements.md | 88 -------------- ...Has Gradient Fill and Pixel Art Options.md | 86 ------------- ... Plasma 5.22, JPEG XL Support, and More.md | 90 -------------- 8 files changed, 745 deletions(-) delete mode 100644 sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md delete mode 100644 sources/news/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md delete mode 100644 sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md delete mode 100644 sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md delete mode 100644 sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md delete mode 100644 sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md delete mode 100644 sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md delete mode 100644 sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md diff --git a/sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md b/sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md deleted file mode 100644 index 50d653af38..0000000000 --- a/sources/news/20210610 Vivaldi 4.0 Looks Like an All-in-One Browser for Linux.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: subject: (Vivaldi 4.0 Looks Like an All-in-One Browser for Linux) -[#]: via: (https://news.itsfoss.com/vivaldi-4-0-release/) -[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Vivaldi 4.0 Looks Like an All-in-One Browser for Linux -====== - -Vivaldi 4.0 is the latest version that introduces new functionalities for multitaskers and users who rely on web browsers for everything. - -It is worth noting that only the UI layer of Vivaldi is closed-source, more than 93% of its source code is open-source. Even though it is not completely FOSS, many users use it because of its anti-tracking policy, appealing interface, and active Linux support. - -In case you did not know, recently [Vivaldi made significant performance improvements][1] taking Linux (Ubuntu) into account for testing. So, it looks like they keep Linux users in mind, which is a good thing. - -If you thought [Firefox 89][2] release was exciting, Vivaldi is particularly interesting for its new additions. - -### Vivaldi 4.0: What’s New? - -The latest major release focuses to prove itself as a better alternative to popular web browsers like Google Chrome, and Microsoft Edge. - -#### Vivaldi Translate - -![][3] - -Powered by [Lingvanex][4], Vivaldi Translate delivers a concise translation for your text, removing the need to install a plugin or using a separate translator tool and providing a secure translation too. - -Have you ever had to access a website in a language you do not understand? If yes, then you know how painful it is to copy-paste the text into a translator to understand what the page is saying. - -But now that you have an integrated tool with Vivaldi that facilitates your browsing experience without compromising your privacy. You can access the translation feature using the icon in the address bar whenever you load a website with a different language. - -#### Vivaldi Mail (Beta) - -![][5] - -Using a browser is a good way of exchanging information, including emails. When you have multiple emails for different purposes, it can get quickly overwhelming managing them. - -Mail makes it easier by assembling your diverse emails into a single place in the web browser. Due to its support for IMAP and POP3, you can integrate most email providers. - -So, you do not have to install a 3rd party webmail client to keep things convenient to access. - -#### Vivaldi Feed Reader (Beta) - -![][6] - -RSS is the go-to online reading for many users. - -While we have [RSS readers for Linux][7] already. You can access Vivaldi Feed Reader right from Mail; thus, allowing you to filter feeds and apply certain properties on them. - -You can add articles, YouTube videos, podcasts, and more to the feed. When you load up a site for anything, a feed icon comes up in the right-side of the address bar. All you have to do is click on it to add things to your feed, it is that easy. - -#### Vivaldi Calendar (Beta) - -Vivaldi Calendar does all that you expect from a full-fledged calendar app without the trade-off of your privacy. And this is an extremely useful addition to Vivaldi. - -Accessing what you plan without launching a separate service or app and having the ability to quickly access it in your browser should save a lot of time. - -#### Other Changes - -While Vivaldi offers a lot of features, it also makes it easy to choose the experience you want right after you launch the browser - -There are three layouts you can select: - -![][3] - - * **Essentials**: Only Ad blocker and translations available. - * **Classic**: Everything in essentials, plus side panels and status bar. - * **Fully Loaded:** All the features offered ready for access in your layout including the Calendar, Mail, and Feed Reader. - - - -For more information on how it all works and details of the latest release, you may want to go through the [announcement post][8]. - -### Summing Up - -Vivaldi is a cross-platform web browser that does not neglect Linux users. With the latest Vivaldi 4.0 release, the browser offers an exciting experience with an arsenal of features that major web browsers do not offer. - -You can download the latest update from the official website (DEB/RPM files available). You can also choose to manually add the repositories for your distribution using the [official instructions][9]. - -[Download Vivaldi 4.0][10] - -_What do you think about using Vivaldi on Linux after this major upgrade?_ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/vivaldi-4-0-release/ - -作者:[Omar Maarof][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/omar/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/vivaldi-browser-3-7-release/ -[2]: https://news.itsfoss.com/firefox-89-release/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://lingvanex.com -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUwNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEzMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://itsfoss.com/feed-reader-apps-linux/ -[8]: https://vivaldi.com/blog/vivaldi-4-0/ -[9]: https://help.vivaldi.com/desktop/install-update/manual-setup-vivaldi-linux-repositories/ -[10]: https://vivaldi.com/download/ diff --git a/sources/news/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md b/sources/news/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md deleted file mode 100644 index 53022505b3..0000000000 --- a/sources/news/20210614 helloSystem - FreeBSD Based OS Brings another Promising Release 0.5.0.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: subject: (helloSystem – FreeBSD Based OS Brings another Promising Release 0.5.0) -[#]: via: (https://www.debugpoint.com/2021/06/hellosystem-0-5-0-release/) -[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -helloSystem – FreeBSD Based OS Brings another Promising Release 0.5.0 -====== -The helloSystem team brings another promising release with its latest -version 0.5.0. And gives hope to users as a free alternative to macOS. -![helloSystem 0.5.0][1] - -The helloSystem is a FreeBSD-based lightweight operating system designed from the ground up. The operating system with FreeBSD at its core provides a real “open” alternative to the macOS and its users. - -The ideas and principles mainly give FreeBSD users an alternative to the no-lock-down environment, unlike macOS. That means you get any application software you want in helloSystem, that too includes all Linux applications. Because FreeBSD already has a built-in layer to run Linux applications. And it is worth mentioning that you can keep using your older hardware with this operating system without fear of non-upgradable status. - -An impressive operating system, indeed. However, the operating system is fairly new, hence things are still being worked on. - -Let’s take a look at what’s new in the new helloSystem 0.5.0 release. - -### helloSystem 0.5.0 – What’s New - -This release is based on the stable FreeBSD 12.2 version. This release provides updates to wireless networking and much new specific hardware support. The primary window manager is Openbox 3.4 which is a bit older version right now. - -The main top panel Global system menu is now updated automatically when the system is modified with applications or directories. - -From the changelog, it is evident that the file manager Filer sees most of the updates in this release of updates in this point release. Here are the updates in Filer 0.10.0: - - * Initial spatial mode option for Filer (each folder opens in its own window) - * “Go to…” menu in Filer, Command+Shift+G - * Go up to the parent folder in Filer using Command+Up - * Get Info in Filer using Command+I - * Filer brings already-open windows to the front rather than opening multiple windows for the same folder - * Context menu in Filer for opening text files and folders as root - * Filer now shows volumes on the desktop - * Filer now shows the correct names for volumes (“volume labels”) - * Adjusted icon grid size in Filer - * Filer now shows volumes first in the sidebar - * Menus are now available if only the desktop is showing and no Filer windows are open Filer now shows alternating row colors in detail view - - - -Other updates include: - - * New app QHexEdit and Android File Transfer Utility is introduced. - * Updated initgfx, more GPUs such as the AMD Radeon HD 6630M/6650M/6750M/7670M/7690M (Whistler/Turks) family GPUs found in 2011 Macs might now be supported - * Double click on the title bar of any application to hide the main window and shows only the title bar. - * It is now possible to save (persist across reboots) custom keyboard preferences -Placeholder .app bundles (and thereby menu entries) are automatically created for applications installed with pkg - * Audio Volume can now be set from the global menu bar - - - -![Utilities][2] - -Most of the important application shortcut is added, but they are not installed by default with the .iso file. So you need to download and install what you need. This is good in the way that, the .iso size is reduced without all those apps. You just install later what you need. Most of the important ones are available in the menu as shortcuts such as LibreOffice, GIMP, etc. - -### Download - -The project is hosted on GitHub at the moment. You can download the 64-bit .iso file from the below link. - -[helloSystem 0.5.0][3] - -Once downloaded, you can either install it in a physical system or try it on a [virtual machine][4]. - -If you are planning to try it out in a physical system as a multi-boot, I would recommend you to be a little extra careful, there might be issues with UEFI. - -### Closing Notes - -This is one of the interesting FreeBSD OS that I am following very closely. A promising project indeed with a stable alternative to Linux and macOS. Request you to contribute to the project in any capacity in GitHub. - -Cheers. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/06/hellosystem-0-5-0-release/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/helloSystem-0.5.0-1024x578.jpg -[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Utilities.jpg -[3]: https://github.com/helloSystem/ISO/releases/download/r0.5.0/hello-0.5.0_0E223-FreeBSD-12.2-amd64.iso -[4]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/ diff --git a/sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md b/sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md deleted file mode 100644 index 065429576a..0000000000 --- a/sources/news/20210617 elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: subject: (elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box) -[#]: via: (https://news.itsfoss.com/elementary-os-6-beta-2-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box -====== - -elementary OS 6 “Odin” [beta release][1] gave us a sneak peek on a variety of interesting things that are in motion for the final release. - -Now, the second beta release, i.e. **elementary OS 6 Beta 2** is starting to make sense of the ambitious plans that the development team has for the stable release soon. - -This release is meant for testing and development, do not install it on your production system. - -### What’s New in elementary OS 6 Beta 2? - -elementary OS 6 beta 2 brings in three major key upgrades along with under-the-hood improvements. - -First, the improvements to the installer. - -There are a few UI tweaks to the installer for a cleaner and consistent look. You will also find a subtle animation with the installation progress instead of a static icon. - -![Credits: elementary OS Blog][2] - -If you have been using the first beta, you will need to re-install for proper testing. The installer window did not resize, which was a problem for me to test using a virtual machine setup. - -The next major highlight is the **addition of first party Flatpak applications**. While they already made it clear that they want to transition to Flatpak packages for any pre-installed apps, now they are finally making progress. - -![][3] - -As mentioned in the beta 2 [release announcement][4]: - -> elementary OS 6 now comes with Calculator, Camera, Document Viewer, Screenshot, Tasks, and Web from the AppCenter Flatpak repository. - -So, you should expect more first-party applications to embrace Flatpak packaging. It will also make its way to third-party applications available in the App Center (which the developers can follow to make their applications available as a Flatpak package). - -Of course, this may also encourage other distributions to adopt Flatpak applications to provide a secure sandbox experience out of the box. - -The last important addition with this release is the **ability to add online accounts from the System settings**. - -You can add both mail and calendar accounts, note that both IMAP and CalDav standards are supported. - -Once you add the accounts, it will show up in apps like Calendar, Tasks, and Mail making the experience seamless. - -#### Other Improvements - -![][5] - -Along with several under-the-hood improvements, other significant changes include: - - * Improved notification system that supports icon badges and action buttons - * Updating the documentation before the final release - * Web supports dark style theme - - - -For more information on the latest beta release, you can explore the [release announcement][4]. - -### Download elementary OS 6 Beta 2 - -You can download the beta 2 for public testing from its [official builds][6] page. It is worth noting that only GitHub sponsors can access early/daily builds. - -[elementary OS 6 Beta 2][6] - -_I’m excited about elementary OS 6, what about you? Drop your thoughts in the comments section below._ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/elementary-os-6-beta-2-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/elementary-os-6-beta/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU1MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMiIgd2lkdGg9IjcxOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://blog.elementary.io/elementary-os-6-odin-beta-2/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4MCIgd2lkdGg9IjcyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://builds.elementary.io diff --git a/sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md b/sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md deleted file mode 100644 index 244e434df5..0000000000 --- a/sources/news/20210622 Security-Focused Tutanota Mail-s Linux Desktop Application is Now Available.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: subject: (Security-Focused Tutanota Mail’s Linux Desktop Application is Now Available) -[#]: via: (https://news.itsfoss.com/tutanota-desktop/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Security-Focused Tutanota Mail’s Linux Desktop Application is Now Available -====== - -Tutanota is an open-source privacy-oriented email service. It is an impressive [secure email service][1] as an alternative to Gmail. - -In fact, our ethical web portal [LinuxHandbook][2] hosts emails on Tutanota. - -While it is already a full-fledged service with constant improvements added regularly, the desktop client was something in beta since 2018. - -Now, they have finally [announced][3] the availability of their desktop client for Linux, Windows, and macOS for every Tutanota user. - -### Access Tutanota Using the Desktop Client - -The desktop client features all the goodies that you get with the web version. The announcement mentions that they have had rigorous tests and review to ensure that you get the best security while using the desktop version. - -![][4] - -You can also go through the [security review on GitHub][5]. - -To walk you through, let me highlight some of the key features that the desktop version offers: - - * Encrypted mailbox - * Encrypted calendar - * Secure Contact and Address book - * Ability to search encrypted data locally - * Supports email and calendar notifications - * Two-factor authentication - * Supports opening different windows - - - -In addition to these, you can also set out-of-the-office notifications, spellcheck your emails before sending, use filters, and do great deal of things that you normally find in the web version. - -If needed, you can set it up to run on startup, disable its background activity, choose the storage path for downloads, and several other options. - -The desktop client should give you a great level of control for a good experience. - -I also noticed that it offers a desktop integration option when you first launch the desktop app. This should integrate the client with the system tray. - -To enhance security, the desktop client uses caching of the web client. This will make sure that you don’t have to re-login and load up the correct version needed for access. - -![][6] - -### Download Tutanota Desktop - -It is available as an AppImage file for Linux. You may want to refer to our [AppImage guide][7] to get started. - -You can download it from the official website. Tutanota also gives you the [option to verify the signature][8] to check if you did not download a tampered file. - -[Download Tutanota][9] - -_A desktop client is something many users prefer over the web version, what about you? What do you think about Tutanota’s desktop version?_ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/tutanota-desktop/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/secure-private-email-services/ -[2]: https://linuxhandbook.com/about/ -[3]: https://tutanota.com/blog/posts/desktop-clients-end-beta/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://github.com/tutao/tutanota/issues/2787 -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://itsfoss.com/use-appimage-linux/ -[8]: https://tutanota.com/faq/#verify-desktop -[9]: https://tutanota.com/#download diff --git a/sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md b/sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md deleted file mode 100644 index d7967cb687..0000000000 --- a/sources/news/20210629 Dark and Light Only- Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: subject: (Dark and Light Only! Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme) -[#]: via: (https://news.itsfoss.com/ubuntu-21-10-theme-change/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Dark and Light Only! Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme -====== - -Ubuntu’s default “Yaru” community theme is an excellent choice. However, Ubuntu’s team has been tweaking it for a while since Ubutu 19.10 to match their branding and offer a good-looking experience. - -I liked the default themes available with Ubuntu 20.04. Up until now, you got standard, light, and dark theme options to choose from. - -![][1] - -But starting with [Ubuntu 21.10][2], you will no longer find the “**Standard**” (or mixed) theme available to pick. It all comes down to two choices that include light and dark theme only. - -Now, why is this happening? What exactly is the Standard theme offering now? - -Here’s what you need to know … - -### Ubuntu’s Standard Theme is Problematic - -![][1] - -If you have used Ubuntu, you probably know that Ubuntu’s Standard theme refers to a mixed theme. It features a dark window bar (or the titlebar of applications) and the rest follows a light theme pattern. - -With **Ubuntu and GNOME’s default theme color conflicts** and **lack of theming API** for GTK (and Gnome shell), it is already [problematic][3] to customize and work on Ubuntu’s desktop theme. - -Moreover, GTK 3 and GTK 4 do not support having a separate background color for the headerbar from the rest of the window. Hence, it is tough to keep bug-free implementations for every GTK application. - -And that is the reason the Yaru community design team recently [proposed][4] to remove the mixed theme. - -Ubuntu’s team has agreed to this decision and the change has been merged. You should no longer find the mixed theme in Ubuntu 21.10 but only the dark and light themes as your option. - -In other words, “Yaru” will be the light theme, and “Yaru dark” will be the dark theme when using [GNOME Tweaks][5]. There will be no “Yaru-light” anymore. - -### Will They Bring Back the Mixed Theme? - -Unless there are changes in the upstream — GNOME providing a theming API and GTK 3/4 supporting more customizability for headerbar, the mixed theme is gone for good. - -So, with Ubuntu 21.10 and any future releases, you get fully light and fully dark themes, which should offer a seamless user experience across any GTK application. - -### A Potential Rebranding in Ubuntu 21.10 - -While the Brand and Visual team at Canonical agreed to the default Yaru theme changes, they also want to work closely with the Yaru community design team for the upcoming rebranding, as mentioned by a designer in this [GitHub thread][4]: - -![][6] - -So, what exactly do we know about the upcoming rebranding for Ubuntu 21.10? Nothing yet. - -But considering that Ubuntu 20.04 shaped up with attractive branding and visuals, I’m excited about this one. Most probably, the default color scheme will change – but what what will it change to? - -Let’s wait for that! Feel free to share your thoughts on this development on Ubuntu’s future design in the comments below. - -First noticed at: [OMG! Ubuntu][7] - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/ubuntu-21-10-theme-change/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/ -[3]: https://github.com/ubuntu/yaru/discussions/2677 -[4]: https://github.com/ubuntu/yaru/issues/2913 -[5]: https://itsfoss.com/gnome-tweak-tool/ -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://www.omgubuntu.co.uk/2021/06/ubuntu-21-10-yarn-theme-change diff --git a/sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md b/sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md deleted file mode 100644 index 7b446a5a80..0000000000 --- a/sources/news/20210629 Nextcloud Alternative Twake Adds New Features and Privacy Improvements.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: subject: (Nextcloud Alternative Twake Adds New Features and Privacy Improvements) -[#]: via: (https://news.itsfoss.com/twake-2021-q2-release/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Nextcloud Alternative Twake Adds New Features and Privacy Improvements -====== - -If you did not know about Twake, you might want to check out our quick review on [Twake app][1] on our main portal. - -To give you a quick introduction, I would say that Twake aims to be a modern, open-source Nextcloud alternative with Slack-like features in the mix. In other words, it could be an all-in-one solution for your requirements. - -Now, after several updates to the platform, there’s a big release that addresses some improvements and adds a couple of new features. - -Here, let me give you some highlights of the latest release. - -### New and Improved Channels - -If you are using Twake to collaborate and communicate as an [open-source alternative to Slack][2], there are some significant improvements to the way everyone interacts with channels. - -It is now super easy to leave and join channels, which needed attention in its early implementation. - -![][3] - -The channel access rights have been tweaked to let the team members create a channel as per their requirements. If you have a lot of channels and want to add some of them for quick access, you can now add them to favorites to do just that. - -Also, if you are in dire need of multiple channels, you will have to ability to create groups of channels to better organize them. - -![][4] - -If you create a public channel, you can invite all your workspace members to it in one go. Also, if a new user joins, they will be added to all the public channels by default. - -### Colleagues and Guest Management - -![][5] - -You get a new add colleague button to add collaborators using their email addresses. While it makes things convenient, it is also great to see that you can invite anyone not in your workplace as a guest to a direct channel when needed. - -### Privacy and Other Improvements - -![][6] - -Originally, they used Amazon Web Services (AWS) to host everything. Now, they have switched to a France-based server (OVH Cloud) as someone with a better privacy policy in place. - -Under-the-hood, they have also transitioned from using PHP to NodeJS in the back end to make things faster. - -They have made several technical improvements to ensure security of users’ data and also improved the notifications. - -To learn more about what’s coming next and about this specific release, you can check out their [official announcement][7] or the [GitHub page][8]. - -[Twake.app][9] - -If you haven’t tried Twake yet, it is an interesting choice to go for. While there are some room for improvements like the addition of two-factor authentication for free and standard users, it is an impressive experience. - -_What do you think about Twake? Feel free to share your thoughts in the comments down below._ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/twake-2021-q2-release/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/twake-app/ -[2]: https://itsfoss.com/open-source-slack-alternative/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQxNCIgd2lkdGg9IjU1MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzMiIgd2lkdGg9Ijc1MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://www.linagora.com/en/post/2021/06/22/twake-q2-505-product-update-en -[8]: https://github.com/linagora/Twake -[9]: https://twake.app/en/ diff --git a/sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md b/sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md deleted file mode 100644 index 0a4e076a1b..0000000000 --- a/sources/news/20210630 Children-s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: subject: (Children’s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options) -[#]: via: (https://news.itsfoss.com/tux-paint-0-9-26/) -[#]: author: (Abhishek https://news.itsfoss.com/author/root/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Children’s Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options -====== - -Tux Paint is an [open source drawing application][1] and an alternative to Microsoft Paint on Linux. It is a cross-platform application and you can also use it on Windows and macOS. - -[Tux Paint][2] primarily intends to be used by children between the age of 3 and 12. It is actually used in schools worldwide. It features easy to use interface, sound effect and a Tux mascot that works as guide in an entertaining way. - -Of course, this doesn’t mean that you cannot use Tux Paint if you are 13 or older. - -The developers of Tux Paint have just released the version 0.9.26. Let’s see what new features you get in the latest release. - -### What’s new in Tux Paint 0.9.26? - -Here are the main new features in improvement added in the version 0.9.26. - -#### Fill tool now has gradient option - -![][3] - -Gradient colors have gained quite some popularity lately. Keeping that in mind, Tux Paint’s Fill tool now can fill the selected area with gradient colors. - -There are two kinds of gradients filling available. The “Radial” fill creates a circular gradient centered around the mouse click, while the “Linear” fill allows the interactive creation of gradients at different angles and sizes. - -#### Magic tools now has pixel and checkerboard options - -The Magic tool now has “pixel” options that makes it easier to create retro-gaming style pixel art. It doesn’t give the capability of full-fledged pixel tool like [Pixelorama][4] but at pixelating is available as an option. - -There is also a Checkerboard option that fills the entire canvas with a check pattern and the “Clone” option allows duplicating parts of the picture via brush strokes. - -#### Accessibility improvements - -![][5] - -The new version has two accessibility options added. The entire user interface of Tux Paint can now be enlarged. This is going to benefit users with impaired vision. This will also make the program more suitable to very HiDPI displays. - -Another option is to re-organize the color palette. It can also be helpful to users of coarse input devices, such as eye-gaze tracking systems. - -#### What else? - -Tux Paint’s user documentation has been overhauled and this makes localization easier. So if you are interested, please contact the Tux Paint team and help with localization efforts. - -#### Getting Tux Paint 0.9.26 - -On Linux, you can get the latest Tux Paint in [Flatpak package format][6]. If you have Flatpak support enabled, you can use the following command to install it: - -``` -flatpak install flathub org.tuxpaint.Tuxpaint -``` - -For Windows and macOS, you can [download it from its website][7]. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/tux-paint-0-9-26/ - -作者:[Abhishek][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/root/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/open-source-paint-apps/ -[2]: http://www.tuxpaint.org/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://itsfoss.com/pixelorama/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYyNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://flathub.org/apps/details/org.tuxpaint.Tuxpaint -[7]: http://www.tuxpaint.org/download/ diff --git a/sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md b/sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md deleted file mode 100644 index 2be59d622d..0000000000 --- a/sources/news/20210701 KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: subject: (KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More) -[#]: via: (https://news.itsfoss.com/kaos-2021-06-release/) -[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More -====== - -[KaOS][1] is an independent Linux/GNU distribution built from scratch. It is uses Qt and [KDE][2], comes baked in with [pacman][3] as its package manager. - -The latest version comes with useful upgrades. Let’s discover what this version has to offer. - -### What’s New? - -![][4] - -KaOS 2021.06 comes with [Plasma 5.22][5], which is the latest and the most stable release currently. Not just limited to stability, it also provides better flexibility and usability. To know more about the desktop environment, you can refer to our article on [Plasma 5.22][6]. - -To give you a quick overview, the most remarkable new feature Plasma 5.22 presents is **Adaptive Transparency. **It means the panel and panel widgets will be pleasantly translucent. However, if there are any maximized windows, they will become entirely opaque. - -Also, **Plasma Wayland** session now supports **Activities. **Thus, you can keep your work separate from other tasks. In other words, you will get the most out of your activity by staying focused on it. - -Along with the desktop environment upgrade, some of the key changes include: - - * Plasma System Monitor now replaces KSysguard. - * No need to adjust a mirror list to install/update KaOS anymore. KaOS will be using Fosshost as the default mirror, which utilizes Fastly CDN to deliver the content from a nearby location without you needing to select a mirror explicitly. - * KWin Wayland now includes the Present Windows effect. - * New applications added include [Maliit][7] virtual keyboard packages. - * Support for [JPEG XL][8], a modern option for the JPEG format. - - - -![][9] - -### Other Improvements - - * The Calamares installer has two new QML modules to provide consistent layout and the interactive map that you notice in the installer should work fine without an active internet connection. - * All of the latest Plasma Desktop packages are built on **Qt 5.15.2+**. These include Frameworks 5.83.0, Plasma 5.22.2, and KDE applications 21.04.2. - * LibreOffice has replaced Calligra as the default office suite. - * Installing on RAID is currently unavailable. - - - -![][10] - -For more details you can refer to the [official announcement][11]. - -### Summing Up - -KaOS is making progress towards providing a complete and focused open-source operating system. They are working on presenting constant enhancements within the scope of KDE. - -[Download KaOS 2021.06][12] - -_What do you think about KaOS with Plasma 5.22? Would you be willing to try it out?_ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/kaos-2021-06-release/ - -作者:[Omar Maarof][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/omar/ -[b]: https://github.com/lujun9972 -[1]: https://kaosx.us/ -[2]: https://kde.org/ -[3]: https://itsfoss.com/pacman-command/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://kde.org/announcements/plasma/5/5.22.0/ -[6]: https://news.itsfoss.com/kde-plasma-5-22-release/ -[7]: https://maliit.github.io/ -[8]: https://jpeg.org/jpegxl/ -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU3NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[11]: https://kaosx.us/news/2021/kaos06/ -[12]: https://kaosx.us/pages/download/ From c9ba9ca19dd63d37369f25fb07070c38f1ae2941 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Jul 2021 06:28:12 +0800 Subject: [PATCH 512/870] PRF @PearFL --- .../20210606 How Real-World Apps Lose Data.md | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/translated/talk/20210606 How Real-World Apps Lose Data.md b/translated/talk/20210606 How Real-World Apps Lose Data.md index 85870a44d5..ee04f3dc65 100644 --- a/translated/talk/20210606 How Real-World Apps Lose Data.md +++ b/translated/talk/20210606 How Real-World Apps Lose Data.md @@ -3,44 +3,47 @@ [#]: author: (Simon Arneaud https://theartofmachinery.com) [#]: collector: (lujun9972) [#]: translator: (PearFL) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -真实世界的应用程序是如何丢失数据? +现实中的应用程序是如何丢失数据? ====== -现代应用程序开发的一大优点是,云提供商会担心硬件故障或如何设置RAID等问题。优秀的云供应商不太可能丢失你的应用数据, 所以有时我会被询问现在的备份究竟是什么呢?下面是一些现实世界的故事。 +![](https://img.linux.net.cn/data/attachment/album/202107/20/062734awvesw2nqnzrsw5i.jpg) -### 故事 #1 +现代应用程序开发的一大优点是,像硬件故障或如何设置 RAID 这类问题是由云提供商操心的。优秀的云供应商不太可能丢失你的应用数据,所以有时我会被询问现在为什么还要备份?下面是一些现实世界的故事。 -第一个故事来自一个数据科学项目:它基本上是一个从正在进行的研究中来收集数据的庞大而复杂的管道,然后用各种不同的方式处理以满足一些尖端模型的需要。这个面向用户的应用程序还没有启动,但是一个由数据科学家和开发人员组成的团队已经为建立这个模型和它的数据集工作了好几个月。 +### 故事之一 -在项目中工作的人有他们自己的实验工作的开发环境。他们会在终端中做一些类似' export ENVIRONMENT=simonsdev '的事情,然后所有在终端上运行的软件都会在那个环境下运行,而不是在生产环境下。 +第一个故事来自一个数据科学项目:它基本上是一个从正在进行的研究中来收集数据的庞大而复杂的管道,然后用各种不同的方式处理以满足一些尖端模型的需要。这个面向用户的应用程序还没有推出,但是一个由数据科学家和开发人员组成的团队已经为建立这个模型和它的数据集工作了好几个月。 -该团队需要承受着巨大的压力去推出面向用户的应用程序,以便利益相关者能够从他们几个月的投资中真正看到一些回报。一个星期六,一位工程师试图赶完一些工作。他在晚上很晚的时候做完了一个实验,决定收拾东西回家。他启动了一个清理脚本来删除他的开发环境中的所有内容,但奇怪的是,这比平时花费了更长的时间。那时他意识到他已经忘记了哪个终端被配置为指向哪个环境。 +在项目中工作的人有他们自己的实验工作的开发环境。他们会在终端中做一些类似 `export ENVIRONMENT=simonsdev` 的事情,然后所有在终端上运行的软件都会在那个环境下运行,而不是在生产环境下。 -### 故事 #2 +该团队迫切需要推出一个面向用户的应用程序,以便那些花钱的人能够从他们几个月的投资中真正看到一些回报。在一个星期六,一位工程师试图赶工一些工作。他在晚上很晚的时候做完了一个实验,决定收拾东西回家。他启动了一个清理脚本来删除他的开发环境中的所有内容,但奇怪的是,这比平时花费了更长的时间。这时他意识到,他已经忘记了哪个终端被配置为指向哪个环境。(LCTT 译注:意即删除了生产环境。) -第二个故事来自于一个商业网页和手机应用。后端有一个由一组工程师负责的微服务体系结构。这意味着部署需要协调,但是使用正式的发布过程和自动化简化了一些。新代码在准备好后会被审查并合并到 master 中,并且高级开发人员经常会为每个微服务标记一个版本,然后自动部署到暂存环境。临时环境中的版本会定期收集到一个元版本中,在自动部署到生产之前,该版本会得到不同人的认可(这是一个合规环境)。 +### 故事之二 -有一天,一位开发人员正在开发一个复杂的功能,而其他开发该微服务的开发人员一致认为,应该致力于掌握正在进行的代码,并理解它不应该被实际发布。长话短说,并不是团队中的每个人都收到了消息,而是代码进入了发布管道。更糟糕的是,实验代码需要一种新的方式来表示用户配置文件数据,因此它有一个临时数据迁移,在启动到生产时运行并损坏所有用户配置文件。 +第二个故事来自于一个商业的网页和手机应用。后端有一个由一组工程师负责的微服务体系结构。这意味着部署需要协调,但是使用正式的发布过程和自动化简化了一些。新代码在准备好后会被审查并合并到主干中,并且高层开发人员通常会为每个微服务标记版本,然后自动部署到临时环境。临时环境中的版本会被定期收集到一个元版本中,在自动部署到生产环境之前,该版本会得到各个人的签署(这是一个合规环境)。 -### 故事 #3 +有一天,一位开发人员正在开发一个复杂的功能,而其他开发该微服务的开发人员都同意将他们正在开发的代码提交到主干,也都知道它还不能被实际发布。长话短说,并不是团队中的每个人都收到了消息,而代码就进入了发布管道。更糟糕的是,那些实验性代码需要一种新的方式来表示用户配置文件数据,因此它有一个临时数据迁移,它在推出到生产环境时运行,损坏了所有的用户配置文件。 -第三个故事来自另一款网络应用。这个有一个更简单的架构:大部分代码在一个应用程序中,数据在数据库中。然而,这个应用程序也是在很大的截止日期压力下编写的。事实证明,在开发初期,当彻底的数据库架构更改很常见时,添加了一项功能来检测此类更改并清理旧数据。这实际上对发布前的早期开发很有用,并且始终仅作为开发环境的临时功能。不幸的是,在匆忙构建应用的其余部分并启动时,我们忘记了代码。当然,直到有一天它在生产环境中被触发。 +### 故事之三 + +第三个故事来自另一款网页应用。这个有一个更简单的架构:大部分代码在一个应用程序中,数据在数据库中。然而,这个应用程序也是在很大的截止日期压力下编写的。事实证明,在开发初期,当彻底更改的数据库架构很常见时,添加一项功能来检测此类更改并清理旧数据,这实际上对发布前的早期开发很有用,并且始终只是作为开发环境的临时功能。不幸的是,在匆忙构建应用的其余部分并推出时,我们忘记了这些代码。当然,直到有一天它在生产环境中被触发了。 ### 事后分析 -对于任何停机问题的事后分析,很容易忽视大局,最终将一切归咎于一些小细节。一个特例是发现某人犯了一些错误,然后责怪那个人。这些故事中的所有工程师实际上都是优秀的工程师(雇佣SRE顾问的公司不是为了偷工减料),所以解雇他们,换掉他们并不能解决任何问题。即使你拥有100个开发人员,这100个开发人员仍然是有限的,所以在足够的复杂性和压力下,错误也会发生。最重要的解决方案是备份,它可以帮助你在丢失数据的情况下(包括来自恶意软件的数据,这是最近新闻中的一个热门话题)。如果你无法容忍零拷贝,就不要只有一个副本。 +对于任何故障的事后分析,很容易忽视大局,最终将一切归咎于一些小细节。一个特例是发现某人犯了一些错误,然后责怪那个人。这些故事中的所有工程师实际上都是优秀的工程师(雇佣 SRE 顾问的公司不是那些在长期雇佣中偷工减料的公司),所以解雇他们,换掉他们并不能解决任何问题。即使你拥有 100 倍的开发人员,它仍然是有限的,所以在足够的复杂性和压力下,错误也会发生。最重要的解决方案是备份,无论你如何丢失数据(包括来自恶意软件,这是最近新闻中的一个热门话题),它都能帮助你。如果你无法容忍没有副本,就不要只有一个副本。 -故事1的结局很糟糕:没有备份。该项目因近六个月的数据收集而推迟。顺便说一句,有些地方只保留一个每日快照作为备份,这个故事也是一个很好的例子,说明了这是如何出错的:如果数据丢失发生在星期六,并且准备在星期一尝试恢复,那么一日备份就只能得到星期日的空数据。 +故事之一的结局很糟糕:没有备份。该项目的六个月的数据收集白干了。顺便说一句,有些地方只保留一个每日快照作为备份,这个故事也是一个很好的例子,说明了这也会出错:如果数据丢失发生在星期六,并且你准备在星期一尝试恢复,那么一日备份就只能得到星期日的一个空数据备份。 -故事2并不有趣,但效果要好得多。备份可用,但数据迁移也是可逆的。不有趣的部分是发布是在午餐前完成的,并且必须在生产站点关闭时对修复进行编码。我讲这个故事的主要原因是为了提醒大家,备份并不仅仅是灾难性的数据丢失。部分数据损坏也会发生,而且可能会更加混乱。 +故事之二并不算好,但结果要好得多。备份是可用的,但数据迁移也是可逆的。不好的部分是发布是在推出前完成的,并且修复工作必须在生产站点关闭时进行编码。我讲这个故事的主要原因是为了提醒大家,备份并不仅仅是灾难性的数据丢失。部分数据损坏也会发生,而且可能会更加混乱。 -故事3仅仅只是一般。尽管少量数据永久丢失,但大部分数据可以从备份中恢复。团队中的每个人都对现在没有注释的极其危险的代码感到非常糟糕。我没有参与早期的开发,但我感觉很糟糕,因为恢复数据所需的时间比正常情况要长得多。通过经过良好测试的恢复过程,我认为该站点应该在总共不到 15 分钟的时间内重新上线。但是第一次恢复没有成功,我不得不调试为什么不能成功,然后重试。当一个生产站点宕机了,需要你重新启动它,每10秒就会感觉很漫长。 值得庆幸的是,涉众比某些人理解得多。他们实际上松了一口气,因为一次数分钟的数据丢失和不到一小时的停机时间本就可以使公司陷入瘫痪的灾难。 +故事之三还好。尽管少量数据永久丢失,但大部分数据可以从备份中恢复。团队中的每个人都对没有标记极其明显的危险代码感到非常难过。我没有参与早期的开发,但我感觉很糟糕,因为恢复数据所需的时间比正常情况要长得多。如果有一个经过良好测试的恢复过程,我认为该站点应该在总共不到 15 分钟的时间内重新上线。但是第一次恢复没有成功,我不得不调试它为什么不能成功,然后重试。当一个生产站点宕机了,需要你重新启动它,每过 10 秒钟都感觉过了一个世纪。值得庆幸的是,老板们比某些人更能理解我们。他们实际上松了一口气,因为这一场可能使公司沉没的一次性灾难只导致了几分钟的数据丢失和不到一个小时的停机时间。 + +在实践中,备份“成功”但恢复失败的情况极为普遍。很多时候,小型数据集上进行恢复测试是可以正常工作的,但在生产规模的大数据集上就会失败。当每个人都压力过大时,灾难最有可能发生,而生产站点的故障只会增加压力。在时间合适的时候测试和记录完整的恢复过程是一个非常好的主意。 -在实践中,进行了备份“工作”但恢复失败是非常常见的。很多时候,小型数据集上进行恢复测试是可以正常工作的,但在生产规模的大数据集上就会失败。当每个人都压力过大时,灾难最有可能发生,而关闭生产站点只会增加压力。在时间合适的时候测试和记录完整的恢复过程是一个非常好的主意。 -------------------------------------------------------------------------------- via: https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html @@ -48,7 +51,7 @@ via: https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html 作者:[Simon Arneaud][a] 选题:[lujun9972][b] 译者:[PearFL](https://github.com/PearFL) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 42ff431f8f5e543299fa6d65345970be59d241d6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Jul 2021 06:28:56 +0800 Subject: [PATCH 513/870] PUB @PearFL https://linux.cn/article-13598-1.html --- .../20210606 How Real-World Apps Lose Data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210606 How Real-World Apps Lose Data.md (98%) diff --git a/translated/talk/20210606 How Real-World Apps Lose Data.md b/published/20210606 How Real-World Apps Lose Data.md similarity index 98% rename from translated/talk/20210606 How Real-World Apps Lose Data.md rename to published/20210606 How Real-World Apps Lose Data.md index ee04f3dc65..9f8406d810 100644 --- a/translated/talk/20210606 How Real-World Apps Lose Data.md +++ b/published/20210606 How Real-World Apps Lose Data.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (PearFL) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13598-1.html) 现实中的应用程序是如何丢失数据? ====== From a010a88c87b32773216e1747b30ffbec7a2cc5fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Jul 2021 06:54:29 +0800 Subject: [PATCH 514/870] PRF @MjSeven --- ...ogramming languages read and write data.md | 66 ++++++++----------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/translated/tech/20210714 How different programming languages read and write data.md b/translated/tech/20210714 How different programming languages read and write data.md index 638a15b63b..34466071bb 100644 --- a/translated/tech/20210714 How different programming languages read and write data.md +++ b/translated/tech/20210714 How different programming languages read and write data.md @@ -3,18 +3,20 @@ [#]: author: "Alan Smithee https://opensource.com/users/alansmithee" [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 不同的编程语言是如何读写数据的 ====== -每种编程语言都有其独特的完成任务的方式,这也说明了为什么有这么多语言可供选择。 -![Code going into a computer.][1] -在 Jim Hall 的_[不同的编程语言如何完成相同的事情][2]_文章中,他演示了 13 中不同的语言如何使用不同的语法来完成同一个任务。经验是,编程语言往往有很多相似之处。一旦你了解了一种编程语言,你就可以通过理解它的语法和结构来学习另一种。 +> 每种编程语言都有其独特的完成任务的方式,这也说明了为什么有这么多语言可供选择。 -本着同样的精神,Jim 的文章比较了不同编程语言如何读写数据。无论数据来自配置文件还是用户创建的文件,在存储设备上处理数据都是程序员的常见任务。但以这种方式涵盖所有编程语言是不切实际的,最近的 Opensource.com 系列文章提供了对这些编程语言采用的不同方法的深入了解: +![](https://img.linux.net.cn/data/attachment/album/202107/20/065355dfr3f1zmf7fpzmw7.jpg) + +在 Jim Hall 的《[不同的编程语言如何完成相同的事情][2]》文章中,他演示了 13 种不同的语言如何使用不同的语法来完成同一个任务。经验是,编程语言往往有很多相似之处。一旦你了解了一种编程语言,你就可以通过理解它的语法和结构来学习另一种。 + +本着同样的精神,Jim 的文章比较了不同编程语言如何读写数据。无论数据来自配置文件还是用户创建的文件,在存储设备上处理数据都是程序员的常见任务。以这种方式涵盖所有编程语言是不切实际的,但最近的 Opensource.com 系列文章提供了对这些编程语言采用的不同方法的深入了解: * [C][3] * [C++][4] @@ -24,13 +26,11 @@ * [Bash][8] * [Python][9] - - ### 读写数据 用计算机读写数据的过程和你在现实生活中读写数据的过程类似。要访问书中的数据,你首先要打开它,然后阅读单词或将生词写入书中,然后合上书。 -当程序需要从文件中读取数据时,你向程序传入一个文件位置,然后计算机将该数据读入 RAM 中并解析它。同样,当程序需要将数据写入文件时,计算机会将新数据放入系统的内存写入缓冲区,然后将其同步到存储设备上的文件中。 +当程序需要从文件中读取数据时,你向程序传入一个文件位置,然后计算机将该数据读入内存中并解析它。同样,当程序需要将数据写入文件时,计算机会将新数据放入系统的内存写入缓冲区,然后将其同步到存储设备上的文件中。 下面是这些操作的一些伪代码: @@ -38,18 +38,15 @@ 2. 读取文件内容,或将数据写入文件。 3. 关闭文件。 - - ### 从文件中读取数据 从 Opensource.com 系列文章的语言中,你可以看到读取文件的三种趋势。 #### C -在 C 语言中,打开文件可能涉及检索单个字符,例如 `EOF` 指示符,表示文件结束,或数据块,具体取决于你的需求和方法。根据你的目标,它可能感觉像一个主要是手工的过程,但这正是其他语言所模仿的。 +在 C 语言中,打开文件可能涉及检索单个字符(直到 `EOF` 指示符,表示文件结束)或一个数据块,具体取决于你的需求和方法。根据你的目标,它可能感觉像一个主要是手工的过程,但这正是其他语言所模仿的。 - -```c +``` FILE *infile; int ch; @@ -68,7 +65,7 @@ fclose(infile); 你还可以选择将文件的某些部分加载到系统缓冲区中,然后在缓冲区外工作。 -```c +``` FILE *infile; char buffer[300]; @@ -87,8 +84,7 @@ fclose(infile); C++ 简化了一些步骤,允许你将数据解析为字符串。 - -```c++ +``` std::string sFilename = "example.txt"; std::ifstream fileSource(sFilename); @@ -101,10 +97,9 @@ while (fileSource >> buffer) { #### Java -Java 和 Groovy 和 C++ 类似。它们使用名为 `Scanner` 的类来设置数据流或对象,这样就会包含你选择的文件内容。你可以通过标记(字节、行、整数等)扫描文件。 +Java 和 Groovy 类似于 C++。它们使用名为 `Scanner` 的类来设置数据流或对象,这样就会包含你选择的文件内容。你可以通过标记(字节、行、整数等)扫描文件。 - -```java +``` File myFile = new File("example.txt"); Scanner myScanner = new Scanner(myFile); @@ -119,7 +114,7 @@ myScanner.close(); #### Groovy -```groovy +``` def myFile = new File('example.txt') def myScanner = new Scanner(myFile) @@ -135,8 +130,7 @@ myScanner.close() Lua 和 Python 进一步抽象了整个过程。你不必有意识地创建数据流,你只需给一个变量赋值为 `open` 函数的返回值,然后解析该变量的内容。这种方式快速,最简且容易。 - -```lua +``` myFile = io.open('example.txt', 'r') lines = myFile:read("*all") @@ -148,7 +142,7 @@ myFile:close() #### Python -```python +``` f = open('example.tmp', 'r') for line in f: @@ -165,14 +159,12 @@ f.close() 在 C 语言中,你可以使用 `fputc` 函数将字符写入文件: - -```c +``` fputc(ch, outfile); ``` 或者,你可以使用 `fwrite` 将数据写入缓冲区。 - ```c fwrite(buffer, sizeof(char), buffer_length, outfile); ``` @@ -181,8 +173,7 @@ fwrite(buffer, sizeof(char), buffer_length, outfile); 因为 C++ 使用 `ifstream` 库为数据打开缓冲区,所以你可以像 C 语言那样将数据写入缓冲区(C++ 库除外)。 - -```c++ +``` std::cout << buffer << std::endl; ``` @@ -190,19 +181,17 @@ std::cout << buffer << std::endl; 在 Java 中,你可以使用 `FileWriter` 类来创建一个可以写入数据的对象。它的工作方式与 `Scanner` 类非常相似,只是方向相反。 - -```java -[FileWriter][19] myFileWriter = new [FileWriter][19]("example.txt", true); +``` +FileWriter myFileWriter = new FileWriter("example.txt", true); myFileWriter.write("Hello world\n"); myFileWriter.close(); ``` #### Groovy -类似地,Groovy 使用 `FileWriter`,但使用了稍微 "groovy" 的语法。 +类似地,Groovy 使用 `FileWriter`,但使用了稍微 “groovy” 的语法。 - -```groovy +``` new FileWriter("example.txt", true).with { write("Hello world\n") flush() @@ -214,17 +203,16 @@ new FileWriter("example.txt", true).with { Lua 和 Python 很相似,都使用名为 `open` 的函数来加载文件,`writer` 函数来写入数据,`close` 函数用于关闭文件。 -```Lua +``` myFile = io.open('example.txt', 'a') io.output(myFile) io.write("hello world\n") -io.close(myFile)xxxxxxxxxx myFile = io.open('example.txt', 'a')io.output(myFile)io.write("hello world\n")io.close(myFile)myFile = io.open('example.txt', 'a')io.output(myFile)io.write("hello world\n")io.close(myFile) +io.close(myFile) ``` #### Python - -```python +``` myFile = open('example.txt', 'w') myFile.write('hello world') myFile.close() @@ -254,7 +242,7 @@ via: https://opensource.com/article/21/7/programming-read-write 作者:[Alan Smithee][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 54795c738b2be364ffc70d5bf4d8243d7f51ce11 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Jul 2021 06:55:22 +0800 Subject: [PATCH 515/870] PUB @MjSeven https://linux.cn/article-13599-1.html --- ...How different programming languages read and write data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210714 How different programming languages read and write data.md (99%) diff --git a/translated/tech/20210714 How different programming languages read and write data.md b/published/20210714 How different programming languages read and write data.md similarity index 99% rename from translated/tech/20210714 How different programming languages read and write data.md rename to published/20210714 How different programming languages read and write data.md index 34466071bb..544a76741a 100644 --- a/translated/tech/20210714 How different programming languages read and write data.md +++ b/published/20210714 How different programming languages read and write data.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13599-1.html" 不同的编程语言是如何读写数据的 ====== From 76d6cd41bec128b14af9b1b014d2ded8f1e33721 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 20 Jul 2021 08:35:56 +0800 Subject: [PATCH 516/870] translated --- ...4 Getting Started with Podman on Fedora.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) rename {sources => translated}/tech/20210714 Getting Started with Podman on Fedora.md (54%) diff --git a/sources/tech/20210714 Getting Started with Podman on Fedora.md b/translated/tech/20210714 Getting Started with Podman on Fedora.md similarity index 54% rename from sources/tech/20210714 Getting Started with Podman on Fedora.md rename to translated/tech/20210714 Getting Started with Podman on Fedora.md index 852e1368cd..476e69069e 100644 --- a/sources/tech/20210714 Getting Started with Podman on Fedora.md +++ b/translated/tech/20210714 Getting Started with Podman on Fedora.md @@ -7,35 +7,35 @@ [#]: publisher: ( ) [#]: url: ( ) -Getting Started with Podman on Fedora +在 Fedora 上开始使用 Podman ====== ![][1] -Podman logo from the Podman project +来自 Podman 项目的 Podman 标志 -[Podman][2] is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System. In this article, we will introduce podman and how to use it with a small application build using nodejs. The app will be very simple and clean. +[Podman][2] 是一个无守护程序的容器引擎,用于在你的 Linux 系统上开发、管理和运行 OCI 容器。在这篇文章中,我们将介绍 podman 以及如何用 nodejs 构建一个小型应用来使用它。该应用将是非常简单和干净的。 -### Install Podman +### 安装 Podman -Podman command is the same as [docker][3] just type in your terminal **alias docker=podman** if you have docker already installed +如果你已经安装了 docker,只需在终端输入 **alias docker=podman**,那么 Podman 的命令就与 [docker][3] 相同。 -Podman is installed by default in Fedora. But if you don’t have it for any reason, you can install it using the following command: +在 Fedora 中,Podman 是默认安装的。但是如果你因为任何原因没有安装,你可以用下面的命令安装它: ``` sudo dnf install podman ``` -For fedora [silverblue][4] users, podman is already installed in your OS. +对于 Fedora [silverblue][4] 用户,podman 已经安装在你的操作系统中了。 -After installation, run the hello world image to ensure everything is working: +安装后,运行 hello world 镜像,以确保一切正常: ``` podman pull hello-world podman run hello-world ``` -If everything is working well you will see the following output in your terminal: +如果一切运行良好,你将在终端看到以下输出: ``` Hello from Docker! @@ -53,15 +53,15 @@ This message shows that your installation appears to be working correctly. https://docs.docker.com/get-started/ ``` -### Simple Nodejs App +### 简单的 Nodejs 应用 -First, we will create a folder **webapp** , type the following command in your terminal +首先,我们将创建一个文件夹 **webapp**,在终端输入以下命令 ``` mkdir webapp && cd webapp ``` -Now create the file ****_package.json_ This file includes all the dependencies that the project needs to work well. Copy the following code inside the file _package.json ._ +现在创建文件 **_package.json_**,该文件包括项目运行所需的所有依赖项。在文件 _package.json_ 中复制以下代码: ``` { @@ -74,7 +74,7 @@ Now create the file ****_package.json_ This file includes all the dependencies t } ``` -Create the file _index.js_ and add the following code there: +创建文件 _index.js_,并在其中添加以下代码: ``` const express = require('express') @@ -89,11 +89,11 @@ app.listen(8081, () => { }); ``` -You can download source code from [here][5]. +你可以从[这里][5]下载源代码。 -### Create Dockerfile +### 创建 Dockerfile -First of all, create a file called _Dockerfile_ and make sure the first character is a capital, NOT lower case, then add the following code there: +首先,创建一个名为 _Dockerfile_ 的文件,并确保第一个字符是大写,而不是小写,然后在那里添加以下代码: ``` FROM node:alpine @@ -103,42 +103,42 @@ RUN npm install CMD ["npm", "start"] ``` -Be sure you are inside the folder _webapp_ then show the image and then type the following command: +确保你在 _webapp_ 文件夹内,然后显示镜像,然后输入以下命令: ``` podman build . ``` -Make sure to add the **dot**. The image is created on your machine and you can show it using the following command: +确保加了**点**。镜像在你的机器上被创建,你可以用以下命令显示它: ``` podman images ``` -The last step is to run the image inside a container by typing the following command: +最后一步是输入以下命令在容器中运行该镜像: ``` podman run -p 8080:8080 ``` -Now open your browser in _localhost:8080_ and you will see that your app works. +现在在你的浏览器中打开 _localhost:8080_,你会看到你的应用已经工作。 -### Stopping and Remove Container +### 停止和删除容器 -To exit from the container use _CTRL-C._ You can remove the container by using the container id. Get the id and stop the container using these commands: +使用 _CTRL-C_ 退出容器,你可以使用容器 ID 来删除容器。获取 ID 并使用这些命令停止容器: ``` podman ps -a podman stop ``` -You can delete the images from your machine by using the following command: +你可以使用以下命令从你的机器上删除镜像: ``` podman rmi ``` -Read more about podman and how it works on the [official website][2] +在[官方网站][2]上阅读更多关于 podman 和它如何工作的信息。 -------------------------------------------------------------------------------- @@ -146,7 +146,7 @@ via: https://fedoramagazine.org/getting-started-with-podman-in-fedora/ 作者:[Yazan Monshed][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e4f62eb889d432c40ab8741d5fff838d03639619 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 20 Jul 2021 08:40:24 +0800 Subject: [PATCH 517/870] translating --- ...apper- A Sleek Looking Linux Video Player for Minimalists.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md b/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md index d0f91333b4..67f0f58036 100644 --- a/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md +++ b/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/clapper-video-player/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ffea1889784deb9232c2a62e3bcd7ccbc8bd7cb5 Mon Sep 17 00:00:00 2001 From: zhaoxiaonan Date: Tue, 20 Jul 2021 11:42:10 +0800 Subject: [PATCH 518/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=BE=85=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...05 6 evening rituals for working in tech.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sources/tech/20201105 6 evening rituals for working in tech.md b/sources/tech/20201105 6 evening rituals for working in tech.md index 6b999b090e..ed7a7e7d03 100644 --- a/sources/tech/20201105 6 evening rituals for working in tech.md +++ b/sources/tech/20201105 6 evening rituals for working in tech.md @@ -1,11 +1,11 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (6 evening rituals for working in tech) -[#]: via: (https://opensource.com/article/20/11/evening-rituals-working-tech) -[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike) +[#]: collector: "lujun9972" +[#]: translator: "Arzelan" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "6 evening rituals for working in tech" +[#]: via: "https://opensource.com/article/20/11/evening-rituals-working-tech" +[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" 6 evening rituals for working in tech ====== @@ -44,6 +44,6 @@ via: https://opensource.com/article/20/11/evening-rituals-working-tech [a]: https://opensource.com/users/jen-wike [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_jadud_farm-road.png?itok=of8IuSM5 (A farm road) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_jadud_farm-road.png?itok=of8IuSM5 "A farm road" [2]: https://opensource.com/article/20/2/linux-ebook-readers [3]: https://opensource.com/article/20/10/tech-morning-rituals From 07995bf7c0e3648da2fb24eb9c66cbfa4336f629 Mon Sep 17 00:00:00 2001 From: Shiboi77 <87035635+Shiboi77@users.noreply.github.com> Date: Tue, 20 Jul 2021 18:20:33 +0800 Subject: [PATCH 519/870] Update and rename sources/talk/20210529 My family-s Linux story.md to transtlated/talk/20210529 My family-s Linux story.md --- .../talk/20210529 My family-s Linux story.md | 38 ------------------- .../talk/20210529 My family-s Linux story.md | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 sources/talk/20210529 My family-s Linux story.md create mode 100644 transtlated/talk/20210529 My family-s Linux story.md diff --git a/sources/talk/20210529 My family-s Linux story.md b/sources/talk/20210529 My family-s Linux story.md deleted file mode 100644 index 32febedaca..0000000000 --- a/sources/talk/20210529 My family-s Linux story.md +++ /dev/null @@ -1,38 +0,0 @@ -[#]: subject: (My family's Linux story) -[#]: via: (https://opensource.com/article/21/5/my-linux-story) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) -[#]: collector: (lujun9972) -[#]: translator: (Shiboi77) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -My family's Linux story -====== -Our first attempt at Linux was just an apt-get away. -![Terminal command prompt on orange background][1] - -My first attempt at Linux was one of those "maybe I should give this a try" kinds of situations. - -Back in the late 1990s, I found some kind of packaged Red Hat distro on quite a few floppies, bought a second hard drive for the family laptop, and set about installing it. It was an interesting experiment, but as I recall the family wasn't quite ready to share the computer to that extent. Fast forward to 2005, I finally broke down and bought a lovely Toshiba laptop that ran Window XP. At work, I had an aging Sun SPARCStation 5, and I didn't really like the direction the whole Solaris thing was going at that point (Motif-based desktop). I really wanted GIMP for some project or the other, but the convoluted journey to installing GNOME 1.x (was it 1.4? maybe) on Solaris was challenging. So, I was actually contemplating jumping ship to Windows XP. But after living with it on my home machine for a few months, I found myself liking that even less than trying to run GNOME on Solaris, so I installed Ubuntu Hoary Hedgehog 5.04 and then Breezy Badger 5.10 on my laptop. It was wonderful. That machine with its 3.2GHz Pentium, 2GB of memory, and 100GB hard drive ran rings around my SPARCStation 5. - -All of a sudden, instead of fooling around with cobbled-together Solaris packages to try to get stuff running, things were just an apt-get away. The timing was good, too. My family and I lived in Grenoble, France from August 2006 to July 2007, while my wife was on sabbatical. Because of the Linux Toshiba, I was able to take my work with me. At the time I was doing a lot of GIS data processing on a couple of big projects; I found I could do the same thing in PostGIS / PostgreSQL much more rapidly than with the incredibly expensive commercial GIS software we used back home in Canada. Everyone was happy, especially me.  - -The funny thing that happened along the way was that we took two other computers to France - my wife's similar Toshiba (running XP, which worked fine for her) and our kids' recently acquired new Toshiba laptop, also running XP. Just after Christmas, they had some friends over who inadvertently installed a nasty and impossible to remove virus on their computer. After several hours over a few days, one of my kids asked "Dad, can't we just install the same thing as on your computer"?  And poof, three new Linux users were created. My son, at 29 years old, is still a happy Linux user, and I'm guessing on his fourth or fifth Linux laptop, the last few all supplied by System76. One of my daughters was forced to convert to Windows when she started law school three years ago as her school had a mandatory testing framework that only would run on Windows and would allegedly detect things like VMs and whatnot (please don't get me started). And, my other daughter was seduced by a Macbook Air that her company bought for her. - -Oh well, can't win them all! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/my-linux-story - -作者:[Chris Hermansen][a] -选题:[lujun9972][b] -译者:[Shiboi77](https://github.com/Shiboi77) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/clhermansen -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) diff --git a/transtlated/talk/20210529 My family-s Linux story.md b/transtlated/talk/20210529 My family-s Linux story.md new file mode 100644 index 0000000000..8245ab86be --- /dev/null +++ b/transtlated/talk/20210529 My family-s Linux story.md @@ -0,0 +1,38 @@ +[#]: subject: (My family's Linux story) +[#]: via: (https://opensource.com/article/21/5/my-linux-story) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: (shiboi77 ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +我的家庭 Linux 故事 +====== +我们在Linux的第一次尝试只是一个简单的方法。 +![在橙色背景的终端命令提示][1] + +我在linux的第一次尝试是“或许我应该试一试”的这种情况。 + +回到1990年,我在相当多的软盘上找到了一些打包的红帽发行版,我为家庭笔记本买了第二个硬盘,然后设置安装了它。 这是一件有趣的实验,但是我记起家中并没有准备在这程度上分享电脑。快进到2005年,我最终崩溃了,买了一台运行windows xp的可爱的东芝笔记本电脑。在工作中,我有一个老化的SUN SPARCStation 5,并且我不太喜欢整个solaris的发展方向(基于Motif的桌面)。我真的想要用GIMP来完成一些项目或其他项目,但是安装GNOME1.x的是复杂的(也许它是1.4?)在Solaris是具有挑战性的。所以,我实际上是在考虑跳槽到Windows xp。 但是在我的家用机器上用了几个月之后,我发现自己喜欢它的程度甚至低于在Solaris上运行GNOME,所以我安装了Ubuntu Hoary Hedgehog 5.04然后在我的笔记本电脑上安装了Breezy Badger 5.10。这太棒了。那台拥有3.2GHz奔腾处理器,2GB内存和100GB的硬盘的机器在我的SPARCStation 5周围运行。 + +突然之间,不再是用拼凑起来的Solaris安装包试图去让东西运行,这些事情仅仅是一个轻松地方式。并且时机也很好。我家庭和我从2006年8月到2007年7月居住在法国格勒诺布尔,而我的妻子在休假。因为有了linux东芝,我才能随身带着我的工作。那个时候我在几大项目上做了大量的GIS数据处理,我发现我可以在PostGIS / PostgreSQL上做同样的事情,比我们在加拿大使用的昂贵得多的商业GIS软件要快得多。大家都很开心,尤其是我。 + +一路上发生的有趣的事情是,我们把另外两台电脑逮到了法国——我妻子的类似的东芝电脑(运行xp,对她来说很好用)和我们孩子最近新买的东芝牌笔记本电脑,也运行xp。仅仅就在圣诞节过后,他们有一些朋友在无意中安装了一个讨厌的并且无法清除的病毒在他们的电脑上。经过几个小时甚至几天后,我的一个孩子问我:“爸爸,我们就不能安装和你电脑上一样的东西吗?”然后,创建了三个新的Linux用户。我的儿子在29岁依然是一个快乐的Linux用户,我猜他第四或第五台Linux笔记本电脑的系统全部由最近的系统76支持。我的一个女儿三年前开始读法学院,因为他所在的学校有一个强制性的测试框架,只能在Windows上运行,而且据称会检测VM之类的东西(请不要让我开始)。而且我的另一个女儿被她的公司为她买的Macbook Air诱惑了。 + +哦,好吧,不能赢得他们所有! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/my-linux-story + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[shiboi77](https://github.com/shiboi77) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) From d711668b73a00c28aa3ec692fd6c2545fca67015 Mon Sep 17 00:00:00 2001 From: Shiboi77 <87035635+Shiboi77@users.noreply.github.com> Date: Tue, 20 Jul 2021 18:22:12 +0800 Subject: [PATCH 520/870] Rename transtlated/talk/20210529 My family-s Linux story.md to translated/talk/20210529 My family-s Linux story.md --- .../talk/20210529 My family-s Linux story.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {transtlated => translated}/talk/20210529 My family-s Linux story.md (100%) diff --git a/transtlated/talk/20210529 My family-s Linux story.md b/translated/talk/20210529 My family-s Linux story.md similarity index 100% rename from transtlated/talk/20210529 My family-s Linux story.md rename to translated/talk/20210529 My family-s Linux story.md From bc898094ab8002bd48b94e9b3a5f80407ae2507c Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Wed, 21 Jul 2021 00:07:19 +0800 Subject: [PATCH 521/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91-te?= =?UTF-8?q?ch-20210529=20Configuring=20Vim=20as=20a=20Writing=20Tool.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20210529 Configuring Vim as a Writing Tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210529 Configuring Vim as a Writing Tool.md b/sources/tech/20210529 Configuring Vim as a Writing Tool.md index ca6a93e8f7..b7afb5e863 100644 --- a/sources/tech/20210529 Configuring Vim as a Writing Tool.md +++ b/sources/tech/20210529 Configuring Vim as a Writing Tool.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/configuring-vim-writing/) [#]: author: (Theena https://news.itsfoss.com/author/theena/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (piaoshi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fc0e9d6c5efdc7e7a1c409544e4ad921ce9dc3d9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Jul 2021 05:03:38 +0800 Subject: [PATCH 522/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210720=20?= =?UTF-8?q?Access=20cloud=20files=20on=20Windows=20with=20ownCloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210720 Access cloud files on Windows with ownCloud.md --- ...ss cloud files on Windows with ownCloud.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20210720 Access cloud files on Windows with ownCloud.md diff --git a/sources/tech/20210720 Access cloud files on Windows with ownCloud.md b/sources/tech/20210720 Access cloud files on Windows with ownCloud.md new file mode 100644 index 0000000000..a517fd3a4c --- /dev/null +++ b/sources/tech/20210720 Access cloud files on Windows with ownCloud.md @@ -0,0 +1,117 @@ +[#]: subject: (Access cloud files on Windows with ownCloud) +[#]: via: (https://opensource.com/article/21/7/owncloud-windows-files) +[#]: author: (Martin Loschwitz https://opensource.com/users/martinloschwitzorg) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Access cloud files on Windows with ownCloud +====== +ownCloud VFS leverages Microsoft's cloud files API to make opening, +modifying, and saving online files seamless. +![Scissors cutting open access to files][1] + +Most computer users nowadays rely on online file storage. Thanks to the rise of cloud computing, the idea of storing files remotely and downloading them when needed has gained a lot of fresh air in recent years. Yet, the principle's technical roots are anything but new, with implementations reaching back decades. While the protocols used and features expected for accessing data on online storage have changed massively, the basic idea hasn't altered much since the days of FTP and similar protocols. + +There's an easy explanation for why online (or "cloud") storage has so many fans. Cloud storage usually resides on highly redundant infrastructure, often distributed across physical sites. Ordinary people would have a tough time setting up anything similar with the tools generally available to them. Cloud storage also allows users to extend their storage space easily without having to fiddle with their device hardware. It also enables people to share files with relatives, friends, or colleagues in just a few simple steps. + +Smartphones are an excellent example of cloud storage's advantages; clients including Dropbox, Google Drive, and iCloud are deeply integrated into mobile operating systems and can be used in apps just like local storage. + +Classical desktop and laptop computers don't integrate online storage as well as smartphones do. Rather, accessing iCloud, ownCloud, or other storage solutions from a computer is a tedious task for several reasons. + +### A matter of protocol + +Many of the reasons boil down to the protocol. The methods and protocols for accessing online storage have changed often, and no single protocol has established itself as a de-facto standard. Online storage services such as Dropbox, S3, and iCloud use proprietary protocols (partially based on open protocols such as WebDAV), which cannot be implemented easily on desktop operating systems. As a result, desktop users often face tedious user interfaces (UIs), reduced comfort, and poor user experience (UX) with online file storage. + +It helps to look a bit deeper to understand the problem and come up with possible solutions. To start, all modern operating systems—notably Windows, macOS, and Linux (along with its numerous derivatives)—assume they are exclusively in charge of a user's files. This comes from the old-fashioned assumption that a user's files will be hosted on a single device. If all a user's files are stored on the same device, it is easy to put them in a tree-like structure (as desktop operating systems have been doing for ages) and present a unique view to the user. + +With cloud-based storage, things are not so easy. Because these files are not available locally, a computer's operating system cannot manage or display them the same way it displays local files. To edit an Excel sheet stored in the cloud, you must download the file from the cloud, store it locally, modify it, and upload it again. Not only does this break your UI and UX; it also creates chaos. + +Some online storage providers try to work around the issue with clients that synchronize contents between the cloud and the local machine. This is an ugly workaround. For instance, you might not want the dozens of gigabytes of data stored in your cloud to also reside on your small local device. To mitigate this challenge, some tools allow you to select a subset of data to synchronize between the client and the online service; this shifts the problem to the side a bit but certainly does not solve it. + +### How WebDAV failed the industry + +Many IT professionals are likely shaking their heads fiercely, knowing there's a protocol for these types of tasks that could be used. And they are not completely wrong. [WebDAV][2] was specified as early as June 2007 by the IETF to extend the HTTP protocol for Web Distributed Authoring and Versioning (WebDAV for short). WebDAV's sole purpose was to provide an interface that allows files in a remote location, such as online cloud storage, to be accessed and edited the same way local files can be. WebDAV has gained traction since then: Private cloud solutions such as ownCloud and NextCloud support and can be accessed through it. + +Yet to call WebDAV a ringing success would be unrealistic, as neither the server nor the client side has achieved widespread use. Matters are especially bad on the server side: many online storage services, including Dropbox, Google Drive, and Microsoft OneDrive, do not support the WebDAV extension to HTTP. Some put proxy services in place. Dropbox, for instance, can be used with DAVbox to achieve WebDAV access. Other services provide tools to mitigate the lack of a working WebDAV server. Generally speaking, though, WebDAV support is not widespread throughout the industry, and that will probably not change anytime soon. + +### Poor operating system support for WebDAV + +This leads right into the second aspect of WebDAV's disastrous history: the client side. At this time, only one operating system has somewhat complete client support throughout the relevant tools of its userland, and that is Linux. Standard desktop environments such as KDE, GNOME, and Xfce can connect to WebDAV drives from the desktop. They also integrate WebDAV drives as if they were normal local disks, effectively allowing users to move data back and forth between the remote site and the local machine. Last but not least, they can download files from WebDAV devices on demand instead of keeping files continuously in sync between a remote site and the local drive. In Linux, life with WebDAV is mostly good—mostly because WebDAV doesn't feature inherent caching. + +Matters change a bit when looking at macOS. Apple equipped macOS with a WebDAV client a while ago, and it mostly works fine. However, it is tedious for less experienced users to set up. And macOS's WebDAV client tends to misbehave when the connection between the client and the server is brittle—like it would be for users in Germany behind LTE connectivity. In such setups, users have to clean up their WebDAV directories regularly to be able to use them. + +The most widespread operating system, Windows, also offers the most dramatic failure in terms of WebDAV integration. To even set up a WebDAV-based storage drive, you would have to edit the Windows Registry—a task that easily exceeds the average computer user's knowledge. If that were not bad enough, even after modifying the Registry, the Windows client for the WebDAV protocol looks more like a stub than a usable feature. You will soon experience problems like those found with the macOS WebDAV implementation, and the experience of using the protocol will be terrible. + +### ownCloud's VFS alternative + +[ownCloud][3] is a private cloud solution that allows users to store, sync, and share data on their own terms, including on a Raspberry Pi, a private cloud, or in a hybrid setup. ownCloud offers a client for the world's most common operating system. But for many years, it relied upon workarounds, like requiring users to explicitly choose which files to synchronize. + +ownCloud has come up with a solution to the problem—and it's a rather sophisticated one. Windows offers an interface to connect to cloud-based online storage, and ownCloud leverages that interface with its [virtual file system][4] (VFS).  + +### How VFS works + +ownCloud's VFS functionality for Windows heavily relies on a Microsoft feature named [cloud files API][5]. It was officially introduced in Windows 10, version 1809 in 2017. Microsoft designed it for file synchronization with OneDrive, but other services are free to use the API, which is now part of the Windows 10 core. The cloud files API is kind of a demarcation line for synchronizing data from the cloud to a local machine and vice versa. It's split into two parts: + + * The **API** provides functions on the API level to perform tasks such as opening, saving, and uploading files to the remote host after the user commits changes. The cloud files API handles a lot of things invisible to the user; for instance, a client using the API will display all remote files as "present" in the local view without downloading them. The cloud files API will download a file only after the user explicitly requests to open it from the remote drive. + * The **Windows.Storage.Provider** namespace allows applications in the userland to configure a client to access a remote service through the cloud files API. + + + +### What the user sees + +The revolutionary way that cloud files API deals with files in remote storage under Windows becomes clear when you see ownCloud VFS in action. + +First, set up a connection to your ownCloud drives from within the ownCloud Client for Windows. Make sure _virtual file support_ is enabled; this makes the directories in your ownCloud drive immediately visible and selectable in Windows tools, such as the Explorer. You won't be able to tell them apart from the files on your local storage devices, and when you open a file stored in ownCloud, it will appear like it is locally present. For files not synchronized to the local host, the cloud files API generates a placeholder that is replaced with the actual file when you open it. This allows a seamless user experience while preserving bandwidth on the client's and the server's internet links. + +Setting up a VFS drive in Windows does not require administrator privileges, as editing the Windows Registry for WebDAV connectivity requires. This means ownCloud VFS might be usable on devices such as business laptops, where the administrator account is usually not available to the user. Compliance policies may still forbid using ownCloud if the instance is not run by the company under its compliance regime, however. + +### Major differences from WebDAV + +Not only does VFS work considerably better on Windows 10 operating systems, it also offers a few features not available in protocols like WebDAV. One of these is implicit caching. During normal operations, VFS will synchronize files when they are opened until a locally defined cache is full; if the user requests additional files, VFS will remove the oldest files from the cache. + +Furthermore, VFS allows you to specify "favorite" files that will always be synchronized automatically from the remote drive whether or not you are trying to access them. This shortens the initial time to access frequently used files, especially if the files are large. + +### Storage Sense makes sense + +Another helpful feature in the Windows cloud files API is the "Storage Sense" feature added in Windows 1809. While primarily aimed at OneDrive users, Storage Sense can be used in the background with an ownCloud online storage drive due to its cloud files API support. Storage Sense regularly scans the Windows C: drive for files that have not been used for a long time. It synchronizes these files to the remote cloud storage and deletes them from the local device, freeing up space for data used more often. + +The user can determine Storage Sense's intervals and when Windows will trigger scans. The latter factor is not very important anymore because searching an SSD or NVMe device is very fast compared to the old days of searching spinning disk drives. Storage Sense aims to increase available disk space on systems, and ownCloud drives can be targets for offloading unused files. + +### VFS on other operating systems + +By creating a virtual file system based on the cloud files API, ownCloud improves the experience of using ownCloud online storage as a web drive in Microsoft Windows 10. ownCloud is one of the few free, libre, and open source software projects using this API at all—even other vendors' commercial support for it is rather weak. Apple's iCloud client for Windows uses the cloud files API, but the list is short. + +How does ownCloud use VFS on other operating systems? It's not as easy as porting the Windows functionality to other operating systems because the cloud files API is not present on non-Windows machines. + +ownCloud still implements comparable functionality—sort of. The macOS and Linux ownCloud clients behave as though the cloud files API were available even on non-Windows systems. Certain Windows functions have been replaced in the background with stubs for the corresponding system. There are a few notable differences between the Windows client and the view in Linux or macOS. For instance, Windows shows the correct file size even for remote files represented locally by a placeholder. On Linux and macOS, all files are displayed with a size of 1 byte and a local extension of .owncloud. This makes it clear that the files do not exist locally—at least until the user asks to open them and ownCloud initiates the download. + +It's true, though, that the VFS experience on macOS and Linux is not quite as smooth as it is on Windows 10. + +### Summary + +ownCloud's VFS dramatically improves the integration of ownCloud cloud storage drives into Windows 10. In contrast to WebDAV and related protocols, the cloud files API is a native API in Windows, integrated seamlessly with the operating system. This eliminates the ugly hacking required to enable WebDAV access in Windows 10, let alone the contortions needed to use it effectively. Older Windows clients do not benefit from the API, and its advantages might create an incentive to update old Windows versions in environments where ownCloud is heavily used. + +macOS and Linux users do not benefit as much from ownCloud's VFS support. On Linux, hobby projects like [elokab-files-manager][6] provide better support for ownCloud VFS. But this is certainly not something you would want to bet on as your daily driver. The situation on macOS is even worse: While Apple has long promised to add similar API functionality to macOS, only Big Sur seems to have the required feature set. As of this writing, ownCloud's developers have not yet adapted the ownCloud client for macOS to the new features in Big Sur. Consequently, Linux and macOS users can use VFS on their platforms with minor limitations. Windows 10 users, however, get the biggest bang for their buck. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/owncloud-windows-files + +作者:[Martin Loschwitz][a] +选题:[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/martinloschwitzorg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files) +[2]: https://en.wikipedia.org/wiki/WebDAV +[3]: https://owncloud.com/ +[4]: https://owncloud.com/features/virtual-files/ +[5]: https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine +[6]: https://github.com/dragotin/elokab-files-manager From 71cff81a127aaa8328090e4972d3e695949f9b4f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Jul 2021 05:03:59 +0800 Subject: [PATCH 523/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210720=20?= =?UTF-8?q?Run=20a=20Linux=20virtual=20machine=20in=20Podman?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210720 Run a Linux virtual machine in Podman.md --- ...0 Run a Linux virtual machine in Podman.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20210720 Run a Linux virtual machine in Podman.md diff --git a/sources/tech/20210720 Run a Linux virtual machine in Podman.md b/sources/tech/20210720 Run a Linux virtual machine in Podman.md new file mode 100644 index 0000000000..72df55d22a --- /dev/null +++ b/sources/tech/20210720 Run a Linux virtual machine in Podman.md @@ -0,0 +1,119 @@ +[#]: subject: (Run a Linux virtual machine in Podman) +[#]: via: (https://opensource.com/article/21/7/linux-podman) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Run a Linux virtual machine in Podman +====== +Use Podman Machine to create a basic Fedora CoreOS VM to use with +containers and containerized workloads. +![woman on laptop sitting at the window][1] + +Fedora CoreOS is an automatically updating, minimal [rpm-ostree][2]-based operating system for running containerized workloads securely and at scale. + +[Podman][3] "is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers. Podman is based on libpod, a library for container lifecycle management." + +Magical things happen when you use [Podman Machine][4], a feature that helps you create a basic Fedora CoreOS virtual machine (VM) to use with containers and containerized workloads. + +### Getting started with Podman Machine + +The first step is to install Podman. If you already have the latest version of Podman installed, you can skip the step. On my Fedora 34 machine, I installed Podman with: + + +``` +`$ sudo dnf install podman` +``` + +I'm using podman-3.2.2-1.fc34.x86_64. + +### Initializing a Fedora CoreOS + +Once Podman is installed, initialize it with: + + +``` +❯ podman machine init vm2 +Downloading VM image: fedora-coreos-34.20210626.1.0-qemu.x86_64.qcow2.xz: done   +Extracting compressed file +``` + +This command creates `vm2` and downloads Fedora CoreOS's qcow2 file in .xz format and extracts it. + +### Listing your VMs + +It's always important to know your VMs and their status, and the `list` command helps with that. The following example shows the names of all my VMs, the date they were created, and the last time they were up: + + +``` +❯ podman machine list   +NAME                    VM TYPE         CREATED         LAST UP +podman-machine-default*  qemu           6 days ago      Currently running +vm2                     qemu            11 minutes ago  11 minutes ago +``` + +### Starting a VM + +To start a VM, run: + + +``` +❯ podman machine start +Waiting for VM … +``` + +### SSHing into the VM + +You can use secure shell (SSH) to access your VM and use it to run workloads without any setup hassles: + + +``` +❯ podman machine ssh   +Connecting to vm podman-machine-default. To close connection, use `~.` or `exit` +Fedora CoreOS 34.20210611.1.0 +Tracker: +Discuss: +  +Last login: Wed Jun 23 13:23:36 2021 from 10.0.2.2 +[core@localhost ~]$ uname -a +Linux localhost 5.12.9-300.fc34.x86_64 #1 SMP Thu Jun 3 13:51:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux +[core@localhost ~]$ +``` + +Currently, Podman only supports running one VM at a time. + +### Stopping your VM + +To stop a running VM, use the `stop` command: + + +``` +❯ podman machine stop + +[core@localhost ~]$ Connection to localhost closed by remote host. +Connection to localhost closed. +Error: exit status 255 +``` + +I hope this helps you get started with Podman Machine. Give it a try, and let us know what you think in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/linux-podman + +作者:[Sumantro Mukherjee][a] +选题:[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/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: http://coreos.github.io/rpm-ostree/ +[3]: https://github.com/containers/podman +[4]: http://docs.podman.io/en/latest/markdown/podman-machine.1.html From 670f84228ea6c29a392ffbd6e32cac329f411cef Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 21 Jul 2021 08:38:27 +0800 Subject: [PATCH 524/870] translated --- ...ps for daily needs part 1- web browsers.md | 112 ------------------ ...ps for daily needs part 1- web browsers.md | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 112 deletions(-) delete mode 100644 sources/tech/20210716 Apps for daily needs part 1- web browsers.md create mode 100644 translated/tech/20210716 Apps for daily needs part 1- web browsers.md diff --git a/sources/tech/20210716 Apps for daily needs part 1- web browsers.md b/sources/tech/20210716 Apps for daily needs part 1- web browsers.md deleted file mode 100644 index c03f7cea9c..0000000000 --- a/sources/tech/20210716 Apps for daily needs part 1- web browsers.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: subject: (Apps for daily needs part 1: web browsers) -[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/) -[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Apps for daily needs part 1: web browsers -====== - -![][1] - -Photo by [Brooke Cagle][2] on [Unsplash][3] - -One of the important apps for daily needs is a web browser. That’s because surfing the internet is an activity most people do in front of the computer. This article will introduce some of the open source web browsers that you can use on Fedora Linux. You need to install the software mentioned. All the browsers mentioned in this article are already available in the official Fedora repository. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. - -### Firefox - -Firefox is a fast and privacy-focused browser that works across many devices. It was created by [Mozilla][5] and is a browser with complete features offering many extensions. You can add many powerful functions and useful features to your Firefox browser. It uses just enough memory to create a smooth experience so your computer stays responsive to other tasks. You can create an account that will allow you to share configurations on multiple devices, so you don’t need to set up Firefox on each device. - -![][6] - -Firefox offers the following features: - - * Private Browsing mode - * Ad tracker blocking - * Password manager - * Sync between devices - * Picture-in-Picture - - - -More information about Firefox browser is available at this link: [https://www.mozilla.org/en-US/firefox][7] - -### GNOME Web - -GNOME Web is a browser for GNOME desktop which is the default desktop environment for Fedora Workstation. It may be very appropriate as your main browser if you use Fedora Workstation with GNOME as the default desktop environment. This browser has a simple, clean, and beautiful look. GNOME Web has fewer features than Firefox, but it is sufficient for common uses. - -![][8] - -GNOME Web offers the following features: - - * Incognito mode - * GNOME desktop integration - * built-in adblocker - * Intelligent tracking prevention - - - -More information about GNOME Web is available at this link: - -### Chromium - -Chromium is an open-source web browser from the Chromium Project and has a minimalist user interface. It has a similar appearance to Chrome, because it actually serves as the base for Chrome and several other browsers. Many people use Chromium because they are used to Chrome. - -![][9] - -Chromium offers the following features: - - * Incognito mode - * Extensions - * Autofill for passwords - - - -More information about Chromium browser is available at this link: - -### qutebrowser - -This browser is a little bit different than the browsers mentioned above. qutebrowser is a keyboard-focused browser with a minimal GUI. Therefore, you won’t find the buttons normally found in other browsers, like back, home, reload, etc. Instead, you can type commands with the keyboard to run functions in the qutebrowser. It uses Vim-style key bindings, so it’s suitable for Vim users. You should try this browser if you are interested in getting a different experience in surfing the internet. - -![][10] - -qutebrowser offers the following features: - - * Adblock - * Private browsing mode - * Quickmarks - - - -More information about qutebrowser browser is available at this link: - -### Conclusion - -Everyone has different needs in using the internet, especially for browsing. Each browser mentioned in this article has different features. So choose a browser that suits your daily needs and preferences. If you use the browsers mentioned in this article, share your story in the comments. And if you use a browser other than the one mentioned in this article, please mention it. Hopefully this article can help you in choosing the browser that you will use for your daily needs on Fedora. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/ - -作者:[Arman Arisman][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/armanwu/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-1-Browsers-2-816x345.jpg -[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ -[5]: https://www.mozilla.org/en-US/ -[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Firefox-1-1024x707.png -[7]: https://www.mozilla.org/en-US/firefox/ -[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Web-1024x658.png -[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Chromium-1-1024x690.png -[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-qb-1024x687.png diff --git a/translated/tech/20210716 Apps for daily needs part 1- web browsers.md b/translated/tech/20210716 Apps for daily needs part 1- web browsers.md new file mode 100644 index 0000000000..e6d0c5b07d --- /dev/null +++ b/translated/tech/20210716 Apps for daily needs part 1- web browsers.md @@ -0,0 +1,112 @@ +[#]: subject: (Apps for daily needs part 1: web browsers) +[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/) +[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +满足日常需求的应用第一部分:网络浏览器 +====== + +![][1] + +照片由 [Brooke Cagle][2] 发布在 [Unsplash][3]。 + +满足日常需求的重要应用之一是网络浏览器。这是因为上网是大多数人在电脑前进行的一项活动。本文将介绍一些你可以在 Fedora Linux 上使用的开源网络浏览器。你需要安装上述软件。本文提到的所有浏览器都已经在官方的 Fedora 软件库中提供。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。 + +### Firefox + +火狐是一个快速且注重隐私的浏览器,可以在许多设备上使用。它是由 [Mozilla][5] 创建的,是一个具有完整功能的浏览器,提供许多扩展。你可以为你的火狐浏览器添加许多强大的功能和有用的特性。它只使用适量的内存来创造一个流畅的体验,使你的电脑保持对其他任务的响应。你可以创建一个账户,让你在多个设备上共享配置,所以你不需要在每个设备上设置火狐浏览器。 + +![][6] + +火狐浏览器提供以下功能: + + * 隐私浏览模式 + * 阻止广告跟踪器 + * 密码管理器 + * 设备之间的同步 + * 画中画 + + + +关于火狐浏览器的更多信息可在此链接中找到:[https://www.mozilla.org/en-US/firefox][7] + +### GNOME Web + +GNOME Web 是 GNOME 桌面的一个浏览器,它是 Fedora 工作站的默认桌面环境。如果你使用 GNOME 作为默认桌面环境的 Fedora Workstation,它可能非常适合作为你的主浏览器。这个浏览器有一个简单、干净、漂亮的外观。GNOME Web 的功能比 Firefox 少,但对于普通用途来说已经足够了。 + +![][8] + +GNOME Web 提供了以下功能: + + * 隐身模式 + * GNOME 桌面集成 + * 内置广告拦截器 + * 智能跟踪预防 + + + +关于 GNOME Web 的更多信息可以在这个链接中找到: + +### Chromium + +Chromium 是一个来自 Chromium 项目的开源网络浏览器,它有一个极简的用户界面。它的外观与 Chrome 相似,因为它实际上是作为 Chrome 和其他几个浏览器的基础。许多人使用 Chromium 是因为他们已经习惯了 Chrome。 + +![][9] + +Chromium 提供以下功能: + + * 隐身模式 + * 扩展程序 + * 密码的自动填写 + + + +关于 Chromium 浏览器的更多信息可在此链接中找到: + +### qutebrowser + +这个浏览与上面提到的稍有不同,qutebrowser 是一个以键盘为中心的浏览器,具有最小的 GUI。因此,你不会发现通常在其他浏览器中的按钮,如返回、主页、重新加载等。相反,你可以用键盘输入命令来运行 qutebrowser 中的功能。它使用 Vim 风格的键绑定,所以它适合 Vim 用户。如果你有兴趣在上网时获得不同的体验,你应该试试这个浏览器。 + +![][10] + +qutebrowser 提供以下功能: + + * 广告屏蔽 + * 隐私浏览模式 + * 快速书签 + + + +关于 qutebrowser 浏览器的更多信息可在此链接中找到: + +### 总结 + +每个人在使用互联网时都有不同的需求,特别是在浏览方面。本文中提到的每个浏览器都有不同的功能。因此,请选择适合你日常需求和喜好的浏览器。如果你使用的是本文中提到的浏览器,请在评论中分享你的故事。如果你使用的是其他的浏览器,请说一下。希望这篇文章能帮助你选择在 Fedora 上满足你日常需求的浏览器。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/ + +作者:[Arman Arisman][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-1-Browsers-2-816x345.jpg +[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ +[5]: https://www.mozilla.org/en-US/ +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Firefox-1-1024x707.png +[7]: https://www.mozilla.org/en-US/firefox/ +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Web-1024x658.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Chromium-1-1024x690.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-qb-1024x687.png From a32c18286f2797ecabdae287f7424850699defa5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 21 Jul 2021 08:41:20 +0800 Subject: [PATCH 525/870] translated --- .../20210719 Run Python applications in virtual environments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210719 Run Python applications in virtual environments.md b/sources/tech/20210719 Run Python applications in virtual environments.md index c86d1849ae..38673cf029 100644 --- a/sources/tech/20210719 Run Python applications in virtual environments.md +++ b/sources/tech/20210719 Run Python applications in virtual environments.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/python-pipx) [#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8114d968c138ea5c3d7aea1a1ce758a869a29a5b Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Wed, 21 Jul 2021 09:34:37 +0800 Subject: [PATCH 526/870] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rence between a fork and a distribution.md | 82 ------------------- 1 file changed, 82 deletions(-) delete mode 100644 sources/talk/20180713 What-s the difference between a fork and a distribution.md diff --git a/sources/talk/20180713 What-s the difference between a fork and a distribution.md b/sources/talk/20180713 What-s the difference between a fork and a distribution.md deleted file mode 100644 index 57b08ffcf6..0000000000 --- a/sources/talk/20180713 What-s the difference between a fork and a distribution.md +++ /dev/null @@ -1,82 +0,0 @@ -Wlzzzz-del is translating. -What's the difference between a fork and a distribution? -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG) - -If you've been around open source software for any length of time, you'll hear the terms fork and distribution thrown around casually in conversation. For many people, the distinction between the two isn't clear, so here I'll try to clear up the confusion. - -### First, some definitions - -Before explaining the nuances of a fork vs. a distribution and the pitfalls thereof, let's define key concepts. - -**[Open source software][1]** is software that: - - * Is freely available to distribute under certain [license][2] restraints - * Permits its source code to be viewable and modified under certain license restraints - - - -Open source software can be **consumed** in the following ways: - - * Downloaded in binary or source code format, often at no charge (e.g., the [Eclipse developer environment][3]) - * As a distribution (product) by a vendor, sometimes at a cost to the user (e.g., [Red Hat products][4]) - * Embedded into proprietary software solutions (e.g., some smartphones and browsers display fonts using the open source [freetype software][5]) - - - -**Free and open source (FOSS)** is not necessarily "free" as in "zero cost." Free and open source simply means the software is free to distribute, modify, study, and use, subject to the software's licensing. The software distributor may attach a purchase price to it. For example, Linux is available at no cost as Fedora, CentOS, Gentoo, etc. or as a paid distribution as Red Hat Enterprise Linux, SUSE, etc. - -**Community** refers to the organizations and individuals that collaboratively work on an open source project. Any individual or organization can contribute to the project by writing or reviewing code, documentation, test suites, managing meetings, updating websites, etc., provided they abide by the license. For example, at [Openhub.net][6], we see government, nonprofit, commercial, and education organizations [contributing to some open source projects][7]. - -**project** is the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed. - -An open sourceis the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed. - -A **distribution** is a copy, in binary or source code format, of an open source project. For example, CentOS, Fedora, Red Hat Enterprise Linux, SUSE, Ubuntu, and others are distributions of the Linux project. Tectonic, Google Kubernetes Engine, Amazon Container Service, and Red Hat OpenShift are distributions of the Kubernetes project. - -Vendor distributions of open source projects are often called **products** , thus Red Hat OpenStack Platform is the Red Hat OpenStack product that is a distribution of the OpenStack upstream project—and it is still 100% open source. - -The **trunk** is the main workstream in the community where the open source project is developed. - -An open source **fork** is a version of the open source project that is developed along a separate workstream from the main trunk. - -Thus, **a distribution is not the same as a fork**. A distribution is a packaging of the upstream project that is made available by vendors, often as products. However, the core code and documentation in the distribution adhere to the version in the upstream project. A fork—and any distribution based on the fork—results in a version of the code and documentation that are different from the upstream project. Users who have forked upstream open source code have to maintain it on their own, meaning they lose the benefit of the collaboration that takes place in the upstream community. - -To further explain a software fork, let's use the analogy of migrating animals. Whales and sea lions migrate from the Arctic to California and Mexico; Monarch butterflies migrate from Alaska to Mexico; and (in the Northern Hemisphere) swallows and many other birds fly south for the winter. The key to a successful migration is that all animals in the group stick together, follow the leaders, find food and shelter, and don't get lost. - -### Risks of going it on your own - -A bird, butterfly, or whale that strays from the group loses the benefit of remaining with the group and knowing where to find food, shelter, and the desired destination. - -Similarly, users or organizations that fork and modify an upstream project and maintain it on their own run the following risks: - - 1. **They cannot update their code based on the upstream because their code differs.** This is known as technical debt; the more changes made to forked code, the more it costs in time and money to rebase the fork to the upstream project. - 2. **They potentially run less secure code.** If a vulnerability is found in open source code and fixed by the community in the upstream, a forked version of the code may not benefit from this fix because it is different from the upstream. - 3. **They might not benefit from new features.** The upstream community, using input from many organizations and individuals, creates new features for the benefit of all users of the upstream project. If an organization forks the upstream, they potentially cannot incorporate the new features because their code differs. - 4. **They might not integrate with other software packages.** Open source projects are rarely developed as single entities; rather they often are packaged together with other projects to create a solution. Forked code may not be able to be integrated with other projects because the developers of the forked code are not collaborating in the upstream with other participants. - 5. **They might not certify on hardware platforms.** Software packages are often certified to run on hardware platforms so, if problems arise, the hardware and software vendors can collaborate to find the root cause or problem. - - - -In summary, an open source distribution is simply a packaging of an upstream, multi-organizational, collaborative open source project sold and supported by a vendor. A fork is a separate development workstream of an open source project and risks not being able to benefit from the collaborative efforts of the upstream community. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/7/forks-vs-distributions - -作者:[Jonathan Gershater][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/jgershat -[1]:https://opensource.com/resources/what-open-source -[2]:https://opensource.com/tags/licensing -[3]:https://www.eclipse.org/che/getting-started/download/ -[4]:https://access.redhat.com/downloads -[5]:https://www.freetype.org/ -[6]:http://openhub.net -[7]:https://www.openhub.net/explore/orgs From 8b8b2664241e8de22bdbe0c60c391ca106591b40 Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Wed, 21 Jul 2021 09:39:19 +0800 Subject: [PATCH 527/870] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rence between a fork and a distribution.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 translated/talk/20180713 What-s the difference between a fork and a distribution.md diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md new file mode 100644 index 0000000000..40a5541a95 --- /dev/null +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -0,0 +1,74 @@ +What's the difference between a fork and a distribution? +分支与发行版有什么不同? +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG) + +如果你们对开源软件有过一段时间地了解,一定曾在许多相关的途径中听说过分支(fork)和发行版(distribution)两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。 + +### 首先地,关于定义 + +在解释分支与发行版两者的细微区别与相似之处之前,让我们先给一些相关的重要概念下定义。 + +**[开源软件][1]** 是指具有以下特点的软件: + + * 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用 + * 在特定的协议限制下,软件源代码供所有人使用与修改 + +开源软件有以下几种 **消费** 方式: + + * 以二进制或者源代码的方式下载,通常是不收费的。(例如, [Eclipse开发者环境][3] ) + ### * 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]) + * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]) + +将 **自由且开源(FOSS)** 中的”自由“理解成“零成本”是不准确的。自由且开源仅仅意味着这个软件在遵守软件协议的前提下是可以免费传播、修改、学习和使用的。软件传播者也可能为该软件定价。例如,免费使用的Linux发行版有Fedora、Centos等。另外,收费的发行版有红帽企业版Linux、SUSE等。 + +**社区(community)** 指的是为一个开源项目协同工作和贡献的团体或个人。任何人或者团体都可以在遵守协议的前提下通过例如编写或者审查代码、撰写使用文档、测试软件、管理会议、更新网站等方式为开源项目作出贡献。例如,在[Openhub.net][6]网站,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在[为一些开源项目作出贡献][7]。 + +**项目(project)** 是集合作开发、文档和测试的结果。绝大多数项目都搭建了主要仓库用来存储代码、文档、测试文件和目前正在开发的文件。 + +**发行版(distribution)** 是指开源项目的一份的副本,通常以二进制或源代码为样式。例如,Centos、Fedora、红帽企业版Linux、SUSE、Ubuntu等都是Linux这一项目的发行版。Tectonic、谷歌的Kubernetes引擎、亚马逊的容器服务和红帽的OpenShift都是Kubernetes项目的发行版。 + +开源项目的商业发行版经常被称作 **产品(products)** ,类似地红帽OpenStack平台是红帽OpenStack产品系列旗下的一个基于OpenStack上游项目搭建并且百分百开源的发行版。 + +**主干(trunk)** 是该开源项目发展的主要社区工作流。 + +**分支(fork)** 是开源项目主干的一个版本,他是分离自主干的独立工作流。 + +因此, **一个发行版并不等同于一个分支** 。发行版是上游项目的包裹,具有可用性,经常作为产品进行销售。然而,发行版的核心代码和文档需要遵守上游项目的版本规则。从上游版本中获取开源代码的分支用户必须依靠他们自身来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。 + +为了对软件分支进行进一步的解释,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。 + +### 独立前行带来的风险 + +一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护以及知道哪儿有食物、庇护所和目的地。 + +相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: + + 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 + 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 + 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 + 4.**他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 + 5.**他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + +总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/7/forks-vs-distributions + +作者:[Jonathan Gershater][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[Wlzzzz-del](https://github.com/Wlzzzz-del) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jgershat +[1]:https://opensource.com/resources/what-open-source +[2]:https://opensource.com/tags/licensing +[3]:https://www.eclipse.org/che/getting-started/download/ +[4]:https://access.redhat.com/downloads +[5]:https://www.freetype.org/ +[6]:http://openhub.net +[7]:https://www.openhub.net/explore/orgs From 408220232629cda129ca826e68cae9ec140d1743 Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Wed, 21 Jul 2021 09:45:48 +0800 Subject: [PATCH 528/870] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rence between a fork and a distribution.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index 40a5541a95..523fa71c33 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -12,14 +12,14 @@ What's the difference between a fork and a distribution? **[开源软件][1]** 是指具有以下特点的软件: - * 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用 - * 在特定的协议限制下,软件源代码供所有人使用与修改 + * 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用 + * 在特定的协议限制下,软件源代码供所有人使用与修改 开源软件有以下几种 **消费** 方式: - * 以二进制或者源代码的方式下载,通常是不收费的。(例如, [Eclipse开发者环境][3] ) - ### * 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]) - * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]) + * 以二进制或者源代码的方式下载,通常是不收费的。(例如,[Eclipse开发者环境][3]) + * 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]) + * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]) 将 **自由且开源(FOSS)** 中的”自由“理解成“零成本”是不准确的。自由且开源仅仅意味着这个软件在遵守软件协议的前提下是可以免费传播、修改、学习和使用的。软件传播者也可能为该软件定价。例如,免费使用的Linux发行版有Fedora、Centos等。另外,收费的发行版有红帽企业版Linux、SUSE等。 @@ -45,11 +45,11 @@ What's the difference between a fork and a distribution? 相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: - 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 - 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 - 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 - 4.**他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 - 5.**他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + 1.**由于代码不同,分支用户不能够基于上游版本更新代码.** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 + 2.**分支用户基本上都在运行几乎没有安全保障的代码.** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 + 3.**分支用户几乎无法从新特性中获益.** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 + 4.**他们可能无法和其他软件包整合在一起.** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 + 5.**他们可能不能够在硬件平台上验证分支代码可行性.**软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 From d0c245461316ece1db912495d2699b2f07285c06 Mon Sep 17 00:00:00 2001 From: wlz <57861805+Wlzzzz-del@users.noreply.github.com> Date: Wed, 21 Jul 2021 09:48:32 +0800 Subject: [PATCH 529/870] Update 20180713 What-s the difference between a fork and a distribution.md --- ...he difference between a fork and a distribution.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index 523fa71c33..ab70a266c7 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -44,12 +44,11 @@ What's the difference between a fork and a distribution? 一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护以及知道哪儿有食物、庇护所和目的地。 相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: - - 1.**由于代码不同,分支用户不能够基于上游版本更新代码.** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 - 2.**分支用户基本上都在运行几乎没有安全保障的代码.** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 - 3.**分支用户几乎无法从新特性中获益.** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 - 4.**他们可能无法和其他软件包整合在一起.** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 - 5.**他们可能不能够在硬件平台上验证分支代码可行性.**软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 + 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 + 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 + 4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 + 5. **他们可能不能够在硬件平台上验证分支代码可行性。**软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 From 81f3844bc9e48fc5fb6d72ed573671e5ac7e2ee9 Mon Sep 17 00:00:00 2001 From: wlz <57861805+Wlzzzz-del@users.noreply.github.com> Date: Wed, 21 Jul 2021 09:48:57 +0800 Subject: [PATCH 530/870] Update 20180713 What-s the difference between a fork and a distribution.md --- ...3 What-s the difference between a fork and a distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index ab70a266c7..179962ba29 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -48,7 +48,7 @@ What's the difference between a fork and a distribution? 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 - 5. **他们可能不能够在硬件平台上验证分支代码可行性。**软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + 5. **他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 From a46ec1d2a33f3d9b862979cc59159f821469089e Mon Sep 17 00:00:00 2001 From: wlz <57861805+Wlzzzz-del@users.noreply.github.com> Date: Wed, 21 Jul 2021 09:49:35 +0800 Subject: [PATCH 531/870] Update 20180713 What-s the difference between a fork and a distribution.md --- ...3 What-s the difference between a fork and a distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index 179962ba29..87abb65fe8 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -45,7 +45,7 @@ What's the difference between a fork and a distribution? 相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 - 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 + 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益。 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 5. **他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 From b22e5d9b12c8739c80d3f01bcec242c0c251d863 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 10:50:22 +0800 Subject: [PATCH 532/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zxy-wyx 感谢您,完成了第一篇翻译贡献! --- .../20210629 A brief history of FreeDOS.md | 100 +++++++++--------- 1 file changed, 51 insertions(+), 49 deletions(-) diff --git a/translated/talk/20210629 A brief history of FreeDOS.md b/translated/talk/20210629 A brief history of FreeDOS.md index 3931cd87d6..c6e3703a80 100644 --- a/translated/talk/20210629 A brief history of FreeDOS.md +++ b/translated/talk/20210629 A brief history of FreeDOS.md @@ -3,88 +3,90 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (zxy-wyx) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) FreeDOS 简史 ====== -经历了近30年的发展, FreeDOS 已经成为了世界先进的 DOS。 -![第一批使用计算机的人][1] -一个老师正在给他的一个学生讲[编程之道][2]。 “编程之道包含在所有的软件中--不管它多么微不足道,” 老师说道。 +> 经历了近 30 年的发展, FreeDOS 已经成为了世界先进的 DOS。 -“编程之道在手提电脑里面吗?” 学生问道。 +![](https://img.linux.net.cn/data/attachment/album/202107/21/104903zzxiyc4i4gkpxiph.jpg) -“是的,” 老师回答道。 +> 一个大师正在给他的一个弟子讲 [编程之道][2]。 “编程之道包含在所有的软件中 —— 不管它多么微不足道,” 大师说道。 +> +> “编程之道在手持计算器里面吗?” 弟子问道。 +> +> “是的,” 大师回答道。 +> +> “编程之道在电子游戏里面吗?” 弟子继续问道。 +> +> “即便是电子游戏中,” 大师说。 +> +> “那编程之道在个人电脑的 DOS 里面吗?” +> +> 大师咳嗽了一下,稍稍改变了一下姿势,说道,“今天的课就到这里吧。” +> +> ——《编程之道》,Geoffrey James,InfoBooks,1987 -“编程之道在电脑游戏里面吗?”学生继续问道 +过去,计算仅限于昂贵的大型机和“大铁疙瘩”计算机系统,如 PDP 11。但是微处理器的出现在 20 世纪 70 年代带来了一场计算革命。你终于可以在家里有一台电脑了——“个人电脑”时代已经到了! -“他甚至在电脑游戏里面," 老师说。 +我记得看到的最早的个人电脑包括 Commodore、TRS-80 和 Apple。个人电脑成了一个热门话题,所以 IBM 决定进入这个市场。在经历了一个快速开发周期之后,IBM 于 1981 年 8 月发布了 IBM 5150 个人电脑(最初的“IBM PC”)。 -“那编程之道在个人电脑的操作系统里面吗?” +从零开始创建一台计算机并非易事,因此 IBM 以用“现成”的硬件来构建 PC 而闻名,并从外部开发商那里获得了其他组件的授权。其中之一是微软授权的操作系统。反过来,微软从西雅图计算机产品公司获得了 86-DOS ,进行了各种更新,并将新版本作为 IBM PC-DOS 与 IBM PC 一起首次亮相。 -老师咳嗽了一下,稍稍改变了姿势,说道,“今天的课结束了。” +### 早期的 DOS -编程之道, Geoffrey James, 信息类书籍, 1987 +运行在最多只有 640 千字节内存中的 DOS,除了管理硬件和允许用户启动应用程序之外,真的做不了什么。因此,PC-DOS 1.0 命令行非常贫乏,只包含了一些设置日期和时间、管理文件、控制终端和格式化软盘的命令。DOS 还包括一个 BASIC 语言解释器,这是那个时代所有个人计算机的一个标准功能。 -过去,计算仅限于昂贵的大型机和“超大型计算机”计算机系统,如 PDP 11。但是微处理器的出现在 20 世纪 70 年代带来了一场计算机革命。 你终于可以在家里有一台电脑了——“个人电脑浪潮”已经到了! +直到 PC-DOS 2.0,DOS 才变得更加有趣,为命令行添加了新的命令,并包含了其他有用的工具。但对我来说,直到 1991 年的 MS-DOS 5.0 才有了“现代感”。微软在这个版本中对 DOS 进行了大修,更新了许多命令,并用一个新的全屏编辑器取代了老旧的 Edlin 编辑器,使之更方便用户使用。DOS 5 还包括我喜欢的其他特性,比如基于微软 QuickBASIC 编译器的新 BASIC 解释器,简称 QBASIC. 如果你曾经在 DOS 上玩过 Gorillas 游戏,那可能就是在 MS-DOS 5.0 中运行的。 -我记得看到的最早的个人电脑包括 Commodore, TRS-80, 和 Apple。个人电脑成了一个热门话题,所以 IBM 决定进入这个市场。 在经历了一个短暂的开发周期之后,IBM 于 1981 年 8 月发布了 IBM 5150 个人计算机(最初的“IBM PC”)。 +尽管进行了这些升级,但我对 DOS 命令行并不完全满意。DOS 从来没有偏离原来的设计,有其局限性。DOS 为用户提供了一些工具,可以从命令行执行一些事情 —— 否则,你就得使用 DOS 命令行来启动应用程序。微软认为用户大部分时间都会花在几个关键的应用程序上,比如文字处理器或电子表格。 -从零开始创建一台计算机并非易事,因此 IBM 用现成的硬件来构建 PC 而闻名,并从外部开发人员那里获得了其他组件的许可。 其中之一是微软授权的操作系统。反过来,微软从西雅图电脑产品公司获得了 86-DOS ,进行了各种更新,并在 IBM PC 上推出了新版本的 IBM PC-DOS。 - -###早期的 DOS - -早期的 DOS 在内存中运行最多为 640 千字节, DOS 只能管理硬件,允许用户启动应用程序。因此,PC-DOS 1.0 命令行非常贫乏,只包含了一些设置日期和时间、管理文件、控制终端和格式化软盘的命令。DOS 还包括一个基本的语言解释器,这是这个时代所有个人计算机的一个基本功能。 - -直到 PC-DOS 2.0,DOS 才变得更加有趣,在命令行中添加了新的命令,并包含了其他有用的工具。但对我来说,直到1991 年 MS-DOS 5.0 才开始感觉到先进。微软在这个版本中对 DOS 进行了全面改革,更新了许多命令,并用一个新的全屏编辑器取代了老旧的 Edlin 编辑器,这个编辑器对用户更加友好。 DoS 5 还包括我喜欢的其他特性,比如基于 Microsoft QuickBASIC Compiler, 简称 QBASIC. 如果你曾经在 DOS 上玩过 the Gorillas 游戏, 可能是在 MS-DOS 5.0 中运行。 - -尽管进行了这些升级,但我对 DOS 命令行并不完全满意。DOS 从来没有偏离原来的设计,改变有限。DOS 为用户提供了一些工具,可以从命令行执行一些事情--否则,你就应该使用 DOS 命令行来启动应用程序。微软认为用户大部分时间都会花在几个关键的应用程序上,比如文字处理器或电子表格。 - -但是开发人员想要一个功能更强的 DOS,此时一个子行业正在萌芽,以提供整洁的工具和程序。有些是全屏应用程序,但也有许多是增强 DOS 命令环境的命令行实用程序. 当我学到一点 C 编程时,我开始编写自己的实用程序,扩展或替换 DOS 命令行。尽管 MS-DOS 的基础相当有限,但我发现第三方实用程序加上我自己的工具创建了一个功能强大的DOS命令行。 +但是开发人员想要一个功能更强的 DOS,此时一个细分行业正在萌芽,以提供小巧优雅的工具和程序。有些是全屏应用程序,但也有许多是增强 DOS 命令环境的命令行实用程序。当我学会一点 C 语言编程时,我开始编写自己的实用程序,扩展或替换 DOS 命令行。尽管 MS-DOS 的基础相当有限,但我发现第三方实用程序加上我自己的工具创建了一个功能强大的 DOS 命令行。 ### FreeDOS -1994 年初,我开始在科技杂志上看到很多微软高管的采访,他们说下一个版本的 Windows 将完全取代 DOS。 我以前使用过 Windows,但如果你还记得那个时代,你就知道 Windows 3.1 不是一个很好的平台。 Windows 3.1 是笨重的和有很多漏洞的——如果一个应用程序崩溃,它可能会摧毁整个 Windows 系统。我也不喜欢 Windows 的图形用户界面。我更喜欢在命令行做我的工作,而不是用鼠标。 +1994 年初,我开始在科技杂志上看到很多对微软高管的采访,他们说下一个版本的 Windows 将完全取代 DOS。我以前使用过 Windows,但如果你还记得那个时代,你就知道 Windows 3.1 并不是一个很好的平台。Windows 3.1 很笨重,有很多毛病,如果一个应用程序崩溃,它可能会使整个 Windows 系统瘫痪。我也不喜欢 Windows 的图形用户界面。我更喜欢在命令行做我的工作,而不是用鼠标。 -我考虑了 Windows,并决定,“如果 Windows3.2 或 Windows4.0 将类似于 Windows3.1,我我将不会去使用它。” 但我有什么选择?此时,我已经对 Linux 进行了实验,并认为 [linux很棒][3]—但是 Linux 没有任何应用程序。我的文字处理器、电子表格和其他程序都在 DOS 上。我需要 DOS。 +我考虑过 Windows,并决定,“如果 Windows 3.2 或 Windows 4.0 会像 Windows 3.1 一样,我就不会去使用它。” 但我有什么选择?此时,我已经尝试过 Linux,并认为 [Linux 很棒][3],但是 Linux 没有任何应用程序。我的文字处理器、电子表格和其他程序都在 DOS 上。我需要 DOS。 -然后我有了个主意!我想,“如果开发人员能够在互联网上共同编写一个完整的 Unix 操作系统,那么我们当然可以在 DOS 中做同样的事情。”毕竟,与 Unix 相比,DOS 是一个相当简单的操作系统。DOS 一次运行一个任务(单任务),并且有一个更简单的内存模型。写我们自己的 DOS 应该不难。 +然后我有了个主意!我想,“如果开发人员能够在互联网上共同编写一个完整的 Unix 操作系统,那么我们当然可以对 DOS 做同样的事情。”毕竟,与 Unix 相比,DOS 是一个相当简单的操作系统。DOS 一次运行一个任务(单任务),并且有一个更简单的内存模型。编写我们自己的 DOS 应该不难。 -因此,在 1994 年 6 月 29 日,我在一个名为 Usenet 的留言板网络上向 ‘comp.os.msdos.apps’[发布了一个公告][4] 。 +因此,在 1994 年 6 月 29 日,我在一个名为 Usenet 的留言板网络上向 “comp.os.msdos.apps” [发布了一个公告][4]: -PD-DOS 项目宣布: +> PD-DOS 项目公告: +> +> 几个月前,我发表了关于启动公共领域版本的 DOS 的文章。 当时大家对此的普遍支持,许多人都同意这样的说法:“开始编写吧!”所以,我就…… +> +> 宣布首次生产 PD-DOS 的努力。我已经写了一个“清单”,描述了这样一个项目的目标和工作大纲,以及一个“任务列表”,它准确地显示了需要编写什么。我会把这些贴在这里,供大家讨论。 -几个月前,我发表了关于启动 DOS 公共领域版本的文章。 当时对此的普遍支持很强烈,许多人都同意这样的说法:“开始创作吧!”所以我有..。 +\* 关于这个名字的说明 —— 我希望这个新的 DOS 成为每个人都可以使用的东西,我天真地认为,当每个人都可以使用它时,它就是“公共领域”。我很快就意识到了这种差别,所以我们把 “PD-DOS” 改名为 “Free-DOS”,然后去掉连字符变成 “FreeDOS”。 -第一次宣布努力生产 PD-DOS。我已经写了一个“清单”,描述了这样一个项目的目标和工作大纲,以及一个“任务列表”,它准确地显示了需要写什么。我会把这些贴在这里,然后讨论一下。 - -*关于这个名字的注释--我希望这个新的 DOS 成为每个人都可以使用的东西,我天真地认为,当每个人都可以使用它时,它就是“公共领域”。我很快就意识到了这种差别,所以我们把 “PD-DOS” 改名为 “Free-DOS”,然后去掉连字符变成 “FreeDOS”。 - -一些开发人员联系我,提供他们为替换或增强 DOS 命令行而创建的实用程序,类似于我自己的努力。就在项目宣布几个月后,我们汇集了我们的实用程序,并创建了一个实用的系统,我们在 1994 年 9 月发布了一个名为 “Alpha 1” 的系统。当时的发展相当迅速,我们在 1994 年 12 月采用了 “Alpha 2”,1995 年 1 月采用了“Alpha 3”,1995 年 6 月采用了“Alpha 4”。 +一些开发人员联系我,提供他们为替换或增强 DOS 命令行而创建的实用程序,类似于我自己的努力。就在项目宣布几个月后,我们汇集了我们的实用程序,并创建了一个实用的系统,我们在 1994 年 9 月发布了一个 “Alpha 1” 版本。在那些日子里,发展是相当迅速的,我们在 1994 年 12 月发布了 “Alpha 2”,1995 年 1 月发布了 “Alpha 3”,1995 年 6 月发布了“Alpha 4”。 ### 一个现代的 DOS -从那以后,我们一直致力于使 FreeDOS 成为“现代” DOS。而大部分现代化都集中在创建一个丰富的命令行环境上。是的,DOS 仍然需要支持应用程序,但是我们相信 FreeDOS 也需要一个强大的命令行环境。这就是为什么 FreeDOS 包含了许多有用的工具,包括导航目录、管理文件、播放音乐、连接网络的命令,……以及类似 Unix 的实用程序集合,如 “Less”、“Du”、“Head”、“tail”、“Se”和“trt”。 +从那以后,我们一直致力于使 FreeDOS 成为 “现代” DOS。而这种现代化大部分都集中在创建一个丰富的命令行环境上。是的,DOS 仍然需要支持应用程序,但是我们相信 FreeDOS 也需要一个强大的命令行环境。这就是为什么 FreeDOS 包含了许多有用的工具,包括浏览目录、管理文件、播放音乐、连接网络的命令,……以及类似 Unix 的实用程序集合,如 `less`、`du`、`head`、`tail`、`sed` 和 `tr`。 -虽然 FreeDOS 的开发已经放缓,但它并没有停止。开发人员继续为 FreeDOS 编写新程序,并向 FreeDOS 添加新功能。我对 FreeDOS 1.3 RC4 的几个重要补充感到特别兴奋,FreeDOS 1.3 RC4 是即将发布的FreeDOS 1.3 的最新候选版本。最近的一些更新如下: +虽然 FreeDOS 的开发已经放缓,但它并没有停止。开发人员继续为 FreeDOS 编写新程序,并向 FreeDOS 添加新功能。我对 FreeDOS 1.3 RC4 的几个重要补充感到特别兴奋,FreeDOS 1.3 RC4 是即将发布的 FreeDOS 1.3 的最新候选版本。最近的一些更新如下: - *Mateusz Viste 创建了一个新的电子书阅读器,名为 Ancient Machine Book (AMB),我们利用它作为 FreeDOS 1.3 RC4 中的新帮助系统。 - *Rask Ingemann Lambertsen、Andrew Jenner、TK Chia 和其他人正在更新 GCC 的 ia-16 版本,包括一个新的_libi86_库,它提供了与 Borland TurboC++ 编译器的 C 库的某种程度的兼容性。 - *Jason Hood 更新了一个可下载的 CD-ROM 重定向器,以替代微软的 MSCDEX,最多支持10个驱动器。 - *SuperIlu 已经创建了 DOjS,这是一个 Javascript 开发画布,具有集成的编辑器、图形和声音输出,以及鼠标、键盘和操纵杆输入。 - *Japheth 已经创建了一个 DOS32PAE 扩展程序,它能够通过 PAE 分页使用大量的内存。 + * Mateusz Viste 创建了一个新的电子书阅读器,名为 Ancient Machine Book(AMB),我们利用它作为 FreeDOS 1.3 RC4 中的新帮助系统。 + * Rask Ingemann Lambertsen、Andrew Jenner、TK Chia 和其他人正在更新 GCC 的 IA-16 版本,包括一个新的libi86 库,它提供了与 Borland TurboC++ 编译器的 C 库的某种程度的兼容性。 + * Jason Hood 更新了一个可卸载的 CD-ROM 重定向器,以替代微软的 MSCDEX,最多支持 10 个驱动器。 + * SuperIlu 创建了 DOjS,这是一个 Javascript 开发画布,具有集成的编辑器、图形和声音输出,以及鼠标、键盘和操纵杆输入。 + * Japheth 创建了一个 DOS32PAE 扩展程序,它能够通过 PAE 分页使用大量的内存。 -尽管 FreeDOS 有了新的发展,我们仍然忠于我们的 DOS 根基。在我们继续朝着 FreeDOS 1.3 “最终”的方向努力时,我们提出了几个核心假设,包括: +尽管 FreeDOS 有了新的发展,我们仍然忠于我们的 DOS 根基。在我们继续朝着 FreeDOS 1.3 “最终”版本努力时,我们带着几个核心假设,包括: - ***兼容性是关键**-如果FreeDOS不能运行经典DOS应用程序,它就不是真正的DOS。虽然我们提供了许多优秀的开源工具、应用程序和游戏,但您也可以运行遗留的DOS应用程序。 - ***继续在旧 PC 上运行(XT,‘286,386 等)**-FreeDOS 1.3 将保持 16 位英特尔,但在可能的情况下将支持扩展驱动程序支持的新硬件。为此,我们继续专注于单用户命令行环境。 - ***FreeDOS 是开源软件**-我一直说,如果人们不能访问、学习和修改源代码,FreeDOS 就不是“免费 DOS”。FreeDOS 1.3 将包括尽可能多地使用公认的开源许可证的软件。但 DOS 实际上早于 GNU 通用公共许可证 (1989)和开放源码定义 (1998),因此一些 DOS 软件可能会使用自己的“免费源代码”许可证,而这并不是标准的“开源”许可。当我们认为软件包包括在 FreeDOS,我们将继续评估任何许可证,以确保它们是合适的“开放源码”,即使它们没有得到正式承认。 + * **兼容性是关键** —— 如果 FreeDOS 不能运行经典 DOS 应用程序,它就不是真正的 “DOS”。虽然我们提供了许多优秀的开源工具、应用程序和游戏,但你也可以运行你的传统的 DOS 应用程序。 + * **继续在旧 PC 上运行(XT、286、386 等)** —— FreeDOS 1.3 将保持 16 位英特尔架构,但在可能的情况下将支持扩展驱动程序支持的新硬件。为此,我们继续专注于单用户命令行环境。 + * **FreeDOS 是开源软件** —— 我一直说,如果人们不能访问、学习和修改源代码,FreeDOS 就不是“自由的 DOS”。FreeDOS 1.3 将包括尽可能多地包括使用公认的开源许可证的软件。但 DOS 实际上早于 GNU 通用公共许可证(1989)和开放源码定义(1998),因此一些 DOS 软件可能会使用它自己的“免费源代码”许可证,而不是标准的“开源”许可。当我们考虑将软件包纳入 FreeDOS 时,我们将继续评估任何许可证,以确保它们是合适的“开放源码”,即使它们没有得到正式承认。 -我们欢迎您的帮助,使FreeDOS强大! 请加入我们的电子邮件名单-我们欢迎所有新来者和投稿人。我们通过电子邮件列表进行交流,但是列表的容量非常小,所以不太可能填满你的收件箱。 +我们欢迎你的帮助,使 FreeDOS 强大!请加入我们的电子邮件列表,我们欢迎所有新来者和贡献者。我们通过电子邮件列表进行交流,不过这个列表的信件量非常小,所以不太可能撑爆你的收件箱。 -访问FreeDOS网站[www.freedos.org][5]. +访问 FreeDOS 网站 [www.freedos.org][5]。 -------------------------------------------------------------------------------- @@ -93,7 +95,7 @@ via: https://opensource.com/article/21/6/history-freedos 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[zxy-wyx](https://github.com/zxy-wyx) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1a1ad269c9d03d15f6c21b9bc16fa9ddcfa560cf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 10:51:18 +0800 Subject: [PATCH 533/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zxy-wyx 本文首发地址:https://linux.cn/article-13601-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/zxy-wyx --- .../talk => published}/20210629 A brief history of FreeDOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210629 A brief history of FreeDOS.md (99%) diff --git a/translated/talk/20210629 A brief history of FreeDOS.md b/published/20210629 A brief history of FreeDOS.md similarity index 99% rename from translated/talk/20210629 A brief history of FreeDOS.md rename to published/20210629 A brief history of FreeDOS.md index c6e3703a80..5601e5c66c 100644 --- a/translated/talk/20210629 A brief history of FreeDOS.md +++ b/published/20210629 A brief history of FreeDOS.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (zxy-wyx) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13601-1.html) FreeDOS 简史 ====== From 25ad94f0ddbecb812edd7d2052fc389d7b7917c9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 11:57:21 +0800 Subject: [PATCH 534/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tanloong 感谢您,完成了第一篇翻译贡献! --- ...de to NLP analysis with Python and NLTK.md | 143 ++++++++---------- 1 file changed, 63 insertions(+), 80 deletions(-) diff --git a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md index 8223727f4b..80e8ce60a8 100644 --- a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md +++ b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md @@ -1,18 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (tanloong) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (An advanced guide to NLP analysis with Python and NLTK) [#]: via: (https://opensource.com/article/20/8/nlp-python-nltk) [#]: author: (Girish Managoli https://opensource.com/users/gammay) -用 Python 和 NLTK 进行 NLP 分析的高级教程 +进阶教程:用 Python 和 NLTK 进行 NLP 分析 ====== -进一步学习自然语言处理的基本概念 -![Brain on a computer screen][1] -在[之前的文章][2]里,我介绍了自然语言处理NLP和宾夕法尼亚大学研发的自然语言处理工具包 ([NLTK][3])。我演示了用 Python 解析文本和定义停用词的方法,并介绍了语料库的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。 +> 进一步学习自然语言处理的基本概念 + +![](https://img.linux.net.cn/data/attachment/album/202107/21/115633k8l9nkqowqkowpwm.jpg) + +在 [之前的文章][2] 里,我介绍了自然语言处理natural language processing(NLP)和宾夕法尼亚大学研发的自然语言处理工具包Natural Language Toolkit ([NLTK][3])。我演示了用 Python 解析文本和定义停顿词stopword的方法,并介绍了语料库corpus的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。 这篇文章主要包括以下部分: @@ -21,38 +23,35 @@ * Tree树库treebank * 命名实体识别Named entity recognition +### 词网和同义词集 -### WordNet 和同义词集synsets +[词网][4]WordNet 是 NLTK 里的一个大型词汇数据库语料库。词网包含各单词的诸多认知同义词cognitive synonyms(认知同义词常被称作“同义词集synset”)。在词网里,名词、动词、形容词和副词,各自被组织成一个同义词的网络。 -[WordNet][4] 是 NLTK 里的一个大型词典数据库。WordNet 包含各单词的诸多认知同义词cognitive synonyms (一个认知同义词常被称作 synset)。在 WordNet 里,名词、动词、形容词和副词,各自被组织成一个同义词的网络。 +词网是一个很有用的文本分析工具。它有面向多种语言的版本(汉语、英语、日语、俄语和西班牙语等),也使用多种许可证(从开源许可证到商业许可证都有)。初代版本的词网由普林斯顿大学研发,面向英语,使用类 MIT 许可证MIT-like license。 -WordNet 是文本分析的一个很有用的工具。它有面向多种语言的版本 (汉语、英语、日语、俄语和西班牙语等),也使用多种许可证 (从开源许可证到商业许可证都有)。初代版本的 WordNet 由普林斯顿大学研发,面向英语,使用类 MIT 许可证MIT-like license。 - -因为一个词可能有多个意义或多个词性,所以可能与多个 synset 相关联。每个 synset 通常提供下列属性: +因为一个词可能有多个意义或多个词性,所以可能与多个同义词集相关联。每个同义词集通常提供下列属性: |**属性** | **定义** | **例子**| |---|---|---| -|名称Name| 此 synset 的名称 | 单词 code 有 5 个 synset,名称分别是 `code.n.01`、 `code.n.02`、 `code.n.03`、`code.v.01` 和 `code.v.02`| -|词性POS| 此 synset 的词性 | 单词 code 有 3 个名词词性的 synset 和 2 个动词词性的 synset| -|定义Definition| 该词作对应词性时的定义 | 动词 code 的一个定义是:(计算机科学) 数据或计算机程序指令的象征性排列symbolic arrangement| -|例子Examples| 使用该词的例子 | code 一词的例子:为了安全,我们应该给信息编码。We should encode the message for security reasons| -|词元Lemmas| 与该词相关联的其他 synset (包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元直接与其他词元相关联,而不是直接与单词words/rt>相关联|`code.v.02` 的词元是`code.v.02.encipher`、`code.v.02.cipher`、`code.v.02.cypher`、`code.v.02.encrypt`、`code.v.02.inscribe` 和 `code.v.02.write_in_code`| -|反义词Antonyms| 意思相反的词 | 词元 `encode.v.01.encode` 的反义词是 `decode.v.01.decode`| +|名称Name| 此同义词集的名称 | 单词 `code` 有 5 个同义词集,名称分别是 `code.n.01`、 `code.n.02`、 `code.n.03`、`code.v.01` 和 `code.v.02`| +|词性POS| 此同义词集的词性 | 单词 `code` 有 3 个名词词性的同义词集和 2 个动词词性的同义词集| +|定义Definition| 该词作对应词性时的定义 | 动词 `code` 的一个定义是:(计算机科学)数据或计算机程序指令的象征性排列symbolic arrangement| +|例子Example| 使用该词的例子 | `code` 一词的例子:We should encode the message for security reasons| +|词元Lemma| 与该词相关联的其他同义词集(包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元直接与其他词元相关联,而不是直接与单词word相关联|`code.v.02` 的词元是 `code.v.02.encipher`、`code.v.02.cipher`、`code.v.02.cypher`、`code.v.02.encrypt`、`code.v.02.inscribe` 和 `code.v.02.write_in_code`| +|反义词Antonym| 意思相反的词 | 词元 `encode.v.01.encode` 的反义词是 `decode.v.01.decode`| |上义词Hypernym|该词所属的一个范畴更大的词 | `code.v.01` 的一个上义词是 `tag.v.01`| -|分项词Meronym| 属于该词组成部分的词 | computer 的一个分项词是 chip | -|总项词Holonym| 该词作为组成部分所属的词 | window 的一个总项词是 computer screen| +|分项词Meronym| 属于该词组成部分的词 | `computer` 的一个分项词是 `chip` | +|总项词Holonym| 该词作为组成部分所属的词 | `window` 的一个总项词是 `computer screen`| -synset 还有一些其他属性,在 `<你的 Python 安装路径>/Lib/site-packages` 下的 `nltk/corpus/reader/wordnet.py`,你可以找到它们。 +同义词集还有一些其他属性,在 `<你的 Python 安装路径>/Lib/site-packages` 下的 `nltk/corpus/reader/wordnet.py`,你可以找到它们。 下面的代码或许可以帮助理解。 这个函数: - ``` from nltk.corpus import wordnet - def synset_info(synset): print("Name", synset.name()) print("POS:", synset.pos()) @@ -75,7 +74,6 @@ for synset in synsets: 将会显示: - ``` 5 synsets: Name code.n.01 @@ -116,7 +114,7 @@ Part Holonyms: [] Part Meronyms: [] ``` -同义词集synsets词元lemmas在 WordNet 里是按照树状结构组织起来的,下面的代码会给出直观的展现: +同义词集synset词元lemma在词网里是按照树状结构组织起来的,下面的代码会给出直观的展现: ``` def hypernyms(synset): @@ -127,9 +125,9 @@ for synset in synsets:     print(synset.name() + " tree:")     pprint(synset.tree(rel=hypernyms))     print() +``` -[/code] [code] - +``` code.n.01 tree: [Synset('code.n.01'),  [Synset('written_communication.n.01'), @@ -155,24 +153,23 @@ code.v.02 tree:    ... ``` -WordNet 并没有涵盖所有的单词和其信息 (现今英语有约 17,0000 个单词,最新版的 WordNet 涵盖了约 15,5000 个),但它开了个好头。掌握了 WordNet 的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的“词网”WordNet! +词网并没有涵盖所有的单词和其信息(现今英语有约 17,0000 个单词,最新版的 词网 涵盖了约 15,5000 个),但它开了个好头。掌握了“词网”的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的“词网”! #### 自主尝试 -使用 Python 库,下载维基百科的 [open source][5] 页面,并列出该页面所有单词的同义词集synsets 词元lemmas。 +使用 Python 库,下载维基百科的 “[open source][5]” 页面,并列出该页面所有单词的同义词集synset词元lemma。 ### 相似度比较 相似度比较的目的是识别出两篇文本的相似度,在搜索引擎、聊天机器人等方面有很多应用。 -比如,相似度比较可以识别 football 和 soccer 是否有相似性。 +比如,相似度比较可以识别 `football` 和 `soccer` 是否有相似性。 ``` syn1 = wordnet.synsets('football') syn2 = wordnet.synsets('soccer') -# A word may have multiple synsets, so need to compare each synset of word1 with synset of word2 -# 一个单词可能有多个 synset,需要把 word1 的每个 synset 和 word2 的每个 synset 分别比较 +# 一个单词可能有多个 同义词集,需要把 word1 的每个同义词集和 word2 的每个同义词集分别比较 for s1 in syn1:     for s2 in syn2:         print("Path similarity of: ") @@ -180,9 +177,9 @@ for s1 in syn1:         print(s2, '(', s2.pos(), ')', '[', s2.definition(), ']')         print("   is", s1.path_similarity(s2))         print() +``` -[/code] [code] - +``` Path similarity of: Synset('football.n.01') ( n ) [ any of various games played with a ball (round or oval) in which two teams try to kick or carry or propel the ball into each other's goal ] Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] @@ -194,9 +191,9 @@ Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players t    is 0.05 ``` -两个词各个 synset 之间路径相似度path similarity最大的是 0.5,表明它们关联性很大 ([路径相似度path similarity][6]指两个词的意义在上下义关系的词汇分类结构hypernym/hypnoym taxonomy中的最短距离)。 +两个词各个同义词集之间路径相似度path similarity最大的是 0.5,表明它们关联性很大([路径相似度path similarity][6]指两个词的意义在上下义关系的词汇分类结构hypernym/hypnoym taxonomy中的最短距离)。 -那么 code 和 bug 呢?这两个计算机领域的词的相似度是: +那么 `code` 和 `bug` 呢?这两个计算机领域的词的相似度是: ``` Path similarity of: @@ -215,7 +212,7 @@ Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or m    is 0.09090909090909091 ``` -这些是这两个词各 synset 之间路径相似度path similarity的最大值,这些值表明两个词是有关联性的。 +这些是这两个词各同义词集之间路径相似度path similarity的最大值,这些值表明两个词是有关联性的。 NLTK 提供多种相似度计分器similarity scorers,比如: @@ -232,7 +229,7 @@ NLTK 提供多种相似度计分器similarity scorers, 使用 Python 库,从维基百科的 [Category: Lists of computer terms][7] 生成一个术语列表,然后计算各术语之间的相似度。 -### tree树库treebank +### 树和树库 使用 NLTK,你可以把文本表示成树状结构以便进行分析。 @@ -240,7 +237,6 @@ NLTK 提供多种相似度计分器similarity scorers, 这是一份简短的文本,对其做预处理和词性标注: - ``` import nltk @@ -251,8 +247,7 @@ words = nltk.tokenize.word_tokenize(text) words_tagged = nltk.pos_tag(words) ``` -要把文本转换成树状结构,你必须定义一个语法grammar 。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。 - +要把文本转换成树状结构,你必须定义一个语法grammar。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。 ``` # A simple grammar to create tree @@ -261,7 +256,6 @@ grammar = "NP: {<JJ><NN>}" 然后用这个语法grammar创建一颗tree: - ``` # Create tree parser = nltk.RegexpParser(grammar) @@ -271,7 +265,6 @@ pprint(tree) 运行上面的代码,将得到: - ``` Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])]) ``` @@ -284,10 +277,7 @@ tree.draw() ![NLTK Tree][9] -(Girish Managoli, [CC BY-SA 4.0][10]) - -这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的主语 ([subject][11]): - +这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的 [主语][11]: ``` subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"] @@ -300,22 +290,22 @@ def subject(sentence_tree): print("Subject:", subject(tree)) ``` -结果显示主语是 I: +结果显示主语是 `I`: ``` Subject: I ``` -这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票,1 月 1 号伦敦飞纽约的“,机器人可以用这种分析方法解读这个指令: +这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票,1 月 1 号伦敦飞纽约的”,机器人可以用这种分析方法解读这个指令: **动作**: 预订 **动作的对象**: 机票 **乘客**: Jane **出发地**: 伦敦 **目的地**: 纽约 -**日期**: (明年) 1 月 1 号 +**日期**: (明年)1 月 1 号 -树库treebank指由许多预先标注好的tree构成的语料库。现在已经有面向多种语言的树库,既有开源的,也有限定条件下才能免费使用的,以及商用的。其中使用最广泛的是面向英语的宾州树库。宾州树库取材于 _华尔街日报_ Wall Street Journal。NLTK 也包含了宾州树库作为一个子语料库。下面是一些使用树库treebank的方法: +树库treebank指由许多预先标注好的tree构成的语料库。现在已经有面向多种语言的树库,既有开源的,也有限定条件下才能免费使用的,以及商用的。其中使用最广泛的是面向英语的宾州树库。宾州树库取材于华尔街日报Wall Street Journal。NLTK 也包含了宾州树库作为一个子语料库。下面是一些使用树库treebank的方法: ``` words = nltk.corpus.treebank.words() @@ -326,8 +316,9 @@ tagged_sents = nltk.corpus.treebank.tagged_sents() print(len(tagged_sents), "sentences:") print(tagged_sents) -[/code] [code] +``` +``` 100676 words: ['Pierre', 'Vinken', ',', '61', 'years', 'old', ',', ...] 3914 sentences: @@ -339,9 +330,9 @@ print(tagged_sents) ``` sent0 = tagged_sents[0] pprint(sent0) +``` -[/code] [code] - +``` [('Pierre', 'NNP'),  ('Vinken', 'NNP'),  (',', ','), @@ -354,20 +345,20 @@ pprint(sent0) ``` grammar = ''' -    Subject: {<NNP><NNP>} -    SubjectInfo: {<CD><NNS><JJ>} -    Action: {<MD><VB>} -    Object: {<DT><NN>} -    Stopwords: {<IN><DT>} -    ObjectInfo: {<JJ><NN>} -    When: {<NNP><CD>} + Subject: {} + SubjectInfo: {} + Action: {} + Object: {
} + Stopwords: {
} + ObjectInfo: {} + When: {} ''' parser = nltk.RegexpParser(grammar) tree = parser.parse(sent0) print(tree) +``` -[/code] [code] - +``` (S   (Subject Pierre/NNP Vinken/NNP)   ,/, @@ -385,28 +376,24 @@ print(tree) 图形化地显示: - ``` tree.draw() ``` ![NLP Treebank image][12] -(Girish Managoli, [CC BY-SA 4.0][10]) - trees树库treebanks的概念是文本分析的一个强大的组成部分。 #### 自主尝试 -使用 Python 库,下载维基百科的 [open source][5] 页面,将得到的文本以图形化的树状结构展现出来。 +使用 Python 库,下载维基百科的 “[open source][5]” 页面,将得到的文本以图形化的树状结构展现出来。 -### 命名实体识别Named entity recognition +### 命名实体识别 无论口语还是书面语都包含着重要数据。文本处理的主要目标之一,就是提取出关键数据。几乎所有应用场景所需要提取关键数据,比如航空公司的订票机器人或者问答机器人。 NLTK 为此提供了一个命名实体识别named entity recognition的功能。 这里有一个代码示例: - ``` sentence = 'Peterson first suggested the name "open source" at Palo Alto, California' ``` @@ -427,9 +414,9 @@ ne_tagged = nltk.ne_chunk(pos_tagged) print("NE tagged text:") print(ne_tagged) print() +``` -[/code] [code] - +``` NE tagged text: (S   (PERSON Peterson/NNP) @@ -454,9 +441,9 @@ print("Recognized named entities:") for ne in ne_tagged:     if hasattr(ne, "label"):         print(ne.label(), ne[0:]) +``` -[/code] [code] - +``` Recognized named entities: PERSON [('Peterson', 'NNP')] FACILITY [('Palo', 'NNP'), ('Alto', 'NNP')] @@ -471,28 +458,24 @@ ne_tagged.draw() ![NLTK Treebank tree][13] -(Girish Managoli, [CC BY-SA 4.0][10]) +NLTK 内置的命名实体标注器named-entity tagger,使用的是宾州法尼亚大学的 [Automatic Content Extraction][14](ACE)程序。该标注器能够识别组织机构ORGANIZATION、人名PERSON、地名LOCATION、设施FACILITY地缘政治实体geopolitical entity等常见实体entites。 -NLTK 内置的命名实体标注器named-entity tagger,使用的是宾州法尼亚大学的 [Automatic Content Extraction][14] (ACE) 程序。 该标注器能够识别组织机构ORGANIZATION、人名PERSON、地名LOCATION、设施FACILITY地缘政治实体geopolitical entity等常见实体entites。 - -NLTK 也可以使用其他标注器tagger,比如 [Stanford Named Entity Recognizer][15]. 这个经过训练的标注器用 Java 写成,但 NLTK 提供了一个使用它的接口 (详情请查看 [nltk.parse.stanford][16] 或 [nltk.tag.stanford][17])。 +NLTK 也可以使用其他标注器tagger,比如 [Stanford Named Entity Recognizer][15]. 这个经过训练的标注器用 Java 写成,但 NLTK 提供了一个使用它的接口(详情请查看 [nltk.parse.stanford][16] 或 [nltk.tag.stanford][17])。 #### 自主尝试 -使用 Python 库,下载维基百科的 [open source][5] 页面,并识别出对开源open source有影响力的人的名字,以及他们为开源open source做贡献的时间和地点。 +使用 Python 库,下载维基百科的 “[open source][5]” 页面,并识别出对开源open source有影响力的人的名字,以及他们为开源open source做贡献的时间和地点。 ### 高级实践 如果你准备好了,尝试用这篇文章以及此前的文章介绍的知识构建一个超级结构superstructure。 -使用 Python 库,下载维基百科的 [Category: Computer science page][18],然后: - +使用 Python 库,下载维基百科的 “[Category: Computer science page][18]”,然后: * 找出其中频率最高的单词unigrams、二元搭配bigrams三元搭配trigrams,将它们作为一个关键词列表或者技术列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。 * 图形化地显示这个领域里重要的人名、技术、日期和地点。这会是一份很棒的信息图。 * 构建一个搜索引擎。你的搜索引擎性能能够超过维基百科吗? - ### 下一步? 自然语言处理是应用构建application building的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。 @@ -508,7 +491,7 @@ via: https://opensource.com/article/20/8/nlp-python-nltk 作者:[Girish Managoli][a] 选题:[lujun9972][b] 译者:[tanloong](https://github.com/tanloong) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 12fa02e6cf5b5ef3ca6356525502d03337680c1c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 12:00:26 +0800 Subject: [PATCH 535/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tanloong 本文首发地址:https://linux.cn/article-13602-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/tanloong --- ... An advanced guide to NLP analysis with Python and NLTK.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200807 An advanced guide to NLP analysis with Python and NLTK.md (99%) diff --git a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/published/20200807 An advanced guide to NLP analysis with Python and NLTK.md similarity index 99% rename from translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md rename to published/20200807 An advanced guide to NLP analysis with Python and NLTK.md index 80e8ce60a8..65fc9c9f76 100644 --- a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md +++ b/published/20200807 An advanced guide to NLP analysis with Python and NLTK.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tanloong) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13602-1.html) [#]: subject: (An advanced guide to NLP analysis with Python and NLTK) [#]: via: (https://opensource.com/article/20/8/nlp-python-nltk) [#]: author: (Girish Managoli https://opensource.com/users/gammay) From 13957ed6f185926fbf3a19819578d69f1499a3e9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 16:28:38 +0800 Subject: [PATCH 536/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @piaoshi 感谢您,完成了第一篇翻译贡献! --- ...7 Using Git Version Control as a Writer.md | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/translated/news/20210627 Using Git Version Control as a Writer.md b/translated/news/20210627 Using Git Version Control as a Writer.md index d9181e59a1..da76290ad1 100644 --- a/translated/news/20210627 Using Git Version Control as a Writer.md +++ b/translated/news/20210627 Using Git Version Control as a Writer.md @@ -3,36 +3,40 @@ [#]: author: (Theena https://news.itsfoss.com/author/theena/) [#]: collector: (lujun9972) [#]: translator: (piaoshi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -作为一个写作者如何使用Git版本控制 +作为一个写作者如何使用 Git 版本控制 ====== +> 我使用 Vim 和 Git 来写小说。是的,你也可以用 Git 来完成非编码任务。 + +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Using-Git-for-Writing.jpg?w=1200&ssl=1) + 我相信当代的写作者们应该开始思考他们的工作流程了。 在一个注意力高度分散的世界里,作为写作者,我们必须对每天执行的任务链拥有控制权。传统上,作家们会把他们的写作放在分散注意力的事较少、注意力高度集中的时间段。不幸的是,海明威、阿特伍德们的这些建议不再真正适用于我们了。我们所生活的世界联系得更紧密了,因此对作家来说就有了更多的陷阱。这首先要求我们要有足够的自制力,不要让社交媒体或小狗和小猫的可爱视频在我们写作的时候分散我们的注意力。 -但是,如果你的写作需要快速地检查事实、拼写不常见和技术性的词汇等,断开与互联网连接并不是一个现实的选项——这正是我写作时的场景。另一个问题是你用于写作的应用程序本身的干扰;作为一个长期使用 MS Word 的人,我发现它越来越漂亮,但速度越来越慢,也越来越让人分心。作为当初我[迁移到 Vim 的主要原因][1]之一,我曾详细地谈到了这一点,所以我不打算再在这个问题上大谈特谈。重点是,在现代世界中,在现代设备上进行写作,可能远非理想状态。 +但是,如果你的写作需要快速地检查事实、拼写不常见和技术性的词汇等,断开与互联网连接并不是一个现实的选项 —— 这正是我写作时的场景。另一个问题是你用于写作的应用程序本身的干扰;作为一个长期使用 MS Word 的人,我发现它越来越漂亮,但速度越来越慢,也越来越让人分心。作为当初我 [迁移到 Vim 的主要原因][1] 之一,我曾详细地谈到了这一点,所以我不打算再在这个问题上大谈特谈。重点是,在现代世界中,在现代设备上进行写作,可能远非理想状态。 -因为我已经详细介绍过了[我为什么转向 Vim][2]和开源版本控制,在这篇文章中,我更想谈谈该 **怎么做**,特别是如何使用开源的版本控制技术,比如git(和GitHub)。 +因为我已经详细介绍过了 [我为什么转向 Vim][2] 和开源版本控制,在这篇文章中,我更想谈谈该 **怎么做**,特别是如何使用开源的版本控制技术,比如 Git(和 GitHub)。 ### 什么是版本控制?再来一次? ![Source: https://git-scm.com/][3] -上图是我们如何进行传统版本控制的一个说明。这个图中假设你有一台设备,而且你只在那台设备上写作。但对我而言,我在许多机器上写作,包括我的安卓手机和一些不同年代的笔记本电脑,我会在特定的任务特定的位置使用到它们。我在所有这些设备上进行的一个共同任务就是写作——因此,我的设备必须以合理的方式捕捉变化并控制文件的版本。不要再让我将 `file1V1_device1_date.doc` 作为文件名了。 +上图是我们如何进行传统版本控制的一个说明。这个图中假设你有一台设备,而且你只在那台设备上写作。但对我而言,我在许多机器上写作,包括我的安卓手机和一些不同年代的笔记本电脑,我会在特定的任务、特定的位置使用到它们。我在所有这些设备上进行的一个共同任务就是写作 —— 因此,我的设备必须以合理的方式捕捉变化并控制文件的版本。不要再让我将 `file1V1_device1_date.doc` 作为文件名了。 -上图也没有考虑到我们用来写作的工具。像 LibreOffice Write 这样的文字处理器可以在 Linux、Mac 和 Windows 系统上使用,但在手机上使用文字处理器将会是一段不愉快的经历。我们中的一些写作者还使用其他文本工具——包括 Gmail 或我们的电子邮件客户端——来为我们的写作打草稿。但按逻辑顺序跟踪所有这些文件和电子邮件是相当折磨人的——我就用这样的流程写过一本书,相信我:我花在弄清文件名、版本变化、评论、给自己的注释以及带有附加注释的电子邮件上的时间,足以让我精神错乱。 +上图也没有考虑到我们用来写作的工具。像 LibreOffice Write 这样的文字处理器可以在 Linux、Mac 和 Windows 系统上使用,但在手机上使用文字处理器将会是一段不愉快的经历。我们中的一些写作者还使用其他文本工具(包括 Gmail 或我们的电子邮件客户端)来为我们的写作打草稿。但按逻辑顺序跟踪所有这些文件和电子邮件是相当折磨人的,我就用这样的流程写过一本书,相信我:我花在弄清文件名、版本变化、评论、给自己的注释以及带有附加注释的电子邮件上的时间,足以让我精神错乱。 -读到这里,你们中的一些人可能会正确地指出,有云备份技术呀。虽然云存储的好处是巨大的,而且我也在继续使用它们,但其版本控制几乎没有,或者说并不强大。 +读到这里,你们中的一些人可能会正确地指出,有云备份技术呀。虽然云存储的好处是巨大的,而且我也在继续使用它们,但其版本控制几乎不存在,或者说并不强大。 ### 一个更好的工作流程 就像地球上的其它地方一样,大流行病的开始引发了一些焦虑和一些反思。我利用这段时间在 [The Odin Project][4](强烈推荐给那些想学习 html、CSS、JavaScript/Ruby 的人)上自学了网络开发。 -在课程的第一个模块中,有一个关于 Git 的介绍:什么是版本控制,以及它试图解决什么问题。读了这一章后,我豁然开朗。我立即意识到,这个 _git_ 正是我作为一个写作者所要寻找的东西。 +在课程的第一个模块中,有一个关于 Git 的介绍:什么是版本控制,以及它试图解决什么问题。读了这一章后,我豁然开朗。我立即意识到,这个 _Git_ 正是我作为一个写作者所要寻找的东西。 是的,更好的方法不是本地化的版本控制,而是 _分布式_ 的版本控制。“分布式”描述的是设备的分布,而我在这些设备上访问文件,以及之后进行编辑修改。下图是分布式版本控制的一个直观说明。 @@ -44,7 +48,7 @@ * 使我的稿件库可以从任何地方、任何设备上访问 * 易于使用 - * 减少或消除因在写作、学习和编码各工作流程之间的场景切换而产生的摩擦——尽可能使用同一工具(即 Vim)。 + * 减少或消除因在写作、学习和编码各工作流程之间的场景切换而产生的摩擦 —— 尽可能使用同一工具(即 Vim)。 * 可扩展性 * 易于维护 @@ -52,7 +56,7 @@ ![][6] -如你所见,我的版本控制系统是分布式版本控制的一个简单的适配。在我的例子中,通过将 git 版本控制应用到云存储([pCloud][7])的一个文件夹上,我可以同时利用这两种技术的优点。因此,我的工作流程可以用下图描述: +如你所见,我的版本控制系统是分布式版本控制的一个简单的适配。在我的例子中,通过将 Git 版本控制应用到云存储([pCloud][7])的一个文件夹上,我可以同时利用这两种技术的优点。因此,我的工作流程可以用下图描述: ![][8] @@ -68,9 +72,9 @@ 你们中的写作者一定想知道这个系统存在什么缺点。以下是我在持续使用和完善这一工作流程时预计到的几个问题。 * 对草稿的评论:文字处理器的一个更有用的功能是具有评论的功能。当我希望以后再回到文本的某一部分时,我经常在这部分为自己留下一个评论。我仍然没有想出一个解决这个问题的办法。 - * 协作:文字处理程序允许写作者之间进行协作。在我以前做广告相关工作的时候,我会用 Google Docs 来写文案,然后分享链接给我的设计师,从而他可以为广告和网站对文案进行摘录。现在,我的解决方法是用 markdown 写文案,并通过 Pandoc 将 markdown 文件导出为 .doc 文件。更关键的是,当我的手稿完成后,我仍然需要将文件以 .doc 格式发送给我的编辑。一旦我的编辑做了一些修改并把它发回来,我再尝试用 Vim 打开它就没有意义了。在这一点上,该系统的局限性变得更加明显。 + * 协作:文字处理程序允许写作者之间进行协作。在我以前做广告相关工作的时候,我会用 Google Docs 来写文案,然后分享链接给我的设计师,从而他可以为广告和网站对文案进行摘录。现在,我的解决方法是用 Markdown 写文案,并通过 Pandoc 将 Markdown 文件导出为 .doc 文件。更关键的是,当我的手稿完成后,我仍然需要将文件以 .doc 格式发送给我的编辑。一旦我的编辑做了一些修改并把它发回来,我再尝试用 Vim 打开它就没有意义了。在这一点上,该系统的局限性变得更加明显。 -我并不是说这是最好的方法,但在我职业生涯的这个阶段,这是对我来说最好的方法。我想,随着我对我的新的[用于写作的开源工具][10]和版本控制越来越熟悉和适应,我将进一步完善这个方法。 +我并不是说这是最好的方法,但在我职业生涯的这个阶段,这是对我来说最好的方法。我想,随着我对我的新的 [用于写作的开源工具][10] 和版本控制越来越熟悉和适应,我将进一步完善这个方法。 我希望这篇文章能为那些想使用 Git 进行文档版本控制的写作者提供一个很好的介绍。这肯定不是一篇详尽的文章,但我将分享一些有用的链接,使你的旅程更容易。 @@ -78,8 +82,6 @@ 2. [开始使用 Git][12] 3. GitHub 的 Git 基础知识教程 -作为彩蛋,这里有一段我在安卓设备上使用 Vim 处理一首诗,并将改动推送到 Git 的屏幕录像。 - -------------------------------------------------------------------------------- via: https://news.itsfoss.com/version-control-writers/ @@ -87,7 +89,7 @@ via: https://news.itsfoss.com/version-control-writers/ 作者:[Theena][a] 选题:[lujun9972][b] 译者:[piaoshi](https://github.com/piaoshi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -95,12 +97,12 @@ via: https://news.itsfoss.com/version-control-writers/ [b]: https://github.com/lujun9972 [1]: https://news.itsfoss.com/how-i-started-loving-vim/ [2]: https://news.itsfoss.com/configuring-vim-writing/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/local.png?w=800&ssl=1 [4]: https://www.theodinproject.com/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgwMCIgd2lkdGg9IjY2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwNSIgd2lkdGg9IjYxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/distributed.png?w=668&ssl=1 +[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Version_Control.png?w=617&ssl=1 [7]: https://itsfoss.com/recommends/pcloud/ -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc1MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Version_Control_2.png?w=886&ssl=1 [9]: https://www.youtube.com/watch?v=NtH-HhaLw-Q [10]: https://itsfoss.com/open-source-tools-writers/ [11]: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/introduction-to-git From b80f2e5b507c524263912a2597e6eb79c4a5bb03 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 16:29:46 +0800 Subject: [PATCH 537/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @piaoshi 本文首发地址:https://linux.cn/article-13604-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/Piaoshi --- .../20210627 Using Git Version Control as a Writer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210627 Using Git Version Control as a Writer.md (99%) diff --git a/translated/news/20210627 Using Git Version Control as a Writer.md b/published/20210627 Using Git Version Control as a Writer.md similarity index 99% rename from translated/news/20210627 Using Git Version Control as a Writer.md rename to published/20210627 Using Git Version Control as a Writer.md index da76290ad1..9c62e93ebd 100644 --- a/translated/news/20210627 Using Git Version Control as a Writer.md +++ b/published/20210627 Using Git Version Control as a Writer.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (piaoshi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13604-1.html) 作为一个写作者如何使用 Git 版本控制 ====== From 4d94a9c8d39c8ab5583fbbb9fca97f845d6b0ef3 Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Wed, 21 Jul 2021 23:04:11 +0800 Subject: [PATCH 538/870] Delete source file and summit translated file-tech-20210529 Configuring Vim as a Writing Tool.md --- ...10529 Configuring Vim as a Writing Tool.md | 206 ------------------ ...10529 Configuring Vim as a Writing Tool.md | 193 ++++++++++++++++ 2 files changed, 193 insertions(+), 206 deletions(-) delete mode 100644 sources/tech/20210529 Configuring Vim as a Writing Tool.md create mode 100644 translated/tech/20210529 Configuring Vim as a Writing Tool.md diff --git a/sources/tech/20210529 Configuring Vim as a Writing Tool.md b/sources/tech/20210529 Configuring Vim as a Writing Tool.md deleted file mode 100644 index b7afb5e863..0000000000 --- a/sources/tech/20210529 Configuring Vim as a Writing Tool.md +++ /dev/null @@ -1,206 +0,0 @@ -[#]: subject: (Configuring Vim as a Writing Tool) -[#]: via: (https://news.itsfoss.com/configuring-vim-writing/) -[#]: author: (Theena https://news.itsfoss.com/author/theena/) -[#]: collector: (lujun9972) -[#]: translator: (piaoshi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Configuring Vim as a Writing Tool -====== - -In my first column I spoke about why I moved [my writing to Vim][1] – away from the standard tools of modern writers such as word processors (MS Word and their open source equivalents), text editors (Notepad since I’ve been a Windows user until last year), and cloud based storage technology. If you are a writer, I urge you to [read that part 1][1] before continuing here. - -Essentially, I argued that the more devices you use, the more writing tools you’ll need, the more complex the workflow eventually becomes. This is pertinent because I have four devices, including an Android phone, a main daily driver laptop running Linux, and a couple of older laptops, including a Mac, I take when I go outdoors for shoots. - -Vim was the perfect solution for me, and how I work; while I won’t argue that my new workflow is the best way for writers to work in the modern world, I will argue that it is important for writers to have a tool that works across all our devices, and is powerful enough to meet the needs for the different kinds of writing that we writers engage in everyday. - -Vim’s main benefit from this perspective, therefore, is that it is cross-platform – no matter what device you are on, Vim will work. I won’t speak extensively about using Vim in the Apple ecosystem, but a cursory glance at the reviews for [this app][2] tells me that somewhere someone needs Vim no matter what device they are using. - -Now let’s say you are a writer who wants to start using Vim. Where do you start once you’ve installed it? - -This part of the article isn’t necessarily a tutorial but a series of recommendations, including an examination of a .vimrc configuration file for prose writing. Wherever possible I will link to the respective YouTube tutorial that I learnt from. - -Linux users already have Vim pre-installed – launch it via the terminal emulator of choice. For Windows and Mac users, you can download it from the [official site][3]. - -### Recommendations - -**Post Vim Installation/Launch** - - * Open Vim Tutor via terminal. (Mac users can launch it this way, while Windows users can launch it using this method. You will not be using Vim to do any writing during this phase – instead you will spend 15 minutes everyday doing the Vim Tutorial. Don’t spend a minute longer or shorter; see how much progress you can make inside the tutorial within the allotted 15 minutes. You will find that every day, you progress that much deeper into the tutorial. Inside a month, you should be able to complete the entire tutorial within those 15 minutes. - * Becoming a better typist has immense benefits for Vim usage. This is optional, but I am relearning to type from scratch and it is having the side effect of making Vim even more useful. I began spending 15 minutes everyday on this site as a warm up before I went into the Vim Tutorial. - - - -I allocated 30 minutes at the start of every day for both these exercises to warm up, and 30 minutes every evening to cool down before I went to bed. This may have contributed to my quick transition from my old tool kit to Vim, but your mileage may vary. - -Once again, let me stress that the above steps _**other than Vim Tutor**_ is optional; it all depends on your individual motivation levels. - -We now come to the meat of this article: How do you configure Vim to be writer-friendly? - -### How to configure .vimrc for writing - -_Before I begin, I’d like to remind readers here that I am not a tech person – I am a novelist – and that any errors you see in the below are my own; I would love for feedback from experienced Vim users on how to refine my configuration file even further._ - -Below is my .vimrc file. You can clone mine from my [GitHub][4] and refine it further. - -``` -syntax on - -set noerrorbells "This removes vim's default error bell, turning it off so that it doesn't annoy us -set textwidth=100 "Ensures that each line is not longer than 100 columns -set tabstop=4 softtabstop=4 -set shiftwidth=4 -set expandtab -set smartindent -set linebreak -set number -set showmatch -set showbreak=+++ -set smartcase -set noswapfile -set undodir=~/.vim/undodir -set undofile -set incsearch -set spell -set showmatch -set confirm -set ruler -set autochdir -set autowriteall -set undolevels=1000 -set backspace=indent,eol,start - -" The next two settings ensure that line breaks and wrap work how writers, not -" coders, prefer it - -set wrap -nnoremap :set linebreak -nnoremap :set nolinebreak - - -call plug#begin('~/.vim/plugged') - -" This is for color themes - -Plug 'colepeters/spacemacs-theme.vim' -Plug 'sainnhe/gruvbox-material' -Plug 'phanviet/vim-monokai-pro' -Plug 'flazz/vim-colorschemes' -Plug 'chriskempson/base16-vim' -Plug 'gruvbox-community/gruvbox' - -" This is a selection of plugins to make prose writing easier. - -Plug 'dpelle/vim-LanguageTool' -Plug 'ron89/thesaurus_query.vim' -Plug 'junegunn/goyo.vim' -Plug 'junegunn/limelight.vim' -Plug 'reedes/vim-pencil' -Plug 'reedes/vim-wordy' - - -" This section are nice-to-haves for easier integration with machine, using vim-airline and such. - -Plug 'vim-airline/vim-airline' - -"This section deals with workspace and session management - -Plug 'thaerkh/vim-workspace' - -"Related to above, the following code saves all session files in a single directory outside your -"workspace - -let g:workspace_session_directory = $HOME . '/.vim/sessions/' - - -"Related to above, this is a activity tracker for vim - -Plug 'wakatime/vim-wakatime' - -" A disturbance in the force: we are using some emacs functionality here, org-mode specifically - -Plug 'jceb/vim-orgmode' - - - -" This is for language-specific plugins - -Plug 'plasticboy/vim-markdown' - - - call plug#end() - -colorscheme pacific -set background=dark - -if executable('rg') - let g:rg_derive_root='true' -endif -``` - -Learn how to install Vim Plugin. This tutorial helped me. I use Vim Plugged because it was the simplest and most elegant in my view. - -![][5] - -#### .vimrc housekeeping for writers - - * `syntax on` : this ensures that vim acknowledges what syntax I am using. I primarily use markdown for most note-taking and writing articles such as this one; while plain-text is my preferred method when working on my fiction. - * `set noerrorbells` : for the sake of your sanity, I highly recommend turning this on - * `set textwidth=100` : For ease of reading because no one wants to be horizontal scrolling a text document - * `set spell“ - * `set wrap` : ensures text wraps like how writers, not coders, would want it. You will notice that I haven’t spent much time discussing some of the other basic configuration, but I don’t feel those are salient for writers. I do some hobbyist coding so my .vimrc is a reflection of that. If all you want to do is to write on Vim, then the above configuration ought to get you started. - - - -From that point, your .vimrc is a living document of what you want to do with Vim, and how you want Vim to do that for you. - -#### A note on plug-ins - -Plug-ins are specified between lines 43-98. Assuming you’ve followed the tutorial on how to install vim plug-ins, I highly recommend the following vim writing-specific plug-ins to get started: - - * `vim-LanguageTool` - * `thesaurus_query.vim` - * `vim-pencil` - * `vim-wordy` - * `vim-goyo` - * `vim-markdown` - - - -#### Conclusion - -In this article, we gently introduced how writers can get started on vim, including a basic primer on configuring .vimrc for writing. In addition to mine, I am going to link here to the .vimrc of other writers that I found on GitHub, and have used as inspiration for my own. - -![][6] - -Remember that this is just a starter kit of a .vimrc for writers. As your needs evolve, you will find that Vim can evolve with it. Therefore, learning to configure your .vimrc is worth investing some time in. - -In the next article, I will be examining specifics of my writing workflow, using Vim and Git and GitHub. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/configuring-vim-writing/ - -作者:[Theena][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/theena/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/how-i-started-loving-vim/ -[2]: https://apps.apple.com/us/app/ivim/id1266544660 -[3]: https://www.vim.org/ -[4]: https://github.com/MiragianCycle/dotfiles -[5]: https://i1.wp.com/i.ytimg.com/vi/n9k9scbTuvQ/hqdefault.jpg?w=780&ssl=1 -[6]: https://i2.wp.com/i.ytimg.com/vi/Pq3JMp3stxQ/hqdefault.jpg?w=780&ssl=1 diff --git a/translated/tech/20210529 Configuring Vim as a Writing Tool.md b/translated/tech/20210529 Configuring Vim as a Writing Tool.md new file mode 100644 index 0000000000..b08e1f0deb --- /dev/null +++ b/translated/tech/20210529 Configuring Vim as a Writing Tool.md @@ -0,0 +1,193 @@ +[#]: subject: (Configuring Vim as a Writing Tool) +[#]: via: (https://news.itsfoss.com/configuring-vim-writing/) +[#]: author: (Theena https://news.itsfoss.com/author/theena/) +[#]: collector: (lujun9972) +[#]: translator: (piaoshi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +将 Vim 配置成一个写作工具 +====== + +在我的第一个专栏中,我谈到了我为什么把 [我的写作工作迁移到了 Vim 上][1] -- 远离现代写作者们的标准工具,如文字处理器(MS Word 及它的开源替代方案)、文本编辑器(记事本,因为直到去年我一直是 Windows 用户)和云存储技术。如果你是一个写作者,在继续下面的内容前,我建议你先阅读一下 [那篇文章的第一部分][1] 。 + +基本上可以说,你使用的设备越多,你需要的写作工具就越多,最终你的工作流程就越复杂。这一点对我来说是很贴切的,因为我有四台设备,包括一部安卓手机,一台日常用的运行 Linux 的主力笔记本电脑,还有两台旧的笔记本电脑,其中一台是 Mac,我去户外拍摄时会带着它。 + +Vim 对于我和我的工作方式来说是一个完美的解决方案;虽然我不会说我的新的工作流程是现代世界写作者工作的最佳方式,但我可以说的是,对于写作者来说,拥有一个能在我们所有设备上工作的工具非常重要的,并且这个工具要足够强大以满足我们写作者每天从事的不同类型的写作需求。 + +从这个角度来看,Vim 的主要优势是它是跨平台的 -- 无论在什么设备上,Vim 都能工作。在苹果生态系统中使用 Vim 的情况我就不细说了,但粗略地看一下 [这个应用程序][2] 的评论,我就会让知道,在某些地方有某些人需要 Vim,不管他们使用的是什么设备。 + +现在我们假设你是一个想开始使用 Vim 的写作者。一旦你安装了它,你该从哪里开始呢? + +我在这一部分给你的不是一个教程,而是一系列的建议,包含对一个用于诗歌写作的 .vimrc 配置文件的解读。只要有可能,我就会链接到我学习相应内容时用到的 YouTube 上的教程。 + +对于 Linux 用户来说,系统已经预装了 Vim -- 通过你喜欢的终端模拟器就可以启动它。对于 Windows 和 Mac 用户,你可以从 [Vim 官方网站][3] 下载它。 + +### 建议 + +**安装/启用 Vim 后** + + * 通过终端打开 Vim Tutor。( Mac 用户可以用这种方式启动,而 Windows 用户也可以用这种方法启动。[译者注:原文这里本应该有链接,可能作者忘记添加了。无论如何,在终端中, Linux 中的命令是 vimtutor,Windows 在安装目录下找到 vimtutor.bat 命令并运行;Mac?应该与 Linux 一样?我没 Mac 呀!])在这个阶段,你不会使用 Vim 进行任何写作 -- 相反,你要每天花15分钟做 Vim 教程。不要多花一分钟或少花一分钟;看看在规定的15分钟内,你能在教程中取得多大的进展。你会发现,每天你都会在教程中取得更大的进步。在一个月内,你应该能够利用这些15分钟完成整个教程。 + * 成为一个更好的打字员对 Vim 的使用来说有极大的好处。这不是必须的,但我正在重新学习打字,它的副作用是使 Vim 变得更加有用了。我每次都以花15分钟练习打字开始,作为进入 Vim 教程前的热身。 + +在每一天的开始,我分配了30分钟的时间做这两项练习进行热身,而每天晚上睡觉前再分配30分钟进行练习以让我安定下来。这样的做法帮我快速从旧的工具包过渡到了 Vim,但你的安排可能有所不同。 + +我再次强调, _**除了Vim Tutor之外**_ ,上述步骤都是可选的;这完全取决于你个人的动机水平。 + +现在我们来到了这篇文章的重点:如何配置 Vim ,使它对写作者友好? + +### 如何配置用于写作的 .vimrc + +_在开始之前,我想在这里提醒各位读者,我不是一个技术人员 -- 我是一个小说家 -- 你在下面看到的任何错误都是我自己的;我希望有经验的 Vim 用户能提供反馈,告诉我如何进一步完善我的配置文件。_ + +下面是我的 .vimrc 文件。你可以从我的 [GitHub][4] 上下载,并进一步完善它。 + +``` +syntax on + +set noerrorbells "取消 Vim 的错误警告铃声,关闭它以免打扰到我们 +set textwidth=100 "确保每一行不超过100字符 +set tabstop=4 softtabstop=4 +set shiftwidth=4 +set expandtab +set smartindent +set linebreak +set number +set showmatch +set showbreak=+++ +set smartcase +set noswapfile +set undodir=~/.vim/undodir +set undofile +set incsearch +set spell +set showmatch +set confirm +set ruler +set autochdir +set autowriteall +set undolevels=1000 +set backspace=indent,eol,start + +" 下面的设置确保按写作者而不是程序员喜欢的方式折行 + +set wrap +nnoremap :set linebreak +nnoremap :set nolinebreak + + +call plug#begin('~/.vim/plugged') + +" 这是颜色风格插件 + +Plug 'colepeters/spacemacs-theme.vim' +Plug 'sainnhe/gruvbox-material' +Plug 'phanviet/vim-monokai-pro' +Plug 'flazz/vim-colorschemes' +Plug 'chriskempson/base16-vim' +Plug 'gruvbox-community/gruvbox' + +" 这是为了更容易的诗歌写作选择的一些插件 + +Plug 'dpelle/vim-LanguageTool' +Plug 'ron89/thesaurus_query.vim' +Plug 'junegunn/goyo.vim' +Plug 'junegunn/limelight.vim' +Plug 'reedes/vim-pencil' +Plug 'reedes/vim-wordy' + + +" 这一部分是为了更容易地与机器集成,用了 vim-airline 这类插件 + +Plug 'vim-airline/vim-airline' + +" 这一部分外理工作区和会话管理 + +Plug 'thaerkh/vim-workspace' + +" 与上面插件相关, 下面的代码将你的所有的会话文件保存到一个你工作区之外的目录 + +let g:workspace_session_directory = $HOME . '/.vim/sessions/' + + +" 与上面插件相关,这是一个 Vim 活动的跟踪器 + +Plug 'wakatime/vim-wakatime' + +" 一个干扰因素:我在这里使用了一些 Emacs 的功能,特别是 org-mode + +Plug 'jceb/vim-orgmode' + + +" 这是文件格式相关插件 + +Plug 'plasticboy/vim-markdown' + + +call plug#end() + +colorscheme pacific +set background=dark + +if executable('rg') + let g:rg_derive_root='true' +endif +``` + +学习如何安装 Vim 插件时,这个教程帮助了我。我使用 Vim Plugged 插件管理器是因为在我看来它是最简单、最优雅的。 + +![][5] + +#### 对于写作者的 .vimrc 的选项的整理 + + * `syntax on` : 这可以确保 Vim 知道我在使用什么语法。做笔记,写这种文章时我主要使用 Markdown ;而在写小说的时候,纯文本是我的首选格式。 + * `set noerrorbells` : 为了你的精神状态,我强烈建议打开这个选项。 + * `set textwidth=100` : 为了便于阅读,没有人愿意横向滚动一个文本文件。 + * `set spell` : 提醒你,如果有拼写错误的话。 + * `set wrap` : 确保文本以写作者而不是程序员的方式进行折行。 + +你会注意到,我没有花更多时间讨论其他一些基本配置选项,因为我并不觉得那些对写作者来说有多重要。因为我做一些业余的编码工作,所以我的 .vimrc 配置反映了这一点。如果你只想在 Vim 上写作,那么上述配置就应该能让你顺利开始。 + +从这点上来说,你的 .vimrc 是一个活的文档,它能生动地反映你想用 Vim 做什么,以及你希望 Vim 如何为你做这些事情。 + +#### 关于插件的说明 + +第43-98行之间是我对插件的配置。如果你已经学习了关于如何安装 Vim 插件的教程,我强烈推荐你从以下专为写作开发的 Vim 插件开始: + + * `vim-LanguageTool` + * `thesaurus_query.vim` + * `vim-pencil` + * `vim-wordy` + * `vim-goyo` + * `vim-markdown` + +#### 总结 + +在这篇文章中,我们简单地介绍了写作者可以怎样开始使用 Vim,以及一个在写作工作中需要的 .vimrc 入门配置。除了我的 .vimrc 之外,我还将在这里链接到我在 GitHub 上发现的其他写作者的 .vimrc,它们是我自己配置时的灵感来源。 + +![][6] + +请劳记,这只是一个写作者的 .vimrc 的入门配置。你会发现,随着你的需求的发展,Vim 也可以随之发展。因此,投入一些时间学习配置你的 .vimrc 是值得的。 + +在下一篇文章中,我将会检视我在写作时的工作流程的具体细节,这个工作流程中我使用了 Vim 和 Git 及 GitHub。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/configuring-vim-writing/ + +作者:[Theena][a] +选题:[lujun9972][b] +译者:[piaoshi](https://github.com/piaoshi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/theena/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/how-i-started-loving-vim/ +[2]: https://apps.apple.com/us/app/ivim/id1266544660 +[3]: https://www.vim.org/ +[4]: https://github.com/MiragianCycle/dotfiles +[5]: https://i1.wp.com/i.ytimg.com/vi/n9k9scbTuvQ/hqdefault.jpg?w=780&ssl=1 +[6]: https://i2.wp.com/i.ytimg.com/vi/Pq3JMp3stxQ/hqdefault.jpg?w=780&ssl=1 From fc3b856ce91e1e65b54e0bc2a4c3341085411110 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Jul 2021 05:02:24 +0800 Subject: [PATCH 539/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210721=20?= =?UTF-8?q?Run=20GitHub=20Actions=20on=20Fedora=20CoreOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md --- ...721 Run GitHub Actions on Fedora CoreOS.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md diff --git a/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md b/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md new file mode 100644 index 0000000000..c4b80e2b99 --- /dev/null +++ b/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md @@ -0,0 +1,219 @@ +[#]: subject: (Run GitHub Actions on Fedora CoreOS) +[#]: via: (https://fedoramagazine.org/run-github-actions-on-fedora-coreos/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Run GitHub Actions on Fedora CoreOS +====== + +![][1] + +[United Artists][2], Public domain, via Wikimedia Commons + +[GitHub Actions][3] is a service provided to quickly setup continuous integration and delivery (CI/CD) workflows . These workflows run on hosts called _runners_. GitHub provides [hosted runners][4] with a limited set of operating system choice (Windows Server, Ubuntu, MacOS). + +Another option is to use [self-hosted][5] runners which gives the repository administrator more control on the runners. Self-hosted runners are dedicated to a repository or organization. The following article goes through the steps of configuring self-hosted runners using Fedora CoreOS. + +### Getting Started + +Fedora CoreOS is a minimalist operating system designed to be easy to deploy and maintain at scale. The operating system will automaticaly update and provide, by default, the tools needed to run containers. For all of these reasons, Fedora CoreOS is a great choice to consider for running CI/CD workflows. + +The first step to configure and provision a Fedora CoreOS machine is to generate an [Ignition][6] file. [Butane][7] allows you to generate Ignition’s file using a friendlier format (YAML). + +#### Configure a Fedora CoreOS runner + +To execute GitHub actions on Fedora CoreOS, the host needs the binaries and scripts used to register and run the runner. Download the binaries and scripts from the [actions runner project][8] and deploy under _/usr/local/sbin/actions-runner_. + +``` +version: "1.3.0" +variant: fcos +storage: + directories: + - path: /usr/local/sbin/actions-runner + mode: 0755 + user: + name: core + group: + name: core + files: + - path: /usr/local/sbin/actions-runner/actions-runner-linux.tar.gz + overwrite: true + contents: + source: https://github.com/actions/runner/releases/download/v2.278.0/actions-runner-linux-x64-2.278.0.tar.gz + mode: 0755 + user: + name: core + group: + name: core +``` + +#### Registration and Removal token + +Configuring runners for a project requires a “token”. This prevents registering or removing self-hosted runners from projects without the correct permissions. Tokens provided by Github have a one hour expiration time. If the runner restarts after this time it will require a new registration token. + +The token can be problematic, in particular with Fedora CoreOS automatic updates. The update process expects that the host will restart at least once every couple weeks after receiving new data. + +Luckily, it is possible to use GitHub REST API to obtain these tokens and automatically configure the runner every time the host restarts. The following _manage-runner.sh_ script uses the APIs to retrieve a token, remove any runner already configured and register the runner with a new token. + +``` +#!/bin/bash +# Handles the Github Action runner configuration. +# Remove and Registration token expires after 1 hour, if we want our runner +# to work after a reboot (auto update) we need to refresh the tokens. + +# First remove the runner with a fresh remove token +REMOVE_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/actions/runners/remove-token | jq -r '.token') +/usr/local/sbin/actions-runner/config.sh remove --token ${REMOVE_TOKEN} + + +# Then register the runner with a fresh registration token +REGISTRATION_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/actions/runners/registration-token | jq -r '.token') +/usr/local/sbin/actions-runner/config.sh --url https://github.com/cverna/fcos-actions-runner --token ${REGISTRATION_TOKEN} --labels fcos --unattended +``` + +The script above uses a few environment variables that contain a GitHub username and a [Personal Access Token][9] used to authenticate the REST API requests. The Personal Access Token requires the repo permissions in order to successfully retrieve the runner registration and removal tokens. The token is security sensitive so it is better to store it in a different file with stricter permissions. In this example that file is _actions-runner_. + +``` +GITHUB_USER= +GITHUB_REPO= +GITHUB_TOKEN= +``` + +Following is the Butane snippet that creates these two files – _manage-runner.sh_ and _actions-runner_. + +``` +- path: /usr/local/sbin/actions-runner/manage-runner.sh + contents: + local: manage-runner.sh + mode: 0755 + user: + name: core + group: + name: core + - path: /etc/actions-runner + contents: + local: actions-runner + mode: 0700 + user: + name: core + group: + name: core +``` + +### Running Actions on Fedora CoreOS + +Finally, create the systemd services that will configure and start the runner. Define the services in the Butane configuration file. + +``` +systemd: + units: + - name: github-runner-configure.service + enabled: true + contents: | + [Unit] + Description=Configure the github action runner for a repository + After=network-online.target boot-complete.target + Requires=boot-complete.target + [Service] + EnvironmentFile=/etc/actions-runner + Type=oneshot + RemainAfterExit=yes + User=core + WorkingDirectory=/usr/local/sbin/actions-runner + ExecStartPre=tar xvf actions-runner-linux.tar.gz --no-same-owner + ExecStart=/usr/local/sbin/actions-runner/manage-runner.sh + [Install] + WantedBy=multi-user.target + - name: github-runner.service + enabled: true + contents: | + [Unit] + Description=Run the github action runner + After=github-runner-configure.service + [Service] + WorkingDirectory=/usr/local/sbin/actions-runner + User=core + ExecStart=/usr/local/sbin/actions-runner/run.sh + [Install] + WantedBy=multi-user.target +``` + +This creates two services, _github-runner-configure.service_ (running once when the host has finished booting) and _github-runner.service_ (running the Actions runner binaries and waiting for new CI/CD jobs). + +Now that the Butane configuration is complete, generate an Ignition file out of it and provision a Fedora CoreOS Actions runner. + +``` +$ podman run -i --rm -v $PWD:/code:z --workdir /code quay.io/coreos/butane:release --pretty --strict --files-dir /code config.yaml -o config.ignition +``` + +Once the Ignition file is generated, it can be used to provision a runner on the platforms where Fedora CoreOS is [available][10]. + +> [Getting started with Fedora CoreOS][11] + +### Configure an Action to use a self-hosted runner + +The following test Action workflow will test the FCOS self-hosted worker. Create the following file in your git repository _.github/workflows/main.yml_ + +``` +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: fcos + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Run a one-line script + run: podman run --rm fedora-minimal:34 echo Hello World ! +``` + +Note that the _runs-on_ configuration is set up to use a runner with the label _fcos_. + +The code presented in this article is available [here][12]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/run-github-actions-on-fedora-coreos/ + +作者:[Clément Verna][a] +选题:[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/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/modern-times-816x345.jpg +[2]: https://commons.wikimedia.org/wiki/File:Chaplin_-_Modern_Times.jpg +[3]: https://docs.github.com/en/actions +[4]: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners +[5]: https://docs.github.com/en/actions/hosting-your-own-runners +[6]: https://github.com/coreos/ignition +[7]: https://github.com/coreos/butane +[8]: https://github.com/actions/runner +[9]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token +[10]: https://docs.fedoraproject.org/en-US/fedora-coreos/bare-metal/ +[11]: https://fedoramagazine.org/getting-started-with-fedora-coreos/ +[12]: https://github.com/cverna/fcos-actions-runner From 68cae95c8e0fce1d9a7893e26d1f7ad5503ada0b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Jul 2021 05:02:51 +0800 Subject: [PATCH 540/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210722=20?= =?UTF-8?q?Top=20Android=20Emulators=20to=20Run=20and=20Test=20Android=20A?= =?UTF-8?q?pps=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md --- ...s to Run and Test Android Apps on Linux.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md diff --git a/sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md b/sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md new file mode 100644 index 0000000000..4310ba1c27 --- /dev/null +++ b/sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md @@ -0,0 +1,135 @@ +[#]: subject: (Top Android Emulators to Run and Test Android Apps on Linux) +[#]: via: (https://itsfoss.com/android-emulators-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Top Android Emulators to Run and Test Android Apps on Linux +====== + +Android is built on top of a heavily customized Linux kernel. So, running mobile apps on Linux makes sense using an Android emulator. + +While this is not something new that you can do on your Linux machine, it is a feature more in demand after Windows introduced the ability to run Android apps in 2021. + +Not just limited to using apps, some of the Android emulators can also come in handy for development and testing. + +Hence, I have compiled a list of the best emulators that you can use to test or run Android applications/games on Linux. + +### 1\. Anbox + +Anbox is a pretty popular emulator that lets Linux users run Android apps. Probably this is what Deepin Linux utilizes to make help run Android apps out of the box. + +It isolates the Android operating system from the host using a container, which also lets them make the latest Android version available to use. + +Android apps running will not have direct access to your hardware—which is a good security decision. + +Unlike some of the other options here, Anbox does not technically need an emulation layer to make Android work. In other words, it is as close to a native Android experience on your Linux system. + +For this reason, it may not be the easiest option available. You cannot just use the Google Play Store to install applications, you need to utilize Android Debug Bridge (ADB). All you need is the APK file of an app to install and use it. + +[Anbox][1] + +### 2\. Genymotion + +![][2] + +Genymotion is an impressive solution tailored for testing and development. + +It is not a free and open-source option. They provide virtual Android experiences as a service through the cloud or a desktop client that is independent of Android Studio. + +You can simulate a variety of hardware configurations and Android versions to create a virtual device for testing. It also gives you the ability to scale up and has multiple Android virtual devices running for extensive tests. + +It can help you test how file uploading works in your app, impacts battery, performance, memory, and so on. + +While it is a premium solution mostly for professionals, it does support the latest Linux distributions that include Ubuntu 20.04 LTS. + +[Genymotion][3] + +### 3\. Android-x86 + +![][4] + +Android x86 is an open-source project to make Android run on a PC with 32-bit support. + +You can choose to install it using a virtual machine manager on your Linux system or directly try it on your PC. + +Official [installation instructions][5] are available if you need to go ahead. + +Unlike some other options, it is a simple emulator that tries to work on a PC with no fancy features. + +[Android x86][6] + +### 4\. Android Studio (Virtual Devices) + +![][7] + +Android Studio is a full-fledged tool for development and testing. Fortunately, with the support for Linux, you can use it to emulate the Android experience for experiments if you need to. + +You just need to create an Android Virtual Device (AVD) that you can configure and then simulate as an emulator. + +There are good chances to find support for some of the latest smartphones, TVs, and smartwatches as well. + +It needs a certain learning curve to be able to pull it off, but it is free and completely open-source. + +[Android Studio][8] + +### 5\. ARChon + +![][9] + +An interesting solution is an Android emulator that you can use in Linux and any other platform. + +It helps run Android apps on Chrome OS or with Chrome browser on any operating system. Unlike some others, you may not get a complete Android experience but only the ability to run Android apps. + +You just have to unpack the runtime and load it into Chrome extensions. Next, add the app you want to use by downloading the APK file onto it. + +[ARChon][10] + +### 6\. Bliss OS + +![][11] + +Bliss OS is yet another open-source project, similar to Android x86 that aims to make Android run on PC. + +Unlike Android x86, it gives more compatibility options by supporting both 32-bit and 64-bit architectures. Also, you can download the compatible file as per your processor. + +It is actively maintained and supports the latest Android versions available in the market. + +[Bliss OS][12] + +### Wrapping Up + +While you will find several Android emulators available for Linux, they may not replace a full-fledged smartphone experience. + +Every emulator comes with a set of features along with a specific purpose. Choose the one that you need! + +Have you tried Android emulators yet? What’s your favorite emulator that you have used in Linux? Feel free to let me know in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/android-emulators-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://anbox.io +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/genymotion-android-emulator.png?resize=800%2C508&ssl=1 +[3]: https://www.genymotion.com +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/android-x86-emulator.jpg?resize=1920%2C1080&ssl=1 +[5]: https://www.android-x86.org/installhowto.html +[6]: https://www.android-x86.org +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/android-virtual-devices-studio.png?resize=800%2C296&ssl=1 +[8]: https://developer.android.com/studio +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/arcrhon.jpg?resize=800%2C426&ssl=1 +[10]: https://archon-runtime.github.io +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/bliss-os-android.png?resize=800%2C576&ssl=1 +[12]: https://blissos.org From 3cf98927b5ad91ccc0ec74538dc815e55a21d292 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Jul 2021 05:03:47 +0800 Subject: [PATCH 541/870] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210720=20?= =?UTF-8?q?You=20Can=20Now=20Use=20KDE=20Connect=20in=20Windows=20as=20Wel?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md --- ... Now Use KDE Connect in Windows as Well.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md diff --git a/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md b/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md new file mode 100644 index 0000000000..0a84562890 --- /dev/null +++ b/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md @@ -0,0 +1,91 @@ +[#]: subject: (You Can Now Use KDE Connect in Windows as Well) +[#]: via: (https://news.itsfoss.com/kde-connect-windows/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +You Can Now Use KDE Connect in Windows as Well +====== + +KDE Connect is a popular open-source tool that lets you share a connection between a phone and your computer. + +While it was always limited to the Linux platform, it looks like that it is coming to Windows after all. + +And, cross-platform availability of software is always a good thing. + +### What is KDE Connect? + +In case you are coming across it for the first time—KDE connect lets you share files, links, sync notifications, gives you the ability to reply to messages, and more. + +You can also choose to control your desktop and perform some custom commands remotely. And, you can also use your phone to control the volume/skip the music playing on your computer. + +### KDE Connect Available as Beta in Microsoft Store + +![][1] + +As per a Reddit thread posted a few weeks back, a KDE contributor mentions that the beta version is available from the [Microsoft Store][2]. + +However, it is only accessible through the private link and cannot be found when you search for it in the Microsoft Store. + +This also marks official support for Windows. + +![][3] + +### KDE Connect for Windows: Here’s How it Looks + +![][4] + +You just need to make sure that both of your devices are connected to the same network. + +Next, all you have to do is pair them and then start sharing files/links, browse your phone, and also get notifications. + +You can choose to tweak some of the options that include storage paths for shared images or change the sound to play when you try to ring the device. + +![][5] + +As you can notice here, you have a variety of options to make use of. + +I tried connecting my Android device for a while, and it worked just fine. You may want to explore more to learn what else you can do with it. + +### Why is it Good News for Windows Users? + +Undoubtedly Windows users already had plenty of options to achieve the same functions without KDE Connect. But with KDE connect onboard, it will finally provide the opportunity to use an open-source and privacy-friendly tool that they can pair their devices with. + +After all, you would not want your notifications, and links/files that you share to be spied upon by a shoddy third-party application. + +In that case, KDE Connect is your friend. + +Even though it is in beta right now. You can try it out by visiting the link and installing it from the Microsoft store. + +[KDE Connect on Microsoft Store][2] + +**Via**: [Omg!Ubuntu!][6] + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kde-connect-windows/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIyOCIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://www.microsoft.com/en-gb/p/kde-connect/9n93mrmsxbf0?&activetab=pivot:overviewtab +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://www.omgubuntu.co.uk/2021/07/kde-connect-windows-app From 96cb221e6549ed1b33aa989db07b0075366db70d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 22 Jul 2021 08:29:55 +0800 Subject: [PATCH 542/870] translated --- ...king Linux Video Player for Minimalists.md | 93 ------------------ ...king Linux Video Player for Minimalists.md | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 93 deletions(-) delete mode 100644 sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md create mode 100644 translated/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md diff --git a/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md b/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md deleted file mode 100644 index 67f0f58036..0000000000 --- a/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: subject: (Meet Clapper: A Sleek Looking Linux Video Player for Minimalists) -[#]: via: (https://itsfoss.com/clapper-video-player/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Meet Clapper: A Sleek Looking Linux Video Player for Minimalists -====== - -Love minimalism? You’ll love Clapper. - -Clapper is a new [video player for Linux][1]. Actually, it’s more for GNOME than Linux. - -Built on top of GNOME’s JavaScript library and GTK4 toolkit, it blends naturally in the GNOME desktop environment. It uses [GStreamer][2] for media backend and [OpenGL][3] for rendering. - -I like application with minimalist approach. While VLC is the Swiss Knife of media players, I prefer [MPV player][4] for the sleek, minimal interface. And now I think I am going to stick with Clapper for sometime. - -### Clapper video player - -![A screenshot of Clapper video player][5] - -[Clapper uses hardware acceleration][6] by default. It supports Intel and AMD GPUs and works on both Xorg and Wayland. - -[Clapper][7] doesn’t use the traditional upper window bar. There are auto-hiding preference menu, mode changer and window control buttons for you to access a few features. This gives it a sleek, minimalist look. - -It has three modes: - - * Windowed mode: the default mode shows the progress bar and window control - * Floating mode: the progress bar is hidden and the player is floating on top of other applications like the ‘[always on top][8]‘ feature or ‘picture in picture’ mode - * Fullscreen mode: Player goes full screen, progress bar is bigger but they all auto-hide - - - -![Interface of Clapper video player with preference control and window modes][9] - -Clapper also has an adaptive UI which can also be used on Linux-based smartphones and tablets. So if you have got yourself a Pine Phone or Librem5, you can use Clapper on it. - -There is support for subtitles with option to change the font. However, the subtitles didn’t work in my testing. There is also no option to explicitly add subtitles to a playing video. This is something that must be improved. - -Like VLC, Clapper also gives you the option to resume playback from the last point if you open the same video file again. One of the [handy features I love in VLC][10]. - -Clapper supports playing videos from the internet as well if you provide the URL. - -Here, in the screenshot, I am playing a YouTube video in Clapper. It is a beautiful song sung by a beautiful singer and actress. Can you guess which song or movie it is? - -![Clapper playing a video from YouTube][11] - -### Install Clapper on Linux - -Clapper is available in AUR for Arch and Manjaro users. That should not be a surprise for anyone. AUR has everything under the sun. - -For other distributions, Clapper officially provides [Flatpak package][12]. So, please [enable Flatpak support for your distribution][13] and then use the following command to install it: - -``` -flatpak install flathub com.github.rafostar.Clapper -``` - -Once installed, simply search for it in the application menu or right click on a video file and choose to open it with Clapper. - -Clapper is far from being the perfect video player. However, it has potential to become a popular Linux application. - -If you use it, please do share your experience. If you find bugs, please [notify the developer][14]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/clapper-video-player/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/video-players-linux/ -[2]: https://gstreamer.freedesktop.org/ -[3]: https://www.opengl.org/ -[4]: https://itsfoss.com/mpv-video-player/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-screenshot.png?resize=800%2C498&ssl=1 -[6]: https://github.com/Rafostar/clapper/wiki/Hardware-acceleration -[7]: https://github.com/Rafostar/clapper -[8]: https://itsfoss.com/always-on-top/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-video-player-interface.jpg?resize=800%2C480&ssl=1 -[10]: https://itsfoss.com/simple-vlc-tips/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-youtube-video.jpg?resize=800%2C501&ssl=1 -[12]: https://flathub.org/apps/details/com.github.rafostar.Clapper -[13]: https://itsfoss.com/flatpak-guide/ -[14]: https://github.com/Rafostar/clapper/issues diff --git a/translated/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md b/translated/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md new file mode 100644 index 0000000000..be278de96f --- /dev/null +++ b/translated/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md @@ -0,0 +1,94 @@ +[#]: subject: (Meet Clapper: A Sleek Looking Linux Video Player for Minimalists) +[#]: via: (https://itsfoss.com/clapper-video-player/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +认识 Clapper:一款外观时尚的 Linux 视频播放器,适合极简主义者使用 +====== + +喜欢极简主义吗?你会喜欢 Clapper 的。 + +Clapper 是一个新的 [Linux 视频播放器][1]。实际上,它更多的是为 GNOME 而不是为 Linux。 + +它构建在 GNOME 的 JavaScript 库和 GTK4 工具包之上,自然地融合在 GNOME 的桌面环境中。它使用 [GStreamer][2] 作为媒体后端,使用 [OpenGL][3] 进行渲染。 + +我喜欢极简主义的应用。虽然 VLC 是媒体播放器中的瑞士刀,但我更喜欢 [MPV 播放器][4],因为它的界面时尚、简约。现在我想要坚持使用 Clapper 一段时间了。 + +### Clapper 视频播放器 + +![A screenshot of Clapper video player][5] + +[Clapper 默认使用硬件加速][6]。它支持英特尔和 AMD 的 GPU,在 Xorg 和 Wayland 上都能工作。 + +[Clapper][7] 不使用传统的上部窗口栏。有自动隐藏的偏好菜单、模式切换器和窗口控制按钮供你访问一些功能。这给了它一个时尚、简约的外观。 + +它有三种模式: + + * 窗口模式:默认模式显示进度条和窗口控制。 + * 浮动模式:进度条被隐藏,播放器漂浮在其他应用程序的顶部,就像“[总是在顶部][8]”或“画中画”模式。 + * 全屏模式:播放器进入全屏,进度条变大,但它们都会自动隐藏起来 + + + +![Interface of Clapper video player with preference control and window modes][9] + +Clapper 也有一个自适应的用户界面,也可以在基于 Linux 的智能手机和平板电脑上使用。因此,如果你有自己的 Pine Phone 或 Librem5,你可以在它上面使用 Clapper。 + +它支持字幕,并可选择改变字体。然而,在我的测试中,字幕并不可用。也没有选项可以明确地在播放的视频中添加字幕。这一点必须改进。 + +和 VLC 一样,如果你再次打开同一个视频文件,Clapper 也可以让你选择从最后一个点恢复播放。这是我喜欢的 VLC 中的一个[方便的功能][10]。 + +如果你提供 URL,Clapper 也支持从互联网上播放视频。 + +这里的截图中,我正在 Clapper 中播放一个 YouTube 视频。这是一首由一位美丽的歌手和演员唱的优美歌曲。你能猜到这是哪首歌或哪部电影吗? + + +![Clapper playing a video from YouTube][11] + +### 在 Linux 上安装 Clapper + +对 Arch 和 Manjaro 用户而言,Clapper 可在 AUR 中找到。这不是对所有人的惊喜。AUR 有这世上的一切。 + +对于其他发行版,Clapper 官方提供了 [Flatpak 包][12]。所以,请[为你的发行版启用 Flatpak 支持][13],然后使用下面的命令来安装它: + +``` +flatpak install flathub com.github.rafostar.Clapper +``` + +安装后,只需在应用菜单中搜索它,或右击视频文件,选择用 Clapper 打开它。 + +Clapper 远不是一个完美的视频播放器。然而,它有可能成为一个流行的 Linux 应用。 + +如果你使用它,请分享你的经验。如果你发现问题,请[通知开发者][14]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/clapper-video-player/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/video-players-linux/ +[2]: https://gstreamer.freedesktop.org/ +[3]: https://www.opengl.org/ +[4]: https://itsfoss.com/mpv-video-player/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-screenshot.png?resize=800%2C498&ssl=1 +[6]: https://github.com/Rafostar/clapper/wiki/Hardware-acceleration +[7]: https://github.com/Rafostar/clapper +[8]: https://itsfoss.com/always-on-top/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-video-player-interface.jpg?resize=800%2C480&ssl=1 +[10]: https://itsfoss.com/simple-vlc-tips/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-youtube-video.jpg?resize=800%2C501&ssl=1 +[12]: https://flathub.org/apps/details/com.github.rafostar.Clapper +[13]: https://itsfoss.com/flatpak-guide/ +[14]: https://github.com/Rafostar/clapper/issues From 3a10100e29dd6d3836f94ea04bf99ec191c06893 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 22 Jul 2021 08:32:47 +0800 Subject: [PATCH 543/870] translating --- sources/tech/20210720 Run a Linux virtual machine in Podman.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210720 Run a Linux virtual machine in Podman.md b/sources/tech/20210720 Run a Linux virtual machine in Podman.md index 72df55d22a..5c91c4eb51 100644 --- a/sources/tech/20210720 Run a Linux virtual machine in Podman.md +++ b/sources/tech/20210720 Run a Linux virtual machine in Podman.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/linux-podman) [#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e86fb3ec0ff0031f840979d3f872fd7dc504fc45 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Jul 2021 20:56:18 +0800 Subject: [PATCH 544/870] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Wlzzzz-del 感谢您,完成了第一篇翻译贡献! --- ...rence between a fork and a distribution.md | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index 87abb65fe8..3cb7d0bd95 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -1,56 +1,60 @@ -What's the difference between a fork and a distribution? 分支与发行版有什么不同? ====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG) +> 开源软件的发行版和分支是不一样的。了解其中的区别和潜在的风险。 -如果你们对开源软件有过一段时间地了解,一定曾在许多相关的途径中听说过分支(fork)和发行版(distribution)两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。 +![](https://img.linux.net.cn/data/attachment/album/202107/22/205518spblrgcpxrlnbibe.jpg) -### 首先地,关于定义 +如果你们对开源软件有过一段时间的了解,一定曾在许多相关方面中听说过分支fork发行版distribution两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。 + +(LCTT 译注:fork 一词,按我们之前的倡议,在版本控制工作流中,为了避免和同一个仓库的 branch 一词混淆,我们建议翻译为“复刻”。但是在项目和发行版这个语境下,没有这个混淆,惯例上还是称之为“分支”。) + +### 首先,一些定义 在解释分支与发行版两者的细微区别与相似之处之前,让我们先给一些相关的重要概念下定义。 **[开源软件][1]** 是指具有以下特点的软件: - * 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用 - * 在特定的协议限制下,软件源代码供所有人使用与修改 + * 在特定的 [许可证][2] 限制下,软件供所有人免费分发 + * 在特定的许可证限制下,软件源代码可以供所有人查看与修改 -开源软件有以下几种 **消费** 方式: +开源软件可以按以下方式 **使用**: - * 以二进制或者源代码的方式下载,通常是不收费的。(例如,[Eclipse开发者环境][3]) + * 以二进制或者源代码的方式下载,通常是免费的。(例如,[Eclipse 开发者环境][3]) * 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]) - * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]) + * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的 [Freetype 软件][5]) -将 **自由且开源(FOSS)** 中的”自由“理解成“零成本”是不准确的。自由且开源仅仅意味着这个软件在遵守软件协议的前提下是可以免费传播、修改、学习和使用的。软件传播者也可能为该软件定价。例如,免费使用的Linux发行版有Fedora、Centos等。另外,收费的发行版有红帽企业版Linux、SUSE等。 +自由开源软件free and open source software(FOSS)不一定是“零成本”的“免费free”。自由开源软件仅仅意味着这个软件在遵守软件许可证的前提下可以自由地分发、修改、研究和使用。软件分发者也可能为该软件定价。例如,Linux 可以是 Fedora、Centos、Gentoo 等免费发行版,也可以是付费的发行版,如红帽企业版 Linux(RHEL)、SUSE Linux 企业版(SLES)等。 -**社区(community)** 指的是为一个开源项目协同工作和贡献的团体或个人。任何人或者团体都可以在遵守协议的前提下通过例如编写或者审查代码、撰写使用文档、测试软件、管理会议、更新网站等方式为开源项目作出贡献。例如,在[Openhub.net][6]网站,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在[为一些开源项目作出贡献][7]。 +社区community指的是在一个开源项目上协作的团体或个人。任何人或者团体都可以在遵守协议的前提下,通过编写或审查代码/文档/测试套件、管理会议、更新网站等方式为开源项目作出贡献。例如,在 [Openhub.net][6] 网站上,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在 [为一些开源项目作出贡献][7]。 -**项目(project)** 是集合作开发、文档和测试的结果。绝大多数项目都搭建了主要仓库用来存储代码、文档、测试文件和目前正在开发的文件。 +一个开源项目project是集协作开发、文档和测试的结果。大多数项目都搭建了一个中央仓库用来存储代码、文档、测试文件和目前正在开发的文件。 -**发行版(distribution)** 是指开源项目的一份的副本,通常以二进制或源代码为样式。例如,Centos、Fedora、红帽企业版Linux、SUSE、Ubuntu等都是Linux这一项目的发行版。Tectonic、谷歌的Kubernetes引擎、亚马逊的容器服务和红帽的OpenShift都是Kubernetes项目的发行版。 +发行版distribution是指开源项目的一份的二进制或源代码的副本。例如,CentOS、Fedora、红帽企业版 Linux(RHEL)、SUSE Linux、Ubuntu 等都是 Linux 项目的发行版。Tectonic、谷歌的 Kubernetes 引擎(GKE)、亚马逊的容器服务和红帽的 OpenShift 都是 Kubernetes 项目的发行版。 -开源项目的商业发行版经常被称作 **产品(products)** ,类似地红帽OpenStack平台是红帽OpenStack产品系列旗下的一个基于OpenStack上游项目搭建并且百分百开源的发行版。 +开源项目的商业发行版经常被称作产品products,因此,红帽 OpenStack 平台是红帽 OpenStack 的产品,它是 OpenStack 上游项目的一个发行版,并且是百分百开源的。 -**主干(trunk)** 是该开源项目发展的主要社区工作流。 +主干trunk是开发开源项目的社区的主要工作流。 -**分支(fork)** 是开源项目主干的一个版本,他是分离自主干的独立工作流。 +开源分支fork是开源项目主干的一个版本,它是分离自主干的独立工作流。 -因此, **一个发行版并不等同于一个分支** 。发行版是上游项目的包裹,具有可用性,经常作为产品进行销售。然而,发行版的核心代码和文档需要遵守上游项目的版本规则。从上游版本中获取开源代码的分支用户必须依靠他们自身来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。 +因此,**发行版并不等同于分支**。发行版是上游项目的一种包装,由厂商提供,经常作为产品进行销售。然而,发行版的核心代码和文档与上游项目的版本保持一致。分支,以及任何基于分支的的发行版,导致代码和文档的版本与上游项目不同。对上游项目进行了分支的用户必须自己来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。 -为了对软件分支进行进一步的解释,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。 +为了进一步解释软件分支,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王斑蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。 ### 独立前行带来的风险 -一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护以及知道哪儿有食物、庇护所和目的地。 +一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护,以及知道哪儿有食物、庇护所和目的地。 相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: - 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 - 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益。 - 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 - 4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 - 5. **他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 -总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 + 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术债,对分支的代码修改的越多,将这一分支重新归入上游项目需要花费的时间和金钱成本就越高。 + 2. **分支用户有可能运行不太安全的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能无法从这次修复中受益。 + 3. **分支用户可能不会从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户利益的新特性。如果一个组织从上游分支,由于代码不同,它们可能无法纳入新的功能。 + 4. **它们可能无法和其他软件包整合在一起。** 开源项目很少是作为单一实体开发的;相反地,它们经常被与其他项目打包在一起构成一套解决方案。分支代码可能无法与其他项目整合,因为分支代码的开发者没有与上游的其他参与者们合作。 + 5. **它们可能不会得到硬件平台认证。** 软件包通常被搭载在硬件平台上进行认证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + +总之,开源发行版只是一个来自上游的、多组织协同开发的、由供应商销售与支持的打包集合。分支是一个开源项目的独立开发工作流,有可能无法从上游社区协同工作的结果中受益。 -------------------------------------------------------------------------------- @@ -59,7 +63,7 @@ via: https://opensource.com/article/18/7/forks-vs-distributions 作者:[Jonathan Gershater][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[Wlzzzz-del](https://github.com/Wlzzzz-del) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 09d1e34d9cb4b82370172e6bf97a4876232c5331 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Jul 2021 20:57:23 +0800 Subject: [PATCH 545/870] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Wlzzzz-del 本文首发地址: https://linux.cn/article-13605-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/Wlzzzz-del --- ...713 What-s the difference between a fork and a distribution.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180713 What-s the difference between a fork and a distribution.md (100%) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/published/20180713 What-s the difference between a fork and a distribution.md similarity index 100% rename from translated/talk/20180713 What-s the difference between a fork and a distribution.md rename to published/20180713 What-s the difference between a fork and a distribution.md From 3124d9167b41af987e2f549b5dc12573ec22013a Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Thu, 22 Jul 2021 22:13:51 +0800 Subject: [PATCH 546/870] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91[te?= =?UTF-8?q?ch]:=2020210418=20F(r)iction-=20Or=20How=20I=20Learnt=20to=20St?= =?UTF-8?q?op=20Worrying=20and=20Start=20Loving=20Vim.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on- Or How I Learnt to Stop Worrying and Start Loving Vim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md b/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md index 7743b5f167..3375b7377e 100644 --- a/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md +++ b/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/how-i-started-loving-vim/) [#]: author: (Theena https://news.itsfoss.com/author/theena/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (piaoshi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d9996224bceff2c84e2ac2269daea745d9d9c9f7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Jul 2021 05:03:29 +0800 Subject: [PATCH 547/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210723=20?= =?UTF-8?q?Fixing=20Flatpak=20Error:=20No=20remote=20refs=20found=20simila?= =?UTF-8?q?r=20to=20=E2=80=98flathub=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md --- ...o remote refs found similar to ‘flathub.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md diff --git a/sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md b/sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md new file mode 100644 index 0000000000..af768edbab --- /dev/null +++ b/sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md @@ -0,0 +1,84 @@ +[#]: subject: (Fixing Flatpak Error: No remote refs found similar to ‘flathub’) +[#]: via: (https://itsfoss.com/no-remote-ref-found-flatpak/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fixing Flatpak Error: No remote refs found similar to ‘flathub’ +====== + +So, I just installed Fedora. Installing my favorite applications was among the list of things to do after installing Fedora. + +I tried installing VLC in Flatpak form, but it gave me an error: + +**error: No remote refs found similar to ‘flathub’** + +![No remote refs found error displayed with Flatpak][1] + +### Fixing “no remote refs found similar to flathub” error + +The fix is rather simple. Add the Flathub repository in the following way: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +It will ask for your password, or you could use the above command with sudo. + +Now, if you try to install a Fltapak package from Fltahub, it should work as expected. + +![Adding the Flathub repoistory fixes the issue][2] + +### Reason why you see this error and how it was fixed + +Now that have fixed the error, it would be a good idea to also learn why you saw this error in the first place and how it was fixed. + +Like most other package managers in Linux, Flatpak also works on the concept of repositories. In simpler words, you can imagine package repositories as a warehouse where packages are stored. + +But in order to retrieve a package from this warehouse, you need to know the address of the warehouse first. + +That’s what happens here. You are trying to download (and install) a package from a certain repository (Flathub in this case). But your system doesn’t know about this “flathub”. + +In order to solve this issue, you added the Flathub repository. When you do that, your Linux system can look for the package you are trying to install in this repository. + +You may see all the remote Flatpak repository added to your system. + +![List Flatpak repositories added to your system][3] + +Let’s have a deeper look at the command which was used for adding the repository: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + + * flatpak: this is the flatpak CLI tool. + * remote-add: this option indicates that you are adding a new remote repository. + * –if-not-exists: this ensures that the remote repository is only added if it is not added already. + * flathub: this is short reference for the complete URL of the actual repository. You may name it something else but the convention is to use the one provided by the developer. + * : The actual repository address. + + + +_**So, the bottom line is that when you see Flatpak complaining about ‘no remote refs found similar to xyz’, verify that the said repository is not added and if that’s the case, figure out its URL and add it to the system.**_ + +I hope this quick tip help you with this Flatpak issue. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/no-remote-ref-found-flatpak/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-remote-ref-not-found-error-800x265.png?resize=800%2C265&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-no-remote-ref-problem-fixed.png?resize=800%2C317&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-list-repositories.png?resize=800%2C317&ssl=1 From 46de005c6f81fe0fc6a5e367f47483a16e806fe1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Jul 2021 05:03:56 +0800 Subject: [PATCH 548/870] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210722=20?= =?UTF-8?q?Write=20your=20first=20JavaScript=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210722 Write your first JavaScript code.md --- ...210722 Write your first JavaScript code.md | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 sources/tech/20210722 Write your first JavaScript code.md diff --git a/sources/tech/20210722 Write your first JavaScript code.md b/sources/tech/20210722 Write your first JavaScript code.md new file mode 100644 index 0000000000..b4466dd5ba --- /dev/null +++ b/sources/tech/20210722 Write your first JavaScript code.md @@ -0,0 +1,204 @@ +[#]: subject: (Write your first JavaScript code) +[#]: via: (https://opensource.com/article/21/7/javascript-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Write your first JavaScript code +====== +JavaScript was created for the web, but it can do so much more. Learn +the basics, then download our cheat sheet so you always have the details +at hand. +![Code with javascript on white background][1] + +JavaScript is a programming language full of pleasant surprises. Many people first encounter JavaScript as a language for the web. There's a JavaScript engine in all the major browsers, there are popular frameworks such as JQuery, Cash, and Bootstrap to help make web design easier, and there are even programming environments written in JavaScript. It seems to be everywhere on the internet, but it turns out that it's also a useful language for projects like [Electron][2], an open source toolkit for building cross-platform desktop apps with JavaScript. + +JavaScript is a surprisingly multipurpose language with a wide assortment of libraries for much more than just making websites. Learning the basics of the language is easy, and it's a gateway to building whatever you imagine. + +### Install JavaScript + +As you progress with JavaScript, you may find yourself wanting advanced JavaScript libraries and runtimes. When you're just starting, though, you don't have to install JavaScript at all. All major web browsers include a JavaScript engine to run the code. You can write JavaScript using your favorite text editor, load it into your web browser, and see what your code does. + +### Get started with JavaScript + +To write your first JavaScript code, open your favorite text editor, such as [Notepad++][3], [Atom][4], or [VSCode][5]. Because it was developed for the web, JavaScript works well with HTML, so first, just try some basic HTML: + + +``` +<[html][6]> +  <[head][7]> +    <[title][8]>JS</[title][8]> +  </[head][7]> +  <[body][9]> +    <[p][10] id="example">Nothing here.</[p][10]> +  </[body][9]> +</[html][6]> +``` + +Save the file, and then open it in a web browser. + +![HTML displayed in browser][11] + +(Seth Kenlon, [CC BY-SA 4.0][12]) + +To add JavaScript to this simple HTML page, you can either create a JavaScript file and refer to it in the page's `head` or just embed your JavaScript code in the HTML using the `